text
stringlengths
2
99.9k
meta
dict
# bower-json [![Build Status](https://secure.travis-ci.org/bower/json.png?branch=master)](http://travis-ci.org/bower/json) [![Coverage Status](https://coveralls.io/repos/bower/json/badge.svg?branch=master&service=github)](https://coveralls.io/github/bower/json?branch=master) Read `bower.json` files with semantics, normalisation, defaults and validation. Install via [npm](https://www.npmjs.org/package/bower-json): `npm install --save bower-json` ## Usage #### .read(file, options, callback) #### .readSync(file, options) Reads `file` and applies normalisation, defaults and validation according to the `bower.json` spec. If the passed `file` does not exist, the callback is called with `error.code` equal to `ENOENT`. If the passed `file` contents are not valid JSON, the callback is called with `error.code` equal to `EMALFORMED`. If the `json` does not comply with the `bower.json` spec, the callback is called with `error.code` equal to `EINVALID`. If `file` is a directory, `find()` will be used to search for the json file. The `options` argument is optional and can be omitted. These options will be passed to `parse` method. ```js var bowerJson = require('bower-json'); // Can also be used by simply calling bowerJson() bowerJson.read('/path/to/bower.json', function (err, json) { if (err) { console.error('There was an error reading the file'); console.error(err.message); return; } console.log('JSON: ', json); }); ``` #### .parse(json, options) Parses an object. Useful when you want to apply normalisation and validation directly to an object. If the `json` does not comply with the `bower.json` spec, an error is thrown with `error.code` equal to `EINVALID`. The `options` arguments is optional and can be omitted. Available options: - validate: Apply validation, defaults to `true` - normalize: Apply normalisation, defaults to `false` - clone: clone, use and return the passed in `json` object instead of using it directly, defaults to `false` ```js var bowerJson = require('bower-json'); var json = { name: 'my-package', version: '0.0.1' }; try { bowerJson.parse(json); } catch (err) { console.error('There was an error parsing the object'); console.error(err.message); } ``` #### .getIssues(json) - DEPRECATED Validates the passed `json` object. Returns an object with errors and warnings of this bower.json contents. ```js var bowerJson = require('bower-json'); var json = { name: 'myPackage', version: '0.0.1', main: {} }; var issues = bowerJson.getIssues(json); expect(issues).toEqual({ errors: ['The "main" field has to be either an Array or a String'], warnings: ['The "name" must be lowercase'] }); #### .validate(json) Validates the passed `json` object. Throws an error with `error.code` equal to `EINVALID` if it does not comply with the spec. ```js var bowerJson = require('bower-json'); var json = { name: 'myPackage', version: '0.0.1' }; try { bowerJson.validate(json); } catch (err) { console.error('There was an error validating the object'); console.error(err.message); } ``` #### .normalize(json) ```js var bowerJson = require('bower-json'); var json = { name: 'my-package', version: '0.0.1', main: 'foo.js,bar.js' }; bowerJson.normalize(json); json.main // ['foo.js', 'bar.js'] ``` #### .find(folder, callback) #### .findSync(folder) Finds the `json` filename inside a folder. Checks if a `bower.json` exists, falling back to `component.json` (deprecated) and `.bower.json`. If no file was found, the callback is called with a `error.code` of `ENOENT`. ```js var bowerJson = require('bower-json'); bowerJson.find('/path/to/folder', function (err, filename) { if (err) { console.error('There is no json file in the folder'); return; } console.log('Filename: ', filename); // Now that we got the filename, we can read its contents bowerJson.read(filename, function (err, json) { if (err) { console.error('There was an error reading the file'); console.error(err.message); return; } console.log('JSON: ', json); }); }); ``` ## License Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
{ "pile_set_name": "Github" }
module.exports = 2;
{ "pile_set_name": "Github" }
#import <Foundation/Foundation.h> #import "UMSocialTaskConfig.h" @interface UMSocialHttpFactory : NSObject /** * 创建一个NSMutableURLRequest的对象 * * @param method @see UMSocialHttpMethodType * @param path base path 如: http://www.umeng.com * @param pathParameters 加入到path后面的键值对 * @param bodyParameters 加入到body的键值对 * @param headers 加入的http的header的键值对 * * @return @see NSMutableURLRequest */ + (NSMutableURLRequest *)makeRequestWithMethod:(UMSocialHttpMethodType)method path:(NSString *)path pathParameters:(NSDictionary *)pathParameters bodyParameters:(NSDictionary *)bodyParameters headers:(NSDictionary *)headers; @end
{ "pile_set_name": "Github" }
#pragma once #include "caffe2/core/common.h" #if defined(__APPLE__) #define CAFFE2_SUPPORTS_SIGNAL_HANDLER #elif defined(__linux__) && !defined(CAFFE2_DISABLE_SIGNAL_HANDLERS) #define CAFFE2_SUPPORTS_FATAL_SIGNAL_HANDLERS #define CAFFE2_SUPPORTS_SIGNAL_HANDLER #endif namespace caffe2 { class CAFFE2_API SignalHandler { public: enum class Action { NONE, STOP }; // Constructor. Specify what action to take when a signal is received. SignalHandler(Action SIGINT_action, Action SIGHUP_action); ~SignalHandler(); Action CheckForSignals(); private: bool GotSIGINT(); bool GotSIGHUP(); Action SIGINT_action_; Action SIGHUP_action_; unsigned long my_sigint_count_; unsigned long my_sighup_count_; }; #if defined(CAFFE2_SUPPORTS_FATAL_SIGNAL_HANDLERS) // This works by setting up certain fatal signal handlers. Previous fatal // signal handlers will still be called when the signal is raised. Defaults // to being off. CAFFE2_API void setPrintStackTracesOnFatalSignal(bool print); CAFFE2_API bool printStackTracesOnFatalSignal(); #endif // defined(CAFFE2_SUPPORTS_SIGNAL_HANDLER) } // namespace caffe2
{ "pile_set_name": "Github" }
#if !defined (_TOOLBAR_H_) #define _TOOLBAR_H_ /* Function prototypes for application routines */ #endif /* _TOOLBAR_H_ */
{ "pile_set_name": "Github" }
head 1.2; access; symbols; locks john:1.2; strict; comment @# @; 1.2 date 95.12.04.19.13.33; author jkc; state Exp; branches; next 1.1; 1.1 date 95.12.04.19.08.50; author jkc; state Exp; branches; next ; desc @@ 1.2 log @Added windowtitles. @ text @#! /bin/sh # suimp2d, suimp3d --- impulsive seismic data over a point scatterer 2D,3D WIDTH=420 HEIGHT=700 WIDTHOFF1=0 WIDTHOFF2=430 WIDTHOFF3=860 HEIGHTOFF=150 echo "The third of three windows in this demo takes some time to come up" echo ## Example 1: default -- one record zero offset above a point scatterer ## one shot at (0,0) ## one receiver at (0,0) ## scatterer at (1000,1000) suimp2d x0=0 | suxwigb perc=$perc \ title="Single Trace" \ windowtitle="Single Trace" \ label1="Time (sec)" label2="Trace" \ wbox=${WIDTH} hbox=${HEIGHT} xbox=${WIDTHOFF1} ybox=${HEIGHTOFF} & ## Example 2: common shot data set above a point scatterer ## one shot at (0,0) ## range of receivers from (0,0) to (0,2000) ## scatterer at (1000,1000) suimp2d nrec=100 dgx=20 | suxmovie perc=$perc d2=20\ title="Common Shot data" \ windowtitle="Shot data" \ label1="Time (sec)" label2="Offset (m)" \ -geometry ${WIDTH}x${HEIGHT}+${WIDTHOFF2}+${HEIGHTOFF} & ## Example 3: common offset data above a point scatterer ## 100 shots with a spacing of 20 (meters) ## range of shots from (0,0) to (0,2000) ## 100 receivers with a spacing of 20 (meters) ## range of receivers from (0,0) to (0,2000) ## scatterer at (1000,1000) ### common offset = 100 (using suwind). suimp2d nshot=100 nrec=100 dgx=20 dsx=20 | suwind key=offset min=100 max=100 count=100 | suxmovie perc=$perc \ title="Common Offset data" \ windowtitle="Offset data" \ label1="Time (sec)" label2="Channel" \ -geometry ${WIDTH}x${HEIGHT}+${WIDTHOFF3}+${HEIGHTOFF} & exit 0 @ 1.1 log @Initial revision @ text @d20 2 a21 1 title="Single Trace"\ d32 2 a33 1 title="Common Shot data"\ d48 2 a49 1 title="Common Offset data"\ @
{ "pile_set_name": "Github" }
/*============================================================================= Copyright (c) 2001-2008 Joel de Guzman Copyright (c) 2001-2008 Hartmut Kaiser http://spirit.sourceforge.net/ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_ITERATOR #define BOOST_SPIRIT_INCLUDE_CLASSIC_ITERATOR #include <boost/spirit/home/classic/iterator.hpp> #endif
{ "pile_set_name": "Github" }
module Quickbooks module Model class CompanyInfo < BaseModel XML_COLLECTION_NODE = "CompanyInfo" XML_NODE = "CompanyInfo" REST_RESOURCE = 'companyinfo' xml_name XML_NODE xml_accessor :id, :from => 'Id' xml_accessor :sync_token, :from => 'SyncToken', :as => Integer xml_accessor :meta_data, :from => 'MetaData', :as => MetaData xml_accessor :company_name, :from => 'CompanyName' xml_accessor :legal_name, :from => 'LegalName' xml_accessor :company_address, :from => 'CompanyAddr', :as => PhysicalAddress xml_accessor :customer_communication_address, :from => 'CustomerCommunicationAddr', :as => PhysicalAddress xml_accessor :legal_address, :from => 'LegalAddr', :as => PhysicalAddress xml_accessor :primary_phone, :from => 'PrimaryPhone', :as => TelephoneNumber xml_accessor :company_start_date, :from => 'CompanyStartDate', :as => DateTime xml_accessor :employer_id, :from => 'EmployerId' xml_accessor :fiscal_year_start_month, :from => 'FiscalYearStartMonth' xml_accessor :country, :from => 'Country' xml_accessor :email, :from => 'Email', :as => EmailAddress xml_accessor :web_site, :from => 'WebAddr', :as => WebSiteAddress xml_accessor :supported_languages, :from => 'SupportedLanguages' xml_accessor :name_values, :from => 'NameValue', :as => [NameValue] def find_name_value(name) nv = name_values.find { |nv| nv.name == name } nv ? nv.value : nil end def find_boolean_name_value(name) find_name_value(name) == "true" end def industry_type find_name_value("IndustryType") end def industry_code find_name_value("IndustryCode") end def company_type find_name_value("CompanyType") end def subscription_status find_name_value("SubscriptionStatus") end def offering_sku find_name_value("OfferingSku") end def neo_enabled find_boolean_name_value("NeoEnabled") end def payroll_feature find_boolean_name_value("PayrollFeature") end def accountant_feature find_boolean_name_value("AccountantFeature") end end end end
{ "pile_set_name": "Github" }
// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Verify that illegal function signatures are detected. // Does not compile. package main type t1 int type t2 int type t3 int func f1(*t2, x t3) // ERROR "named" func f2(t1, *t2, x t3) // ERROR "named" func f3() (x int, *string) // ERROR "named" func f4() (t1 t1) // legal - scope of parameter named t1 starts in body of f4.
{ "pile_set_name": "Github" }
// Rewrite of Alchemist Unstable Concoction // Author: Noya // Date: October 13, 2015 // Version: 6.83 // Type: Datadriven // // ----- FILE REQUIREMENTS ----- // Script files: // scripts/vscripts/heroes/hero_alchemist/unstable_concoction.lua // // KV files: // scripts/npc/abilities/alchemist/unstable_concoction_throw_datadriven.txt "unstable_concoction_datadriven" { // General //------------------------------------------------------------------------------------------------------------- "BaseClass" "ability_datadriven" "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE" "AbilityUnitDamageType" "DAMAGE_TYPE_PHYSICAL" "SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO" "FightRecapLevel" "1" "AbilityTextureName" "alchemist_unstable_concoction" // Casting //------------------------------------------------------------------------------------------------------------- "AbilityCastPoint" "0.0" // Time //------------------------------------------------------------------------------------------------------------- "AbilityCooldown" "16.0" // Cost //------------------------------------------------------------------------------------------------------------- "AbilityManaCost" "120" // Special //------------------------------------------------------------------------------------------------------------- "AbilitySpecial" { "01" { "var_type" "FIELD_FLOAT" "brew_time" "5.0" } "02" { "var_type" "FIELD_FLOAT" "brew_explosion" "5.5" } "03" { "var_type" "FIELD_FLOAT" "min_stun" "0.25" } "04" { "var_type" "FIELD_FLOAT" "max_stun" "1.75 2.5 3.25 4.0" } "05" { "var_type" "FIELD_INTEGER" "min_damage" "0" } "06" { "var_type" "FIELD_INTEGER" "max_damage" "150 220 290 360" } "07" { "var_type" "FIELD_INTEGER" "radius" "175" } } "precache" { "soundfile" "soundevents/game_sounds_heroes/game_sounds_alchemist.vsndevts" "particle" "particles/units/heroes/hero_alchemist/alchemist_unstable_concoction_timer.vpcf" // This particle isn't used because it would need a separate rule to attach to the hands or weapons for each hero // CP1 and CP2 are left and right hands respectively "particle" "particles/units/heroes/hero_alchemist/alchemist_unstableconc_bottles.vpcf" } "OnSpellStart" { "RunScript" { "ScriptFile" "heroes/hero_alchemist/unstable_concoction.lua" "Function" "StartBrewing" "sub_ability_name" "unstable_concoction_throw_datadriven" } "ApplyModifier" { "ModifierName" "modifier_unstable_concoction_brewing" "Target" "CASTER" } } "OnUpgrade" { "RunScript" { "ScriptFile" "heroes/hero_alchemist/unstable_concoction.lua" "Function" "LevelUpAbility" "ability_name" "unstable_concoction_throw_datadriven" } } "Modifiers" { "modifier_unstable_concoction_brewing" { "IsHidden" "1" "Duration" "%brew_explosion" "ThinkInterval" "0.5" "OnIntervalThink" { "RunScript" { "ScriptFile" "heroes/hero_alchemist/unstable_concoction.lua" "Function" "UpdateTimerParticle" } } "OnDestroy" { "RunScript" { "ScriptFile" "heroes/hero_alchemist/unstable_concoction.lua" "Function" "CheckSelfStun" "sub_ability_name" "unstable_concoction_throw_datadriven" "Target" { "Center" "CASTER" "Radius" "%radius" "Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY" "Types" "DOTA_UNIT_TARGET_HERO" } } } } "modifier_unstable_concoction_stun" { "IsDebuff" "1" "States" { "MODIFIER_STATE_STUNNED" "MODIFIER_STATE_VALUE_ENABLED" } "OverrideAnimation" "ACT_DOTA_DISABLED" "EffectName" "particles/generic_gameplay/generic_stunned.vpcf" "EffectAttachType" "follow_overhead" } } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <!-- Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.2 Version: 3.7.0 Author: KeenThemes Website: http://www.keenthemes.com/ Contact: [email protected] Follow: www.twitter.com/keenthemes Like: www.facebook.com/keenthemes Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project. --> <!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <meta charset="utf-8"/> <title>Metronic | Form Stuff - Form Validation</title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1.0" name="viewport"/> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <meta content="" name="description"/> <meta content="" name="author"/> <!-- BEGIN GLOBAL MANDATORY STYLES --> <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"> <link href="../../assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css"/> <!-- END GLOBAL MANDATORY STYLES --> <!-- BEGIN PAGE LEVEL STYLES --> <link rel="stylesheet" type="text/css" href="../../assets/global/plugins/select2/select2.css"/> <link rel="stylesheet" type="text/css" href="../../assets/global/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.css"/> <link rel="stylesheet" type="text/css" href="../../assets/global/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css"> <link rel="stylesheet" type="text/css" href="../../assets/global/plugins/bootstrap-datepicker/css/datepicker.css"/> <!-- END PAGE LEVEL SCRIPTS --> <!-- BEGIN THEME STYLES --> <link href="../../assets/global/css/components-md.css" id="style_components" rel="stylesheet" type="text/css"/> <link href="../../assets/global/css/plugins-md.css" rel="stylesheet" type="text/css"/> <link href="../../assets/admin/layout2/css/layout.css" rel="stylesheet" type="text/css"/> <link id="style_color" href="../../assets/admin/layout2/css/themes/grey.css" rel="stylesheet" type="text/css"/> <link href="../../assets/admin/layout2/css/custom.css" rel="stylesheet" type="text/css"/> <!-- END THEME STYLES --> <link rel="shortcut icon" href="favicon.ico"/> </head> <!-- END HEAD --> <!-- BEGIN BODY --> <!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices --> <!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default --> <!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle --> <!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle --> <!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle --> <!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar --> <!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer --> <!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side --> <!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu --> <body class="page-md page-boxed page-header-fixed page-container-bg-solid page-sidebar-closed-hide-logo "> <!-- BEGIN HEADER --> <div class="page-header md-shadow-z-1-i navbar navbar-fixed-top"> <!-- BEGIN HEADER INNER --> <div class="page-header-inner container"> <!-- BEGIN LOGO --> <div class="page-logo"> <a href="index.html"> <img src="../../assets/admin/layout2/img/logo-default.png" alt="logo" class="logo-default"/> </a> <div class="menu-toggler sidebar-toggler"> <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header --> </div> </div> <!-- END LOGO --> <!-- BEGIN RESPONSIVE MENU TOGGLER --> <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a> <!-- END RESPONSIVE MENU TOGGLER --> <!-- BEGIN PAGE ACTIONS --> <!-- DOC: Remove "hide" class to enable the page header actions --> <div class="page-actions hide"> <div class="btn-group"> <button type="button" class="btn btn-circle red-pink dropdown-toggle" data-toggle="dropdown"> <i class="icon-bar-chart"></i>&nbsp;<span class="hidden-sm hidden-xs">New&nbsp;</span>&nbsp;<i class="fa fa-angle-down"></i> </button> <ul class="dropdown-menu" role="menu"> <li> <a href="javascript:;"> <i class="icon-user"></i> New User </a> </li> <li> <a href="javascript:;"> <i class="icon-present"></i> New Event <span class="badge badge-success">4</span> </a> </li> <li> <a href="javascript:;"> <i class="icon-basket"></i> New order </a> </li> <li class="divider"> </li> <li> <a href="javascript:;"> <i class="icon-flag"></i> Pending Orders <span class="badge badge-danger">4</span> </a> </li> <li> <a href="javascript:;"> <i class="icon-users"></i> Pending Users <span class="badge badge-warning">12</span> </a> </li> </ul> </div> <div class="btn-group"> <button type="button" class="btn btn-circle green-haze dropdown-toggle" data-toggle="dropdown"> <i class="icon-bell"></i>&nbsp;<span class="hidden-sm hidden-xs">Post&nbsp;</span>&nbsp;<i class="fa fa-angle-down"></i> </button> <ul class="dropdown-menu" role="menu"> <li> <a href="javascript:;"> <i class="icon-docs"></i> New Post </a> </li> <li> <a href="javascript:;"> <i class="icon-tag"></i> New Comment </a> </li> <li> <a href="javascript:;"> <i class="icon-share"></i> Share </a> </li> <li class="divider"> </li> <li> <a href="javascript:;"> <i class="icon-flag"></i> Comments <span class="badge badge-success">4</span> </a> </li> <li> <a href="javascript:;"> <i class="icon-users"></i> Feedbacks <span class="badge badge-danger">2</span> </a> </li> </ul> </div> </div> <!-- END PAGE ACTIONS --> <!-- BEGIN PAGE TOP --> <div class="page-top"> <!-- BEGIN HEADER SEARCH BOX --> <!-- DOC: Apply "search-form-expanded" right after the "search-form" class to have half expanded search box --> <form class="search-form search-form-expanded" action="extra_search.html" method="GET"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search..." name="query"> <span class="input-group-btn"> <a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a> </span> </div> </form> <!-- END HEADER SEARCH BOX --> <!-- BEGIN TOP NAVIGATION MENU --> <div class="top-menu"> <ul class="nav navbar-nav pull-right"> <!-- BEGIN NOTIFICATION DROPDOWN --> <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte --> <li class="dropdown dropdown-extended dropdown-notification" id="header_notification_bar"> <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-bell"></i> <span class="badge badge-default"> 7 </span> </a> <ul class="dropdown-menu"> <li class="external"> <h3><span class="bold">12 pending</span> notifications</h3> <a href="extra_profile.html">view all</a> </li> <li> <ul class="dropdown-menu-list scroller" style="height: 250px;" data-handle-color="#637283"> <li> <a href="javascript:;"> <span class="time">just now</span> <span class="details"> <span class="label label-sm label-icon label-success"> <i class="fa fa-plus"></i> </span> New user registered. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">3 mins</span> <span class="details"> <span class="label label-sm label-icon label-danger"> <i class="fa fa-bolt"></i> </span> Server #12 overloaded. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">10 mins</span> <span class="details"> <span class="label label-sm label-icon label-warning"> <i class="fa fa-bell-o"></i> </span> Server #2 not responding. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">14 hrs</span> <span class="details"> <span class="label label-sm label-icon label-info"> <i class="fa fa-bullhorn"></i> </span> Application error. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">2 days</span> <span class="details"> <span class="label label-sm label-icon label-danger"> <i class="fa fa-bolt"></i> </span> Database overloaded 68%. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">3 days</span> <span class="details"> <span class="label label-sm label-icon label-danger"> <i class="fa fa-bolt"></i> </span> A user IP blocked. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">4 days</span> <span class="details"> <span class="label label-sm label-icon label-warning"> <i class="fa fa-bell-o"></i> </span> Storage Server #4 not responding dfdfdfd. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">5 days</span> <span class="details"> <span class="label label-sm label-icon label-info"> <i class="fa fa-bullhorn"></i> </span> System Error. </span> </a> </li> <li> <a href="javascript:;"> <span class="time">9 days</span> <span class="details"> <span class="label label-sm label-icon label-danger"> <i class="fa fa-bolt"></i> </span> Storage server failed. </span> </a> </li> </ul> </li> </ul> </li> <!-- END NOTIFICATION DROPDOWN --> <!-- BEGIN INBOX DROPDOWN --> <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte --> <li class="dropdown dropdown-extended dropdown-inbox" id="header_inbox_bar"> <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-envelope-open"></i> <span class="badge badge-default"> 4 </span> </a> <ul class="dropdown-menu"> <li class="external"> <h3>You have <span class="bold">7 New</span> Messages</h3> <a href="page_inbox.html">view all</a> </li> <li> <ul class="dropdown-menu-list scroller" style="height: 275px;" data-handle-color="#637283"> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar2.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Lisa Wong </span> <span class="time">Just Now </span> </span> <span class="message"> Vivamus sed auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar3.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Richard Doe </span> <span class="time">16 mins </span> </span> <span class="message"> Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar1.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Bob Nilson </span> <span class="time">2 hrs </span> </span> <span class="message"> Vivamus sed nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar2.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Lisa Wong </span> <span class="time">40 mins </span> </span> <span class="message"> Vivamus sed auctor 40% nibh congue nibh... </span> </a> </li> <li> <a href="inbox.html?a=view"> <span class="photo"> <img src="../../assets/admin/layout3/img/avatar3.jpg" class="img-circle" alt=""> </span> <span class="subject"> <span class="from"> Richard Doe </span> <span class="time">46 mins </span> </span> <span class="message"> Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> </ul> </li> </ul> </li> <!-- END INBOX DROPDOWN --> <!-- BEGIN TODO DROPDOWN --> <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte --> <li class="dropdown dropdown-extended dropdown-tasks" id="header_task_bar"> <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-calendar"></i> <span class="badge badge-default"> 3 </span> </a> <ul class="dropdown-menu extended tasks"> <li class="external"> <h3>You have <span class="bold">12 pending</span> tasks</h3> <a href="page_todo.html">view all</a> </li> <li> <ul class="dropdown-menu-list scroller" style="height: 275px;" data-handle-color="#637283"> <li> <a href="javascript:;"> <span class="task"> <span class="desc">New release v1.2 </span> <span class="percent">30%</span> </span> <span class="progress"> <span style="width: 40%;" class="progress-bar progress-bar-success" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">40% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Application deployment</span> <span class="percent">65%</span> </span> <span class="progress"> <span style="width: 65%;" class="progress-bar progress-bar-danger" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">65% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Mobile app release</span> <span class="percent">98%</span> </span> <span class="progress"> <span style="width: 98%;" class="progress-bar progress-bar-success" aria-valuenow="98" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">98% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Database migration</span> <span class="percent">10%</span> </span> <span class="progress"> <span style="width: 10%;" class="progress-bar progress-bar-warning" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">10% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Web server upgrade</span> <span class="percent">58%</span> </span> <span class="progress"> <span style="width: 58%;" class="progress-bar progress-bar-info" aria-valuenow="58" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">58% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">Mobile development</span> <span class="percent">85%</span> </span> <span class="progress"> <span style="width: 85%;" class="progress-bar progress-bar-success" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">85% Complete</span></span> </span> </a> </li> <li> <a href="javascript:;"> <span class="task"> <span class="desc">New UI release</span> <span class="percent">38%</span> </span> <span class="progress progress-striped"> <span style="width: 38%;" class="progress-bar progress-bar-important" aria-valuenow="18" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">38% Complete</span></span> </span> </a> </li> </ul> </li> </ul> </li> <!-- END TODO DROPDOWN --> <!-- BEGIN USER LOGIN DROPDOWN --> <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte --> <li class="dropdown dropdown-user"> <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <img alt="" class="img-circle" src="../../assets/admin/layout2/img/avatar3_small.jpg"/> <span class="username username-hide-on-mobile"> Nick </span> <i class="fa fa-angle-down"></i> </a> <ul class="dropdown-menu dropdown-menu-default"> <li> <a href="extra_profile.html"> <i class="icon-user"></i> My Profile </a> </li> <li> <a href="page_calendar.html"> <i class="icon-calendar"></i> My Calendar </a> </li> <li> <a href="inbox.html"> <i class="icon-envelope-open"></i> My Inbox <span class="badge badge-danger"> 3 </span> </a> </li> <li> <a href="page_todo.html"> <i class="icon-rocket"></i> My Tasks <span class="badge badge-success"> 7 </span> </a> </li> <li class="divider"> </li> <li> <a href="extra_lock.html"> <i class="icon-lock"></i> Lock Screen </a> </li> <li> <a href="login.html"> <i class="icon-key"></i> Log Out </a> </li> </ul> </li> <!-- END USER LOGIN DROPDOWN --> </ul> </div> <!-- END TOP NAVIGATION MENU --> </div> <!-- END PAGE TOP --> </div> <!-- END HEADER INNER --> </div> <!-- END HEADER --> <div class="clearfix"> </div> <div class="container"> <!-- BEGIN CONTAINER --> <div class="page-container"> <!-- BEGIN SIDEBAR --> <div class="page-sidebar-wrapper"> <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing --> <!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed --> <div class="page-sidebar navbar-collapse collapse"> <!-- BEGIN SIDEBAR MENU --> <!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) --> <!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode --> <!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode --> <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing --> <!-- DOC: Set data-keep-expand="true" to keep the submenues expanded --> <!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed --> <ul class="page-sidebar-menu page-sidebar-menu-hover-submenu " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200"> <li class="start "> <a href="index.html"> <i class="icon-home"></i> <span class="title">Dashboard</span> </a> </li> <li> <a href="javascript:;"> <i class="icon-basket"></i> <span class="title">eCommerce</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="ecommerce_index.html"> <i class="icon-home"></i> Dashboard</a> </li> <li> <a href="ecommerce_orders.html"> <i class="icon-basket"></i> Orders</a> </li> <li> <a href="ecommerce_orders_view.html"> <i class="icon-tag"></i> Order View</a> </li> <li> <a href="ecommerce_products.html"> <i class="icon-handbag"></i> Products</a> </li> <li> <a href="ecommerce_products_edit.html"> <i class="icon-pencil"></i> Product Edit</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-rocket"></i> <span class="title">Page Layouts</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="layout_fontawesome_icons.html"> <span class="badge badge-roundless badge-danger">new</span>Layout with Fontawesome Icons</a> </li> <li> <a href="layout_glyphicons.html"> Layout with Glyphicon</a> </li> <li> <a href="layout_full_height_content.html"> <span class="badge badge-roundless badge-warning">new</span>Full Height Content</a> </li> <li> <a href="layout_sidebar_reversed.html"> <span class="badge badge-roundless badge-warning">new</span>Right Sidebar Page</a> </li> <li> <a href="layout_sidebar_fixed.html"> Sidebar Fixed Page</a> </li> <li> <a href="layout_sidebar_closed.html"> Sidebar Closed Page</a> </li> <li> <a href="layout_ajax.html"> Content Loading via Ajax</a> </li> <li> <a href="layout_disabled_menu.html"> Disabled Menu Links</a> </li> <li> <a href="layout_blank_page.html"> Blank Page</a> </li> <li> <a href="layout_fluid_page.html"> Fluid Page</a> </li> <li> <a href="layout_language_bar.html"> Language Switch Bar</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-diamond"></i> <span class="title">UI Features</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="ui_general.html"> General Components</a> </li> <li> <a href="ui_buttons.html"> Buttons</a> </li> <li> <a href="ui_icons.html"> <span class="badge badge-roundless badge-danger">new</span>Font Icons</a> </li> <li> <a href="ui_colors.html"> Flat UI Colors</a> </li> <li> <a href="ui_typography.html"> Typography</a> </li> <li> <a href="ui_tabs_accordions_navs.html"> Tabs, Accordions & Navs</a> </li> <li> <a href="ui_tree.html"> <span class="badge badge-roundless badge-danger">new</span>Tree View</a> </li> <li> <a href="ui_page_progress_style_1.html"> <span class="badge badge-roundless badge-warning">new</span>Page Progress Bar</a> </li> <li> <a href="ui_blockui.html"> Block UI</a> </li> <li> <a href="ui_bootstrap_growl.html"> <span class="badge badge-roundless badge-warning">new</span>Bootstrap Growl Notifications</a> </li> <li> <a href="ui_notific8.html"> Notific8 Notifications</a> </li> <li> <a href="ui_toastr.html"> Toastr Notifications</a> </li> <li> <a href="ui_alert_dialog_api.html"> <span class="badge badge-roundless badge-danger">new</span>Alerts & Dialogs API</a> </li> <li> <a href="ui_session_timeout.html"> Session Timeout</a> </li> <li> <a href="ui_idle_timeout.html"> User Idle Timeout</a> </li> <li> <a href="ui_modals.html"> Modals</a> </li> <li> <a href="ui_extended_modals.html"> Extended Modals</a> </li> <li> <a href="ui_tiles.html"> Tiles</a> </li> <li> <a href="ui_datepaginator.html"> <span class="badge badge-roundless badge-success">new</span>Date Paginator</a> </li> <li> <a href="ui_nestable.html"> Nestable List</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-puzzle"></i> <span class="title">UI Components</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="components_pickers.html"> Date & Time Pickers</a> </li> <li> <a href="components_context_menu.html"> Context Menu</a> </li> <li> <a href="components_dropdowns.html"> Custom Dropdowns</a> </li> <li> <a href="components_form_tools.html"> Form Widgets & Tools</a> </li> <li> <a href="components_form_tools2.html"> Form Widgets & Tools 2</a> </li> <li> <a href="components_editors.html"> Markdown & WYSIWYG Editors</a> </li> <li> <a href="components_ion_sliders.html"> Ion Range Sliders</a> </li> <li> <a href="components_noui_sliders.html"> NoUI Range Sliders</a> </li> <li> <a href="components_jqueryui_sliders.html"> jQuery UI Sliders</a> </li> <li> <a href="components_knob_dials.html"> Knob Circle Dials</a> </li> </ul> </li> <!-- BEGIN ANGULARJS LINK --> <li class="tooltips" data-container="body" data-placement="right" data-html="true" data-original-title="AngularJS version demo"> <a href="angularjs" target="_blank"> <i class="icon-paper-plane"></i> <span class="title"> AngularJS Version </span> </a> </li> <!-- END ANGULARJS LINK --> <li class="active open"> <a href="javascript:;"> <i class="icon-settings"></i> <span class="title">Form Stuff</span> <span class="selected"></span> <span class="arrow open"></span> </a> <ul class="sub-menu"> <li> <a href="form_controls_md.html"> <span class="badge badge-roundless badge-danger">new</span>Material Design<br> Form Controls</a> </li> <li> <a href="form_controls.html"> Bootstrap<br> Form Controls</a> </li> <li> <a href="form_icheck.html"> iCheck Controls</a> </li> <li> <a href="form_layouts.html"> Form Layouts</a> </li> <li> <a href="form_editable.html"> <span class="badge badge-roundless badge-warning">new</span>Form X-editable</a> </li> <li> <a href="form_wizard.html"> Form Wizard</a> </li> <li class="active"> <a href="form_validation.html"> Form Validation</a> </li> <li> <a href="form_image_crop.html"> <span class="badge badge-roundless badge-danger">new</span>Image Cropping</a> </li> <li> <a href="form_fileupload.html"> Multiple File Upload</a> </li> <li> <a href="form_dropzone.html"> Dropzone File Upload</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-briefcase"></i> <span class="title">Data Tables</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="table_basic.html"> Basic Datatables</a> </li> <li> <a href="table_tree.html"> Tree Datatables</a> </li> <li> <a href="table_responsive.html"> Responsive Datatables</a> </li> <li> <a href="table_managed.html"> Managed Datatables</a> </li> <li> <a href="table_editable.html"> Editable Datatables</a> </li> <li> <a href="table_advanced.html"> Advanced Datatables</a> </li> <li> <a href="table_ajax.html"> Ajax Datatables</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-wallet"></i> <span class="title">Portlets</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="portlet_general.html"> General Portlets</a> </li> <li> <a href="portlet_general2.html"> <span class="badge badge-roundless badge-danger">new</span>New Portlets #1</a> </li> <li> <a href="portlet_general3.html"> <span class="badge badge-roundless badge-danger">new</span>New Portlets #2</a> </li> <li> <a href="portlet_ajax.html"> Ajax Portlets</a> </li> <li> <a href="portlet_draggable.html"> Draggable Portlets</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-bar-chart"></i> <span class="title">Charts</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="charts_amcharts.html"> amChart</a> </li> <li> <a href="charts_flotcharts.html"> Flotchart</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-docs"></i> <span class="title">Pages</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="page_timeline.html"> <i class="icon-paper-plane"></i> <span class="badge badge-warning">2</span>New Timeline</a> </li> <li> <a href="extra_profile.html"> <i class="icon-user-following"></i> <span class="badge badge-success badge-roundless">new</span>New User Profile</a> </li> <li> <a href="page_todo.html"> <i class="icon-hourglass"></i> <span class="badge badge-danger">4</span>Todo</a> </li> <li> <a href="inbox.html"> <i class="icon-envelope"></i> <span class="badge badge-danger">4</span>Inbox</a> </li> <li> <a href="extra_faq.html"> <i class="icon-info"></i> FAQ</a> </li> <li> <a href="page_portfolio.html"> <i class="icon-feed"></i> Portfolio</a> </li> <li> <a href="page_coming_soon.html"> <i class="icon-flag"></i> Coming Soon</a> </li> <li> <a href="page_calendar.html"> <i class="icon-calendar"></i> <span class="badge badge-danger">14</span>Calendar</a> </li> <li> <a href="extra_invoice.html"> <i class="icon-flag"></i> Invoice</a> </li> <li> <a href="page_blog.html"> <i class="icon-speech"></i> Blog</a> </li> <li> <a href="page_blog_item.html"> <i class="icon-link"></i> Blog Post</a> </li> <li> <a href="page_news.html"> <i class="icon-eye"></i> <span class="badge badge-success">9</span>News</a> </li> <li> <a href="page_news_item.html"> <i class="icon-bell"></i> News View</a> </li> <li> <a href="page_timeline_old.html"> <i class="icon-paper-plane"></i> <span class="badge badge-warning">2</span>Old Timeline</a> </li> <li> <a href="extra_profile_old.html"> <i class="icon-user"></i> Old User Profile</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-present"></i> <span class="title">Extra</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="page_about.html"> About Us</a> </li> <li> <a href="page_contact.html"> Contact Us</a> </li> <li> <a href="extra_search.html"> Search Results</a> </li> <li> <a href="extra_pricing_table.html"> Pricing Tables</a> </li> <li> <a href="extra_404_option1.html"> 404 Page Option 1</a> </li> <li> <a href="extra_404_option2.html"> 404 Page Option 2</a> </li> <li> <a href="extra_404_option3.html"> 404 Page Option 3</a> </li> <li> <a href="extra_500_option1.html"> 500 Page Option 1</a> </li> <li> <a href="extra_500_option2.html"> 500 Page Option 2</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-folder"></i> <span class="title">Multi Level Menu</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="javascript:;"> <i class="icon-settings"></i> Item 1 <span class="arrow"></span> </a> <ul class="sub-menu"> <li> <a href="javascript:;"> <i class="icon-user"></i> Sample Link 1 <span class="arrow"></span> </a> <ul class="sub-menu"> <li> <a href="#"><i class="icon-power"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-paper-plane"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-star"></i> Sample Link 1</a> </li> </ul> </li> <li> <a href="#"><i class="icon-camera"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-link"></i> Sample Link 2</a> </li> <li> <a href="#"><i class="icon-pointer"></i> Sample Link 3</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-globe"></i> Item 2 <span class="arrow"></span> </a> <ul class="sub-menu"> <li> <a href="#"><i class="icon-tag"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-pencil"></i> Sample Link 1</a> </li> <li> <a href="#"><i class="icon-graph"></i> Sample Link 1</a> </li> </ul> </li> <li> <a href="#"> <i class="icon-bar-chart"></i> Item 3 </a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-user"></i> <span class="title">Login Options</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="login.html"> Login Form 1</a> </li> <li> <a href="login_2.html"> Login Form 2</a> </li> <li> <a href="login_3.html"> Login Form 3</a> </li> <li> <a href="login_soft.html"> Login Form 4</a> </li> <li> <a href="extra_lock.html"> Lock Screen 1</a> </li> <li> <a href="extra_lock2.html"> Lock Screen 2</a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-envelope-open"></i> <span class="title">Email Templates</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="email_template1.html"> New Email Template 1</a> </li> <li> <a href="email_template2.html"> New Email Template 2</a> </li> <li> <a href="email_template3.html"> New Email Template 3</a> </li> <li> <a href="email_template4.html"> New Email Template 4</a> </li> <li> <a href="email_newsletter.html"> Old Email Template 1</a> </li> <li> <a href="email_system.html"> Old Email Template 2</a> </li> </ul> </li> <li class="last "> <a href="javascript:;"> <i class="icon-pointer"></i> <span class="title">Maps</span> <span class="arrow "></span> </a> <ul class="sub-menu"> <li> <a href="maps_google.html"> Google Maps</a> </li> <li> <a href="maps_vector.html"> Vector Maps</a> </li> </ul> </li> </ul> <!-- END SIDEBAR MENU --> </div> </div> <!-- END SIDEBAR --> <!-- BEGIN CONTENT --> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM--> <div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title">Modal title</h4> </div> <div class="modal-body"> Widget settings form goes here </div> <div class="modal-footer"> <button type="button" class="btn blue">Save changes</button> <button type="button" class="btn default" data-dismiss="modal">Close</button> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <!-- /.modal --> <!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM--> <!-- BEGIN STYLE CUSTOMIZER --> <div class="theme-panel"> <div class="toggler tooltips" data-container="body" data-placement="left" data-html="true" data-original-title="Click to open advance theme customizer panel"> <i class="icon-settings"></i> </div> <div class="toggler-close"> <i class="icon-close"></i> </div> <div class="theme-options"> <div class="theme-option theme-colors clearfix"> <span> THEME COLOR </span> <ul> <li class="color-default current tooltips" data-style="default" data-container="body" data-original-title="Default"> </li> <li class="color-grey tooltips" data-style="grey" data-container="body" data-original-title="Grey"> </li> <li class="color-blue tooltips" data-style="blue" data-container="body" data-original-title="Blue"> </li> <li class="color-dark tooltips" data-style="dark" data-container="body" data-original-title="Dark"> </li> <li class="color-light tooltips" data-style="light" data-container="body" data-original-title="Light"> </li> </ul> </div> <div class="theme-option"> <span> Theme Style </span> <select class="layout-style-option form-control input-small"> <option value="square" selected="selected">Square corners</option> <option value="rounded">Rounded corners</option> </select> </div> <div class="theme-option"> <span> Layout </span> <select class="layout-option form-control input-small"> <option value="fluid" selected="selected">Fluid</option> <option value="boxed">Boxed</option> </select> </div> <div class="theme-option"> <span> Header </span> <select class="page-header-option form-control input-small"> <option value="fixed" selected="selected">Fixed</option> <option value="default">Default</option> </select> </div> <div class="theme-option"> <span> Top Dropdown</span> <select class="page-header-top-dropdown-style-option form-control input-small"> <option value="light" selected="selected">Light</option> <option value="dark">Dark</option> </select> </div> <div class="theme-option"> <span> Sidebar Mode</span> <select class="sidebar-option form-control input-small"> <option value="fixed">Fixed</option> <option value="default" selected="selected">Default</option> </select> </div> <div class="theme-option"> <span> Sidebar Style</span> <select class="sidebar-style-option form-control input-small"> <option value="default" selected="selected">Default</option> <option value="compact">Compact</option> </select> </div> <div class="theme-option"> <span> Sidebar Menu </span> <select class="sidebar-menu-option form-control input-small"> <option value="accordion" selected="selected">Accordion</option> <option value="hover">Hover</option> </select> </div> <div class="theme-option"> <span> Sidebar Position </span> <select class="sidebar-pos-option form-control input-small"> <option value="left" selected="selected">Left</option> <option value="right">Right</option> </select> </div> <div class="theme-option"> <span> Footer </span> <select class="page-footer-option form-control input-small"> <option value="fixed">Fixed</option> <option value="default" selected="selected">Default</option> </select> </div> </div> </div> <!-- END STYLE CUSTOMIZER --> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Form Validation <small>form validation</small> </h3> <div class="page-bar"> <ul class="page-breadcrumb"> <li> <i class="fa fa-home"></i> <a href="index.html">Home</a> <i class="fa fa-angle-right"></i> </li> <li> <a href="#">Form Stuff</a> <i class="fa fa-angle-right"></i> </li> <li> <a href="#">Form Validation</a> </li> </ul> <div class="page-toolbar"> <div class="btn-group pull-right"> <button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true"> Actions <i class="fa fa-angle-down"></i> </button> <ul class="dropdown-menu pull-right" role="menu"> <li> <a href="#">Action</a> </li> <li> <a href="#">Another action</a> </li> <li> <a href="#">Something else here</a> </li> <li class="divider"> </li> <li> <a href="#">Separated link</a> </li> </ul> </div> </div> </div> <!-- END PAGE HEADER--> <!-- BEGIN PAGE CONTENT--> <div class="row"> <div class="col-md-12"> <!-- BEGIN VALIDATION STATES--> <div class="portlet box blue"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-gift"></i>Validation States </div> <div class="tools"> <a href="javascript:;" class="collapse"> </a> <a href="#portlet-config" data-toggle="modal" class="config"> </a> <a href="javascript:;" class="reload"> </a> <a href="javascript:;" class="remove"> </a> </div> </div> <div class="portlet-body form"> <!-- BEGIN FORM--> <form action="#" class="form-horizontal"> <div class="form-body"> <h3 class="form-section">Basic validation States</h3> <div class="form-group has-warning"> <label class="control-label col-md-3" for="inputWarning">Input with warning</label> <div class="col-md-4"> <input type="text" class="form-control" id="inputWarning"/> <span class="help-block"> Something may have gone wrong </span> </div> </div> <div class="form-group has-error"> <label class="control-label col-md-3" for="inputError">Input with error</label> <div class="col-md-4"> <input type="text" class="form-control" id="inputError"/> <span class="help-block"> Please correct the error </span> </div> </div> <div class="form-group has-success"> <label class="control-label col-md-3" for="inputSuccess">Input with success</label> <div class="col-md-4"> <input type="text" class="form-control" id="inputSuccess"/> </div> </div> <h3 class="form-section">Validation States With Icons</h3> <div class="form-group has-warning"> <label class="control-label col-md-3">Input with warning</label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa fa-exclamation tooltips" data-original-title="please write a valid email"></i> <input type="text" class="form-control"/> </div> </div> </div> <div class="form-group has-error"> <label class="control-label col-md-3">Input with error</label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa fa-warning tooltips" data-original-title="please write a valid email"></i> <input type="text" class="form-control"/> </div> </div> </div> <div class="form-group has-success"> <label class="control-label col-md-3">Input with success</label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa fa-check tooltips" data-original-title="success input!"></i> <input type="text" class="form-control"/> </div> </div> </div> </div> <div class="form-actions"> <div class="row"> <div class="col-md-offset-3 col-md-9"> <button type="submit" class="btn green">Submit</button> <button type="button" class="btn default">Cancel</button> </div> </div> </div> </form> <!-- END FORM--> </div> </div> <!-- END VALIDATION STATES--> </div> </div> <div class="row"> <div class="col-md-12"> <!-- BEGIN VALIDATION STATES--> <div class="portlet box purple"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-gift"></i>Basic Validation </div> <div class="tools"> <a href="javascript:;" class="collapse"> </a> <a href="#portlet-config" data-toggle="modal" class="config"> </a> <a href="javascript:;" class="reload"> </a> <a href="javascript:;" class="remove"> </a> </div> </div> <div class="portlet-body form"> <!-- BEGIN FORM--> <form action="#" id="form_sample_1" class="form-horizontal"> <div class="form-body"> <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> You have some form errors. Please check below. </div> <div class="alert alert-success display-hide"> <button class="close" data-close="alert"></button> Your form validation is successful! </div> <div class="form-group"> <label class="control-label col-md-3">Name <span class="required"> * </span> </label> <div class="col-md-4"> <input type="text" name="name" data-required="1" class="form-control"/> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Email <span class="required"> * </span> </label> <div class="col-md-4"> <input name="email" type="text" class="form-control"/> </div> </div> <div class="form-group"> <label class="control-label col-md-3">URL <span class="required"> * </span> </label> <div class="col-md-4"> <input name="url" type="text" class="form-control"/> <span class="help-block"> e.g: http://www.demo.com or http://demo.com </span> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Number <span class="required"> * </span> </label> <div class="col-md-4"> <input name="number" type="text" class="form-control"/> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Digits <span class="required"> * </span> </label> <div class="col-md-4"> <input name="digits" type="text" class="form-control"/> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Credit Card <span class="required"> * </span> </label> <div class="col-md-4"> <input name="creditcard" type="text" class="form-control"/> <span class="help-block"> e.g: 5500 0000 0000 0004 </span> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Occupation&nbsp;&nbsp;</label> <div class="col-md-4"> <input name="occupation" type="text" class="form-control"/> <span class="help-block"> optional field </span> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Select <span class="required"> * </span> </label> <div class="col-md-4"> <select class="form-control" name="select"> <option value="">Select...</option> <option value="Category 1">Category 1</option> <option value="Category 2">Category 2</option> <option value="Category 3">Category 5</option> <option value="Category 4">Category 4</option> </select> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Multi Select <span class="required"> * </span> </label> <div class="col-md-4"> <select class="form-control" name="select_multi" multiple> <option value="Category 1">Category 1</option> <option value="Category 2">Category 2</option> <option value="Category 3">Category 3</option> <option value="Category 4">Category 4</option> <option value="Category 5">Category 5</option> </select> <span class="help-block"> select max 3 options, min 1 option </span> </div> </div> </div> <div class="form-actions"> <div class="row"> <div class="col-md-offset-3 col-md-9"> <button type="submit" class="btn green">Submit</button> <button type="button" class="btn default">Cancel</button> </div> </div> </div> </form> <!-- END FORM--> </div> </div> <!-- END VALIDATION STATES--> </div> </div> <div class="row"> <div class="col-md-12"> <!-- BEGIN VALIDATION STATES--> <div class="portlet box yellow"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-gift"></i>Validation Using Icons </div> <div class="tools"> <a href="javascript:;" class="collapse"> </a> <a href="#portlet-config" data-toggle="modal" class="config"> </a> <a href="javascript:;" class="reload"> </a> <a href="javascript:;" class="remove"> </a> </div> </div> <div class="portlet-body form"> <!-- BEGIN FORM--> <form action="#" id="form_sample_2" class="form-horizontal"> <div class="form-body"> <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> You have some form errors. Please check below. </div> <div class="alert alert-success display-hide"> <button class="close" data-close="alert"></button> Your form validation is successful! </div> <div class="form-group"> <label class="control-label col-md-3">Name <span class="required"> * </span> </label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa"></i> <input type="text" class="form-control" name="name"/> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Email <span class="required"> * </span> </label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa"></i> <input type="text" class="form-control" name="email"/> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">URL <span class="required"> * </span> </label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa"></i> <input type="text" class="form-control" name="url"/> </div> <span class="help-block"> e.g: http://www.demo.com or http://demo.com </span> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Number <span class="required"> * </span> </label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa"></i> <input type="text" class="form-control" name="number"/> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Digits <span class="required"> * </span> </label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa"></i> <input type="text" class="form-control" name="digits"/> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Credit Card <span class="required"> * </span> </label> <div class="col-md-4"> <div class="input-icon right"> <i class="fa"></i> <input type="text" class="form-control" name="creditcard"/> </div> <span class="help-block"> e.g: 5500 0000 0000 0004 </span> </div> </div> </div> <div class="form-actions"> <div class="row"> <div class="col-md-offset-3 col-md-9"> <button type="submit" class="btn green">Submit</button> <button type="button" class="btn default">Cancel</button> </div> </div> </div> </form> <!-- END FORM--> </div> </div> <!-- END VALIDATION STATES--> </div> </div> <div class="row"> <div class="col-md-12"> <!-- BEGIN VALIDATION STATES--> <div class="portlet box green"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-gift"></i>Advance Validation </div> <div class="tools"> <a href="javascript:;" class="collapse"> </a> <a href="#portlet-config" data-toggle="modal" class="config"> </a> <a href="javascript:;" class="reload"> </a> <a href="javascript:;" class="remove"> </a> </div> </div> <div class="portlet-body form"> <!-- BEGIN FORM--> <form action="#" id="form_sample_3" class="form-horizontal"> <div class="form-body"> <h3 class="form-section">Advance validation. <small>Custom radio buttons, checkboxes and Select2 dropdowns</small></h3> <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> You have some form errors. Please check below. </div> <div class="alert alert-success display-hide"> <button class="close" data-close="alert"></button> Your form validation is successful! </div> <div class="form-group"> <label class="control-label col-md-3">Name <span class="required"> * </span> </label> <div class="col-md-4"> <input type="text" name="name" data-required="1" class="form-control"/> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">Email Address <span class="required"> * </span> </label> <div class="col-md-4"> <div class="input-group"> <span class="input-group-addon"> <i class="fa fa-envelope"></i> </span> <input type="email" name="email" class="form-control" placeholder="Email Address"> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Occupation&nbsp;&nbsp;</label> <div class="col-md-4"> <input name="occupation" type="text" class="form-control"/> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Select2 Dropdown <span class="required"> * </span> </label> <div class="col-md-4"> <select class="form-control select2me" name="options2"> <option value="">Select...</option> <option value="Option 1">Option 1</option> <option value="Option 2">Option 2</option> <option value="Option 3">Option 3</option> <option value="Option 4">Option 4</option> </select> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Select2 Tags <span class="required"> * </span> </label> <div class="col-md-4"> <input type="hidden" class="form-control" id="select2_tags" value="" name="select2tags"> <span class="help-block"> select tags </span> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Datepicker</label> <div class="col-md-4"> <div class="input-group date date-picker" data-date-format="dd-mm-yyyy"> <input type="text" class="form-control" readonly name="datepicker"> <span class="input-group-btn"> <button class="btn default" type="button"><i class="fa fa-calendar"></i></button> </span> </div> <!-- /input-group --> <span class="help-block"> select a date </span> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Membership <span class="required"> * </span> </label> <div class="col-md-4"> <div class="radio-list" data-error-container="#form_2_membership_error"> <label> <input type="radio" name="membership" value="1"/> Fee </label> <label> <input type="radio" name="membership" value="2"/> Professional </label> </div> <div id="form_2_membership_error"> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Services <span class="required"> * </span> </label> <div class="col-md-4"> <div class="checkbox-list" data-error-container="#form_2_services_error"> <label> <input type="checkbox" value="1" name="service"/> Service 1 </label> <label> <input type="checkbox" value="2" name="service"/> Service 2 </label> <label> <input type="checkbox" value="3" name="service"/> Service 3 </label> </div> <span class="help-block"> (select at least two) </span> <div id="form_2_services_error"> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Markdown</label> <div class="col-md-9"> <textarea name="markdown" data-provide="markdown" rows="10" data-error-container="#editor_error"></textarea> <div id="editor_error"> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">WYSIHTML5 Editor <span class="required"> * </span> </label> <div class="col-md-9"> <textarea class="wysihtml5 form-control" rows="6" name="editor1" data-error-container="#editor1_error"></textarea> <div id="editor1_error"> </div> </div> </div> <div class="form-group last"> <label class="control-label col-md-3">CKEditor <span class="required"> * </span> </label> <div class="col-md-9"> <textarea class="ckeditor form-control" name="editor2" rows="6" data-error-container="#editor2_error"></textarea> <div id="editor2_error"> </div> </div> </div> </div> <div class="form-actions"> <div class="row"> <div class="col-md-offset-3 col-md-9"> <button type="submit" class="btn green">Submit</button> <button type="button" class="btn default">Cancel</button> </div> </div> </div> </form> <!-- END FORM--> </div> <!-- END VALIDATION STATES--> </div> </div> </div> <!-- END PAGE CONTENT--> </div> </div> <!-- END CONTENT --> <!-- BEGIN QUICK SIDEBAR --> <!--Cooming Soon...--> <!-- END QUICK SIDEBAR --> </div> <!-- END CONTAINER --> <!-- BEGIN FOOTER --> <div class="page-footer"> <div class="page-footer-inner"> 2014 &copy; Metronic by keenthemes. </div> <div class="scroll-to-top"> <i class="icon-arrow-up"></i> </div> </div> <!-- END FOOTER --> </div> <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) --> <!-- BEGIN CORE PLUGINS --> <!--[if lt IE 9]> <script src="../../assets/global/plugins/respond.min.js"></script> <script src="../../assets/global/plugins/excanvas.min.js"></script> <![endif]--> <script src="../../assets/global/plugins/jquery.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script> <!-- IMPORTANT! Load jquery-ui.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip --> <script src="../../assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script> <script src="../../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script> <!-- END CORE PLUGINS --> <!-- BEGIN PAGE LEVEL PLUGINS --> <script type="text/javascript" src="../../assets/global/plugins/jquery-validation/js/jquery.validate.min.js"></script> <script type="text/javascript" src="../../assets/global/plugins/jquery-validation/js/additional-methods.min.js"></script> <script type="text/javascript" src="../../assets/global/plugins/select2/select2.min.js"></script> <script type="text/javascript" src="../../assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> <script type="text/javascript" src="../../assets/global/plugins/bootstrap-wysihtml5/wysihtml5-0.3.0.js"></script> <script type="text/javascript" src="../../assets/global/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.js"></script> <script type="text/javascript" src="../../assets/global/plugins/ckeditor/ckeditor.js"></script> <script type="text/javascript" src="../../assets/global/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script> <script type="text/javascript" src="../../assets/global/plugins/bootstrap-markdown/lib/markdown.js"></script> <!-- END PAGE LEVEL PLUGINS --> <!-- BEGIN PAGE LEVEL STYLES --> <script src="../../assets/global/scripts/metronic.js" type="text/javascript"></script> <script src="../../assets/admin/layout2/scripts/layout.js" type="text/javascript"></script> <script src="../../assets/admin/layout2/scripts/demo.js" type="text/javascript"></script> <script src="../../assets/admin/pages/scripts/form-validation.js"></script> <!-- END PAGE LEVEL STYLES --> <script> jQuery(document).ready(function() { // initiate layout and plugins Metronic.init(); // init metronic core components Layout.init(); // init current layout Demo.init(); // init demo features FormValidation.init(); }); </script> <!-- END JAVASCRIPTS --> </body> <!-- END BODY --> </html>
{ "pile_set_name": "Github" }
/*! * Bootstrap v3.1.1 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } /* ======================================================================== * Bootstrap: transition.js v3.1.1 * http://getbootstrap.com/javascript/#transitions * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) // ============================================================ function transitionEnd() { var el = document.createElement('bootstrap') var transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd', 'MozTransition' : 'transitionend', 'OTransition' : 'oTransitionEnd otransitionend', 'transition' : 'transitionend' } for (var name in transEndEventNames) { if (el.style[name] !== undefined) { return { end: transEndEventNames[name] } } } return false // explicit for ie8 ( ._.) } // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { var called = false, $el = this $(this).one($.support.transition.end, function () { called = true }) var callback = function () { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this } $(function () { $.support.transition = transitionEnd() }) }(jQuery); /* ======================================================================== * Bootstrap: alert.js v3.1.1 * http://getbootstrap.com/javascript/#alerts * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // ALERT CLASS DEFINITION // ====================== var dismiss = '[data-dismiss="alert"]' var Alert = function (el) { $(el).on('click', dismiss, this.close) } Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = $(selector) if (e) e.preventDefault() if (!$parent.length) { $parent = $this.hasClass('alert') ? $this : $this.parent() } $parent.trigger(e = $.Event('close.bs.alert')) if (e.isDefaultPrevented()) return $parent.removeClass('in') function removeElement() { $parent.trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? $parent .one($.support.transition.end, removeElement) .emulateTransitionEnd(150) : removeElement() } // ALERT PLUGIN DEFINITION // ======================= var old = $.fn.alert $.fn.alert = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert') if (!data) $this.data('bs.alert', (data = new Alert(this))) if (typeof option == 'string') data[option].call($this) }) } $.fn.alert.Constructor = Alert // ALERT NO CONFLICT // ================= $.fn.alert.noConflict = function () { $.fn.alert = old return this } // ALERT DATA-API // ============== $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) }(jQuery); /* ======================================================================== * Bootstrap: button.js v3.1.1 * http://getbootstrap.com/javascript/#buttons * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // BUTTON PUBLIC CLASS DEFINITION // ============================== var Button = function (element, options) { this.$element = $(element) this.options = $.extend({}, Button.DEFAULTS, options) this.isLoading = false } Button.DEFAULTS = { loadingText: 'loading...' } Button.prototype.setState = function (state) { var d = 'disabled' var $el = this.$element var val = $el.is('input') ? 'val' : 'html' var data = $el.data() state = state + 'Text' if (!data.resetText) $el.data('resetText', $el[val]()) $el[val](data[state] || this.options[state]) // push to event loop to allow forms to submit setTimeout($.proxy(function () { if (state == 'loadingText') { this.isLoading = true $el.addClass(d).attr(d, d) } else if (this.isLoading) { this.isLoading = false $el.removeClass(d).removeAttr(d) } }, this), 0) } Button.prototype.toggle = function () { var changed = true var $parent = this.$element.closest('[data-toggle="buttons"]') if ($parent.length) { var $input = this.$element.find('input') if ($input.prop('type') == 'radio') { if ($input.prop('checked') && this.$element.hasClass('active')) changed = false else $parent.find('.active').removeClass('active') } if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') } if (changed) this.$element.toggleClass('active') } // BUTTON PLUGIN DEFINITION // ======================== var old = $.fn.button $.fn.button = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') var options = typeof option == 'object' && option if (!data) $this.data('bs.button', (data = new Button(this, options))) if (option == 'toggle') data.toggle() else if (option) data.setState(option) }) } $.fn.button.Constructor = Button // BUTTON NO CONFLICT // ================== $.fn.button.noConflict = function () { $.fn.button = old return this } // BUTTON DATA-API // =============== $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { var $btn = $(e.target) if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') $btn.button('toggle') e.preventDefault() }) }(jQuery); /* ======================================================================== * Bootstrap: carousel.js v3.1.1 * http://getbootstrap.com/javascript/#carousel * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // CAROUSEL CLASS DEFINITION // ========================= var Carousel = function (element, options) { this.$element = $(element) this.$indicators = this.$element.find('.carousel-indicators') this.options = options this.paused = this.sliding = this.interval = this.$active = this.$items = null this.options.pause == 'hover' && this.$element .on('mouseenter', $.proxy(this.pause, this)) .on('mouseleave', $.proxy(this.cycle, this)) } Carousel.DEFAULTS = { interval: 5000, pause: 'hover', wrap: true } Carousel.prototype.cycle = function (e) { e || (this.paused = false) this.interval && clearInterval(this.interval) this.options.interval && !this.paused && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) return this } Carousel.prototype.getActiveIndex = function () { this.$active = this.$element.find('.item.active') this.$items = this.$active.parent().children() return this.$items.index(this.$active) } Carousel.prototype.to = function (pos) { var that = this var activeIndex = this.getActiveIndex() if (pos > (this.$items.length - 1) || pos < 0) return if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) if (activeIndex == pos) return this.pause().cycle() return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) } Carousel.prototype.pause = function (e) { e || (this.paused = true) if (this.$element.find('.next, .prev').length && $.support.transition) { this.$element.trigger($.support.transition.end) this.cycle(true) } this.interval = clearInterval(this.interval) return this } Carousel.prototype.next = function () { if (this.sliding) return return this.slide('next') } Carousel.prototype.prev = function () { if (this.sliding) return return this.slide('prev') } Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') var $next = next || $active[type]() var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' var fallback = type == 'next' ? 'first' : 'last' var that = this if (!$next.length) { if (!this.options.wrap) return $next = this.$element.find('.item')[fallback]() } if ($next.hasClass('active')) return this.sliding = false var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) this.$element.trigger(e) if (e.isDefaultPrevented()) return this.sliding = true isCycling && this.pause() if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') this.$element.one('slid.bs.carousel', function () { var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) $nextIndicator && $nextIndicator.addClass('active') }) } if ($.support.transition && this.$element.hasClass('slide')) { $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) $active .one($.support.transition.end, function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) }) .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) } else { $active.removeClass('active') $next.addClass('active') this.sliding = false this.$element.trigger('slid.bs.carousel') } isCycling && this.cycle() return this } // CAROUSEL PLUGIN DEFINITION // ========================== var old = $.fn.carousel $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) var action = typeof option == 'string' ? option : options.slide if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (action) data[action]() else if (options.interval) data.pause().cycle() }) } $.fn.carousel.Constructor = Carousel // CAROUSEL NO CONFLICT // ==================== $.fn.carousel.noConflict = function () { $.fn.carousel = old return this } // CAROUSEL DATA-API // ================= $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { var $this = $(this), href var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false $target.carousel(options) if (slideIndex = $this.attr('data-slide-to')) { $target.data('bs.carousel').to(slideIndex) } e.preventDefault() }) $(window).on('load', function () { $('[data-ride="carousel"]').each(function () { var $carousel = $(this) $carousel.carousel($carousel.data()) }) }) }(jQuery); /* ======================================================================== * Bootstrap: collapse.js v3.1.1 * http://getbootstrap.com/javascript/#collapse * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // COLLAPSE PUBLIC CLASS DEFINITION // ================================ var Collapse = function (element, options) { this.$element = $(element) this.options = $.extend({}, Collapse.DEFAULTS, options) this.transitioning = null if (this.options.parent) this.$parent = $(this.options.parent) if (this.options.toggle) this.toggle() } Collapse.DEFAULTS = { toggle: true } Collapse.prototype.dimension = function () { var hasWidth = this.$element.hasClass('width') return hasWidth ? 'width' : 'height' } Collapse.prototype.show = function () { if (this.transitioning || this.$element.hasClass('in')) return var startEvent = $.Event('show.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return var actives = this.$parent && this.$parent.find('> .panel > .in') if (actives && actives.length) { var hasData = actives.data('bs.collapse') if (hasData && hasData.transitioning) return actives.collapse('hide') hasData || actives.data('bs.collapse', null) } var dimension = this.dimension() this.$element .removeClass('collapse') .addClass('collapsing') [dimension](0) this.transitioning = 1 var complete = function () { this.$element .removeClass('collapsing') .addClass('collapse in') [dimension]('auto') this.transitioning = 0 this.$element.trigger('shown.bs.collapse') } if (!$.support.transition) return complete.call(this) var scrollSize = $.camelCase(['scroll', dimension].join('-')) this.$element .one($.support.transition.end, $.proxy(complete, this)) .emulateTransitionEnd(350) [dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { if (this.transitioning || !this.$element.hasClass('in')) return var startEvent = $.Event('hide.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return var dimension = this.dimension() this.$element [dimension](this.$element[dimension]()) [0].offsetHeight this.$element .addClass('collapsing') .removeClass('collapse') .removeClass('in') this.transitioning = 1 var complete = function () { this.transitioning = 0 this.$element .trigger('hidden.bs.collapse') .removeClass('collapsing') .addClass('collapse') } if (!$.support.transition) return complete.call(this) this.$element [dimension](0) .one($.support.transition.end, $.proxy(complete, this)) .emulateTransitionEnd(350) } Collapse.prototype.toggle = function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() } // COLLAPSE PLUGIN DEFINITION // ========================== var old = $.fn.collapse $.fn.collapse = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data && options.toggle && option == 'show') option = !option if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.collapse.Constructor = Collapse // COLLAPSE NO CONFLICT // ==================== $.fn.collapse.noConflict = function () { $.fn.collapse = old return this } // COLLAPSE DATA-API // ================= $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { var $this = $(this), href var target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 var $target = $(target) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() var parent = $this.attr('data-parent') var $parent = parent && $(parent) if (!data || !data.transitioning) { if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') } $target.collapse(option) }) }(jQuery); /* ======================================================================== * Bootstrap: dropdown.js v3.1.1 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // DROPDOWN CLASS DEFINITION // ========================= var backdrop = '.dropdown-backdrop' var toggle = '[data-toggle=dropdown]' var Dropdown = function (element) { $(element).on('click.bs.dropdown', this.toggle) } Dropdown.prototype.toggle = function (e) { var $this = $(this) if ($this.is('.disabled, :disabled')) return var $parent = getParent($this) var isActive = $parent.hasClass('open') clearMenus() if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we use a backdrop because click events don't delegate $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) } var relatedTarget = { relatedTarget: this } $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) if (e.isDefaultPrevented()) return $parent .toggleClass('open') .trigger('shown.bs.dropdown', relatedTarget) $this.focus() } return false } Dropdown.prototype.keydown = function (e) { if (!/(38|40|27)/.test(e.keyCode)) return var $this = $(this) e.preventDefault() e.stopPropagation() if ($this.is('.disabled, :disabled')) return var $parent = getParent($this) var isActive = $parent.hasClass('open') if (!isActive || (isActive && e.keyCode == 27)) { if (e.which == 27) $parent.find(toggle).focus() return $this.click() } var desc = ' li:not(.divider):visible a' var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc) if (!$items.length) return var index = $items.index($items.filter(':focus')) if (e.keyCode == 38 && index > 0) index-- // up if (e.keyCode == 40 && index < $items.length - 1) index++ // down if (!~index) index = 0 $items.eq(index).focus() } function clearMenus(e) { $(backdrop).remove() $(toggle).each(function () { var $parent = getParent($(this)) var relatedTarget = { relatedTarget: this } if (!$parent.hasClass('open')) return $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) if (e.isDefaultPrevented()) return $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) }) } function getParent($this) { var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } var $parent = selector && $(selector) return $parent && $parent.length ? $parent : $this.parent() } // DROPDOWN PLUGIN DEFINITION // ========================== var old = $.fn.dropdown $.fn.dropdown = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.dropdown') if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) if (typeof option == 'string') data[option].call($this) }) } $.fn.dropdown.Constructor = Dropdown // DROPDOWN NO CONFLICT // ==================== $.fn.dropdown.noConflict = function () { $.fn.dropdown = old return this } // APPLY TO STANDARD DROPDOWN ELEMENTS // =================================== $(document) .on('click.bs.dropdown.data-api', clearMenus) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown) }(jQuery); /* ======================================================================== * Bootstrap: modal.js v3.1.1 * http://getbootstrap.com/javascript/#modals * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // MODAL CLASS DEFINITION // ====================== var Modal = function (element, options) { this.options = options this.$element = $(element) this.$backdrop = this.isShown = null if (this.options.remote) { this.$element .find('.modal-content') .load(this.options.remote, $.proxy(function () { this.$element.trigger('loaded.bs.modal') }, this)) } } Modal.DEFAULTS = { backdrop: true, keyboard: true, show: true } Modal.prototype.toggle = function (_relatedTarget) { return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) } Modal.prototype.show = function (_relatedTarget) { var that = this var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) this.$element.trigger(e) if (this.isShown || e.isDefaultPrevented()) return this.isShown = true this.escape() this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) this.backdrop(function () { var transition = $.support.transition && that.$element.hasClass('fade') if (!that.$element.parent().length) { that.$element.appendTo(document.body) // don't move modals dom position } that.$element .show() .scrollTop(0) if (transition) { that.$element[0].offsetWidth // force reflow } that.$element .addClass('in') .attr('aria-hidden', false) that.enforceFocus() var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) transition ? that.$element.find('.modal-dialog') // wait for modal to slide in .one($.support.transition.end, function () { that.$element.focus().trigger(e) }) .emulateTransitionEnd(300) : that.$element.focus().trigger(e) }) } Modal.prototype.hide = function (e) { if (e) e.preventDefault() e = $.Event('hide.bs.modal') this.$element.trigger(e) if (!this.isShown || e.isDefaultPrevented()) return this.isShown = false this.escape() $(document).off('focusin.bs.modal') this.$element .removeClass('in') .attr('aria-hidden', true) .off('click.dismiss.bs.modal') $.support.transition && this.$element.hasClass('fade') ? this.$element .one($.support.transition.end, $.proxy(this.hideModal, this)) .emulateTransitionEnd(300) : this.hideModal() } Modal.prototype.enforceFocus = function () { $(document) .off('focusin.bs.modal') // guard against infinite focus loop .on('focusin.bs.modal', $.proxy(function (e) { if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { this.$element.focus() } }, this)) } Modal.prototype.escape = function () { if (this.isShown && this.options.keyboard) { this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { e.which == 27 && this.hide() }, this)) } else if (!this.isShown) { this.$element.off('keyup.dismiss.bs.modal') } } Modal.prototype.hideModal = function () { var that = this this.$element.hide() this.backdrop(function () { that.removeBackdrop() that.$element.trigger('hidden.bs.modal') }) } Modal.prototype.removeBackdrop = function () { this.$backdrop && this.$backdrop.remove() this.$backdrop = null } Modal.prototype.backdrop = function (callback) { var animate = this.$element.hasClass('fade') ? 'fade' : '' if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') .appendTo(document.body) this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { if (e.target !== e.currentTarget) return this.options.backdrop == 'static' ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this) }, this)) if (doAnimate) this.$backdrop[0].offsetWidth // force reflow this.$backdrop.addClass('in') if (!callback) return doAnimate ? this.$backdrop .one($.support.transition.end, callback) .emulateTransitionEnd(150) : callback() } else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass('in') $.support.transition && this.$element.hasClass('fade') ? this.$backdrop .one($.support.transition.end, callback) .emulateTransitionEnd(150) : callback() } else if (callback) { callback() } } // MODAL PLUGIN DEFINITION // ======================= var old = $.fn.modal $.fn.modal = function (option, _relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) $this.data('bs.modal', (data = new Modal(this, options))) if (typeof option == 'string') data[option](_relatedTarget) else if (options.show) data.show(_relatedTarget) }) } $.fn.modal.Constructor = Modal // MODAL NO CONFLICT // ================= $.fn.modal.noConflict = function () { $.fn.modal = old return this } // MODAL DATA-API // ============== $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { var $this = $(this) var href = $this.attr('href') var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) if ($this.is('a')) e.preventDefault() $target .modal(option, this) .one('hide', function () { $this.is(':visible') && $this.focus() }) }) $(document) .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }) }(jQuery); /* ======================================================================== * Bootstrap: tooltip.js v3.1.1 * http://getbootstrap.com/javascript/#tooltip * Inspired by the original jQuery.tipsy by Jason Frame * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // TOOLTIP PUBLIC CLASS DEFINITION // =============================== var Tooltip = function (element, options) { this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null this.init('tooltip', element, options) } Tooltip.DEFAULTS = { animation: true, placement: 'top', selector: false, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: 'hover focus', title: '', delay: 0, html: false, container: false } Tooltip.prototype.init = function (type, element, options) { this.enabled = true this.type = type this.$element = $(element) this.options = this.getOptions(options) var triggers = this.options.trigger.split(' ') for (var i = triggers.length; i--;) { var trigger = triggers[i] if (trigger == 'click') { this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) } else if (trigger != 'manual') { var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } } this.options.selector ? (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : this.fixTitle() } Tooltip.prototype.getDefaults = function () { return Tooltip.DEFAULTS } Tooltip.prototype.getOptions = function (options) { options = $.extend({}, this.getDefaults(), this.$element.data(), options) if (options.delay && typeof options.delay == 'number') { options.delay = { show: options.delay, hide: options.delay } } return options } Tooltip.prototype.getDelegateOptions = function () { var options = {} var defaults = this.getDefaults() this._options && $.each(this._options, function (key, value) { if (defaults[key] != value) options[key] = value }) return options } Tooltip.prototype.enter = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) clearTimeout(self.timeout) self.hoverState = 'in' if (!self.options.delay || !self.options.delay.show) return self.show() self.timeout = setTimeout(function () { if (self.hoverState == 'in') self.show() }, self.options.delay.show) } Tooltip.prototype.leave = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) clearTimeout(self.timeout) self.hoverState = 'out' if (!self.options.delay || !self.options.delay.hide) return self.hide() self.timeout = setTimeout(function () { if (self.hoverState == 'out') self.hide() }, self.options.delay.hide) } Tooltip.prototype.show = function () { var e = $.Event('show.bs.' + this.type) if (this.hasContent() && this.enabled) { this.$element.trigger(e) if (e.isDefaultPrevented()) return var that = this; var $tip = this.tip() this.setContent() if (this.options.animation) $tip.addClass('fade') var placement = typeof this.options.placement == 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement var autoToken = /\s?auto?\s?/i var autoPlace = autoToken.test(placement) if (autoPlace) placement = placement.replace(autoToken, '') || 'top' $tip .detach() .css({ top: 0, left: 0, display: 'block' }) .addClass(placement) this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) var pos = this.getPosition() var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight if (autoPlace) { var $parent = this.$element.parent() var orgPlacement = placement var docScroll = document.documentElement.scrollTop || document.body.scrollTop var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : placement $tip .removeClass(orgPlacement) .addClass(placement) } var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) this.applyPlacement(calculatedOffset, placement) this.hoverState = null var complete = function() { that.$element.trigger('shown.bs.' + that.type) } $.support.transition && this.$tip.hasClass('fade') ? $tip .one($.support.transition.end, complete) .emulateTransitionEnd(150) : complete() } } Tooltip.prototype.applyPlacement = function (offset, placement) { var replace var $tip = this.tip() var width = $tip[0].offsetWidth var height = $tip[0].offsetHeight // manually read margins because getBoundingClientRect includes difference var marginTop = parseInt($tip.css('margin-top'), 10) var marginLeft = parseInt($tip.css('margin-left'), 10) // we must check for NaN for ie 8/9 if (isNaN(marginTop)) marginTop = 0 if (isNaN(marginLeft)) marginLeft = 0 offset.top = offset.top + marginTop offset.left = offset.left + marginLeft // $.fn.offset doesn't round pixel values // so we use setOffset directly with our own function B-0 $.offset.setOffset($tip[0], $.extend({ using: function (props) { $tip.css({ top: Math.round(props.top), left: Math.round(props.left) }) } }, offset), 0) $tip.addClass('in') // check to see if placing tip in new offset caused the tip to resize itself var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight if (placement == 'top' && actualHeight != height) { replace = true offset.top = offset.top + height - actualHeight } if (/bottom|top/.test(placement)) { var delta = 0 if (offset.left < 0) { delta = offset.left * -2 offset.left = 0 $tip.offset(offset) actualWidth = $tip[0].offsetWidth actualHeight = $tip[0].offsetHeight } this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') } else { this.replaceArrow(actualHeight - height, actualHeight, 'top') } if (replace) $tip.offset(offset) } Tooltip.prototype.replaceArrow = function (delta, dimension, position) { this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '') } Tooltip.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle() $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) $tip.removeClass('fade in top bottom left right') } Tooltip.prototype.hide = function () { var that = this var $tip = this.tip() var e = $.Event('hide.bs.' + this.type) function complete() { if (that.hoverState != 'in') $tip.detach() that.$element.trigger('hidden.bs.' + that.type) } this.$element.trigger(e) if (e.isDefaultPrevented()) return $tip.removeClass('in') $.support.transition && this.$tip.hasClass('fade') ? $tip .one($.support.transition.end, complete) .emulateTransitionEnd(150) : complete() this.hoverState = null return this } Tooltip.prototype.fixTitle = function () { var $e = this.$element if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') } } Tooltip.prototype.hasContent = function () { return this.getTitle() } Tooltip.prototype.getPosition = function () { var el = this.$element[0] return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { width: el.offsetWidth, height: el.offsetHeight }, this.$element.offset()) } Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } } Tooltip.prototype.getTitle = function () { var title var $e = this.$element var o = this.options title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) return title } Tooltip.prototype.tip = function () { return this.$tip = this.$tip || $(this.options.template) } Tooltip.prototype.arrow = function () { return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') } Tooltip.prototype.validate = function () { if (!this.$element[0].parentNode) { this.hide() this.$element = null this.options = null } } Tooltip.prototype.enable = function () { this.enabled = true } Tooltip.prototype.disable = function () { this.enabled = false } Tooltip.prototype.toggleEnabled = function () { this.enabled = !this.enabled } Tooltip.prototype.toggle = function (e) { var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this self.tip().hasClass('in') ? self.leave(self) : self.enter(self) } Tooltip.prototype.destroy = function () { clearTimeout(this.timeout) this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) } // TOOLTIP PLUGIN DEFINITION // ========================= var old = $.fn.tooltip $.fn.tooltip = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') var options = typeof option == 'object' && option if (!data && option == 'destroy') return if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.tooltip.Constructor = Tooltip // TOOLTIP NO CONFLICT // =================== $.fn.tooltip.noConflict = function () { $.fn.tooltip = old return this } }(jQuery); /* ======================================================================== * Bootstrap: popover.js v3.1.1 * http://getbootstrap.com/javascript/#popovers * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // POPOVER PUBLIC CLASS DEFINITION // =============================== var Popover = function (element, options) { this.init('popover', element, options) } if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { placement: 'right', trigger: 'click', content: '', template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }) // NOTE: POPOVER EXTENDS tooltip.js // ================================ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) Popover.prototype.constructor = Popover Popover.prototype.getDefaults = function () { return Popover.DEFAULTS } Popover.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle() var content = this.getContent() $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) $tip.find('.popover-content')[ // we use append for html objects to maintain js events this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' ](content) $tip.removeClass('fade top bottom left right in') // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do // this manually by checking the contents. if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() } Popover.prototype.hasContent = function () { return this.getTitle() || this.getContent() } Popover.prototype.getContent = function () { var $e = this.$element var o = this.options return $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) } Popover.prototype.arrow = function () { return this.$arrow = this.$arrow || this.tip().find('.arrow') } Popover.prototype.tip = function () { if (!this.$tip) this.$tip = $(this.options.template) return this.$tip } // POPOVER PLUGIN DEFINITION // ========================= var old = $.fn.popover $.fn.popover = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') var options = typeof option == 'object' && option if (!data && option == 'destroy') return if (!data) $this.data('bs.popover', (data = new Popover(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.popover.Constructor = Popover // POPOVER NO CONFLICT // =================== $.fn.popover.noConflict = function () { $.fn.popover = old return this } }(jQuery); /* ======================================================================== * Bootstrap: scrollspy.js v3.1.1 * http://getbootstrap.com/javascript/#scrollspy * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // SCROLLSPY CLASS DEFINITION // ========================== function ScrollSpy(element, options) { var href var process = $.proxy(this.process, this) this.$element = $(element).is('body') ? $(window) : $(element) this.$body = $('body') this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 || '') + ' .nav li > a' this.offsets = $([]) this.targets = $([]) this.activeTarget = null this.refresh() this.process() } ScrollSpy.DEFAULTS = { offset: 10 } ScrollSpy.prototype.refresh = function () { var offsetMethod = this.$element[0] == window ? 'offset' : 'position' this.offsets = $([]) this.targets = $([]) var self = this var $targets = this.$body .find(this.selector) .map(function () { var $el = $(this) var href = $el.data('target') || $el.attr('href') var $href = /^#./.test(href) && $(href) return ($href && $href.length && $href.is(':visible') && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null }) .sort(function (a, b) { return a[0] - b[0] }) .each(function () { self.offsets.push(this[0]) self.targets.push(this[1]) }) } ScrollSpy.prototype.process = function () { var scrollTop = this.$scrollElement.scrollTop() + this.options.offset var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight var maxScroll = scrollHeight - this.$scrollElement.height() var offsets = this.offsets var targets = this.targets var activeTarget = this.activeTarget var i if (scrollTop >= maxScroll) { return activeTarget != (i = targets.last()[0]) && this.activate(i) } if (activeTarget && scrollTop <= offsets[0]) { return activeTarget != (i = targets[0]) && this.activate(i) } for (i = offsets.length; i--;) { activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) && this.activate( targets[i] ) } } ScrollSpy.prototype.activate = function (target) { this.activeTarget = target $(this.selector) .parentsUntil(this.options.target, '.active') .removeClass('active') var selector = this.selector + '[data-target="' + target + '"],' + this.selector + '[href="' + target + '"]' var active = $(selector) .parents('li') .addClass('active') if (active.parent('.dropdown-menu').length) { active = active .closest('li.dropdown') .addClass('active') } active.trigger('activate.bs.scrollspy') } // SCROLLSPY PLUGIN DEFINITION // =========================== var old = $.fn.scrollspy $.fn.scrollspy = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.scrollspy') var options = typeof option == 'object' && option if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.scrollspy.Constructor = ScrollSpy // SCROLLSPY NO CONFLICT // ===================== $.fn.scrollspy.noConflict = function () { $.fn.scrollspy = old return this } // SCROLLSPY DATA-API // ================== $(window).on('load', function () { $('[data-spy="scroll"]').each(function () { var $spy = $(this) $spy.scrollspy($spy.data()) }) }) }(jQuery); /* ======================================================================== * Bootstrap: tab.js v3.1.1 * http://getbootstrap.com/javascript/#tabs * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // TAB CLASS DEFINITION // ==================== var Tab = function (element) { this.element = $(element) } Tab.prototype.show = function () { var $this = this.element var $ul = $this.closest('ul:not(.dropdown-menu)') var selector = $this.data('target') if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } if ($this.parent('li').hasClass('active')) return var previous = $ul.find('.active:last a')[0] var e = $.Event('show.bs.tab', { relatedTarget: previous }) $this.trigger(e) if (e.isDefaultPrevented()) return var $target = $(selector) this.activate($this.parent('li'), $ul) this.activate($target, $target.parent(), function () { $this.trigger({ type: 'shown.bs.tab', relatedTarget: previous }) }) } Tab.prototype.activate = function (element, container, callback) { var $active = container.find('> .active') var transition = callback && $.support.transition && $active.hasClass('fade') function next() { $active .removeClass('active') .find('> .dropdown-menu > .active') .removeClass('active') element.addClass('active') if (transition) { element[0].offsetWidth // reflow for transition element.addClass('in') } else { element.removeClass('fade') } if (element.parent('.dropdown-menu')) { element.closest('li.dropdown').addClass('active') } callback && callback() } transition ? $active .one($.support.transition.end, next) .emulateTransitionEnd(150) : next() $active.removeClass('in') } // TAB PLUGIN DEFINITION // ===================== var old = $.fn.tab $.fn.tab = function ( option ) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tab') if (!data) $this.data('bs.tab', (data = new Tab(this))) if (typeof option == 'string') data[option]() }) } $.fn.tab.Constructor = Tab // TAB NO CONFLICT // =============== $.fn.tab.noConflict = function () { $.fn.tab = old return this } // TAB DATA-API // ============ $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { e.preventDefault() $(this).tab('show') }) }(jQuery); /* ======================================================================== * Bootstrap: affix.js v3.1.1 * http://getbootstrap.com/javascript/#affix * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // AFFIX CLASS DEFINITION // ====================== var Affix = function (element, options) { this.options = $.extend({}, Affix.DEFAULTS, options) this.$window = $(window) .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) this.$element = $(element) this.affixed = this.unpin = this.pinnedOffset = null this.checkPosition() } Affix.RESET = 'affix affix-top affix-bottom' Affix.DEFAULTS = { offset: 0 } Affix.prototype.getPinnedOffset = function () { if (this.pinnedOffset) return this.pinnedOffset this.$element.removeClass(Affix.RESET).addClass('affix') var scrollTop = this.$window.scrollTop() var position = this.$element.offset() return (this.pinnedOffset = position.top - scrollTop) } Affix.prototype.checkPositionWithEventLoop = function () { setTimeout($.proxy(this.checkPosition, this), 1) } Affix.prototype.checkPosition = function () { if (!this.$element.is(':visible')) return var scrollHeight = $(document).height() var scrollTop = this.$window.scrollTop() var position = this.$element.offset() var offset = this.options.offset var offsetTop = offset.top var offsetBottom = offset.bottom if (this.affixed == 'top') position.top += scrollTop if (typeof offset != 'object') offsetBottom = offsetTop = offset if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false if (this.affixed === affix) return if (this.unpin) this.$element.css('top', '') var affixType = 'affix' + (affix ? '-' + affix : '') var e = $.Event(affixType + '.bs.affix') this.$element.trigger(e) if (e.isDefaultPrevented()) return this.affixed = affix this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null this.$element .removeClass(Affix.RESET) .addClass(affixType) .trigger($.Event(affixType.replace('affix', 'affixed'))) if (affix == 'bottom') { this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) } } // AFFIX PLUGIN DEFINITION // ======================= var old = $.fn.affix $.fn.affix = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.affix') var options = typeof option == 'object' && option if (!data) $this.data('bs.affix', (data = new Affix(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.affix.Constructor = Affix // AFFIX NO CONFLICT // ================= $.fn.affix.noConflict = function () { $.fn.affix = old return this } // AFFIX DATA-API // ============== $(window).on('load', function () { $('[data-spy="affix"]').each(function () { var $spy = $(this) var data = $spy.data() data.offset = data.offset || {} if (data.offsetBottom) data.offset.bottom = data.offsetBottom if (data.offsetTop) data.offset.top = data.offsetTop $spy.affix(data) }) }) }(jQuery);
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2014 IBM Corp. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v1.0 which accompany this distribution. * * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Ian Craggs - initial API and implementation and/or initial documentation *******************************************************************************/ #include "MQTTPacket.h" #include "StackTrace.h" #include <string.h> /** * Deserializes the supplied (wire) buffer into unsubscribe data * @param dup integer returned - the MQTT dup flag * @param packetid integer returned - the MQTT packet identifier * @param maxcount - the maximum number of members allowed in the topicFilters and requestedQoSs arrays * @param count - number of members in the topicFilters and requestedQoSs arrays * @param topicFilters - array of topic filter names * @param buf the raw buffer data, of the correct length determined by the remaining length field * @param buflen the length in bytes of the data in the supplied buffer * @return the length of the serialized data. <= 0 indicates error */ int MQTTDeserialize_unsubscribe(unsigned char* dup, unsigned short* packetid, int maxcount, int* count, MQTTString topicFilters[], unsigned char* buf, int len) { MQTTHeader header = {0}; unsigned char* curdata = buf; unsigned char* enddata = NULL; int rc = 0; int mylen = 0; FUNC_ENTRY; header.byte = readChar(&curdata); if (header.bits.type != UNSUBSCRIBE) goto exit; *dup = header.bits.dup; curdata += (rc = MQTTPacket_decodeBuf(curdata, &mylen)); /* read remaining length */ enddata = curdata + mylen; *packetid = readInt(&curdata); *count = 0; while (curdata < enddata) { if (!readMQTTLenString(&topicFilters[*count], &curdata, enddata)) goto exit; (*count)++; } rc = 1; exit: FUNC_EXIT_RC(rc); return rc; } /** * Serializes the supplied unsuback data into the supplied buffer, ready for sending * @param buf the buffer into which the packet will be serialized * @param buflen the length in bytes of the supplied buffer * @param packetid integer - the MQTT packet identifier * @return the length of the serialized data. <= 0 indicates error */ int MQTTSerialize_unsuback(unsigned char* buf, int buflen, unsigned short packetid) { MQTTHeader header = {0}; int rc = 0; unsigned char *ptr = buf; FUNC_ENTRY; if (buflen < 2) { rc = MQTTPACKET_BUFFER_TOO_SHORT; goto exit; } header.byte = 0; header.bits.type = UNSUBACK; writeChar(&ptr, header.byte); /* write header */ ptr += MQTTPacket_encode(ptr, 2); /* write remaining length */ writeInt(&ptr, packetid); rc = ptr - buf; exit: FUNC_EXIT_RC(rc); return rc; }
{ "pile_set_name": "Github" }
# Configuration Linaria can be customized using a JavaScript, JSON or YAML file. This can be in form of: - `linaria.config.js` JS file exporting the object (recommended). - `linaria` property in a `package.json` file. - `.linariarc` file with JSON or YAML syntax. - `.linariarc.json`, `.linariarc.yaml`, `.linariarc.yml`, or `.linariarc.js` file. Example `linaria.config.js`: ```js module.exports = { evaluate: true, displayName: false, }; ``` ## Options - `evaluate: boolean` (default: `true`): Enabling this will evaluate dynamic expressions in the CSS. You need to enable this if you want to use imported variables in the CSS or interpolate other components. Enabling this also ensures that your styled components wrapping other styled components will have the correct specificity and override styles properly. - `displayName: boolean` (default: `false`): Enabling this will add a display name to generated class names, e.g. `.Title_abcdef` instead of `.abcdef'. It is disabled by default to generate smaller CSS files. - `classNameSlug: string | (hash: string, title: string) => string` (default: `default`): Using this will provide an interface to customize the output of the CSS class name. Example: classNameSlug: '[title]', Would generate a class name such as `.header` instead of the default `.header_absdjfsdf` which includes a hash. You may also use a function to define the slug. The function will be evaluated at build time and must return a string: classNameSlug: (hash, title) => `${hash}__${7 * 6}__${title}`, Would generate the class name `.absdjfsdf__42__header`. **note** invalid characters will be replaced with an underscore (`_`). ### Variables - `hash`: The hash of the content. - `title`: The name of the class. - `rules: EvalRule[]` The set of rules that defines how the matched files will be transformed during the evaluation. `EvalRule` is an object with two fields: - `test` is a regular expression or a function `(path: string) => boolean`; - `action` is an `Evaluator` function, `"ignore"` or a name of the module that exports `Evaluator` function as a default export. If `test` is omitted, the rule is applicable for all the files. The last matched rule is used for transformation. If the last matched action for a file is `"ignore"` the file will be evaluated as is, so that file must not contain any js code that cannot be executed in nodejs environment (it's usually true for any lib in `node_modules`). If you need to compile certain modules under `/node_modules/` (which can be the case in monorepo projects), it's recommended to do it on a module by module basis for faster transforms, e.g. `ignore: /node_modules[\/\\](?!some-module|other-module)/`. Example is using Regular Expressions negative lookahead. The Information about `Evaluator`, its default setting and custom implementations can be founded it [evaluators section of How it works docs](./HOW_IT_WORKS.md#evaluators) The default setup is: ```js [ { action: require('linaria/evaluators').shaker, }, { test: /\/node_modules\//, action: 'ignore', }, ]; ``` - `babelOptions: Object` If you need to specify custom babel configuration, you can pass them here. These babel options will be used by Linaria when parsing and evaluating modules. ## `linaria/babel` preset The preset pre-processes and evaluates the CSS. The bundler plugins use this preset under the hood. You also might want to use this preset if you import the components outside of the files handled by your bundler, such as on your server or in unit tests. To use this preset, add `linaria/babel` to your Babel configuration at the end of the presets list: `.babelrc`: ```diff { "presets": [ "@babel/preset-env", "@babel/preset-react", + "linaria/babel" ] } ``` The babel preset can accept the same options supported by the configuration file, however it's recommended to use the configuration file directly. ## Preact If you wish you use Preact, we recommend you to use the `preact-cli` and start from there. The following configuration assumes you are using the default template provided by preact-cli. Start by creating your project using; ``` npx preact-cli create default my-project ``` On top of the default template, you will need to install `@babel/preset-react`. This is because Linaria works with JSX syntax. Otherwise, preact will throw an error saying that `linaria/loader` can't parse JSX. Don't forget to install `linaria`!. After that, your `package.json` should look like the following: ```diff "devDependencies": { + "@babel/preset-react": "^7.8.3", "enzyme": "^3.10.0", "enzyme-adapter-preact-pure": "^2.0.0", "eslint": "^6.0.1", "eslint-config-preact": "^1.1.0", "identity-obj-proxy": "^3.0.0", "jest": "^24.9.0", "jest-preset-preact": "^1.0.0", "per-env": "^1.0.2", "preact-cli": "^3.0.0-rc.6", "preact-render-spy": "^1.2.1", "sirv-cli": "^0.4.5" }, "dependencies": { + "linaria": "^1.3.3", "preact": "^10.3.2", "preact-render-to-string": "^5.1.4", "preact-router": "^3.2.1" }, ``` > If you wish to work with TypeScript, you will also need to install `@babel/preset-typescript` Now in your `preact.config.js`, we will modify the babel rule to use the necessary loaders and presets. Add the following: ```js export default config => { const { options, ...babelLoaderRule } = config.module.rules[0]; // Get the babel rule and options options.presets.push('@babel/preset-react', 'linaria/babel'); // Push the necessary presets config.module.rules[0] = { ...babelLoaderRule, loader: undefined, // Disable the predefined babel-loader on the rule use: [ { loader: 'babel-loader', options }, { loader: 'linaria/loader', options: { babelOptions: options // Pass the current babel options to linaria's babel instance } } ] }; }; ``` > If you wish to work with TypeScript, add the `@babel/preset-typescript` preset before `@babel/preset-react`. After all of that, you should be able to run `npm build`, and it should have no errors. To test that everthing is working, go to a file, for example `components/Header/index.js`, and create a class name. ```js import { h } from 'preact'; import { Link } from 'preact-router/match'; import style from './style.css'; import { css } from 'linaria'; const className = css` color: red; font-weight: 800; `; const Header = () => ( <header class={style.header}> <h1>Preact App</h1> <nav> <Link activeClassName={style.active} href="/"> Home </Link> <Link activeClassName={style.active} href="/profile"> Me </Link> <Link activeClassName={style.active} href="/profile/john"> John </Link> </nav> <button class={className}>Hello</button> //here I use it </header> ); export default Header; ``` > You can also use the `styled` variant, importing from `linaria/react`. If you run `npm run dev`, you should be able to see a button next to the nav title, with red bold text. You can take a look at this example [here](../examples/Preact) ## Gatsby If you wish you use Gatsby, we recommend you to use the `gatsby-cli` and start from there. The following configuration assumes you are using the default template provided by gatsby-cli. Start by creating your project using: ``` npx gatsby new my-project ``` Now, you have two options. You can use `gatsby-plugin-linaria` or create a custom config. ### gatsby-plugin-linaria This is an easier and more straightforward way of integrating Linaria with Gatsby. Check [plugin docs](https://github.com/silvenon/gatsby-plugin-linaria) for instructions. You can also take a look at the example [here](../examples/gatsby/plugin) ### Custom config This is a bit more advanced way of integrating Linaria into your Gatsby project. First, you will need to install `linaria` and `babel-preset-gatsby`. Then, create `babel.config.js` in the root of your project with the following contents: ```js module.exports = { presets: [ 'babel-preset-gatsby', [ 'linaria/babel', { evaluate: true, displayName: process.env.NODE_ENV !== 'production', }, ], ], }; ``` You can read more about configuring Babel in Gatsby projects in [their docs](https://www.gatsbyjs.org/docs/babel/). Besides that, you will need to alter Gatsby's Webpack config to modify the Babel loader. This can be done in `gatsby-node.js` file. Consider the following snippet: ```js exports.onCreateWebpackConfig = ({ actions, loaders, getConfig, stage }) => { const config = getConfig(); config.module.rules = [ ...config.module.rules.filter( rule => String(rule.test) !== String(/\.js?$/) ), { ...loaders.js(), test: /\.js?$/, loader: 'linaria/loader', options: { sourceMap: stage.includes('develop'), displayName: stage.includes('develop'), babelOptions: { presets: ['babel-preset-gatsby'], }, }, exclude: /node_modules/, }, ]; actions.replaceWebpackConfig(config); }; ``` If you want to know more about extending Webpack config in Gatsby projects, check out [relevant Gatsby docs](https://www.gatsbyjs.org/docs/add-custom-webpack-config/). With that done, you should be all set! You can take a look at the minimal example using the above configuration [here](../examples/gatsby/custom-config).
{ "pile_set_name": "Github" }
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: name: Brot and Games url: https://brotandgames.com cron: "* * * * *" two: name: kubernete.sh url: https://kubernete.ch cron: "*/15 * * * *"
{ "pile_set_name": "Github" }
/**************************************************************************//** * * * *****************************************************************************/ #include <x86_64_delta_agc7646v1/x86_64_delta_agc7646v1_config.h> #include "x86_64_delta_agc7646v1_log.h" static int datatypes_init__(void) { #define x86_64_delta_agc7646v1_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL); #include <x86_64_delta_agc7646v1/x86_64_delta_agc7646v1.x> return 0; } void __x86_64_delta_agc7646v1_module_init__(void) { AIM_LOG_STRUCT_REGISTER(); datatypes_init__(); } int __onlp_platform_version__ = 1;
{ "pile_set_name": "Github" }
#begin document (nw/wsj/06/wsj_0677); part 000 nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP(NP* - - - - (ORG* (ARG0* (ARG0* * * - nw/wsj/06/wsj_0677 0 1 [WORD] NNP * - - - - * * * * * - nw/wsj/06/wsj_0677 0 2 [WORD] NNP *) - - - - *) *) * * * - nw/wsj/06/wsj_0677 0 3 [WORD] , * - - - - * * * * * - nw/wsj/06/wsj_0677 0 4 [WORD] WDT (SBAR(WHNP*) - - - - * (R-ARG0*) * * * - nw/wsj/06/wsj_0677 0 5 [WORD] IN (S(PP* - - - - * (ARGM-TMP* * * * - nw/wsj/06/wsj_0677 0 6 [WORD] NNS (NP*)) - - - - (DATE) *) * * * - nw/wsj/06/wsj_0677 0 7 [WORD] VBZ (VP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 8 [WORD] VBN (VP* fight 01 - - * (V*) * * * - nw/wsj/06/wsj_0677 0 9 [WORD] DT (NP(NP* - - - - * (ARG1* * * * - nw/wsj/06/wsj_0677 0 10 [WORD] JJ (NML* - - - - * * * * * - nw/wsj/06/wsj_0677 0 11 [WORD] NNS *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 12 [WORD] NN *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] IN (PP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] NN (NP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 15 [WORD] NNS *))))))) - - - - * *) * * * - nw/wsj/06/wsj_0677 0 16 [WORD] , *) - - - - * * *) * * - nw/wsj/06/wsj_0677 0 17 [WORD] VBD (VP* say 01 - - * * (V*) * * - nw/wsj/06/wsj_0677 0 18 [WORD] PRP (SBAR(S(NP*) - - - - * * (ARG1* (ARG0*) * - nw/wsj/06/wsj_0677 0 19 [WORD] VBZ (VP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 20 [WORD] VBN (VP* sign 03 - - * * * (V*) * - nw/wsj/06/wsj_0677 0 21 [WORD] CD (S(NP(NP* - - - - (CARDINAL) * * (ARG1* (ARG0* - nw/wsj/06/wsj_0677 0 22 [WORD] NNS *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 23 [WORD] IN (PP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 24 [WORD] CD (NP* - - - - (CARDINAL) * * * * - nw/wsj/06/wsj_0677 0 25 [WORD] NNS *))) - - - - * * * * *) - nw/wsj/06/wsj_0677 0 26 [WORD] TO (VP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 27 [WORD] VB (VP* subscribe 02 1 - * * * * (V*) - nw/wsj/06/wsj_0677 0 28 [WORD] IN (PP* - - - - * * * * (ARG1* - nw/wsj/06/wsj_0677 0 29 [WORD] DT (NP(NP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 30 [WORD] JJ * - - - - * * * * * - nw/wsj/06/wsj_0677 0 31 [WORD] NNP (NML* - - - - (ORG* * * * * - nw/wsj/06/wsj_0677 0 32 [WORD] CD *) - - - - *) * * * * - nw/wsj/06/wsj_0677 0 33 [WORD] NN * - - - - * * * * * - nw/wsj/06/wsj_0677 0 34 [WORD] NN *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 35 [WORD] CC * - - - - * * * * * - nw/wsj/06/wsj_0677 0 36 [WORD] PRP$ (NP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 37 [WORD] JJ * - - - - * * * * * - nw/wsj/06/wsj_0677 0 38 [WORD] NNS *))))))))))) - - - - * * *) *) *) - nw/wsj/06/wsj_0677 0 39 [WORD] . *)) - - - - * * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP(NP* - - - - (ORG* * (ARG1* (ARG1* - nw/wsj/06/wsj_0677 0 1 [WORD] CD *) - - - - *) * * * - nw/wsj/06/wsj_0677 0 2 [WORD] , * - - - - * * * * - nw/wsj/06/wsj_0677 0 3 [WORD] DT (NP(NP* - - - - * (ARG1* * * - nw/wsj/06/wsj_0677 0 4 [WORD] NN (ADJP* - - - - * * * * - nw/wsj/06/wsj_0677 0 5 [WORD] HYPH * - - - - * * * * - nw/wsj/06/wsj_0677 0 6 [WORD] VBN *) - - - - * * * * - nw/wsj/06/wsj_0677 0 7 [WORD] JJ * - - - - (DATE) * * * - nw/wsj/06/wsj_0677 0 8 [WORD] NN *) - - - - * *) * * - nw/wsj/06/wsj_0677 0 9 [WORD] VBN (VP* support 01 - - * (V*) * * - nw/wsj/06/wsj_0677 0 10 [WORD] IN (PP* - - - - * (ARG0* * * - nw/wsj/06/wsj_0677 0 11 [WORD] NN (NP*)))) - - - - * *) * * - nw/wsj/06/wsj_0677 0 12 [WORD] , *) - - - - * * *) *) - nw/wsj/06/wsj_0677 0 13 [WORD] VBZ (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] VBN (VP* schedule 01 - - * * (V*) * - nw/wsj/06/wsj_0677 0 15 [WORD] TO (S(VP* - - - - * * (ARG2* * - nw/wsj/06/wsj_0677 0 16 [WORD] VB (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 17 [WORD] VBN (VP* launch 01 - - * * * (V*) - nw/wsj/06/wsj_0677 0 18 [WORD] IN (NP* - - - - (DATE* * * (ARGM-TMP* - nw/wsj/06/wsj_0677 0 19 [WORD] NNP *))))))) - - - - *) * *) *) - nw/wsj/06/wsj_0677 0 20 [WORD] . *)) - - - - * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NN (TOP(S(S(NP*) - - - - (ORG) (ARG0*) * * * - nw/wsj/06/wsj_0677 0 1 [WORD] VBD (VP* say 01 - - * (V*) * * * - nw/wsj/06/wsj_0677 0 2 [WORD] PRP$ (SBAR(S(NP* - - - - * (ARG1* (ARG0* * * - nw/wsj/06/wsj_0677 0 3 [WORD] NN * - - - - * * * * * - nw/wsj/06/wsj_0677 0 4 [WORD] NN *) - - - - * * *) * * - nw/wsj/06/wsj_0677 0 5 [WORD] VBD (VP* sign 03 - - * * (V*) * * - nw/wsj/06/wsj_0677 0 6 [WORD] RP (PRT*) - - - - * * * * * - nw/wsj/06/wsj_0677 0 7 [WORD] DT (NP(NP* - - - - * * (ARG1* * * - nw/wsj/06/wsj_0677 0 8 [WORD] CD * - - - - (CARDINAL) * * * * - nw/wsj/06/wsj_0677 0 9 [WORD] NNS *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 10 [WORD] IN (PP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 11 [WORD] CD (NP* - - - - (CARDINAL) * * * * - nw/wsj/06/wsj_0677 0 12 [WORD] NN * - - - - * * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] NNS *))) - - - - * * *) * * - nw/wsj/06/wsj_0677 0 14 [WORD] IN (PP* - - - - * * (ARGM-TMP* * * - nw/wsj/06/wsj_0677 0 15 [WORD] RB (NP(QP* - - - - (DATE* * * * * - nw/wsj/06/wsj_0677 0 16 [WORD] CD *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 17 [WORD] NNS *))))))) - - - - *) *) *) * * - nw/wsj/06/wsj_0677 0 18 [WORD] CC * - - - - * * * * * - nw/wsj/06/wsj_0677 0 19 [WORD] NN (S(NP* - - - - * * * (ARG0* (ARG0* - nw/wsj/06/wsj_0677 0 20 [WORD] NNS *) - - - - * * * *) *) - nw/wsj/06/wsj_0677 0 21 [WORD] RB (ADVP*) - - - - * * * (ARGM-TMP*) * - nw/wsj/06/wsj_0677 0 22 [WORD] VBP (VP* expect 01 - - * * * (V*) * - nw/wsj/06/wsj_0677 0 23 [WORD] TO (S(VP* - - - - * * * (ARG1* * - nw/wsj/06/wsj_0677 0 24 [WORD] VB (VP* reach 01 - - * * * * (V*) - nw/wsj/06/wsj_0677 0 25 [WORD] PRP$ (NP(NP* - - - - * * * * (ARG1* - nw/wsj/06/wsj_0677 0 26 [WORD] VB (ADJP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 27 [WORD] HYPH * - - - - * * * * * - nw/wsj/06/wsj_0677 0 28 [WORD] RP *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 29 [WORD] NN *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 30 [WORD] IN (PP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 31 [WORD] CD (NP* - - - - (CARDINAL) * * * * - nw/wsj/06/wsj_0677 0 32 [WORD] NNS *))) - - - - * * * * *) - nw/wsj/06/wsj_0677 0 33 [WORD] IN (PP* - - - - * * * * (ARGM-TMP* - nw/wsj/06/wsj_0677 0 34 [WORD] DT (NP(NP* - - - - (DATE* * * * * - nw/wsj/06/wsj_0677 0 35 [WORD] NN *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 36 [WORD] IN (PP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 37 [WORD] DT (NP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 38 [WORD] NN *))))))))) - - - - *) * * *) *) - nw/wsj/06/wsj_0677 0 39 [WORD] . *)) - - - - * * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP(NP* - - - - (PERSON* * (ARG0* * * * - nw/wsj/06/wsj_0677 0 1 [WORD] NNP *) - - - - *) * * * * * - nw/wsj/06/wsj_0677 0 2 [WORD] , * - - - - * * * * * * - nw/wsj/06/wsj_0677 0 3 [WORD] NN (NP(NP*) - - - - * * * * * * - nw/wsj/06/wsj_0677 0 4 [WORD] IN (PP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 5 [WORD] DT (NP(NP* - - - - * (ARG1* * * * * - nw/wsj/06/wsj_0677 0 6 [WORD] NNP (NML* - - - - (GPE) * * * * * - nw/wsj/06/wsj_0677 0 7 [WORD] , * - - - - * * * * * * - nw/wsj/06/wsj_0677 0 8 [WORD] NNP * - - - - (GPE) * * * * * - nw/wsj/06/wsj_0677 0 9 [WORD] , *) - - - - * * * * * * - nw/wsj/06/wsj_0677 0 10 [WORD] NNS * - - - - * * * * * * - nw/wsj/06/wsj_0677 0 11 [WORD] NN *) - - - - * *) * * * * - nw/wsj/06/wsj_0677 0 12 [WORD] WDT (SBAR(WHNP*) - - - - * (R-ARG1*) * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] VBZ (S(VP* be 01 - - * (V*) * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] CD (ADJP(NP* - - - - (PERCENT* (ARG2* * * * * - nw/wsj/06/wsj_0677 0 15 [WORD] NN *) - - - - *) * * * * * - nw/wsj/06/wsj_0677 0 16 [WORD] VBN * - - - - * * * * * * - nw/wsj/06/wsj_0677 0 17 [WORD] IN (PP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 18 [WORD] NN (NP* - - - - (ORG* * * * * * - nw/wsj/06/wsj_0677 0 19 [WORD] NNP * - - - - * * * * * * - nw/wsj/06/wsj_0677 0 20 [WORD] NNP *))))))))) - - - - *) *) * * * * - nw/wsj/06/wsj_0677 0 21 [WORD] , *) - - - - * * *) * * * - nw/wsj/06/wsj_0677 0 22 [WORD] VBD (VP* say 01 - - * * (V*) * * * - nw/wsj/06/wsj_0677 0 23 [WORD] IN (SBAR* - - - - * * (ARG1* * * * - nw/wsj/06/wsj_0677 0 24 [WORD] IN (S(PP* - - - - * * * (ARGM-TMP* * * - nw/wsj/06/wsj_0677 0 25 [WORD] NNP (NP* - - - - (DATE* * * * * * - nw/wsj/06/wsj_0677 0 26 [WORD] CD *)) - - - - *) * * *) * * - nw/wsj/06/wsj_0677 0 27 [WORD] PRP (NP*) - - - - * * * (ARG0*) (ARG0*) * - nw/wsj/06/wsj_0677 0 28 [WORD] VBZ (VP* expect 01 - - * * * (V*) * * - nw/wsj/06/wsj_0677 0 29 [WORD] TO (S(VP* - - - - * * * (ARG1* * * - nw/wsj/06/wsj_0677 0 30 [WORD] VB (VP* have 04 - - * * * * (V*) * - nw/wsj/06/wsj_0677 0 31 [WORD] NNP (S(NP* - - - - (ORG* * * * (ARG1* (ARG1* - nw/wsj/06/wsj_0677 0 32 [WORD] CD *) - - - - *) * * * * *) - nw/wsj/06/wsj_0677 0 33 [WORD] VBN (VP* install 01 - - * * * * * (V*) - nw/wsj/06/wsj_0677 0 34 [WORD] IN (PP* - - - - * * * * * (ARG2* - nw/wsj/06/wsj_0677 0 35 [WORD] RB (NP(NP(QP* - - - - (CARDINAL* * * * * * - nw/wsj/06/wsj_0677 0 36 [WORD] CD *) - - - - *) * * * * * - nw/wsj/06/wsj_0677 0 37 [WORD] NNS *) - - - - * * * * * * - nw/wsj/06/wsj_0677 0 38 [WORD] IN (PP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 39 [WORD] DT (NP(NP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 40 [WORD] JJ * - - - - * * * * * * - nw/wsj/06/wsj_0677 0 41 [WORD] NN *) - - - - * * * * * * - nw/wsj/06/wsj_0677 0 42 [WORD] IN (PP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 43 [WORD] CD (NP(QP* - - - - (CARDINAL* * * * * * - nw/wsj/06/wsj_0677 0 44 [WORD] CD *)))))))))))))))) - - - - *) * *) *) *) *) - nw/wsj/06/wsj_0677 0 45 [WORD] . *)) - - - - * * * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NN (TOP(S(NP(NP(NP*) - - - - * (ARG2* (ARG0* (ARG1* - nw/wsj/06/wsj_0677 0 1 [WORD] IN (PP* - - - - * * * * - nw/wsj/06/wsj_0677 0 2 [WORD] DT (NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 3 [WORD] NN * - - - - * * * * - nw/wsj/06/wsj_0677 0 4 [WORD] NN *))) - - - - * *) *) * - nw/wsj/06/wsj_0677 0 5 [WORD] , * - - - - * * * * - nw/wsj/06/wsj_0677 0 6 [WORD] WDT (SBAR(WHNP*) - - - - * (R-ARG2*) (R-ARG0*) * - nw/wsj/06/wsj_0677 0 7 [WORD] VBZ (S(VP* include 01 - - * (V*) * * - nw/wsj/06/wsj_0677 0 8 [WORD] VBG (S(VP* provide 01 - - * (ARG1* (V*) * - nw/wsj/06/wsj_0677 0 9 [WORD] JJ (NP* - - - - * * (ARG1* * - nw/wsj/06/wsj_0677 0 10 [WORD] CD (NML* - - - - (QUANTITY* * * * - nw/wsj/06/wsj_0677 0 11 [WORD] HYPH * - - - - * * * * - nw/wsj/06/wsj_0677 0 12 [WORD] NN *) - - - - *) * * * - nw/wsj/06/wsj_0677 0 13 [WORD] NN * - - - - * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] NNS *) - - - - * * *) * - nw/wsj/06/wsj_0677 0 15 [WORD] IN (PP* - - - - * * (ARGM-LOC* * - nw/wsj/06/wsj_0677 0 16 [WORD] NNS (NP*))))))) - - - - * *) *) * - nw/wsj/06/wsj_0677 0 17 [WORD] , *) - - - - * * * *) - nw/wsj/06/wsj_0677 0 18 [WORD] VBZ (VP* begin 01 - - * * * (V*) - nw/wsj/06/wsj_0677 0 19 [WORD] IN (PP* - - - - * * * (ARGM-TMP* - nw/wsj/06/wsj_0677 0 20 [WORD] NNP (NP*))) - - - - (DATE) * * *) - nw/wsj/06/wsj_0677 0 21 [WORD] . *)) - - - - * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] `` (TOP(SINV* - - - - * * * * * * * * - nw/wsj/06/wsj_0677 0 1 [WORD] WP (S(SBAR(WHNP*) - - - - * (ARG1*) (ARG0* * * * * (ARG1* - nw/wsj/06/wsj_0677 0 2 [WORD] PRP (S(NP*) - - - - * (ARG0*) * * * * * * - nw/wsj/06/wsj_0677 0 3 [WORD] VBP (VP* - - - - * * * * * * * * - nw/wsj/06/wsj_0677 0 4 [WORD] VBN (VP* do 02 - - * (V*) * * * * * * - nw/wsj/06/wsj_0677 0 5 [WORD] IN (PP* - - - - * (ARGM-TMP* * * * * * * - nw/wsj/06/wsj_0677 0 6 [WORD] CD (NP* - - - - (DATE* * * * * * * * - nw/wsj/06/wsj_0677 0 7 [WORD] NNS *)))))) - - - - *) *) *) * * * * * - nw/wsj/06/wsj_0677 0 8 [WORD] VBZ (VP* show 01 - - * * (V*) * * * * * - nw/wsj/06/wsj_0677 0 9 [WORD] PRP (SBAR(S(NP*) - - - - * * (ARG1* (ARG0*) (ARG1*) * * * - nw/wsj/06/wsj_0677 0 10 [WORD] MD (VP* - - - - * * * (ARGM-MOD*) * * * * - nw/wsj/06/wsj_0677 0 11 [WORD] RB * - - - - * * * (ARGM-NEG*) * * * * - nw/wsj/06/wsj_0677 0 12 [WORD] VB (VP* have 03 - - * * * (V*) * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] JJ (NP(NP* - - - - * * * (ARG1* * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] NNS *) - - - - * * * * * * * * - nw/wsj/06/wsj_0677 0 15 [WORD] VBG (S(VP* get 05 - - * * * * (V*) * * * - nw/wsj/06/wsj_0677 0 16 [WORD] IN (PP* - - - - * * * * (ARG2* * * * - nw/wsj/06/wsj_0677 0 17 [WORD] DT (NP(NP* - - - - * * * * * * (ARG2* * - nw/wsj/06/wsj_0677 0 18 [WORD] NN *) - - - - * * * * * * *) * - nw/wsj/06/wsj_0677 0 19 [WORD] PRP (SBAR(S(NP*) - - - - * * * * * (ARG0*) (ARG1*) * - nw/wsj/06/wsj_0677 0 20 [WORD] VBP (VP* want 01 - - * * * * * (V*) * * - nw/wsj/06/wsj_0677 0 21 [WORD] TO (S(VP* - - - - * * * * * (ARG1* * * - nw/wsj/06/wsj_0677 0 22 [WORD] VB (VP*))))))))))))))))) be 01 - - * * *) *) *) *) (V*) *) - nw/wsj/06/wsj_0677 0 23 [WORD] , * - - - - * * * * * * * * - nw/wsj/06/wsj_0677 0 24 [WORD] '' * - - - - * * * * * * * * - nw/wsj/06/wsj_0677 0 25 [WORD] VBD (VP*) say 01 - - * * * * * * * (V*) - nw/wsj/06/wsj_0677 0 26 [WORD] NNP (NP* - - - - * * * * * * * (ARG0* - nw/wsj/06/wsj_0677 0 27 [WORD] NNP *) - - - - (PERSON) * * * * * * *) - nw/wsj/06/wsj_0677 0 28 [WORD] . *)) - - - - * * * * * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] PRP (TOP(S(NP*) - - - - * (ARG0*) * - nw/wsj/06/wsj_0677 0 1 [WORD] VBD (VP* say 01 - - * (V*) * - nw/wsj/06/wsj_0677 0 2 [WORD] PRP$ (SBAR(S(NP* - - - - * (ARG1* (ARG0* - nw/wsj/06/wsj_0677 0 3 [WORD] NNS * - - - - * * * - nw/wsj/06/wsj_0677 0 4 [WORD] NN *) - - - - * * *) - nw/wsj/06/wsj_0677 0 5 [WORD] VBZ (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 6 [WORD] VBG (VP* sign 03 - - * * (V*) - nw/wsj/06/wsj_0677 0 7 [WORD] RP (PRT*) - - - - * * * - nw/wsj/06/wsj_0677 0 8 [WORD] NNS (NP*) - - - - * * (ARG1*) - nw/wsj/06/wsj_0677 0 9 [WORD] IN (PP* - - - - * * (ARGM-MNR* - nw/wsj/06/wsj_0677 0 10 [WORD] DT (NP(NP* - - - - * * * - nw/wsj/06/wsj_0677 0 11 [WORD] NN *) - - - - * * * - nw/wsj/06/wsj_0677 0 12 [WORD] IN (PP* - - - - * * * - nw/wsj/06/wsj_0677 0 13 [WORD] CD (NP(NP*) - - - - (CARDINAL) * * - nw/wsj/06/wsj_0677 0 14 [WORD] DT (NP* - - - - * * * - nw/wsj/06/wsj_0677 0 15 [WORD] NN *)))))))))) - - - - * *) *) - nw/wsj/06/wsj_0677 0 16 [WORD] . *)) - - - - * * * - nw/wsj/06/wsj_0677 0 0 [WORD] IN (TOP(S(PP* - - - - * (ARGM-LOC* - nw/wsj/06/wsj_0677 0 1 [WORD] NNP (NP(NP*) - - - - (GPE) * - nw/wsj/06/wsj_0677 0 2 [WORD] CC * - - - - * * - nw/wsj/06/wsj_0677 0 3 [WORD] NNP (NP* - - - - (GPE* * - nw/wsj/06/wsj_0677 0 4 [WORD] NNP *))) - - - - *) *) - nw/wsj/06/wsj_0677 0 5 [WORD] , * - - - - * * - nw/wsj/06/wsj_0677 0 6 [WORD] NN (NP* - - - - * (ARG0* - nw/wsj/06/wsj_0677 0 7 [WORD] NNS *) - - - - * *) - nw/wsj/06/wsj_0677 0 8 [WORD] VBP (VP* - - - - * * - nw/wsj/06/wsj_0677 0 9 [WORD] VBN (VP* oppose 01 - - * (V*) - nw/wsj/06/wsj_0677 0 10 [WORD] NNP (NP* - - - - (ORG* (ARG1* - nw/wsj/06/wsj_0677 0 11 [WORD] CD *))) - - - - *) *) - nw/wsj/06/wsj_0677 0 12 [WORD] . *)) - - - - * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP* - - - - * (ARG0* * * * * - nw/wsj/06/wsj_0677 0 1 [WORD] NNP *) - - - - (PERSON) *) * * * * - nw/wsj/06/wsj_0677 0 2 [WORD] VBD (VP* say 01 - - * (V*) * * * * - nw/wsj/06/wsj_0677 0 3 [WORD] JJ (SBAR(S(NP(NP(ADJP* - - - - * (ARG1* (ARG1* * * * - nw/wsj/06/wsj_0677 0 4 [WORD] CC * - - - - * * * * * * - nw/wsj/06/wsj_0677 0 5 [WORD] JJ *) - - - - * * * * * * - nw/wsj/06/wsj_0677 0 6 [WORD] NNS *) - - - - * * * * * * - nw/wsj/06/wsj_0677 0 7 [WORD] IN (PP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 8 [WORD] DT (NP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 9 [WORD] NNS *))) - - - - * * *) * * * - nw/wsj/06/wsj_0677 0 10 [WORD] MD (VP* - - - - * * (ARGM-MOD*) * * * - nw/wsj/06/wsj_0677 0 11 [WORD] VB (VP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 12 [WORD] VBN (VP* canvass 01 - - * * (V*) * * * - nw/wsj/06/wsj_0677 0 13 [WORD] TO (S(VP* - - - - * * (ARGM-PRP* * * * - nw/wsj/06/wsj_0677 0 14 [WORD] VB (VP* see 01 - - * * * (V*) * * - nw/wsj/06/wsj_0677 0 15 [WORD] IN (SBAR* - - - - * * * (ARG1* * * - nw/wsj/06/wsj_0677 0 16 [WORD] PRP (S(NP*) - - - - * * * * (ARG1*) (ARG0*) - nw/wsj/06/wsj_0677 0 17 [WORD] VBP (VP* be 01 - - * * * * (V*) * - nw/wsj/06/wsj_0677 0 18 [WORD] JJ (ADJP* - - - - * * * * (ARG2* * - nw/wsj/06/wsj_0677 0 19 [WORD] IN (PP* - - - - * * * * * * - nw/wsj/06/wsj_0677 0 20 [WORD] VBG (S(VP* get 01 - - * * * * * (V*) - nw/wsj/06/wsj_0677 0 21 [WORD] DT (NP* - - - - * * * * * (ARG1* - nw/wsj/06/wsj_0677 0 22 [WORD] NNS *))))))))))))))))) - - - - * *) *) *) *) *) - nw/wsj/06/wsj_0677 0 23 [WORD] . *)) - - - - * * * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] VBG (TOP(S(NP* subscribe 01 - - * (V*) (ARG0* * - nw/wsj/06/wsj_0677 0 1 [WORD] NNS *) - - - - * (ARG0*) *) * - nw/wsj/06/wsj_0677 0 2 [WORD] VBP (VP* get 01 - - * * (V*) * - nw/wsj/06/wsj_0677 0 3 [WORD] DT (NP(NP* - - - - * * (ARG1* (R-ARG0* - nw/wsj/06/wsj_0677 0 4 [WORD] CD (NML* - - - - (TIME* * * * - nw/wsj/06/wsj_0677 0 5 [WORD] HYPH * - - - - * * * * - nw/wsj/06/wsj_0677 0 6 [WORD] NN *) - - - - *) * * * - nw/wsj/06/wsj_0677 0 7 [WORD] JJ * - - - - (DATE) * * * - nw/wsj/06/wsj_0677 0 8 [WORD] NNP (NML* - - - - (ORG* * * * - nw/wsj/06/wsj_0677 0 9 [WORD] CD *) - - - - *) * * * - nw/wsj/06/wsj_0677 0 10 [WORD] NN * - - - - * * * * - nw/wsj/06/wsj_0677 0 11 [WORD] NN *) - - - - * * * *) - nw/wsj/06/wsj_0677 0 12 [WORD] , * - - - - * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] WP$ (SBAR(WHNP(WHNP* - - - - * * * (ARG0* - nw/wsj/06/wsj_0677 0 14 [WORD] CD * - - - - (CARDINAL) * * * - nw/wsj/06/wsj_0677 0 15 [WORD] CD (NML* - - - - (TIME* * * * - nw/wsj/06/wsj_0677 0 16 [WORD] HYPH * - - - - * * * * - nw/wsj/06/wsj_0677 0 17 [WORD] NN *) - - - - *) * * * - nw/wsj/06/wsj_0677 0 18 [WORD] NN * - - - - * * * * - nw/wsj/06/wsj_0677 0 19 [WORD] NNS *) - - - - * * * * - nw/wsj/06/wsj_0677 0 20 [WORD] IN (PP* - - - - * * * * - nw/wsj/06/wsj_0677 0 21 [WORD] DT (NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 22 [WORD] NN *))) - - - - * * * *) - nw/wsj/06/wsj_0677 0 23 [WORD] VBP (S(VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 24 [WORD] VBN (VP* draw 02 - - * * * (V*) - nw/wsj/06/wsj_0677 0 25 [WORD] NNS (NP*) - - - - * * * (ARG1*) - nw/wsj/06/wsj_0677 0 26 [WORD] IN (PP* - - - - * * * (ARG2* - nw/wsj/06/wsj_0677 0 27 [WORD] NNS (NP*)))))))) - - - - * * *) *) - nw/wsj/06/wsj_0677 0 28 [WORD] . *)) - - - - * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNS (TOP(S(NP*) - - - - * (ARG0*) * * * - nw/wsj/06/wsj_0677 0 1 [WORD] RB (ADVP*) - - - - * (ARGM-ADV*) * * * - nw/wsj/06/wsj_0677 0 2 [WORD] VBP (VP* get 01 - - * (V*) * * * - nw/wsj/06/wsj_0677 0 3 [WORD] DT (NP(NP* - - - - (PRODUCT* (ARG1* (ARG0* * * - nw/wsj/06/wsj_0677 0 4 [WORD] NNP * - - - - * * * * * - nw/wsj/06/wsj_0677 0 5 [WORD] NNP *) - - - - *) * *) * * - nw/wsj/06/wsj_0677 0 6 [WORD] , * - - - - * * * * * - nw/wsj/06/wsj_0677 0 7 [WORD] WDT (SBAR(WHNP*) - - - - * * (R-ARG0*) * * - nw/wsj/06/wsj_0677 0 8 [WORD] MD (S(VP* - - - - * * (ARGM-MOD*) * * - nw/wsj/06/wsj_0677 0 9 [WORD] VB (VP* feature 01 1 - * * (V*) * * - nw/wsj/06/wsj_0677 0 10 [WORD] NN (NP(NP(NP(ADJP* - - - - * * (ARG1* * * - nw/wsj/06/wsj_0677 0 11 [WORD] HYPH * - - - - * * * * * - nw/wsj/06/wsj_0677 0 12 [WORD] JJ *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] JJ * - - - - * * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] NN *) programme - 5 - * * * * * - nw/wsj/06/wsj_0677 0 15 [WORD] JJ (ADJP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 16 [WORD] IN (PP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 17 [WORD] DT (NP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 18 [WORD] JJ (NML* - - - - * * * * * - nw/wsj/06/wsj_0677 0 19 [WORD] HYPH * - - - - * * * * * - nw/wsj/06/wsj_0677 0 20 [WORD] NN *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 21 [WORD] NNS *)))) - - - - * * * * * - nw/wsj/06/wsj_0677 0 22 [WORD] , * - - - - * * * * * - nw/wsj/06/wsj_0677 0 23 [WORD] CC * - - - - * * * * * - nw/wsj/06/wsj_0677 0 24 [WORD] DT (NP(NP(NP* - - - - (PRODUCT* * * (ARG0* (ARG1* - nw/wsj/06/wsj_0677 0 25 [WORD] NNP * - - - - * * * * * - nw/wsj/06/wsj_0677 0 26 [WORD] POS *) - - - - * * * * * - nw/wsj/06/wsj_0677 0 27 [WORD] NNP *) - - - - *) * * *) *) - nw/wsj/06/wsj_0677 0 28 [WORD] , * - - - - * * * * * - nw/wsj/06/wsj_0677 0 29 [WORD] WDT (SBAR(WHNP*) - - - - * * * (R-ARG0*) (R-ARG1*) - nw/wsj/06/wsj_0677 0 30 [WORD] MD (S(VP(VP* - - - - * * * (ARGM-MOD*) * - nw/wsj/06/wsj_0677 0 31 [WORD] VB (VP* offer 01 - - * * * (V*) * - nw/wsj/06/wsj_0677 0 32 [WORD] JJ (NP(NP* - - - - * * * (ARG1* * - nw/wsj/06/wsj_0677 0 33 [WORD] NN *) programme - 5 - * * * * * - nw/wsj/06/wsj_0677 0 34 [WORD] IN (PP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 35 [WORD] NNS (NP(NP*) - - - - * * * * * - nw/wsj/06/wsj_0677 0 36 [WORD] CC * - - - - * * * * * - nw/wsj/06/wsj_0677 0 37 [WORD] NN (NP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 38 [WORD] NNS *)))))) - - - - * * * *) * - nw/wsj/06/wsj_0677 0 39 [WORD] CC * - - - - * * * * * - nw/wsj/06/wsj_0677 0 40 [WORD] MD (VP* - - - - * * * * (ARGM-MOD*) - nw/wsj/06/wsj_0677 0 41 [WORD] VB (VP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 42 [WORD] VBN (VP* support 01 - - * * * * (V*) - nw/wsj/06/wsj_0677 0 43 [WORD] IN (PP* - - - - * * * * (ARG0* - nw/wsj/06/wsj_0677 0 44 [WORD] NN (NP*)))))))))))))))) - - - - * *) *) * *) - nw/wsj/06/wsj_0677 0 45 [WORD] . *)) - - - - * * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP*) - - - - (PERSON) (ARG0*) * - nw/wsj/06/wsj_0677 0 1 [WORD] VBZ (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 2 [WORD] VBN (VP* meet 01 - - * (V*) * - nw/wsj/06/wsj_0677 0 3 [WORD] DT (NP* - - - - * (ARG1* * - nw/wsj/06/wsj_0677 0 4 [WORD] NN *))) resistance 01 1 - * *) (V*) - nw/wsj/06/wsj_0677 0 5 [WORD] . *)) - - - - * * * - nw/wsj/06/wsj_0677 0 0 [WORD] DT (TOP(S(S(NP(NP* - - - - (PRODUCT* (ARG2* (ARG1* * * - nw/wsj/06/wsj_0677 0 1 [WORD] NNP * - - - - * * * * * - nw/wsj/06/wsj_0677 0 2 [WORD] NNP *) - - - - *) *) * * * - nw/wsj/06/wsj_0677 0 3 [WORD] , * - - - - * * * * * - nw/wsj/06/wsj_0677 0 4 [WORD] IN (SBAR* - - - - * * * * * - nw/wsj/06/wsj_0677 0 5 [WORD] NNP (S(NP* - - - - * (ARG0* * * * - nw/wsj/06/wsj_0677 0 6 [WORD] NNP *) - - - - (PERSON) *) * * * - nw/wsj/06/wsj_0677 0 7 [WORD] VBZ (VP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 8 [WORD] VBN (VP* name 01 - - * (V*) * * * - nw/wsj/06/wsj_0677 0 9 [WORD] DT (NP* - - - - * (ARG1* * * * - nw/wsj/06/wsj_0677 0 10 [WORD] CD * - - - - (CARDINAL) * * * * - nw/wsj/06/wsj_0677 0 11 [WORD] NNS *))))) - - - - * *) * * * - nw/wsj/06/wsj_0677 0 12 [WORD] , *) - - - - * * *) * * - nw/wsj/06/wsj_0677 0 13 [WORD] VBZ (VP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] VBN (VP* - - - - * * * * * - nw/wsj/06/wsj_0677 0 15 [WORD] VBN (VP* offer 01 - - * * (V*) * * - nw/wsj/06/wsj_0677 0 16 [WORD] IN (PP* - - - - * * (ARG3* * * - nw/wsj/06/wsj_0677 0 17 [WORD] CD (NP* - - - - (CARDINAL) * * * * - nw/wsj/06/wsj_0677 0 18 [WORD] NN * - - - - * * * * * - nw/wsj/06/wsj_0677 0 19 [WORD] NNS *)))))) - - - - * * *) * * - nw/wsj/06/wsj_0677 0 20 [WORD] CC * - - - - * * * * * - nw/wsj/06/wsj_0677 0 21 [WORD] NNP (S(NP*) - - - - (PERSON) * * (ARG0*) (ARG0*) - nw/wsj/06/wsj_0677 0 22 [WORD] VBZ (VP* continue 01 - - * * * (V*) * - nw/wsj/06/wsj_0677 0 23 [WORD] TO (S(VP* - - - - * * * (ARG1* * - nw/wsj/06/wsj_0677 0 24 [WORD] VB (VP* negotiate 01 - - * * * * (V*) - nw/wsj/06/wsj_0677 0 25 [WORD] IN (PP* - - - - * * * * (ARG1* - nw/wsj/06/wsj_0677 0 26 [WORD] CD (NP* - - - - (CARDINAL) * * * * - nw/wsj/06/wsj_0677 0 27 [WORD] NNS *))))))) - - - - * * * *) *) - nw/wsj/06/wsj_0677 0 28 [WORD] . *)) - - - - * * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] RB (TOP(S(NP(NP(NP(QP* - - - - (PERCENT* (ARG2* (ARG0* - nw/wsj/06/wsj_0677 0 1 [WORD] CD *) - - - - * * * - nw/wsj/06/wsj_0677 0 2 [WORD] NN *) - - - - *) * * - nw/wsj/06/wsj_0677 0 3 [WORD] IN (PP* - - - - * * * - nw/wsj/06/wsj_0677 0 4 [WORD] DT (NP* - - - - * * * - nw/wsj/06/wsj_0677 0 5 [WORD] NN * - - - - * * * - nw/wsj/06/wsj_0677 0 6 [WORD] NNS *))) - - - - * *) * - nw/wsj/06/wsj_0677 0 7 [WORD] VBN (VP*)) approach 01 - - * (V*) *) - nw/wsj/06/wsj_0677 0 8 [WORD] VBP (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 9 [WORD] VBN (VP* reject 01 - - * * (V*) - nw/wsj/06/wsj_0677 0 10 [WORD] DT (NP* - - - - * * (ARG1* - nw/wsj/06/wsj_0677 0 11 [WORD] NN *))) - - - - * * *) - nw/wsj/06/wsj_0677 0 12 [WORD] . *)) - - - - * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP* - - - - * (ARG0* * * - nw/wsj/06/wsj_0677 0 1 [WORD] NNP *) - - - - (PERSON) *) * * - nw/wsj/06/wsj_0677 0 2 [WORD] VBD (VP* say 01 - - * (V*) * * - nw/wsj/06/wsj_0677 0 3 [WORD] IN (SBAR* - - - - * (ARG1* * * - nw/wsj/06/wsj_0677 0 4 [WORD] RB (S(ADVP* - - - - * * * (ARGM-TMP* - nw/wsj/06/wsj_0677 0 5 [WORD] RB *) - - - - * * * *) - nw/wsj/06/wsj_0677 0 6 [WORD] , * - - - - * * * * - nw/wsj/06/wsj_0677 0 7 [WORD] CD (NP(NP*) - - - - (CARDINAL) * * (ARG0* - nw/wsj/06/wsj_0677 0 8 [WORD] IN (PP* - - - - * * * * - nw/wsj/06/wsj_0677 0 9 [WORD] DT (NP(NP* - - - - * * (ARG0* * - nw/wsj/06/wsj_0677 0 10 [WORD] CD * - - - - (CARDINAL) * * * - nw/wsj/06/wsj_0677 0 11 [WORD] NNS *) - - - - * * *) * - nw/wsj/06/wsj_0677 0 12 [WORD] WDT (SBAR(WHNP*) - - - - * * (R-ARG0*) * - nw/wsj/06/wsj_0677 0 13 [WORD] VBD (S(VP* carry 01 - - * * (V*) * - nw/wsj/06/wsj_0677 0 14 [WORD] DT (NP* - - - - * * (ARG1* * - nw/wsj/06/wsj_0677 0 15 [WORD] NN *) - - - - * * *) * - nw/wsj/06/wsj_0677 0 16 [WORD] IN (PP* - - - - * * (ARG2* * - nw/wsj/06/wsj_0677 0 17 [WORD] DT (NP(NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 18 [WORD] CD (NML* - - - - (DATE* * * * - nw/wsj/06/wsj_0677 0 19 [WORD] HYPH * - - - - * * * * - nw/wsj/06/wsj_0677 0 20 [WORD] NN *) - - - - *) * * * - nw/wsj/06/wsj_0677 0 21 [WORD] NN *) - - - - * * * * - nw/wsj/06/wsj_0677 0 22 [WORD] JJ (NP* - - - - (DATE* * * * - nw/wsj/06/wsj_0677 0 23 [WORD] NN *))))))))) - - - - *) * *) *) - nw/wsj/06/wsj_0677 0 24 [WORD] VBP (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 25 [WORD] VBN (VP* subscribe 01 1 - * * * (V*) - nw/wsj/06/wsj_0677 0 26 [WORD] IN (PP* - - - - * * * (ARG1* - nw/wsj/06/wsj_0677 0 27 [WORD] DT (NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 28 [WORD] NN *))))))) - - - - * *) * *) - nw/wsj/06/wsj_0677 0 29 [WORD] . *)) - - - - * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] CD (TOP(S(NP(NP(NP*) - - - - (CARDINAL) (ARG0* - nw/wsj/06/wsj_0677 0 1 [WORD] IN (PP* - - - - * * - nw/wsj/06/wsj_0677 0 2 [WORD] DT (NP* - - - - * * - nw/wsj/06/wsj_0677 0 3 [WORD] NN * - - - - * * - nw/wsj/06/wsj_0677 0 4 [WORD] NNS *))) - - - - * * - nw/wsj/06/wsj_0677 0 5 [WORD] , * - - - - * * - nw/wsj/06/wsj_0677 0 6 [WORD] NNP (NP(NP* - - - - (ORG* * - nw/wsj/06/wsj_0677 0 7 [WORD] NNP * - - - - * * - nw/wsj/06/wsj_0677 0 8 [WORD] NNP *) - - - - *) * - nw/wsj/06/wsj_0677 0 9 [WORD] IN (PP* - - - - * * - nw/wsj/06/wsj_0677 0 10 [WORD] NNP (NP*))) - - - - (GPE) * - nw/wsj/06/wsj_0677 0 11 [WORD] , *) - - - - * *) - nw/wsj/06/wsj_0677 0 12 [WORD] VBD (VP* reject 01 - - * (V*) - nw/wsj/06/wsj_0677 0 13 [WORD] DT (NP* - - - - * (ARG1* - nw/wsj/06/wsj_0677 0 14 [WORD] NN *)) - - - - * *) - nw/wsj/06/wsj_0677 0 15 [WORD] . *)) - - - - * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP(NP* - - - - (PERSON* * * * - nw/wsj/06/wsj_0677 0 1 [WORD] NNP *) - - - - *) * * * - nw/wsj/06/wsj_0677 0 2 [WORD] , * - - - - * * * * - nw/wsj/06/wsj_0677 0 3 [WORD] JJ (NP(NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 4 [WORD] NN *) - - - - * * * * - nw/wsj/06/wsj_0677 0 5 [WORD] IN (PP* - - - - * * * * - nw/wsj/06/wsj_0677 0 6 [WORD] NNS (NP*)) - - - - * * * * - nw/wsj/06/wsj_0677 0 7 [WORD] IN (PP* - - - - * * * * - nw/wsj/06/wsj_0677 0 8 [WORD] NNP (NP* - - - - (GPE) * * * - nw/wsj/06/wsj_0677 0 9 [WORD] NNP * - - - - * * * * - nw/wsj/06/wsj_0677 0 10 [WORD] NNP *))) - - - - * * * * - nw/wsj/06/wsj_0677 0 11 [WORD] , *) - - - - * * * * - nw/wsj/06/wsj_0677 0 12 [WORD] VBD (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] NNP (SBAR(S(NP* - - - - (ORG* * * * - nw/wsj/06/wsj_0677 0 14 [WORD] NN *) - - - - *) * * * - nw/wsj/06/wsj_0677 0 15 [WORD] VBD (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 16 [WORD] VBN (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 17 [WORD] IN (SBAR* - - - - * * * * - nw/wsj/06/wsj_0677 0 18 [WORD] NNS (S(S(NP(NP*) - - - - * (ARG0*) * * - nw/wsj/06/wsj_0677 0 19 [WORD] VBG (VP* watch 01 - - * (V*) * * - nw/wsj/06/wsj_0677 0 20 [WORD] DT (NP* - - - - * (ARG1* * * - nw/wsj/06/wsj_0677 0 21 [WORD] NN *))) - - - - * *) * * - nw/wsj/06/wsj_0677 0 22 [WORD] VBD (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 23 [WORD] RB * - - - - * * * * - nw/wsj/06/wsj_0677 0 24 [WORD] NN (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 25 [WORD] RB (ADVP(ADVP* - - - - * * * * - nw/wsj/06/wsj_0677 0 26 [WORD] RBR *)) - - - - * * * * - nw/wsj/06/wsj_0677 0 27 [WORD] IN (PP* - - - - * * * * - nw/wsj/06/wsj_0677 0 28 [WORD] DT (NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 29 [WORD] CD (NML* - - - - (CARDINAL) * * * - nw/wsj/06/wsj_0677 0 30 [WORD] HYPH * - - - - * * * * - nw/wsj/06/wsj_0677 0 31 [WORD] NN *) - - - - * * * * - nw/wsj/06/wsj_0677 0 32 [WORD] JJ (NML* - - - - * * * * - nw/wsj/06/wsj_0677 0 33 [WORD] NNS *) - - - - * * * * - nw/wsj/06/wsj_0677 0 34 [WORD] NN *)) - - - - * * * * - nw/wsj/06/wsj_0677 0 35 [WORD] IN (PP* - - - - * * * * - nw/wsj/06/wsj_0677 0 36 [WORD] DT (NP(NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 37 [WORD] JJ * - - - - * * * * - nw/wsj/06/wsj_0677 0 38 [WORD] NN *) - - - - * * * * - nw/wsj/06/wsj_0677 0 39 [WORD] IN (PP* - - - - * * * * - nw/wsj/06/wsj_0677 0 40 [WORD] DT (NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 41 [WORD] NN *))))))) - - - - * * * * - nw/wsj/06/wsj_0677 0 42 [WORD] CC * - - - - * * * * - nw/wsj/06/wsj_0677 0 43 [WORD] NN (S(NP* - - - - * * (ARG1* * - nw/wsj/06/wsj_0677 0 44 [WORD] NNS *) - - - - * * *) * - nw/wsj/06/wsj_0677 0 45 [WORD] VBD (VP* be 01 - - * * (V*) * - nw/wsj/06/wsj_0677 0 46 [WORD] RB (ADJP* - - - - * * (ARG2* * - nw/wsj/06/wsj_0677 0 47 [WORD] JJ *) - - - - * * *) * - nw/wsj/06/wsj_0677 0 48 [WORD] IN (PP* - - - - * * (ARGM-TMP* * - nw/wsj/06/wsj_0677 0 49 [WORD] DT (NP(NP* - - - - * * * (ARGM-TMP* - nw/wsj/06/wsj_0677 0 50 [WORD] NN *) - - - - * * * *) - nw/wsj/06/wsj_0677 0 51 [WORD] WRB (SBAR(WHADVP*) - - - - * * * (R-ARGM-TMP*) - nw/wsj/06/wsj_0677 0 52 [WORD] DT (S(NP* - - - - * * * (ARG1* - nw/wsj/06/wsj_0677 0 53 [WORD] NN *) - - - - * * * *) - nw/wsj/06/wsj_0677 0 54 [WORD] VBD (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 55 [WORD] VBG (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 56 [WORD] VBN (VP*)))))))))))))))) air 01 - - * * *) (V*) - nw/wsj/06/wsj_0677 0 57 [WORD] . *)) - - - - * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] `` (TOP(S* - - - - * * * - nw/wsj/06/wsj_0677 0 1 [WORD] DT (S(S(NP(NP* - - - - * (ARG1* (ARG1* - nw/wsj/06/wsj_0677 0 2 [WORD] NN *) - - - - * * * - nw/wsj/06/wsj_0677 0 3 [WORD] IN (PP* - - - - * * * - nw/wsj/06/wsj_0677 0 4 [WORD] JJ (NP* - - - - * * * - nw/wsj/06/wsj_0677 0 5 [WORD] NNS *))) - - - - * *) * - nw/wsj/06/wsj_0677 0 6 [WORD] VBD (VP* be 01 - - * (V*) * - nw/wsj/06/wsj_0677 0 7 [WORD] CD (NP* - - - - (PERCENT* (ARG2* * - nw/wsj/06/wsj_0677 0 8 [WORD] NN *) - - - - *) *) * - nw/wsj/06/wsj_0677 0 9 [WORD] IN (PP* - - - - * (ARGM-LOC* * - nw/wsj/06/wsj_0677 0 10 [WORD] DT (NP* - - - - * * * - nw/wsj/06/wsj_0677 0 11 [WORD] NN *)))) - - - - * *) * - nw/wsj/06/wsj_0677 0 12 [WORD] CC * - - - - * * * - nw/wsj/06/wsj_0677 0 13 [WORD] NN (S(NP* - - - - * * * - nw/wsj/06/wsj_0677 0 14 [WORD] NNS *) - - - - * * * - nw/wsj/06/wsj_0677 0 15 [WORD] VBD (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 16 [WORD] RB * - - - - * * * - nw/wsj/06/wsj_0677 0 17 [WORD] NN (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 18 [WORD] RB (ADVP*))))) - - - - * * *) - nw/wsj/06/wsj_0677 0 19 [WORD] , * - - - - * * * - nw/wsj/06/wsj_0677 0 20 [WORD] '' * - - - - * * * - nw/wsj/06/wsj_0677 0 21 [WORD] VBD (VP*) say 01 - - * * (V*) - nw/wsj/06/wsj_0677 0 22 [WORD] NNP (NP* - - - - * * (ARG0* - nw/wsj/06/wsj_0677 0 23 [WORD] NNP *) - - - - (PERSON) * *) - nw/wsj/06/wsj_0677 0 24 [WORD] . *)) - - - - * * * - nw/wsj/06/wsj_0677 0 0 [WORD] `` (TOP(S* - - - - * * * * - nw/wsj/06/wsj_0677 0 1 [WORD] DT (S(NP* - - - - * (ARG1* * * - nw/wsj/06/wsj_0677 0 2 [WORD] JJ * - - - - * * * * - nw/wsj/06/wsj_0677 0 3 [WORD] NN *) - - - - * *) * * - nw/wsj/06/wsj_0677 0 4 [WORD] VBD (VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 5 [WORD] VBN (VP* receive 01 - - * (V*) * * - nw/wsj/06/wsj_0677 0 6 [WORD] RB (ADVP*) - - - - * (ARGM-MNR*) * * - nw/wsj/06/wsj_0677 0 7 [WORD] -LRB- * - - - - * * * * - nw/wsj/06/wsj_0677 0 8 [WORD] IN (PP* - - - - * (ARG0* * * - nw/wsj/06/wsj_0677 0 9 [WORD] NNS (NP* - - - - * * * * - nw/wsj/06/wsj_0677 0 10 [WORD] CC * - - - - * * * * - nw/wsj/06/wsj_0677 0 11 [WORD] NNS *)) - - - - * *) * * - nw/wsj/06/wsj_0677 0 12 [WORD] -RRB- *))) - - - - * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] , * - - - - * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] CC * - - - - * * * * - nw/wsj/06/wsj_0677 0 15 [WORD] EX (S(NP*) - - - - * * * * - nw/wsj/06/wsj_0677 0 16 [WORD] VBD (VP* be 02 - - * * (V*) * - nw/wsj/06/wsj_0677 0 17 [WORD] RB * - - - - * * (ARGM-NEG*) * - nw/wsj/06/wsj_0677 0 18 [WORD] NN (NP(NP*) - - - - * * (ARG1* * - nw/wsj/06/wsj_0677 0 19 [WORD] JJ (ADJP* - - - - * * * * - nw/wsj/06/wsj_0677 0 20 [WORD] TO (S(VP* - - - - * * * * - nw/wsj/06/wsj_0677 0 21 [WORD] VB (VP* sign 03 - - * * * (V*) - nw/wsj/06/wsj_0677 0 22 [WORD] RP (PRT*)))))))) - - - - * * *) * - nw/wsj/06/wsj_0677 0 23 [WORD] . *)) - - - - * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] PRP (TOP(S(S(NP*) - - - - * (ARG0*) * * * - nw/wsj/06/wsj_0677 0 1 [WORD] RB (ADVP*) - - - - * (ARGM-ADV*) * * * - nw/wsj/06/wsj_0677 0 2 [WORD] VBD (VP* invite 01 - - * (V*) * * * - nw/wsj/06/wsj_0677 0 3 [WORD] DT (NP* - - - - * (ARG1* (ARG0* (ARG0* * - nw/wsj/06/wsj_0677 0 4 [WORD] NN *) - - - - * *) *) *) * - nw/wsj/06/wsj_0677 0 5 [WORD] TO (S(VP* - - - - * (ARG2* * * * - nw/wsj/06/wsj_0677 0 6 [WORD] VB (VP(VP* stop 02 - - * * (V*) * * - nw/wsj/06/wsj_0677 0 7 [WORD] RP (PRT*)) - - - - * * * * * - nw/wsj/06/wsj_0677 0 8 [WORD] CC * - - - - * * * * * - nw/wsj/06/wsj_0677 0 9 [WORD] VB (VP* see 01 - - * * * (V*) * - nw/wsj/06/wsj_0677 0 10 [WORD] DT (NP* - - - - * * * (ARG1* * - nw/wsj/06/wsj_0677 0 11 [WORD] NN *))))))) - - - - * *) * *) * - nw/wsj/06/wsj_0677 0 12 [WORD] , * - - - - * * * * * - nw/wsj/06/wsj_0677 0 13 [WORD] CC * - - - - * * * * * - nw/wsj/06/wsj_0677 0 14 [WORD] EX (S(NP*) - - - - * * * * * - nw/wsj/06/wsj_0677 0 15 [WORD] VBD (VP* be 02 - - * * * * (V*) - nw/wsj/06/wsj_0677 0 16 [WORD] RB * - - - - * * * * (ARGM-NEG*) - nw/wsj/06/wsj_0677 0 17 [WORD] JJ (NP* - - - - * * * * (ARG1* - nw/wsj/06/wsj_0677 0 18 [WORD] NN *))) - - - - * * * * *) - nw/wsj/06/wsj_0677 0 19 [WORD] . * - - - - * * * * * - nw/wsj/06/wsj_0677 0 20 [WORD] '' *)) - - - - * * * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNS (TOP(S(NP*) - - - - * (ARG0*) - nw/wsj/06/wsj_0677 0 1 [WORD] VBP (VP* - - - - * * - nw/wsj/06/wsj_0677 0 2 [WORD] VBG (VP* show 01 - - * (V*) - nw/wsj/06/wsj_0677 0 3 [WORD] NN (NP*))) - - - - * (ARG1*) - nw/wsj/06/wsj_0677 0 4 [WORD] . *)) - - - - * * - nw/wsj/06/wsj_0677 0 0 [WORD] JJ (TOP(S(NP* - - - - (DATE* (ARGM-TMP* * - nw/wsj/06/wsj_0677 0 1 [WORD] NN *) - - - - *) *) * - nw/wsj/06/wsj_0677 0 2 [WORD] , * - - - - * * * - nw/wsj/06/wsj_0677 0 3 [WORD] NNP (NP*) - - - - (PERSON) (ARG0*) * - nw/wsj/06/wsj_0677 0 4 [WORD] VBD (VP* announce 01 - - * (V*) * - nw/wsj/06/wsj_0677 0 5 [WORD] PRP (SBAR(S(NP*) - - - - * (ARG1* (ARG0*) - nw/wsj/06/wsj_0677 0 6 [WORD] VBD (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 7 [WORD] VBN (VP* sell 01 - - * * (V*) - nw/wsj/06/wsj_0677 0 8 [WORD] $ (NP(NP(QP* - - - - (MONEY* * (ARG1* - nw/wsj/06/wsj_0677 0 9 [WORD] CD * - - - - * * * - nw/wsj/06/wsj_0677 0 10 [WORD] CD *)) - - - - *) * * - nw/wsj/06/wsj_0677 0 11 [WORD] IN (PP* - - - - * * * - nw/wsj/06/wsj_0677 0 12 [WORD] NN (NP* - - - - * * * - nw/wsj/06/wsj_0677 0 13 [WORD] NN *))) - - - - * * * - nw/wsj/06/wsj_0677 0 14 [WORD] IN (PP* - - - - * * * - nw/wsj/06/wsj_0677 0 15 [WORD] DT (NP* - - - - * * * - nw/wsj/06/wsj_0677 0 16 [WORD] NN *)) - - - - * * *) - nw/wsj/06/wsj_0677 0 17 [WORD] IN (PP* - - - - * * (ARG2* - nw/wsj/06/wsj_0677 0 18 [WORD] JJ (NP* - - - - * * * - nw/wsj/06/wsj_0677 0 19 [WORD] NNS *))))))) - - - - * *) *) - nw/wsj/06/wsj_0677 0 20 [WORD] . *)) - - - - * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP* - - - - * (ARG0* * - nw/wsj/06/wsj_0677 0 1 [WORD] NNP *) - - - - (PERSON) *) * - nw/wsj/06/wsj_0677 0 2 [WORD] NNP (NP*) - - - - (DATE) (ARGM-TMP*) * - nw/wsj/06/wsj_0677 0 3 [WORD] VBD (VP* say 01 - - * (V*) * - nw/wsj/06/wsj_0677 0 4 [WORD] JJ (SBAR(S(NP* - - - - * (ARG1* (ARG1* - nw/wsj/06/wsj_0677 0 5 [WORD] JJR * - - - - * * * - nw/wsj/06/wsj_0677 0 6 [WORD] NNS *) - - - - * * *) - nw/wsj/06/wsj_0677 0 7 [WORD] VBP (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 8 [WORD] VBN (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 9 [WORD] VBN (VP*)))))) add 02 - - * *) (V*) - nw/wsj/06/wsj_0677 0 10 [WORD] . *)) - - - - * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NNP (TOP(S(NP*) - - - - (PERSON) (ARG0*) (ARG0*) - nw/wsj/06/wsj_0677 0 1 [WORD] VBZ (VP* - - - - * * * - nw/wsj/06/wsj_0677 0 2 [WORD] VBG (VP* spend 01 - - * (V*) * - nw/wsj/06/wsj_0677 0 3 [WORD] $ (NP(QP* - - - - (MONEY* (ARG3* * - nw/wsj/06/wsj_0677 0 4 [WORD] CD * - - - - * * * - nw/wsj/06/wsj_0677 0 5 [WORD] CD *)) - - - - *) *) * - nw/wsj/06/wsj_0677 0 6 [WORD] RB (ADVP*) - - - - * (ARGM-TMP*) * - nw/wsj/06/wsj_0677 0 7 [WORD] TO (S(VP* - - - - * (ARGM-PRP* * - nw/wsj/06/wsj_0677 0 8 [WORD] VB (VP* launch 01 - - * * (V*) - nw/wsj/06/wsj_0677 0 9 [WORD] DT (NP* - - - - * * (ARG1* - nw/wsj/06/wsj_0677 0 10 [WORD] NN *)))))) - - - - * *) *) - nw/wsj/06/wsj_0677 0 11 [WORD] . *)) - - - - * * * - nw/wsj/06/wsj_0677 0 0 [WORD] NN (TOP(S(S(NP(NP*) - - - - * (ARG1* (ARG1* - nw/wsj/06/wsj_0677 0 1 [WORD] IN (PP* - - - - * * * - nw/wsj/06/wsj_0677 0 2 [WORD] NN (NP(NP* - - - - * * * - nw/wsj/06/wsj_0677 0 3 [WORD] NNS *) - - - - * * * - nw/wsj/06/wsj_0677 0 4 [WORD] , * - - - - * * * - nw/wsj/06/wsj_0677 0 5 [WORD] NNS (NP*) - - - - * * * - nw/wsj/06/wsj_0677 0 6 [WORD] CC * - - - - * * * - nw/wsj/06/wsj_0677 0 7 [WORD] NN (NP* - - - - * * * - nw/wsj/06/wsj_0677 0 8 [WORD] NN *)))) - - - - * *) * - nw/wsj/06/wsj_0677 0 9 [WORD] MD (VP* - - - - * (ARGM-MOD*) * - nw/wsj/06/wsj_0677 0 10 [WORD] VB (VP* cost 01 - - * (V*) * - nw/wsj/06/wsj_0677 0 11 [WORD] DT (NP* - - - - * (ARG3* * - nw/wsj/06/wsj_0677 0 12 [WORD] NN *) - - - - * *) * - nw/wsj/06/wsj_0677 0 13 [WORD] RB (NP(NP(QP* - - - - (MONEY* (ARG2* * - nw/wsj/06/wsj_0677 0 14 [WORD] $ * - - - - * * * - nw/wsj/06/wsj_0677 0 15 [WORD] CD *)) - - - - *) * * - nw/wsj/06/wsj_0677 0 16 [WORD] IN (PP* - - - - * * * - nw/wsj/06/wsj_0677 0 17 [WORD] NN (NP*)))))) - - - - * *) *) - nw/wsj/06/wsj_0677 0 18 [WORD] , * - - - - * * * - nw/wsj/06/wsj_0677 0 19 [WORD] NNP (NP* - - - - * * (ARG0* - nw/wsj/06/wsj_0677 0 20 [WORD] NNP *) - - - - (PERSON) * *) - nw/wsj/06/wsj_0677 0 21 [WORD] VBD (VP*) say 01 - - * * (V*) - nw/wsj/06/wsj_0677 0 22 [WORD] . *)) - - - - * * * - #end document
{ "pile_set_name": "Github" }
<?php /* * This file is part of the API Platform project. * * (c) Kévin Dunglas <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace ApiPlatform\Core\Tests\Bridge\NelmioApiDoc\Parser; use ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser; use ApiPlatform\Core\Exception\ResourceClassNotFoundException; use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface; use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface; use ApiPlatform\Core\Metadata\Property\PropertyMetadata; use ApiPlatform\Core\Metadata\Property\PropertyNameCollection; use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface; use ApiPlatform\Core\Metadata\Resource\ResourceMetadata; use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy; use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\RelatedDummy; use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\UnknownDummy; use ApiPlatform\Core\Tests\ProphecyTrait; use Doctrine\Common\Collections\Collection; use Nelmio\ApiDocBundle\DataTypes; use Nelmio\ApiDocBundle\Parser\ParserInterface; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Symfony\Component\PropertyInfo\Type; use Symfony\Component\Serializer\NameConverter\NameConverterInterface; use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; /** * @author Teoh Han Hui <[email protected]> * * @group legacy */ class ApiPlatformParserTest extends TestCase { use ProphecyTrait; /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testConstruct() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $this->assertInstanceOf(ParserInterface::class, $apiPlatformParser); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testSupports() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata())->shouldBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $this->assertTrue($apiPlatformParser->supports([ 'class' => sprintf('%s:%s', ApiPlatformParser::OUT_PREFIX, Dummy::class), ])); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testNoOnDataFirstArray() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata()); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $this->assertFalse($apiPlatformParser->supports([ 'class' => sprintf('%s', ApiPlatformParser::OUT_PREFIX), ])); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testSupportsAttributeNormalization() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create('Acme\CustomAttributeDummy')->willReturn(new ResourceMetadata('dummy', 'dummy', null, [ 'get' => ['method' => 'GET', 'normalization_context' => [AbstractNormalizer::GROUPS => ['custom_attr_dummy_get']]], 'put' => ['method' => 'PUT', 'denormalization_context' => [AbstractNormalizer::GROUPS => ['custom_attr_dummy_put']]], 'delete' => ['method' => 'DELETE'], ], []))->shouldBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactoryProphecy->create('Acme\CustomAttributeDummy', Argument::cetera())->willReturn(new PropertyNameCollection([ 'id', 'name', ]))->shouldBeCalled(); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $idPropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_INT, false)) ->withDescription('The id.') ->withReadable(true) ->withWritable(false) ->withRequired(true); $propertyMetadataFactoryProphecy->create('Acme\CustomAttributeDummy', 'id')->willReturn($idPropertyMetadata)->shouldBeCalled(); $namePropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_STRING, false)) ->withDescription('The dummy name.') ->withReadable(true) ->withWritable(true) ->withRequired(true); $propertyMetadataFactoryProphecy->create('Acme\CustomAttributeDummy', 'name')->willReturn($namePropertyMetadata)->shouldBeCalled(); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $actual = $apiPlatformParser->parse([ 'class' => sprintf('%s:%s:%s', ApiPlatformParser::OUT_PREFIX, 'Acme\CustomAttributeDummy', 'get'), ]); $this->assertEquals([ 'id' => [ 'dataType' => DataTypes::INTEGER, 'required' => false, 'description' => 'The id.', 'readonly' => true, ], 'name' => [ 'dataType' => DataTypes::STRING, 'required' => true, 'description' => 'The dummy name.', 'readonly' => false, ], ], $actual); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testSupportsUnknownResource() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(UnknownDummy::class)->willThrow(ResourceClassNotFoundException::class)->shouldBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $this->assertFalse($apiPlatformParser->supports([ 'class' => sprintf('%s:%s', ApiPlatformParser::OUT_PREFIX, UnknownDummy::class), ])); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testSupportsUnsupportedClassFormat() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(Argument::any())->shouldNotBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $this->assertFalse($apiPlatformParser->supports([ 'class' => Dummy::class, ])); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testParse() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata('dummy', 'dummy', null, [ 'get' => ['method' => 'GET', 'normalization_context' => [AbstractNormalizer::GROUPS => ['custom_attr_dummy_get']]], 'put' => ['method' => 'PUT', 'denormalization_context' => [AbstractNormalizer::GROUPS => ['custom_attr_dummy_put']]], 'gerard' => ['method' => 'get', 'path' => '/gerard', 'denormalization_context' => [AbstractNormalizer::GROUPS => ['custom_attr_dummy_put']]], 'delete' => ['method' => 'DELETE'], ], []))->shouldBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactoryProphecy->create(Dummy::class, Argument::cetera())->willReturn(new PropertyNameCollection([ 'id', 'name', 'dummyPrice', ]))->shouldBeCalled(); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $idPropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_INT, false)) ->withDescription('The id.') ->withReadable(true) ->withWritable(false) ->withRequired(true); $propertyMetadataFactoryProphecy->create(Dummy::class, 'id')->willReturn($idPropertyMetadata)->shouldBeCalled(); $namePropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_STRING, false)) ->withDescription('The dummy name.') ->withReadable(true) ->withWritable(true) ->withRequired(true); $propertyMetadataFactoryProphecy->create(Dummy::class, 'name')->willReturn($namePropertyMetadata)->shouldBeCalled(); $dummyPricePropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_FLOAT, true)) ->withDescription('A dummy price.') ->withReadable(true) ->withWritable(true) ->withRequired(false); $propertyMetadataFactoryProphecy->create(Dummy::class, 'dummyPrice')->willReturn($dummyPricePropertyMetadata)->shouldBeCalled(); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $actual = $apiPlatformParser->parse([ 'class' => sprintf('%s:%s:%s', ApiPlatformParser::OUT_PREFIX, Dummy::class, 'gerard'), ]); $this->assertEquals([ 'id' => [ 'dataType' => DataTypes::INTEGER, 'required' => false, 'description' => 'The id.', 'readonly' => true, ], 'name' => [ 'dataType' => DataTypes::STRING, 'required' => true, 'description' => 'The dummy name.', 'readonly' => false, ], 'dummyPrice' => [ 'dataType' => DataTypes::FLOAT, 'required' => false, 'description' => 'A dummy price.', 'readonly' => false, ], ], $actual); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testParseDateTime() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata('dummy', 'dummy', null, [], []))->shouldBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactoryProphecy->create(Dummy::class, Argument::cetera())->willReturn(new PropertyNameCollection([ 'dummyDate', ]))->shouldBeCalled(); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $dummyDatePropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_OBJECT, true, \DateTime::class)) ->withDescription('A dummy date.') ->withReadable(true) ->withWritable(true) ->withRequired(false); $propertyMetadataFactoryProphecy->create(Dummy::class, 'dummyDate')->willReturn($dummyDatePropertyMetadata)->shouldBeCalled(); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $actual = $apiPlatformParser->parse([ 'class' => sprintf('%s:%s:%s', ApiPlatformParser::OUT_PREFIX, Dummy::class, 'get'), ]); $this->assertEquals([ 'dummyDate' => [ 'dataType' => DataTypes::DATETIME, 'required' => false, 'description' => 'A dummy date.', 'readonly' => false, 'format' => sprintf('{DateTime %s}', \DateTime::RFC3339), ], ], $actual); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testParseRelation() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata('dummy', 'dummy', null, [], []))->shouldBeCalled(); $resourceMetadataFactoryProphecy->create(RelatedDummy::class)->willReturn(new ResourceMetadata())->shouldBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactoryProphecy->create(Dummy::class, Argument::cetera())->willReturn(new PropertyNameCollection([ 'relatedDummy', 'relatedDummies', ]))->shouldBeCalled(); $propertyNameCollectionFactoryProphecy->create(RelatedDummy::class, Argument::cetera())->willReturn(new PropertyNameCollection([ 'id', 'name', ]))->shouldBeCalled(); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $relatedDummyPropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_OBJECT, true, RelatedDummy::class)) ->withDescription('A related dummy.') ->withReadable(true) ->withWritable(true) ->withRequired(false); $propertyMetadataFactoryProphecy->create(Dummy::class, 'relatedDummy')->willReturn($relatedDummyPropertyMetadata)->shouldBeCalled(); $relatedDummiesPropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_OBJECT, false, Collection::class, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, RelatedDummy::class))) ->withDescription('Several dummies.') ->withReadable(true) ->withWritable(true) ->withReadableLink(true) ->withRequired(false); $propertyMetadataFactoryProphecy->create(Dummy::class, 'relatedDummies')->willReturn($relatedDummiesPropertyMetadata)->shouldBeCalled(); $idPropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_INT, false)) ->withReadable(true) ->withWritable(false) ->withRequired(true); $propertyMetadataFactoryProphecy->create(RelatedDummy::class, 'id')->willReturn($idPropertyMetadata)->shouldBeCalled(); $namePropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_STRING, false)) ->withDescription('A name.') ->withReadable(true) ->withWritable(true) ->withRequired(false); $propertyMetadataFactoryProphecy->create(RelatedDummy::class, 'name')->willReturn($namePropertyMetadata)->shouldBeCalled(); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $actual = $apiPlatformParser->parse([ 'class' => sprintf('%s:%s:%s', ApiPlatformParser::OUT_PREFIX, Dummy::class, 'get'), ]); $this->assertEquals([ 'relatedDummy' => [ 'dataType' => 'IRI', 'required' => false, 'description' => 'A related dummy.', 'readonly' => false, 'actualType' => DataTypes::STRING, ], 'relatedDummies' => [ 'dataType' => null, 'required' => false, 'description' => 'Several dummies.', 'readonly' => false, 'actualType' => DataTypes::COLLECTION, 'subType' => RelatedDummy::class, 'children' => [ 'id' => [ 'dataType' => DataTypes::INTEGER, 'required' => false, 'description' => null, 'readonly' => true, ], 'name' => [ 'dataType' => DataTypes::STRING, 'required' => false, 'description' => 'A name.', 'readonly' => false, ], ], ], ], $actual); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testParseWithNameConverter() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata('dummy', 'dummy', null, [], []))->shouldBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactoryProphecy->create(Dummy::class, Argument::cetera())->willReturn(new PropertyNameCollection([ 'nameConverted', ]))->shouldBeCalled(); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $nameConvertedPropertyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_STRING, true)) ->withDescription('A converted name') ->withReadable(true) ->withWritable(true) ->withRequired(false); $propertyMetadataFactoryProphecy->create(Dummy::class, 'nameConverted')->willReturn($nameConvertedPropertyMetadata)->shouldBeCalled(); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $nameConverterProphecy = $this->prophesize(NameConverterInterface::class); $nameConverterProphecy->normalize('nameConverted', Dummy::class)->willReturn('name_converted')->shouldBeCalled(); $nameConverter = $nameConverterProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory, $nameConverter); $actual = $apiPlatformParser->parse([ 'class' => sprintf('%s:%s:%s', ApiPlatformParser::OUT_PREFIX, Dummy::class, 'get'), ]); $this->assertEquals([ 'name_converted' => [ 'dataType' => DataTypes::STRING, 'required' => false, 'description' => 'A converted name', 'readonly' => false, ], ], $actual); } /** * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ public function testParseRecursive() { $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class); $resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata('dummy', 'dummy', null, [], []))->shouldBeCalled(); $resourceMetadataFactoryProphecy->create(RelatedDummy::class)->willReturn(new ResourceMetadata())->shouldBeCalled(); $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal(); $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class); $propertyNameCollectionFactoryProphecy->create(Dummy::class, Argument::cetera())->willReturn(new PropertyNameCollection([ 'relatedDummy', ]))->shouldBeCalled(); $propertyNameCollectionFactoryProphecy->create(RelatedDummy::class, Argument::cetera())->willReturn(new PropertyNameCollection([ 'dummy', ]))->shouldBeCalled(); $propertyNameCollectionFactory = $propertyNameCollectionFactoryProphecy->reveal(); $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class); $relatedDummyMetadatata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_OBJECT, true, RelatedDummy::class)) ->withDescription('A related Dummy.') ->withReadable(true) ->withReadableLink(true) ->withWritableLink(true) ->withWritable(true) ->withRequired(false); $propertyMetadataFactoryProphecy->create(Dummy::class, 'relatedDummy')->willReturn($relatedDummyMetadatata)->shouldBeCalled(); $dummyMetadata = (new PropertyMetadata()) ->withType(new Type(Type::BUILTIN_TYPE_OBJECT, true, Dummy::class)) ->withDescription('A Dummy.') ->withReadable(true) ->withWritable(true) ->withReadableLink(true) ->withWritableLink(true) ->withRequired(false); $propertyMetadataFactoryProphecy->create(RelatedDummy::class, 'dummy')->willReturn($dummyMetadata)->shouldBeCalled(); $propertyMetadataFactory = $propertyMetadataFactoryProphecy->reveal(); $apiPlatformParser = new ApiPlatformParser($resourceMetadataFactory, $propertyNameCollectionFactory, $propertyMetadataFactory); $actual = $apiPlatformParser->parse([ 'class' => sprintf('%s:%s:%s', ApiPlatformParser::OUT_PREFIX, Dummy::class, 'get'), ]); $this->assertEquals([ 'relatedDummy' => [ 'dataType' => null, 'required' => false, 'description' => 'A related Dummy.', 'readonly' => false, 'actualType' => 'model', 'subType' => RelatedDummy::class, 'children' => [ 'dummy' => [ 'dataType' => null, 'required' => false, 'description' => 'A Dummy.', 'readonly' => false, 'actualType' => 'model', 'subType' => Dummy::class, 'children' => [], ], ], ], ], $actual); } }
{ "pile_set_name": "Github" }
/* * Allwinner H3 SoCs pinctrl driver. * * Copyright (C) 2016 Krzysztof Adamski <[email protected]> * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/pinctrl/pinctrl.h> #include "pinctrl-sunxi.h" static const struct sunxi_desc_pin sun8i_h3_r_pins[] = { SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_i2c"), /* SCK */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PL_EINT0 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_i2c"), /* SDA */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PL_EINT1 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_uart"), /* TX */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PL_EINT2 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 3), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_uart"), /* RX */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PL_EINT3 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 4), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_jtag"), /* MS */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PL_EINT4 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 5), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_jtag"), /* CK */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PL_EINT5 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 6), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_jtag"), /* DO */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PL_EINT6 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 7), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_jtag"), /* DI */ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PL_EINT7 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 8), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PL_EINT8 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 9), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PL_EINT9 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 10), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_pwm"), SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PL_EINT10 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 11), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), SUNXI_FUNCTION(0x2, "s_cir_rx"), SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PL_EINT11 */ }; static const struct sunxi_pinctrl_desc sun8i_h3_r_pinctrl_data = { .pins = sun8i_h3_r_pins, .npins = ARRAY_SIZE(sun8i_h3_r_pins), .irq_banks = 1, .pin_base = PL_BASE, .irq_read_needs_mux = true, .disable_strict_mode = true, }; static int sun8i_h3_r_pinctrl_probe(struct platform_device *pdev) { return sunxi_pinctrl_init(pdev, &sun8i_h3_r_pinctrl_data); } static const struct of_device_id sun8i_h3_r_pinctrl_match[] = { { .compatible = "allwinner,sun8i-h3-r-pinctrl", }, {} }; static struct platform_driver sun8i_h3_r_pinctrl_driver = { .probe = sun8i_h3_r_pinctrl_probe, .driver = { .name = "sun8i-h3-r-pinctrl", .of_match_table = sun8i_h3_r_pinctrl_match, }, }; builtin_platform_driver(sun8i_h3_r_pinctrl_driver);
{ "pile_set_name": "Github" }
[ { "clientId": "_clientId_0", "name": "core/social-link", "isValid": true, "attributes": { "url": "https://example.com/", "service": "flickr" }, "innerBlocks": [], "originalContent": "" } ]
{ "pile_set_name": "Github" }
//===-- llvm/System/DynamicLibrary.h - Portable Dynamic Library -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file declares the sys::DynamicLibrary class. // //===----------------------------------------------------------------------===// #ifndef LLVM_SYSTEM_DYNAMIC_LIBRARY_H #define LLVM_SYSTEM_DYNAMIC_LIBRARY_H #include <string> namespace llvm { namespace sys { /// This class provides a portable interface to dynamic libraries which also /// might be known as shared libraries, shared objects, dynamic shared /// objects, or dynamic link libraries. Regardless of the terminology or the /// operating system interface, this class provides a portable interface that /// allows dynamic libraries to be loaded and searched for externally /// defined symbols. This is typically used to provide "plug-in" support. /// It also allows for symbols to be defined which don't live in any library, /// but rather the main program itself, useful on Windows where the main /// executable cannot be searched. class DynamicLibrary { DynamicLibrary(); // DO NOT IMPLEMENT public: /// This function allows a library to be loaded without instantiating a /// DynamicLibrary object. Consequently, it is marked as being permanent /// and will only be unloaded when the program terminates. This returns /// false on success or returns true and fills in *ErrMsg on failure. /// @brief Open a dynamic library permanently. /// /// NOTE: This function is not thread safe. /// static bool LoadLibraryPermanently(const char *filename, std::string *ErrMsg = 0); /// This function will search through all previously loaded dynamic /// libraries for the symbol \p symbolName. If it is found, the addressof /// that symbol is returned. If not, null is returned. Note that this will /// search permanently loaded libraries (LoadLibraryPermanently) as well /// as ephemerally loaded libraries (constructors). /// @throws std::string on error. /// @brief Search through libraries for address of a symbol /// /// NOTE: This function is not thread safe. /// static void *SearchForAddressOfSymbol(const char *symbolName); /// @brief Convenience function for C++ophiles. /// /// NOTE: This function is not thread safe. /// static void *SearchForAddressOfSymbol(const std::string &symbolName) { return SearchForAddressOfSymbol(symbolName.c_str()); } /// This functions permanently adds the symbol \p symbolName with the /// value \p symbolValue. These symbols are searched before any /// libraries. /// @brief Add searchable symbol/value pair. /// /// NOTE: This function is not thread safe. /// static void AddSymbol(const char *symbolName, void *symbolValue); /// @brief Convenience function for C++ophiles. /// /// NOTE: This function is not thread safe. /// static void AddSymbol(const std::string &symbolName, void *symbolValue) { AddSymbol(symbolName.c_str(), symbolValue); } }; } // End sys namespace } // End llvm namespace #endif // LLVM_SYSTEM_DYNAMIC_LIBRARY_H
{ "pile_set_name": "Github" }
// go run mkasm_darwin.go amd64 // Code generated by the command above; DO NOT EDIT. // +build go1.13 #include "textflag.h" TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 JMP libc_fdopendir(SB) TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 JMP libc_closedir(SB) TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 JMP libc_readdir_r(SB)
{ "pile_set_name": "Github" }
// +build !go1.7 package tlsconfig import ( "crypto/x509" ) // SystemCertPool returns an new empty cert pool, // accessing system cert pool is supported in go 1.7 func SystemCertPool() (*x509.CertPool, error) { return x509.NewCertPool(), nil }
{ "pile_set_name": "Github" }
/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) Blender Foundation * All rights reserved. */ /** \file * \ingroup bph */ #pragma once #ifdef __cplusplus extern "C" { #endif struct ClothModifierData; struct Depsgraph; struct Implicit_Data; struct ListBase; struct Object; typedef enum eMassSpringSolverStatus { SIM_SOLVER_SUCCESS = (1 << 0), SIM_SOLVER_NUMERICAL_ISSUE = (1 << 1), SIM_SOLVER_NO_CONVERGENCE = (1 << 2), SIM_SOLVER_INVALID_INPUT = (1 << 3), } eMassSpringSolverStatus; struct Implicit_Data *SIM_mass_spring_solver_create(int numverts, int numsprings); void SIM_mass_spring_solver_free(struct Implicit_Data *id); int SIM_mass_spring_solver_numvert(struct Implicit_Data *id); int SIM_cloth_solver_init(struct Object *ob, struct ClothModifierData *clmd); void SIM_cloth_solver_free(struct ClothModifierData *clmd); int SIM_cloth_solve(struct Depsgraph *depsgraph, struct Object *ob, float frame, struct ClothModifierData *clmd, struct ListBase *effectors); void SIM_cloth_solver_set_positions(struct ClothModifierData *clmd); void SIM_cloth_solver_set_volume(ClothModifierData *clmd); #ifdef __cplusplus } #endif
{ "pile_set_name": "Github" }
{% extends "base.html" %} {% load static %} {% block content %} <div class="container"> <form class="form-horizontal" enctype="multipart/form-data" method="post" action="{% url 'gather_edit_event' location.slug event_id event_slug %}">{% csrf_token %} {% include "snippets/event_form_body.html" %} <input id="submit-event" type="submit" class="btn" value="Submit"> </form> </div> {% endblock %} {% block extrajs %} <script type="text/javascript" src="{% static 'js/jquery-ui-timepicker-addon.js' %}"></script> <script> {% include "snippets/js/organizers_autocomplete.js" %} $('#id_start').datetimepicker({ controlType: 'select' }); $('#id_end').datetimepicker({ controlType: 'select' }); clean_slug_value = function(e) { // make sure there's only letters, numbers and hyphens by removing // special characters, and replace spaces with hyphens (making sure // only one hyphen in a row). force the slug to lowercase. str = $(e.data.elem_id).val(); slugified = str.replace(/[^\d\w\- ]/g, "").replace(/ /g,"-").replace(/-{2,}/, "-").toLowerCase(); // check max length if (slugified.length > 50) { slugified = slugified.substring(0,50); } // make sure there's no trailing hyphens (after trimming, because that // will change the last character) slugified = slugified.replace(/-$/, ""); $("#id_slug").val(slugified); return false; }; $("#id_title").on('input', {'elem_id': "#id_title"}, clean_slug_value); $("#id_slug").focusout({'elem_id': "#id_slug"}, clean_slug_value) </script> {% endblock %}
{ "pile_set_name": "Github" }
#!/bin/bash # Script Name : transfer_script.sh # Author : Craig Richards # Created : 18-July-2012 # Last Modified : # Version : 1.0 # Modifications : # Description : This will send a given script to a certain server once prompted, if it can't find the script it searches for scripts with a similar name ################################# # Start of procedures/functions # ################################# funct_check_params() { if [ ${NARG} -lt 1 ]; then echo "Usage: $0 argument" echo "Argument = Script Name" exit 1 elif # If the argument passed is -h or --h then display the following message in the echo statement [[ ${script_name} = "-h" ]] || [[ ${script_name} = "--h" ]]; then echo "Usage: $0 argument" echo "Argument = Script Name" exit 1 # Quit the program fi # End of the if statement } # End of the function funct_copy_file() { if [ ! -z $transfer_file ]; then read -p "What server to you want to copy the file to : " SERVER echo "Sending $transfer_file to $SERVER in /tmp" scp $transfer_file $SERVER:/tmp else echo -e "File does not exist \n" echo -e "A search for similar files shows :" no_ext=`echo $script_name | cut -f1 -d.` #echo $no_ext new_search=`find ${scripts} -name *$no_ext* -print > /tmp/cr_list.txt` ; export new_search for files in $(cat /tmp/cr_list.txt) do new_files=`basename $files` echo $new_files done echo -e "\nWould you like to use one of these scripts? If so re-run the script and pass the correct script" fi } ################ # Main Program # ################ # Variable Settings script_name=$1 ; export script_name scripts=/export/home/craigdba/unicle/scripts ; export scripts transfer_file=`find ${scripts} -name ${1} -print` ; export transfer_file NARG=$# { funct_check_params funct_copy_file } ## End of Script
{ "pile_set_name": "Github" }
/* * Copyright (C) 2007 Marco Gerards <[email protected]> * Copyright (C) 2009 David Conrad * Copyright (C) 2011 Jordi Ortiz * * This file is part of FFmpeg. * * FFmpeg 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 2.1 of the License, or (at your option) any later version. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * Dirac Decoder * @author Marco Gerards <[email protected]>, David Conrad, Jordi Ortiz <[email protected]> */ #include "avcodec.h" #include "get_bits.h" #include "bytestream.h" #include "internal.h" #include "golomb.h" #include "dirac_arith.h" #include "mpeg12data.h" #include "libavcodec/mpegvideo.h" #include "mpegvideoencdsp.h" #include "dirac_dwt.h" #include "dirac.h" #include "diracdsp.h" #include "videodsp.h" // for ff_emulated_edge_mc_8 /** * The spec limits the number of wavelet decompositions to 4 for both * level 1 (VC-2) and 128 (long-gop default). * 5 decompositions is the maximum before >16-bit buffers are needed. * Schroedinger allows this for DD 9,7 and 13,7 wavelets only, limiting * the others to 4 decompositions (or 3 for the fidelity filter). * * We use this instead of MAX_DECOMPOSITIONS to save some memory. */ #define MAX_DWT_LEVELS 5 /** * The spec limits this to 3 for frame coding, but in practice can be as high as 6 */ #define MAX_REFERENCE_FRAMES 8 #define MAX_DELAY 5 /* limit for main profile for frame coding (TODO: field coding) */ #define MAX_FRAMES (MAX_REFERENCE_FRAMES + MAX_DELAY + 1) #define MAX_QUANT 68 /* max quant for VC-2 */ #define MAX_BLOCKSIZE 32 /* maximum xblen/yblen we support */ /** * DiracBlock->ref flags, if set then the block does MC from the given ref */ #define DIRAC_REF_MASK_REF1 1 #define DIRAC_REF_MASK_REF2 2 #define DIRAC_REF_MASK_GLOBAL 4 /** * Value of Picture.reference when Picture is not a reference picture, but * is held for delayed output. */ #define DELAYED_PIC_REF 4 #define ff_emulated_edge_mc ff_emulated_edge_mc_8 /* Fix: change the calls to this function regarding bit depth */ #define CALC_PADDING(size, depth) \ (((size + (1 << depth) - 1) >> depth) << depth) #define DIVRNDUP(a, b) (((a) + (b) - 1) / (b)) typedef struct { AVFrame *avframe; int interpolated[3]; /* 1 if hpel[] is valid */ uint8_t *hpel[3][4]; uint8_t *hpel_base[3][4]; } DiracFrame; typedef struct { union { int16_t mv[2][2]; int16_t dc[3]; } u; /* anonymous unions aren't in C99 :( */ uint8_t ref; } DiracBlock; typedef struct SubBand { int level; int orientation; int stride; int width; int height; int quant; IDWTELEM *ibuf; struct SubBand *parent; /* for low delay */ unsigned length; const uint8_t *coeff_data; } SubBand; typedef struct Plane { int width; int height; ptrdiff_t stride; int idwt_width; int idwt_height; int idwt_stride; IDWTELEM *idwt_buf; IDWTELEM *idwt_buf_base; IDWTELEM *idwt_tmp; /* block length */ uint8_t xblen; uint8_t yblen; /* block separation (block n+1 starts after this many pixels in block n) */ uint8_t xbsep; uint8_t ybsep; /* amount of overspill on each edge (half of the overlap between blocks) */ uint8_t xoffset; uint8_t yoffset; SubBand band[MAX_DWT_LEVELS][4]; } Plane; typedef struct DiracContext { AVCodecContext *avctx; MpegvideoEncDSPContext mpvencdsp; DiracDSPContext diracdsp; GetBitContext gb; dirac_source_params source; int seen_sequence_header; int frame_number; /* number of the next frame to display */ Plane plane[3]; int chroma_x_shift; int chroma_y_shift; int zero_res; /* zero residue flag */ int is_arith; /* whether coeffs use arith or golomb coding */ int low_delay; /* use the low delay syntax */ int globalmc_flag; /* use global motion compensation */ int num_refs; /* number of reference pictures */ /* wavelet decoding */ unsigned wavelet_depth; /* depth of the IDWT */ unsigned wavelet_idx; /** * schroedinger older than 1.0.8 doesn't store * quant delta if only one codebook exists in a band */ unsigned old_delta_quant; unsigned codeblock_mode; struct { unsigned width; unsigned height; } codeblock[MAX_DWT_LEVELS+1]; struct { unsigned num_x; /* number of horizontal slices */ unsigned num_y; /* number of vertical slices */ AVRational bytes; /* average bytes per slice */ uint8_t quant[MAX_DWT_LEVELS][4]; /* [DIRAC_STD] E.1 */ } lowdelay; struct { int pan_tilt[2]; /* pan/tilt vector */ int zrs[2][2]; /* zoom/rotate/shear matrix */ int perspective[2]; /* perspective vector */ unsigned zrs_exp; unsigned perspective_exp; } globalmc[2]; /* motion compensation */ uint8_t mv_precision; /* [DIRAC_STD] REFS_WT_PRECISION */ int16_t weight[2]; /* [DIRAC_STD] REF1_WT and REF2_WT */ unsigned weight_log2denom; /* [DIRAC_STD] REFS_WT_PRECISION */ int blwidth; /* number of blocks (horizontally) */ int blheight; /* number of blocks (vertically) */ int sbwidth; /* number of superblocks (horizontally) */ int sbheight; /* number of superblocks (vertically) */ uint8_t *sbsplit; DiracBlock *blmotion; uint8_t *edge_emu_buffer[4]; uint8_t *edge_emu_buffer_base; uint16_t *mctmp; /* buffer holding the MC data multiplied by OBMC weights */ uint8_t *mcscratch; int buffer_stride; DECLARE_ALIGNED(16, uint8_t, obmc_weight)[3][MAX_BLOCKSIZE*MAX_BLOCKSIZE]; void (*put_pixels_tab[4])(uint8_t *dst, const uint8_t *src[5], int stride, int h); void (*avg_pixels_tab[4])(uint8_t *dst, const uint8_t *src[5], int stride, int h); void (*add_obmc)(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); dirac_weight_func weight_func; dirac_biweight_func biweight_func; DiracFrame *current_picture; DiracFrame *ref_pics[2]; DiracFrame *ref_frames[MAX_REFERENCE_FRAMES+1]; DiracFrame *delay_frames[MAX_DELAY+1]; DiracFrame all_frames[MAX_FRAMES]; } DiracContext; /** * Dirac Specification -> * Parse code values. 9.6.1 Table 9.1 */ enum dirac_parse_code { pc_seq_header = 0x00, pc_eos = 0x10, pc_aux_data = 0x20, pc_padding = 0x30, }; enum dirac_subband { subband_ll = 0, subband_hl = 1, subband_lh = 2, subband_hh = 3 }; static const uint8_t default_qmat[][4][4] = { { { 5, 3, 3, 0}, { 0, 4, 4, 1}, { 0, 5, 5, 2}, { 0, 6, 6, 3} }, { { 4, 2, 2, 0}, { 0, 4, 4, 2}, { 0, 5, 5, 3}, { 0, 7, 7, 5} }, { { 5, 3, 3, 0}, { 0, 4, 4, 1}, { 0, 5, 5, 2}, { 0, 6, 6, 3} }, { { 8, 4, 4, 0}, { 0, 4, 4, 0}, { 0, 4, 4, 0}, { 0, 4, 4, 0} }, { { 8, 4, 4, 0}, { 0, 4, 4, 0}, { 0, 4, 4, 0}, { 0, 4, 4, 0} }, { { 0, 4, 4, 8}, { 0, 8, 8, 12}, { 0, 13, 13, 17}, { 0, 17, 17, 21} }, { { 3, 1, 1, 0}, { 0, 4, 4, 2}, { 0, 6, 6, 5}, { 0, 9, 9, 7} }, }; static const int qscale_tab[MAX_QUANT+1] = { 4, 5, 6, 7, 8, 10, 11, 13, 16, 19, 23, 27, 32, 38, 45, 54, 64, 76, 91, 108, 128, 152, 181, 215, 256, 304, 362, 431, 512, 609, 724, 861, 1024, 1218, 1448, 1722, 2048, 2435, 2896, 3444, 4096, 4871, 5793, 6889, 8192, 9742, 11585, 13777, 16384, 19484, 23170, 27554, 32768, 38968, 46341, 55109, 65536, 77936 }; static const int qoffset_intra_tab[MAX_QUANT+1] = { 1, 2, 3, 4, 4, 5, 6, 7, 8, 10, 12, 14, 16, 19, 23, 27, 32, 38, 46, 54, 64, 76, 91, 108, 128, 152, 181, 216, 256, 305, 362, 431, 512, 609, 724, 861, 1024, 1218, 1448, 1722, 2048, 2436, 2897, 3445, 4096, 4871, 5793, 6889, 8192, 9742, 11585, 13777, 16384, 19484, 23171, 27555, 32768, 38968 }; static const int qoffset_inter_tab[MAX_QUANT+1] = { 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 9, 10, 12, 14, 17, 20, 24, 29, 34, 41, 48, 57, 68, 81, 96, 114, 136, 162, 192, 228, 272, 323, 384, 457, 543, 646, 768, 913, 1086, 1292, 1536, 1827, 2172, 2583, 3072, 3653, 4344, 5166, 6144, 7307, 8689, 10333, 12288, 14613, 17378, 20666, 24576, 29226 }; /* magic number division by 3 from schroedinger */ static inline int divide3(int x) { return ((x+1)*21845 + 10922) >> 16; } static DiracFrame *remove_frame(DiracFrame *framelist[], int picnum) { DiracFrame *remove_pic = NULL; int i, remove_idx = -1; for (i = 0; framelist[i]; i++) if (framelist[i]->avframe->display_picture_number == picnum) { remove_pic = framelist[i]; remove_idx = i; } if (remove_pic) for (i = remove_idx; framelist[i]; i++) framelist[i] = framelist[i+1]; return remove_pic; } static int add_frame(DiracFrame *framelist[], int maxframes, DiracFrame *frame) { int i; for (i = 0; i < maxframes; i++) if (!framelist[i]) { framelist[i] = frame; return 0; } return -1; } static int alloc_sequence_buffers(DiracContext *s) { int sbwidth = DIVRNDUP(s->source.width, 4); int sbheight = DIVRNDUP(s->source.height, 4); int i, w, h, top_padding; /* todo: think more about this / use or set Plane here */ for (i = 0; i < 3; i++) { int max_xblen = MAX_BLOCKSIZE >> (i ? s->chroma_x_shift : 0); int max_yblen = MAX_BLOCKSIZE >> (i ? s->chroma_y_shift : 0); w = s->source.width >> (i ? s->chroma_x_shift : 0); h = s->source.height >> (i ? s->chroma_y_shift : 0); /* we allocate the max we support here since num decompositions can * change from frame to frame. Stride is aligned to 16 for SIMD, and * 1<<MAX_DWT_LEVELS top padding to avoid if(y>0) in arith decoding * MAX_BLOCKSIZE padding for MC: blocks can spill up to half of that * on each side */ top_padding = FFMAX(1<<MAX_DWT_LEVELS, max_yblen/2); w = FFALIGN(CALC_PADDING(w, MAX_DWT_LEVELS), 8); /* FIXME: Should this be 16 for SSE??? */ h = top_padding + CALC_PADDING(h, MAX_DWT_LEVELS) + max_yblen/2; s->plane[i].idwt_buf_base = av_mallocz_array((w+max_xblen), h * sizeof(IDWTELEM)); s->plane[i].idwt_tmp = av_malloc_array((w+16), sizeof(IDWTELEM)); s->plane[i].idwt_buf = s->plane[i].idwt_buf_base + top_padding*w; if (!s->plane[i].idwt_buf_base || !s->plane[i].idwt_tmp) return AVERROR(ENOMEM); } /* fixme: allocate using real stride here */ s->sbsplit = av_malloc_array(sbwidth, sbheight); s->blmotion = av_malloc_array(sbwidth, sbheight * 16 * sizeof(*s->blmotion)); if (!s->sbsplit || !s->blmotion) return AVERROR(ENOMEM); return 0; } static int alloc_buffers(DiracContext *s, int stride) { int w = s->source.width; int h = s->source.height; av_assert0(stride >= w); stride += 64; if (s->buffer_stride >= stride) return 0; s->buffer_stride = 0; av_freep(&s->edge_emu_buffer_base); memset(s->edge_emu_buffer, 0, sizeof(s->edge_emu_buffer)); av_freep(&s->mctmp); av_freep(&s->mcscratch); s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE); s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp)); s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE); if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch) return AVERROR(ENOMEM); s->buffer_stride = stride; return 0; } static void free_sequence_buffers(DiracContext *s) { int i, j, k; for (i = 0; i < MAX_FRAMES; i++) { if (s->all_frames[i].avframe->data[0]) { av_frame_unref(s->all_frames[i].avframe); memset(s->all_frames[i].interpolated, 0, sizeof(s->all_frames[i].interpolated)); } for (j = 0; j < 3; j++) for (k = 1; k < 4; k++) av_freep(&s->all_frames[i].hpel_base[j][k]); } memset(s->ref_frames, 0, sizeof(s->ref_frames)); memset(s->delay_frames, 0, sizeof(s->delay_frames)); for (i = 0; i < 3; i++) { av_freep(&s->plane[i].idwt_buf_base); av_freep(&s->plane[i].idwt_tmp); } s->buffer_stride = 0; av_freep(&s->sbsplit); av_freep(&s->blmotion); av_freep(&s->edge_emu_buffer_base); av_freep(&s->mctmp); av_freep(&s->mcscratch); } static av_cold int dirac_decode_init(AVCodecContext *avctx) { DiracContext *s = avctx->priv_data; int i; s->avctx = avctx; s->frame_number = -1; ff_diracdsp_init(&s->diracdsp); ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); for (i = 0; i < MAX_FRAMES; i++) { s->all_frames[i].avframe = av_frame_alloc(); if (!s->all_frames[i].avframe) { while (i > 0) av_frame_free(&s->all_frames[--i].avframe); return AVERROR(ENOMEM); } } return 0; } static void dirac_decode_flush(AVCodecContext *avctx) { DiracContext *s = avctx->priv_data; free_sequence_buffers(s); s->seen_sequence_header = 0; s->frame_number = -1; } static av_cold int dirac_decode_end(AVCodecContext *avctx) { DiracContext *s = avctx->priv_data; int i; dirac_decode_flush(avctx); for (i = 0; i < MAX_FRAMES; i++) av_frame_free(&s->all_frames[i].avframe); return 0; } #define SIGN_CTX(x) (CTX_SIGN_ZERO + ((x) > 0) - ((x) < 0)) static inline void coeff_unpack_arith(DiracArith *c, int qfactor, int qoffset, SubBand *b, IDWTELEM *buf, int x, int y) { int coeff, sign; int sign_pred = 0; int pred_ctx = CTX_ZPZN_F1; /* Check if the parent subband has a 0 in the corresponding position */ if (b->parent) pred_ctx += !!b->parent->ibuf[b->parent->stride * (y>>1) + (x>>1)] << 1; if (b->orientation == subband_hl) sign_pred = buf[-b->stride]; /* Determine if the pixel has only zeros in its neighbourhood */ if (x) { pred_ctx += !(buf[-1] | buf[-b->stride] | buf[-1-b->stride]); if (b->orientation == subband_lh) sign_pred = buf[-1]; } else { pred_ctx += !buf[-b->stride]; } coeff = dirac_get_arith_uint(c, pred_ctx, CTX_COEFF_DATA); if (coeff) { coeff = (coeff * qfactor + qoffset + 2) >> 2; sign = dirac_get_arith_bit(c, SIGN_CTX(sign_pred)); coeff = (coeff ^ -sign) + sign; } *buf = coeff; } static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset) { int sign, coeff; coeff = svq3_get_ue_golomb(gb); if (coeff) { coeff = (coeff * qfactor + qoffset + 2) >> 2; sign = get_bits1(gb); coeff = (coeff ^ -sign) + sign; } return coeff; } /** * Decode the coeffs in the rectangle defined by left, right, top, bottom * [DIRAC_STD] 13.4.3.2 Codeblock unpacking loop. codeblock() */ static inline void codeblock(DiracContext *s, SubBand *b, GetBitContext *gb, DiracArith *c, int left, int right, int top, int bottom, int blockcnt_one, int is_arith) { int x, y, zero_block; int qoffset, qfactor; IDWTELEM *buf; /* check for any coded coefficients in this codeblock */ if (!blockcnt_one) { if (is_arith) zero_block = dirac_get_arith_bit(c, CTX_ZERO_BLOCK); else zero_block = get_bits1(gb); if (zero_block) return; } if (s->codeblock_mode && !(s->old_delta_quant && blockcnt_one)) { int quant = b->quant; if (is_arith) quant += dirac_get_arith_int(c, CTX_DELTA_Q_F, CTX_DELTA_Q_DATA); else quant += dirac_get_se_golomb(gb); if (quant < 0) { av_log(s->avctx, AV_LOG_ERROR, "Invalid quant\n"); return; } b->quant = quant; } b->quant = FFMIN(b->quant, MAX_QUANT); qfactor = qscale_tab[b->quant]; /* TODO: context pointer? */ if (!s->num_refs) qoffset = qoffset_intra_tab[b->quant]; else qoffset = qoffset_inter_tab[b->quant]; buf = b->ibuf + top * b->stride; for (y = top; y < bottom; y++) { for (x = left; x < right; x++) { /* [DIRAC_STD] 13.4.4 Subband coefficients. coeff_unpack() */ if (is_arith) coeff_unpack_arith(c, qfactor, qoffset, b, buf+x, x, y); else buf[x] = coeff_unpack_golomb(gb, qfactor, qoffset); } buf += b->stride; } } /** * Dirac Specification -> * 13.3 intra_dc_prediction(band) */ static inline void intra_dc_prediction(SubBand *b) { IDWTELEM *buf = b->ibuf; int x, y; for (x = 1; x < b->width; x++) buf[x] += buf[x-1]; buf += b->stride; for (y = 1; y < b->height; y++) { buf[0] += buf[-b->stride]; for (x = 1; x < b->width; x++) { int pred = buf[x - 1] + buf[x - b->stride] + buf[x - b->stride-1]; buf[x] += divide3(pred); } buf += b->stride; } } /** * Dirac Specification -> * 13.4.2 Non-skipped subbands. subband_coeffs() */ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b, int is_arith) { int cb_x, cb_y, left, right, top, bottom; DiracArith c; GetBitContext gb; int cb_width = s->codeblock[b->level + (b->orientation != subband_ll)].width; int cb_height = s->codeblock[b->level + (b->orientation != subband_ll)].height; int blockcnt_one = (cb_width + cb_height) == 2; if (!b->length) return; init_get_bits8(&gb, b->coeff_data, b->length); if (is_arith) ff_dirac_init_arith_decoder(&c, &gb, b->length); top = 0; for (cb_y = 0; cb_y < cb_height; cb_y++) { bottom = (b->height * (cb_y+1)) / cb_height; left = 0; for (cb_x = 0; cb_x < cb_width; cb_x++) { right = (b->width * (cb_x+1)) / cb_width; codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith); left = right; } top = bottom; } if (b->orientation == subband_ll && s->num_refs == 0) intra_dc_prediction(b); } static int decode_subband_arith(AVCodecContext *avctx, void *b) { DiracContext *s = avctx->priv_data; decode_subband_internal(s, b, 1); return 0; } static int decode_subband_golomb(AVCodecContext *avctx, void *arg) { DiracContext *s = avctx->priv_data; SubBand **b = arg; decode_subband_internal(s, *b, 0); return 0; } /** * Dirac Specification -> * [DIRAC_STD] 13.4.1 core_transform_data() */ static void decode_component(DiracContext *s, int comp) { AVCodecContext *avctx = s->avctx; SubBand *bands[3*MAX_DWT_LEVELS+1]; enum dirac_subband orientation; int level, num_bands = 0; /* Unpack all subbands at all levels. */ for (level = 0; level < s->wavelet_depth; level++) { for (orientation = !!level; orientation < 4; orientation++) { SubBand *b = &s->plane[comp].band[level][orientation]; bands[num_bands++] = b; align_get_bits(&s->gb); /* [DIRAC_STD] 13.4.2 subband() */ b->length = svq3_get_ue_golomb(&s->gb); if (b->length) { b->quant = svq3_get_ue_golomb(&s->gb); align_get_bits(&s->gb); b->coeff_data = s->gb.buffer + get_bits_count(&s->gb)/8; b->length = FFMIN(b->length, FFMAX(get_bits_left(&s->gb)/8, 0)); skip_bits_long(&s->gb, b->length*8); } } /* arithmetic coding has inter-level dependencies, so we can only execute one level at a time */ if (s->is_arith) avctx->execute(avctx, decode_subband_arith, &s->plane[comp].band[level][!!level], NULL, 4-!!level, sizeof(SubBand)); } /* golomb coding has no inter-level dependencies, so we can execute all subbands in parallel */ if (!s->is_arith) avctx->execute(avctx, decode_subband_golomb, bands, NULL, num_bands, sizeof(SubBand*)); } /* [DIRAC_STD] 13.5.5.2 Luma slice subband data. luma_slice_band(level,orient,sx,sy) --> if b2 == NULL */ /* [DIRAC_STD] 13.5.5.3 Chroma slice subband data. chroma_slice_band(level,orient,sx,sy) --> if b2 != NULL */ static void lowdelay_subband(DiracContext *s, GetBitContext *gb, int quant, int slice_x, int slice_y, int bits_end, SubBand *b1, SubBand *b2) { int left = b1->width * slice_x / s->lowdelay.num_x; int right = b1->width *(slice_x+1) / s->lowdelay.num_x; int top = b1->height * slice_y / s->lowdelay.num_y; int bottom = b1->height *(slice_y+1) / s->lowdelay.num_y; int qfactor = qscale_tab[FFMIN(quant, MAX_QUANT)]; int qoffset = qoffset_intra_tab[FFMIN(quant, MAX_QUANT)]; IDWTELEM *buf1 = b1->ibuf + top * b1->stride; IDWTELEM *buf2 = b2 ? b2->ibuf + top * b2->stride : NULL; int x, y; /* we have to constantly check for overread since the spec explicitly requires this, with the meaning that all remaining coeffs are set to 0 */ if (get_bits_count(gb) >= bits_end) return; for (y = top; y < bottom; y++) { for (x = left; x < right; x++) { buf1[x] = coeff_unpack_golomb(gb, qfactor, qoffset); if (get_bits_count(gb) >= bits_end) return; if (buf2) { buf2[x] = coeff_unpack_golomb(gb, qfactor, qoffset); if (get_bits_count(gb) >= bits_end) return; } } buf1 += b1->stride; if (buf2) buf2 += b2->stride; } } struct lowdelay_slice { GetBitContext gb; int slice_x; int slice_y; int bytes; }; /** * Dirac Specification -> * 13.5.2 Slices. slice(sx,sy) */ static int decode_lowdelay_slice(AVCodecContext *avctx, void *arg) { DiracContext *s = avctx->priv_data; struct lowdelay_slice *slice = arg; GetBitContext *gb = &slice->gb; enum dirac_subband orientation; int level, quant, chroma_bits, chroma_end; int quant_base = get_bits(gb, 7); /*[DIRAC_STD] qindex */ int length_bits = av_log2(8 * slice->bytes)+1; int luma_bits = get_bits_long(gb, length_bits); int luma_end = get_bits_count(gb) + FFMIN(luma_bits, get_bits_left(gb)); /* [DIRAC_STD] 13.5.5.2 luma_slice_band */ for (level = 0; level < s->wavelet_depth; level++) for (orientation = !!level; orientation < 4; orientation++) { quant = FFMAX(quant_base - s->lowdelay.quant[level][orientation], 0); lowdelay_subband(s, gb, quant, slice->slice_x, slice->slice_y, luma_end, &s->plane[0].band[level][orientation], NULL); } /* consume any unused bits from luma */ skip_bits_long(gb, get_bits_count(gb) - luma_end); chroma_bits = 8*slice->bytes - 7 - length_bits - luma_bits; chroma_end = get_bits_count(gb) + FFMIN(chroma_bits, get_bits_left(gb)); /* [DIRAC_STD] 13.5.5.3 chroma_slice_band */ for (level = 0; level < s->wavelet_depth; level++) for (orientation = !!level; orientation < 4; orientation++) { quant = FFMAX(quant_base - s->lowdelay.quant[level][orientation], 0); lowdelay_subband(s, gb, quant, slice->slice_x, slice->slice_y, chroma_end, &s->plane[1].band[level][orientation], &s->plane[2].band[level][orientation]); } return 0; } /** * Dirac Specification -> * 13.5.1 low_delay_transform_data() */ static void decode_lowdelay(DiracContext *s) { AVCodecContext *avctx = s->avctx; int slice_x, slice_y, bytes, bufsize; const uint8_t *buf; struct lowdelay_slice *slices; int slice_num = 0; slices = av_mallocz_array(s->lowdelay.num_x, s->lowdelay.num_y * sizeof(struct lowdelay_slice)); align_get_bits(&s->gb); /*[DIRAC_STD] 13.5.2 Slices. slice(sx,sy) */ buf = s->gb.buffer + get_bits_count(&s->gb)/8; bufsize = get_bits_left(&s->gb); for (slice_y = 0; bufsize > 0 && slice_y < s->lowdelay.num_y; slice_y++) for (slice_x = 0; bufsize > 0 && slice_x < s->lowdelay.num_x; slice_x++) { bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den - slice_num * s->lowdelay.bytes.num / s->lowdelay.bytes.den; slices[slice_num].bytes = bytes; slices[slice_num].slice_x = slice_x; slices[slice_num].slice_y = slice_y; init_get_bits(&slices[slice_num].gb, buf, bufsize); slice_num++; buf += bytes; bufsize -= bytes*8; } avctx->execute(avctx, decode_lowdelay_slice, slices, NULL, slice_num, sizeof(struct lowdelay_slice)); /* [DIRAC_STD] 13.5.2 Slices */ intra_dc_prediction(&s->plane[0].band[0][0]); /* [DIRAC_STD] 13.3 intra_dc_prediction() */ intra_dc_prediction(&s->plane[1].band[0][0]); /* [DIRAC_STD] 13.3 intra_dc_prediction() */ intra_dc_prediction(&s->plane[2].band[0][0]); /* [DIRAC_STD] 13.3 intra_dc_prediction() */ av_free(slices); } static void init_planes(DiracContext *s) { int i, w, h, level, orientation; for (i = 0; i < 3; i++) { Plane *p = &s->plane[i]; p->width = s->source.width >> (i ? s->chroma_x_shift : 0); p->height = s->source.height >> (i ? s->chroma_y_shift : 0); p->idwt_width = w = CALC_PADDING(p->width , s->wavelet_depth); p->idwt_height = h = CALC_PADDING(p->height, s->wavelet_depth); p->idwt_stride = FFALIGN(p->idwt_width, 8); for (level = s->wavelet_depth-1; level >= 0; level--) { w = w>>1; h = h>>1; for (orientation = !!level; orientation < 4; orientation++) { SubBand *b = &p->band[level][orientation]; b->ibuf = p->idwt_buf; b->level = level; b->stride = p->idwt_stride << (s->wavelet_depth - level); b->width = w; b->height = h; b->orientation = orientation; if (orientation & 1) b->ibuf += w; if (orientation > 1) b->ibuf += b->stride>>1; if (level) b->parent = &p->band[level-1][orientation]; } } if (i > 0) { p->xblen = s->plane[0].xblen >> s->chroma_x_shift; p->yblen = s->plane[0].yblen >> s->chroma_y_shift; p->xbsep = s->plane[0].xbsep >> s->chroma_x_shift; p->ybsep = s->plane[0].ybsep >> s->chroma_y_shift; } p->xoffset = (p->xblen - p->xbsep)/2; p->yoffset = (p->yblen - p->ybsep)/2; } } /** * Unpack the motion compensation parameters * Dirac Specification -> * 11.2 Picture prediction data. picture_prediction() */ static int dirac_unpack_prediction_parameters(DiracContext *s) { static const uint8_t default_blen[] = { 4, 12, 16, 24 }; static const uint8_t default_bsep[] = { 4, 8, 12, 16 }; GetBitContext *gb = &s->gb; unsigned idx, ref; align_get_bits(gb); /* [DIRAC_STD] 11.2.2 Block parameters. block_parameters() */ /* Luma and Chroma are equal. 11.2.3 */ idx = svq3_get_ue_golomb(gb); /* [DIRAC_STD] index */ if (idx > 4) { av_log(s->avctx, AV_LOG_ERROR, "Block prediction index too high\n"); return -1; } if (idx == 0) { s->plane[0].xblen = svq3_get_ue_golomb(gb); s->plane[0].yblen = svq3_get_ue_golomb(gb); s->plane[0].xbsep = svq3_get_ue_golomb(gb); s->plane[0].ybsep = svq3_get_ue_golomb(gb); } else { /*[DIRAC_STD] preset_block_params(index). Table 11.1 */ s->plane[0].xblen = default_blen[idx-1]; s->plane[0].yblen = default_blen[idx-1]; s->plane[0].xbsep = default_bsep[idx-1]; s->plane[0].ybsep = default_bsep[idx-1]; } /*[DIRAC_STD] 11.2.4 motion_data_dimensions() Calculated in function dirac_unpack_block_motion_data */ if (!s->plane[0].xbsep || !s->plane[0].ybsep || s->plane[0].xbsep < s->plane[0].xblen/2 || s->plane[0].ybsep < s->plane[0].yblen/2) { av_log(s->avctx, AV_LOG_ERROR, "Block separation too small\n"); return -1; } if (s->plane[0].xbsep > s->plane[0].xblen || s->plane[0].ybsep > s->plane[0].yblen) { av_log(s->avctx, AV_LOG_ERROR, "Block separation greater than size\n"); return -1; } if (FFMAX(s->plane[0].xblen, s->plane[0].yblen) > MAX_BLOCKSIZE) { av_log(s->avctx, AV_LOG_ERROR, "Unsupported large block size\n"); return -1; } /*[DIRAC_STD] 11.2.5 Motion vector precision. motion_vector_precision() Read motion vector precision */ s->mv_precision = svq3_get_ue_golomb(gb); if (s->mv_precision > 3) { av_log(s->avctx, AV_LOG_ERROR, "MV precision finer than eighth-pel\n"); return -1; } /*[DIRAC_STD] 11.2.6 Global motion. global_motion() Read the global motion compensation parameters */ s->globalmc_flag = get_bits1(gb); if (s->globalmc_flag) { memset(s->globalmc, 0, sizeof(s->globalmc)); /* [DIRAC_STD] pan_tilt(gparams) */ for (ref = 0; ref < s->num_refs; ref++) { if (get_bits1(gb)) { s->globalmc[ref].pan_tilt[0] = dirac_get_se_golomb(gb); s->globalmc[ref].pan_tilt[1] = dirac_get_se_golomb(gb); } /* [DIRAC_STD] zoom_rotate_shear(gparams) zoom/rotation/shear parameters */ if (get_bits1(gb)) { s->globalmc[ref].zrs_exp = svq3_get_ue_golomb(gb); s->globalmc[ref].zrs[0][0] = dirac_get_se_golomb(gb); s->globalmc[ref].zrs[0][1] = dirac_get_se_golomb(gb); s->globalmc[ref].zrs[1][0] = dirac_get_se_golomb(gb); s->globalmc[ref].zrs[1][1] = dirac_get_se_golomb(gb); } else { s->globalmc[ref].zrs[0][0] = 1; s->globalmc[ref].zrs[1][1] = 1; } /* [DIRAC_STD] perspective(gparams) */ if (get_bits1(gb)) { s->globalmc[ref].perspective_exp = svq3_get_ue_golomb(gb); s->globalmc[ref].perspective[0] = dirac_get_se_golomb(gb); s->globalmc[ref].perspective[1] = dirac_get_se_golomb(gb); } } } /*[DIRAC_STD] 11.2.7 Picture prediction mode. prediction_mode() Picture prediction mode, not currently used. */ if (svq3_get_ue_golomb(gb)) { av_log(s->avctx, AV_LOG_ERROR, "Unknown picture prediction mode\n"); return -1; } /* [DIRAC_STD] 11.2.8 Reference picture weight. reference_picture_weights() just data read, weight calculation will be done later on. */ s->weight_log2denom = 1; s->weight[0] = 1; s->weight[1] = 1; if (get_bits1(gb)) { s->weight_log2denom = svq3_get_ue_golomb(gb); s->weight[0] = dirac_get_se_golomb(gb); if (s->num_refs == 2) s->weight[1] = dirac_get_se_golomb(gb); } return 0; } /** * Dirac Specification -> * 11.3 Wavelet transform data. wavelet_transform() */ static int dirac_unpack_idwt_params(DiracContext *s) { GetBitContext *gb = &s->gb; int i, level; unsigned tmp; #define CHECKEDREAD(dst, cond, errmsg) \ tmp = svq3_get_ue_golomb(gb); \ if (cond) { \ av_log(s->avctx, AV_LOG_ERROR, errmsg); \ return -1; \ }\ dst = tmp; align_get_bits(gb); s->zero_res = s->num_refs ? get_bits1(gb) : 0; if (s->zero_res) return 0; /*[DIRAC_STD] 11.3.1 Transform parameters. transform_parameters() */ CHECKEDREAD(s->wavelet_idx, tmp > 6, "wavelet_idx is too big\n") CHECKEDREAD(s->wavelet_depth, tmp > MAX_DWT_LEVELS || tmp < 1, "invalid number of DWT decompositions\n") if (!s->low_delay) { /* Codeblock parameters (core syntax only) */ if (get_bits1(gb)) { for (i = 0; i <= s->wavelet_depth; i++) { CHECKEDREAD(s->codeblock[i].width , tmp < 1, "codeblock width invalid\n") CHECKEDREAD(s->codeblock[i].height, tmp < 1, "codeblock height invalid\n") } CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n") } else for (i = 0; i <= s->wavelet_depth; i++) s->codeblock[i].width = s->codeblock[i].height = 1; } else { /* Slice parameters + quantization matrix*/ /*[DIRAC_STD] 11.3.4 Slice coding Parameters (low delay syntax only). slice_parameters() */ s->lowdelay.num_x = svq3_get_ue_golomb(gb); s->lowdelay.num_y = svq3_get_ue_golomb(gb); s->lowdelay.bytes.num = svq3_get_ue_golomb(gb); s->lowdelay.bytes.den = svq3_get_ue_golomb(gb); if (s->lowdelay.bytes.den <= 0) { av_log(s->avctx,AV_LOG_ERROR,"Invalid lowdelay.bytes.den\n"); return AVERROR_INVALIDDATA; } /* [DIRAC_STD] 11.3.5 Quantisation matrices (low-delay syntax). quant_matrix() */ if (get_bits1(gb)) { av_log(s->avctx,AV_LOG_DEBUG,"Low Delay: Has Custom Quantization Matrix!\n"); /* custom quantization matrix */ s->lowdelay.quant[0][0] = svq3_get_ue_golomb(gb); for (level = 0; level < s->wavelet_depth; level++) { s->lowdelay.quant[level][1] = svq3_get_ue_golomb(gb); s->lowdelay.quant[level][2] = svq3_get_ue_golomb(gb); s->lowdelay.quant[level][3] = svq3_get_ue_golomb(gb); } } else { if (s->wavelet_depth > 4) { av_log(s->avctx,AV_LOG_ERROR,"Mandatory custom low delay matrix missing for depth %d\n", s->wavelet_depth); return AVERROR_INVALIDDATA; } /* default quantization matrix */ for (level = 0; level < s->wavelet_depth; level++) for (i = 0; i < 4; i++) { s->lowdelay.quant[level][i] = default_qmat[s->wavelet_idx][level][i]; /* haar with no shift differs for different depths */ if (s->wavelet_idx == 3) s->lowdelay.quant[level][i] += 4*(s->wavelet_depth-1 - level); } } } return 0; } static inline int pred_sbsplit(uint8_t *sbsplit, int stride, int x, int y) { static const uint8_t avgsplit[7] = { 0, 0, 1, 1, 1, 2, 2 }; if (!(x|y)) return 0; else if (!y) return sbsplit[-1]; else if (!x) return sbsplit[-stride]; return avgsplit[sbsplit[-1] + sbsplit[-stride] + sbsplit[-stride-1]]; } static inline int pred_block_mode(DiracBlock *block, int stride, int x, int y, int refmask) { int pred; if (!(x|y)) return 0; else if (!y) return block[-1].ref & refmask; else if (!x) return block[-stride].ref & refmask; /* return the majority */ pred = (block[-1].ref & refmask) + (block[-stride].ref & refmask) + (block[-stride-1].ref & refmask); return (pred >> 1) & refmask; } static inline void pred_block_dc(DiracBlock *block, int stride, int x, int y) { int i, n = 0; memset(block->u.dc, 0, sizeof(block->u.dc)); if (x && !(block[-1].ref & 3)) { for (i = 0; i < 3; i++) block->u.dc[i] += block[-1].u.dc[i]; n++; } if (y && !(block[-stride].ref & 3)) { for (i = 0; i < 3; i++) block->u.dc[i] += block[-stride].u.dc[i]; n++; } if (x && y && !(block[-1-stride].ref & 3)) { for (i = 0; i < 3; i++) block->u.dc[i] += block[-1-stride].u.dc[i]; n++; } if (n == 2) { for (i = 0; i < 3; i++) block->u.dc[i] = (block->u.dc[i]+1)>>1; } else if (n == 3) { for (i = 0; i < 3; i++) block->u.dc[i] = divide3(block->u.dc[i]); } } static inline void pred_mv(DiracBlock *block, int stride, int x, int y, int ref) { int16_t *pred[3]; int refmask = ref+1; int mask = refmask | DIRAC_REF_MASK_GLOBAL; /* exclude gmc blocks */ int n = 0; if (x && (block[-1].ref & mask) == refmask) pred[n++] = block[-1].u.mv[ref]; if (y && (block[-stride].ref & mask) == refmask) pred[n++] = block[-stride].u.mv[ref]; if (x && y && (block[-stride-1].ref & mask) == refmask) pred[n++] = block[-stride-1].u.mv[ref]; switch (n) { case 0: block->u.mv[ref][0] = 0; block->u.mv[ref][1] = 0; break; case 1: block->u.mv[ref][0] = pred[0][0]; block->u.mv[ref][1] = pred[0][1]; break; case 2: block->u.mv[ref][0] = (pred[0][0] + pred[1][0] + 1) >> 1; block->u.mv[ref][1] = (pred[0][1] + pred[1][1] + 1) >> 1; break; case 3: block->u.mv[ref][0] = mid_pred(pred[0][0], pred[1][0], pred[2][0]); block->u.mv[ref][1] = mid_pred(pred[0][1], pred[1][1], pred[2][1]); break; } } static void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref) { int ez = s->globalmc[ref].zrs_exp; int ep = s->globalmc[ref].perspective_exp; int (*A)[2] = s->globalmc[ref].zrs; int *b = s->globalmc[ref].pan_tilt; int *c = s->globalmc[ref].perspective; int m = (1<<ep) - (c[0]*x + c[1]*y); int mx = m * ((A[0][0] * x + A[0][1]*y) + (1<<ez) * b[0]); int my = m * ((A[1][0] * x + A[1][1]*y) + (1<<ez) * b[1]); block->u.mv[ref][0] = (mx + (1<<(ez+ep))) >> (ez+ep); block->u.mv[ref][1] = (my + (1<<(ez+ep))) >> (ez+ep); } static void decode_block_params(DiracContext *s, DiracArith arith[8], DiracBlock *block, int stride, int x, int y) { int i; block->ref = pred_block_mode(block, stride, x, y, DIRAC_REF_MASK_REF1); block->ref ^= dirac_get_arith_bit(arith, CTX_PMODE_REF1); if (s->num_refs == 2) { block->ref |= pred_block_mode(block, stride, x, y, DIRAC_REF_MASK_REF2); block->ref ^= dirac_get_arith_bit(arith, CTX_PMODE_REF2) << 1; } if (!block->ref) { pred_block_dc(block, stride, x, y); for (i = 0; i < 3; i++) block->u.dc[i] += dirac_get_arith_int(arith+1+i, CTX_DC_F1, CTX_DC_DATA); return; } if (s->globalmc_flag) { block->ref |= pred_block_mode(block, stride, x, y, DIRAC_REF_MASK_GLOBAL); block->ref ^= dirac_get_arith_bit(arith, CTX_GLOBAL_BLOCK) << 2; } for (i = 0; i < s->num_refs; i++) if (block->ref & (i+1)) { if (block->ref & DIRAC_REF_MASK_GLOBAL) { global_mv(s, block, x, y, i); } else { pred_mv(block, stride, x, y, i); block->u.mv[i][0] += dirac_get_arith_int(arith + 4 + 2 * i, CTX_MV_F1, CTX_MV_DATA); block->u.mv[i][1] += dirac_get_arith_int(arith + 5 + 2 * i, CTX_MV_F1, CTX_MV_DATA); } } } /** * Copies the current block to the other blocks covered by the current superblock split mode */ static void propagate_block_data(DiracBlock *block, int stride, int size) { int x, y; DiracBlock *dst = block; for (x = 1; x < size; x++) dst[x] = *block; for (y = 1; y < size; y++) { dst += stride; for (x = 0; x < size; x++) dst[x] = *block; } } /** * Dirac Specification -> * 12. Block motion data syntax */ static int dirac_unpack_block_motion_data(DiracContext *s) { GetBitContext *gb = &s->gb; uint8_t *sbsplit = s->sbsplit; int i, x, y, q, p; DiracArith arith[8]; align_get_bits(gb); /* [DIRAC_STD] 11.2.4 and 12.2.1 Number of blocks and superblocks */ s->sbwidth = DIVRNDUP(s->source.width, 4*s->plane[0].xbsep); s->sbheight = DIVRNDUP(s->source.height, 4*s->plane[0].ybsep); s->blwidth = 4 * s->sbwidth; s->blheight = 4 * s->sbheight; /* [DIRAC_STD] 12.3.1 Superblock splitting modes. superblock_split_modes() decode superblock split modes */ ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb)); /* svq3_get_ue_golomb(gb) is the length */ for (y = 0; y < s->sbheight; y++) { for (x = 0; x < s->sbwidth; x++) { unsigned int split = dirac_get_arith_uint(arith, CTX_SB_F1, CTX_SB_DATA); if (split > 2) return -1; sbsplit[x] = (split + pred_sbsplit(sbsplit+x, s->sbwidth, x, y)) % 3; } sbsplit += s->sbwidth; } /* setup arith decoding */ ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb)); for (i = 0; i < s->num_refs; i++) { ff_dirac_init_arith_decoder(arith + 4 + 2 * i, gb, svq3_get_ue_golomb(gb)); ff_dirac_init_arith_decoder(arith + 5 + 2 * i, gb, svq3_get_ue_golomb(gb)); } for (i = 0; i < 3; i++) ff_dirac_init_arith_decoder(arith+1+i, gb, svq3_get_ue_golomb(gb)); for (y = 0; y < s->sbheight; y++) for (x = 0; x < s->sbwidth; x++) { int blkcnt = 1 << s->sbsplit[y * s->sbwidth + x]; int step = 4 >> s->sbsplit[y * s->sbwidth + x]; for (q = 0; q < blkcnt; q++) for (p = 0; p < blkcnt; p++) { int bx = 4 * x + p*step; int by = 4 * y + q*step; DiracBlock *block = &s->blmotion[by*s->blwidth + bx]; decode_block_params(s, arith, block, s->blwidth, bx, by); propagate_block_data(block, s->blwidth, step); } } return 0; } static int weight(int i, int blen, int offset) { #define ROLLOFF(i) offset == 1 ? ((i) ? 5 : 3) : \ (1 + (6*(i) + offset - 1) / (2*offset - 1)) if (i < 2*offset) return ROLLOFF(i); else if (i > blen-1 - 2*offset) return ROLLOFF(blen-1 - i); return 8; } static void init_obmc_weight_row(Plane *p, uint8_t *obmc_weight, int stride, int left, int right, int wy) { int x; for (x = 0; left && x < p->xblen >> 1; x++) obmc_weight[x] = wy*8; for (; x < p->xblen >> right; x++) obmc_weight[x] = wy*weight(x, p->xblen, p->xoffset); for (; x < p->xblen; x++) obmc_weight[x] = wy*8; for (; x < stride; x++) obmc_weight[x] = 0; } static void init_obmc_weight(Plane *p, uint8_t *obmc_weight, int stride, int left, int right, int top, int bottom) { int y; for (y = 0; top && y < p->yblen >> 1; y++) { init_obmc_weight_row(p, obmc_weight, stride, left, right, 8); obmc_weight += stride; } for (; y < p->yblen >> bottom; y++) { int wy = weight(y, p->yblen, p->yoffset); init_obmc_weight_row(p, obmc_weight, stride, left, right, wy); obmc_weight += stride; } for (; y < p->yblen; y++) { init_obmc_weight_row(p, obmc_weight, stride, left, right, 8); obmc_weight += stride; } } static void init_obmc_weights(DiracContext *s, Plane *p, int by) { int top = !by; int bottom = by == s->blheight-1; /* don't bother re-initing for rows 2 to blheight-2, the weights don't change */ if (top || bottom || by == 1) { init_obmc_weight(p, s->obmc_weight[0], MAX_BLOCKSIZE, 1, 0, top, bottom); init_obmc_weight(p, s->obmc_weight[1], MAX_BLOCKSIZE, 0, 0, top, bottom); init_obmc_weight(p, s->obmc_weight[2], MAX_BLOCKSIZE, 0, 1, top, bottom); } } static const uint8_t epel_weights[4][4][4] = { {{ 16, 0, 0, 0 }, { 12, 4, 0, 0 }, { 8, 8, 0, 0 }, { 4, 12, 0, 0 }}, {{ 12, 0, 4, 0 }, { 9, 3, 3, 1 }, { 6, 6, 2, 2 }, { 3, 9, 1, 3 }}, {{ 8, 0, 8, 0 }, { 6, 2, 6, 2 }, { 4, 4, 4, 4 }, { 2, 6, 2, 6 }}, {{ 4, 0, 12, 0 }, { 3, 1, 9, 3 }, { 2, 2, 6, 6 }, { 1, 3, 3, 9 }} }; /** * For block x,y, determine which of the hpel planes to do bilinear * interpolation from and set src[] to the location in each hpel plane * to MC from. * * @return the index of the put_dirac_pixels_tab function to use * 0 for 1 plane (fpel,hpel), 1 for 2 planes (qpel), 2 for 4 planes (qpel), and 3 for epel */ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5], int x, int y, int ref, int plane) { Plane *p = &s->plane[plane]; uint8_t **ref_hpel = s->ref_pics[ref]->hpel[plane]; int motion_x = block->u.mv[ref][0]; int motion_y = block->u.mv[ref][1]; int mx, my, i, epel, nplanes = 0; if (plane) { motion_x >>= s->chroma_x_shift; motion_y >>= s->chroma_y_shift; } mx = motion_x & ~(-1U << s->mv_precision); my = motion_y & ~(-1U << s->mv_precision); motion_x >>= s->mv_precision; motion_y >>= s->mv_precision; /* normalize subpel coordinates to epel */ /* TODO: template this function? */ mx <<= 3 - s->mv_precision; my <<= 3 - s->mv_precision; x += motion_x; y += motion_y; epel = (mx|my)&1; /* hpel position */ if (!((mx|my)&3)) { nplanes = 1; src[0] = ref_hpel[(my>>1)+(mx>>2)] + y*p->stride + x; } else { /* qpel or epel */ nplanes = 4; for (i = 0; i < 4; i++) src[i] = ref_hpel[i] + y*p->stride + x; /* if we're interpolating in the right/bottom halves, adjust the planes as needed we increment x/y because the edge changes for half of the pixels */ if (mx > 4) { src[0] += 1; src[2] += 1; x++; } if (my > 4) { src[0] += p->stride; src[1] += p->stride; y++; } /* hpel planes are: [0]: F [1]: H [2]: V [3]: C */ if (!epel) { /* check if we really only need 2 planes since either mx or my is a hpel position. (epel weights of 0 handle this there) */ if (!(mx&3)) { /* mx == 0: average [0] and [2] mx == 4: average [1] and [3] */ src[!mx] = src[2 + !!mx]; nplanes = 2; } else if (!(my&3)) { src[0] = src[(my>>1) ]; src[1] = src[(my>>1)+1]; nplanes = 2; } } else { /* adjust the ordering if needed so the weights work */ if (mx > 4) { FFSWAP(const uint8_t *, src[0], src[1]); FFSWAP(const uint8_t *, src[2], src[3]); } if (my > 4) { FFSWAP(const uint8_t *, src[0], src[2]); FFSWAP(const uint8_t *, src[1], src[3]); } src[4] = epel_weights[my&3][mx&3]; } } /* fixme: v/h _edge_pos */ if (x + p->xblen > p->width +EDGE_WIDTH/2 || y + p->yblen > p->height+EDGE_WIDTH/2 || x < 0 || y < 0) { for (i = 0; i < nplanes; i++) { ff_emulated_edge_mc(s->edge_emu_buffer[i], src[i], p->stride, p->stride, p->xblen, p->yblen, x, y, p->width+EDGE_WIDTH/2, p->height+EDGE_WIDTH/2); src[i] = s->edge_emu_buffer[i]; } } return (nplanes>>1) + epel; } static void add_dc(uint16_t *dst, int dc, int stride, uint8_t *obmc_weight, int xblen, int yblen) { int x, y; dc += 128; for (y = 0; y < yblen; y++) { for (x = 0; x < xblen; x += 2) { dst[x ] += dc * obmc_weight[x ]; dst[x+1] += dc * obmc_weight[x+1]; } dst += stride; obmc_weight += MAX_BLOCKSIZE; } } static void block_mc(DiracContext *s, DiracBlock *block, uint16_t *mctmp, uint8_t *obmc_weight, int plane, int dstx, int dsty) { Plane *p = &s->plane[plane]; const uint8_t *src[5]; int idx; switch (block->ref&3) { case 0: /* DC */ add_dc(mctmp, block->u.dc[plane], p->stride, obmc_weight, p->xblen, p->yblen); return; case 1: case 2: idx = mc_subpel(s, block, src, dstx, dsty, (block->ref&3)-1, plane); s->put_pixels_tab[idx](s->mcscratch, src, p->stride, p->yblen); if (s->weight_func) s->weight_func(s->mcscratch, p->stride, s->weight_log2denom, s->weight[0] + s->weight[1], p->yblen); break; case 3: idx = mc_subpel(s, block, src, dstx, dsty, 0, plane); s->put_pixels_tab[idx](s->mcscratch, src, p->stride, p->yblen); idx = mc_subpel(s, block, src, dstx, dsty, 1, plane); if (s->biweight_func) { /* fixme: +32 is a quick hack */ s->put_pixels_tab[idx](s->mcscratch + 32, src, p->stride, p->yblen); s->biweight_func(s->mcscratch, s->mcscratch+32, p->stride, s->weight_log2denom, s->weight[0], s->weight[1], p->yblen); } else s->avg_pixels_tab[idx](s->mcscratch, src, p->stride, p->yblen); break; } s->add_obmc(mctmp, s->mcscratch, p->stride, obmc_weight, p->yblen); } static void mc_row(DiracContext *s, DiracBlock *block, uint16_t *mctmp, int plane, int dsty) { Plane *p = &s->plane[plane]; int x, dstx = p->xbsep - p->xoffset; block_mc(s, block, mctmp, s->obmc_weight[0], plane, -p->xoffset, dsty); mctmp += p->xbsep; for (x = 1; x < s->blwidth-1; x++) { block_mc(s, block+x, mctmp, s->obmc_weight[1], plane, dstx, dsty); dstx += p->xbsep; mctmp += p->xbsep; } block_mc(s, block+x, mctmp, s->obmc_weight[2], plane, dstx, dsty); } static void select_dsp_funcs(DiracContext *s, int width, int height, int xblen, int yblen) { int idx = 0; if (xblen > 8) idx = 1; if (xblen > 16) idx = 2; memcpy(s->put_pixels_tab, s->diracdsp.put_dirac_pixels_tab[idx], sizeof(s->put_pixels_tab)); memcpy(s->avg_pixels_tab, s->diracdsp.avg_dirac_pixels_tab[idx], sizeof(s->avg_pixels_tab)); s->add_obmc = s->diracdsp.add_dirac_obmc[idx]; if (s->weight_log2denom > 1 || s->weight[0] != 1 || s->weight[1] != 1) { s->weight_func = s->diracdsp.weight_dirac_pixels_tab[idx]; s->biweight_func = s->diracdsp.biweight_dirac_pixels_tab[idx]; } else { s->weight_func = NULL; s->biweight_func = NULL; } } static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height) { /* chroma allocates an edge of 8 when subsampled which for 4:2:2 means an h edge of 16 and v edge of 8 just use 8 for everything for the moment */ int i, edge = EDGE_WIDTH/2; ref->hpel[plane][0] = ref->avframe->data[plane]; s->mpvencdsp.draw_edges(ref->hpel[plane][0], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); /* EDGE_TOP | EDGE_BOTTOM values just copied to make it build, this needs to be ensured */ /* no need for hpel if we only have fpel vectors */ if (!s->mv_precision) return; for (i = 1; i < 4; i++) { if (!ref->hpel_base[plane][i]) ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->avframe->linesize[plane] + 32); /* we need to be 16-byte aligned even for chroma */ ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->avframe->linesize[plane] + 16; } if (!ref->interpolated[plane]) { s->diracdsp.dirac_hpel_filter(ref->hpel[plane][1], ref->hpel[plane][2], ref->hpel[plane][3], ref->hpel[plane][0], ref->avframe->linesize[plane], width, height); s->mpvencdsp.draw_edges(ref->hpel[plane][1], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); s->mpvencdsp.draw_edges(ref->hpel[plane][2], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); s->mpvencdsp.draw_edges(ref->hpel[plane][3], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); } ref->interpolated[plane] = 1; } /** * Dirac Specification -> * 13.0 Transform data syntax. transform_data() */ static int dirac_decode_frame_internal(DiracContext *s) { DWTContext d; int y, i, comp, dsty; if (s->low_delay) { /* [DIRAC_STD] 13.5.1 low_delay_transform_data() */ for (comp = 0; comp < 3; comp++) { Plane *p = &s->plane[comp]; memset(p->idwt_buf, 0, p->idwt_stride * p->idwt_height * sizeof(IDWTELEM)); } if (!s->zero_res) decode_lowdelay(s); } for (comp = 0; comp < 3; comp++) { Plane *p = &s->plane[comp]; uint8_t *frame = s->current_picture->avframe->data[comp]; /* FIXME: small resolutions */ for (i = 0; i < 4; i++) s->edge_emu_buffer[i] = s->edge_emu_buffer_base + i*FFALIGN(p->width, 16); if (!s->zero_res && !s->low_delay) { memset(p->idwt_buf, 0, p->idwt_stride * p->idwt_height * sizeof(IDWTELEM)); decode_component(s, comp); /* [DIRAC_STD] 13.4.1 core_transform_data() */ } if (ff_spatial_idwt_init2(&d, p->idwt_buf, p->idwt_width, p->idwt_height, p->idwt_stride, s->wavelet_idx+2, s->wavelet_depth, p->idwt_tmp)) return -1; if (!s->num_refs) { /* intra */ for (y = 0; y < p->height; y += 16) { ff_spatial_idwt_slice2(&d, y+16); /* decode */ s->diracdsp.put_signed_rect_clamped(frame + y*p->stride, p->stride, p->idwt_buf + y*p->idwt_stride, p->idwt_stride, p->width, 16); } } else { /* inter */ int rowheight = p->ybsep*p->stride; select_dsp_funcs(s, p->width, p->height, p->xblen, p->yblen); for (i = 0; i < s->num_refs; i++) interpolate_refplane(s, s->ref_pics[i], comp, p->width, p->height); memset(s->mctmp, 0, 4*p->yoffset*p->stride); dsty = -p->yoffset; for (y = 0; y < s->blheight; y++) { int h = 0, start = FFMAX(dsty, 0); uint16_t *mctmp = s->mctmp + y*rowheight; DiracBlock *blocks = s->blmotion + y*s->blwidth; init_obmc_weights(s, p, y); if (y == s->blheight-1 || start+p->ybsep > p->height) h = p->height - start; else h = p->ybsep - (start - dsty); if (h < 0) break; memset(mctmp+2*p->yoffset*p->stride, 0, 2*rowheight); mc_row(s, blocks, mctmp, comp, dsty); mctmp += (start - dsty)*p->stride + p->xoffset; ff_spatial_idwt_slice2(&d, start + h); /* decode */ s->diracdsp.add_rect_clamped(frame + start*p->stride, mctmp, p->stride, p->idwt_buf + start*p->idwt_stride, p->idwt_stride, p->width, h); dsty += p->ybsep; } } } return 0; } static int get_buffer_with_edge(AVCodecContext *avctx, AVFrame *f, int flags) { int ret, i; int chroma_x_shift, chroma_y_shift; avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, &chroma_y_shift); f->width = avctx->width + 2 * EDGE_WIDTH; f->height = avctx->height + 2 * EDGE_WIDTH + 2; ret = ff_get_buffer(avctx, f, flags); if (ret < 0) return ret; for (i = 0; f->data[i]; i++) { int offset = (EDGE_WIDTH >> (i && i<3 ? chroma_y_shift : 0)) * f->linesize[i] + 32; f->data[i] += offset; } f->width = avctx->width; f->height = avctx->height; return 0; } /** * Dirac Specification -> * 11.1.1 Picture Header. picture_header() */ static int dirac_decode_picture_header(DiracContext *s) { int retire, picnum; int i, j, refnum, refdist; GetBitContext *gb = &s->gb; /* [DIRAC_STD] 11.1.1 Picture Header. picture_header() PICTURE_NUM */ picnum = s->current_picture->avframe->display_picture_number = get_bits_long(gb, 32); av_log(s->avctx,AV_LOG_DEBUG,"PICTURE_NUM: %d\n",picnum); /* if this is the first keyframe after a sequence header, start our reordering from here */ if (s->frame_number < 0) s->frame_number = picnum; s->ref_pics[0] = s->ref_pics[1] = NULL; for (i = 0; i < s->num_refs; i++) { refnum = picnum + dirac_get_se_golomb(gb); refdist = INT_MAX; /* find the closest reference to the one we want */ /* Jordi: this is needed if the referenced picture hasn't yet arrived */ for (j = 0; j < MAX_REFERENCE_FRAMES && refdist; j++) if (s->ref_frames[j] && FFABS(s->ref_frames[j]->avframe->display_picture_number - refnum) < refdist) { s->ref_pics[i] = s->ref_frames[j]; refdist = FFABS(s->ref_frames[j]->avframe->display_picture_number - refnum); } if (!s->ref_pics[i] || refdist) av_log(s->avctx, AV_LOG_DEBUG, "Reference not found\n"); /* if there were no references at all, allocate one */ if (!s->ref_pics[i]) for (j = 0; j < MAX_FRAMES; j++) if (!s->all_frames[j].avframe->data[0]) { s->ref_pics[i] = &s->all_frames[j]; get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF); break; } } /* retire the reference frames that are not used anymore */ if (s->current_picture->avframe->reference) { retire = picnum + dirac_get_se_golomb(gb); if (retire != picnum) { DiracFrame *retire_pic = remove_frame(s->ref_frames, retire); if (retire_pic) retire_pic->avframe->reference &= DELAYED_PIC_REF; else av_log(s->avctx, AV_LOG_DEBUG, "Frame to retire not found\n"); } /* if reference array is full, remove the oldest as per the spec */ while (add_frame(s->ref_frames, MAX_REFERENCE_FRAMES, s->current_picture)) { av_log(s->avctx, AV_LOG_ERROR, "Reference frame overflow\n"); remove_frame(s->ref_frames, s->ref_frames[0]->avframe->display_picture_number)->avframe->reference &= DELAYED_PIC_REF; } } if (s->num_refs) { if (dirac_unpack_prediction_parameters(s)) /* [DIRAC_STD] 11.2 Picture Prediction Data. picture_prediction() */ return -1; if (dirac_unpack_block_motion_data(s)) /* [DIRAC_STD] 12. Block motion data syntax */ return -1; } if (dirac_unpack_idwt_params(s)) /* [DIRAC_STD] 11.3 Wavelet transform data */ return -1; init_planes(s); return 0; } static int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame) { DiracFrame *out = s->delay_frames[0]; int i, out_idx = 0; int ret; /* find frame with lowest picture number */ for (i = 1; s->delay_frames[i]; i++) if (s->delay_frames[i]->avframe->display_picture_number < out->avframe->display_picture_number) { out = s->delay_frames[i]; out_idx = i; } for (i = out_idx; s->delay_frames[i]; i++) s->delay_frames[i] = s->delay_frames[i+1]; if (out) { out->avframe->reference ^= DELAYED_PIC_REF; *got_frame = 1; if((ret = av_frame_ref(picture, out->avframe)) < 0) return ret; } return 0; } /** * Dirac Specification -> * 9.6 Parse Info Header Syntax. parse_info() * 4 byte start code + byte parse code + 4 byte size + 4 byte previous size */ #define DATA_UNIT_HEADER_SIZE 13 /* [DIRAC_STD] dirac_decode_data_unit makes reference to the while defined in 9.3 inside the function parse_sequence() */ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int size) { DiracContext *s = avctx->priv_data; DiracFrame *pic = NULL; int ret, i, parse_code = buf[4]; unsigned tmp; if (size < DATA_UNIT_HEADER_SIZE) return -1; init_get_bits(&s->gb, &buf[13], 8*(size - DATA_UNIT_HEADER_SIZE)); if (parse_code == pc_seq_header) { if (s->seen_sequence_header) return 0; /* [DIRAC_STD] 10. Sequence header */ if (avpriv_dirac_parse_sequence_header(avctx, &s->gb, &s->source)) return -1; avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); if (alloc_sequence_buffers(s)) return -1; s->seen_sequence_header = 1; } else if (parse_code == pc_eos) { /* [DIRAC_STD] End of Sequence */ free_sequence_buffers(s); s->seen_sequence_header = 0; } else if (parse_code == pc_aux_data) { if (buf[13] == 1) { /* encoder implementation/version */ int ver[3]; /* versions older than 1.0.8 don't store quant delta for subbands with only one codeblock */ if (sscanf(buf+14, "Schroedinger %d.%d.%d", ver, ver+1, ver+2) == 3) if (ver[0] == 1 && ver[1] == 0 && ver[2] <= 7) s->old_delta_quant = 1; } } else if (parse_code & 0x8) { /* picture data unit */ if (!s->seen_sequence_header) { av_log(avctx, AV_LOG_DEBUG, "Dropping frame without sequence header\n"); return -1; } /* find an unused frame */ for (i = 0; i < MAX_FRAMES; i++) if (s->all_frames[i].avframe->data[0] == NULL) pic = &s->all_frames[i]; if (!pic) { av_log(avctx, AV_LOG_ERROR, "framelist full\n"); return -1; } av_frame_unref(pic->avframe); /* [DIRAC_STD] Defined in 9.6.1 ... */ tmp = parse_code & 0x03; /* [DIRAC_STD] num_refs() */ if (tmp > 2) { av_log(avctx, AV_LOG_ERROR, "num_refs of 3\n"); return -1; } s->num_refs = tmp; s->is_arith = (parse_code & 0x48) == 0x08; /* [DIRAC_STD] using_ac() */ s->low_delay = (parse_code & 0x88) == 0x88; /* [DIRAC_STD] is_low_delay() */ pic->avframe->reference = (parse_code & 0x0C) == 0x0C; /* [DIRAC_STD] is_reference() */ pic->avframe->key_frame = s->num_refs == 0; /* [DIRAC_STD] is_intra() */ pic->avframe->pict_type = s->num_refs + 1; /* Definition of AVPictureType in avutil.h */ if ((ret = get_buffer_with_edge(avctx, pic->avframe, (parse_code & 0x0C) == 0x0C ? AV_GET_BUFFER_FLAG_REF : 0)) < 0) return ret; s->current_picture = pic; s->plane[0].stride = pic->avframe->linesize[0]; s->plane[1].stride = pic->avframe->linesize[1]; s->plane[2].stride = pic->avframe->linesize[2]; if (alloc_buffers(s, FFMAX3(FFABS(s->plane[0].stride), FFABS(s->plane[1].stride), FFABS(s->plane[2].stride))) < 0) return AVERROR(ENOMEM); /* [DIRAC_STD] 11.1 Picture parse. picture_parse() */ if (dirac_decode_picture_header(s)) return -1; /* [DIRAC_STD] 13.0 Transform data syntax. transform_data() */ if (dirac_decode_frame_internal(s)) return -1; } return 0; } static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt) { DiracContext *s = avctx->priv_data; AVFrame *picture = data; uint8_t *buf = pkt->data; int buf_size = pkt->size; int i, data_unit_size, buf_idx = 0; int ret; /* release unused frames */ for (i = 0; i < MAX_FRAMES; i++) if (s->all_frames[i].avframe->data[0] && !s->all_frames[i].avframe->reference) { av_frame_unref(s->all_frames[i].avframe); memset(s->all_frames[i].interpolated, 0, sizeof(s->all_frames[i].interpolated)); } s->current_picture = NULL; *got_frame = 0; /* end of stream, so flush delayed pics */ if (buf_size == 0) return get_delayed_pic(s, (AVFrame *)data, got_frame); for (;;) { /*[DIRAC_STD] Here starts the code from parse_info() defined in 9.6 [DIRAC_STD] PARSE_INFO_PREFIX = "BBCD" as defined in ISO/IEC 646 BBCD start code search */ for (; buf_idx + DATA_UNIT_HEADER_SIZE < buf_size; buf_idx++) { if (buf[buf_idx ] == 'B' && buf[buf_idx+1] == 'B' && buf[buf_idx+2] == 'C' && buf[buf_idx+3] == 'D') break; } /* BBCD found or end of data */ if (buf_idx + DATA_UNIT_HEADER_SIZE >= buf_size) break; data_unit_size = AV_RB32(buf+buf_idx+5); if (buf_idx + data_unit_size > buf_size || !data_unit_size) { if(buf_idx + data_unit_size > buf_size) av_log(s->avctx, AV_LOG_ERROR, "Data unit with size %d is larger than input buffer, discarding\n", data_unit_size); buf_idx += 4; continue; } /* [DIRAC_STD] dirac_decode_data_unit makes reference to the while defined in 9.3 inside the function parse_sequence() */ if (dirac_decode_data_unit(avctx, buf+buf_idx, data_unit_size)) { av_log(s->avctx, AV_LOG_ERROR,"Error in dirac_decode_data_unit\n"); return -1; } buf_idx += data_unit_size; } if (!s->current_picture) return buf_size; if (s->current_picture->avframe->display_picture_number > s->frame_number) { DiracFrame *delayed_frame = remove_frame(s->delay_frames, s->frame_number); s->current_picture->avframe->reference |= DELAYED_PIC_REF; if (add_frame(s->delay_frames, MAX_DELAY, s->current_picture)) { int min_num = s->delay_frames[0]->avframe->display_picture_number; /* Too many delayed frames, so we display the frame with the lowest pts */ av_log(avctx, AV_LOG_ERROR, "Delay frame overflow\n"); delayed_frame = s->delay_frames[0]; for (i = 1; s->delay_frames[i]; i++) if (s->delay_frames[i]->avframe->display_picture_number < min_num) min_num = s->delay_frames[i]->avframe->display_picture_number; delayed_frame = remove_frame(s->delay_frames, min_num); add_frame(s->delay_frames, MAX_DELAY, s->current_picture); } if (delayed_frame) { delayed_frame->avframe->reference ^= DELAYED_PIC_REF; if((ret=av_frame_ref(data, delayed_frame->avframe)) < 0) return ret; *got_frame = 1; } } else if (s->current_picture->avframe->display_picture_number == s->frame_number) { /* The right frame at the right time :-) */ if((ret=av_frame_ref(data, s->current_picture->avframe)) < 0) return ret; *got_frame = 1; } if (*got_frame) s->frame_number = picture->display_picture_number + 1; return buf_idx; } AVCodec ff_dirac_decoder = { .name = "dirac", .long_name = NULL_IF_CONFIG_SMALL("BBC Dirac VC-2"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_DIRAC, .priv_data_size = sizeof(DiracContext), .init = dirac_decode_init, .close = dirac_decode_end, .decode = dirac_decode_frame, .capabilities = CODEC_CAP_DELAY, .flush = dirac_decode_flush, };
{ "pile_set_name": "Github" }
#' @title Fuse learner with dummy feature creator. #' #' @description #' Fuses a base learner with the dummy feature creator (see [createDummyFeatures]). #' Returns a learner which can be used like any other learner. #' #' @template arg_learner #' @inheritParams createDummyFeatures #' @template ret_learner #' @family wrapper #' @export makeDummyFeaturesWrapper = function(learner, method = "1-of-n", cols = NULL) { learner = checkLearner(learner) args = list(method = method, cols = cols) rm(list = names(args)) trainfun = function(data, target, args) { data = do.call(createDummyFeatures, c(list(obj = data, target = target), args)) return(list(data = data, control = list())) } predictfun = function(data, target, args, control) { y = intersect(target, colnames(data)) data = do.call(createDummyFeatures, c(list(obj = data, target = y), args)) return(data) } lrn = makePreprocWrapper(learner, trainfun, predictfun, par.vals = args) lrn$id = stri_replace(lrn$id, replacement = ".dummied", regex = "\\.preproc$") addClasses(lrn, "DummyFeaturesWrapper") } getLearnerProperties.DummyFeaturesWrapper = function(learner) { union(getLearnerProperties(learner$next.learner), c("factors", "ordered")) }
{ "pile_set_name": "Github" }
/* * MTSampler.mm * * This file is part of the "LLGL" project (Copyright (c) 2015-2019 by Lukas Hermanns) * See "LICENSE.txt" for license information. */ #include "MTSampler.h" #include "../MTTypes.h" #include <algorithm> #include <LLGL/Platform/Platform.h> namespace LLGL { #ifndef LLGL_OS_IOS static MTLSamplerBorderColor GetBorderColor(const ColorRGBAf& color) { if (color.r == 0.0f && color.g == 0.0f && color.b == 0.0f) { if (color.a == 0.0f) return MTLSamplerBorderColorTransparentBlack; else return MTLSamplerBorderColorOpaqueBlack; } return MTLSamplerBorderColorOpaqueWhite; } #endif // /LLGL_OS_IOS static void Convert(MTLSamplerDescriptor* dst, const SamplerDescriptor& src) { dst.sAddressMode = MTTypes::ToMTLSamplerAddressMode(src.addressModeU); dst.tAddressMode = MTTypes::ToMTLSamplerAddressMode(src.addressModeV); dst.rAddressMode = MTTypes::ToMTLSamplerAddressMode(src.addressModeW); dst.minFilter = MTTypes::ToMTLSamplerMinMagFilter(src.minFilter); dst.magFilter = MTTypes::ToMTLSamplerMinMagFilter(src.magFilter); dst.mipFilter = (src.mipMapping ? MTTypes::ToMTLSamplerMipFilter(src.mipMapFilter) : MTLSamplerMipFilterNotMipmapped); //TODO: src.mipMapLODBias; dst.lodMinClamp = src.minLOD; dst.lodMaxClamp = src.maxLOD; dst.maxAnisotropy = std::max<NSUInteger>(1, std::min<NSUInteger>(static_cast<NSUInteger>(src.maxAnisotropy), 16)); dst.compareFunction = (src.compareEnabled ? MTTypes::ToMTLCompareFunction(src.compareOp) : MTLCompareFunctionNever); #ifndef LLGL_OS_IOS dst.borderColor = GetBorderColor(src.borderColor); #endif // /LLGL_OS_IOS } MTSampler::MTSampler(id<MTLDevice> device, const SamplerDescriptor& desc) { MTLSamplerDescriptor* samplerDesc = [[MTLSamplerDescriptor alloc] init]; Convert(samplerDesc, desc); native_ = [device newSamplerStateWithDescriptor:samplerDesc]; [samplerDesc release]; } MTSampler::~MTSampler() { [native_ release]; } } // /namespace LLGL // ================================================================================
{ "pile_set_name": "Github" }
/* Copyright (C) 2014-2017, Silent Circle, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Any redistribution, use, or modification is done solely for personal benefit and not for any commercial purpose or for monetary gain * 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 Silent Circle 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 SILENT CIRCLE, LLC 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. */ package com.silentcircle.common.util; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.silentcircle.SilentPhoneApplication; import com.silentcircle.silentphone2.R; /** * Created by werner on 03.02.15. */ public class DialerUtils { /** * Attempts to start an activity and displays a toast with the default error message if the * activity is not found, instead of throwing an exception. * * @param context to start the activity with. * @param intent to start the activity with. */ public static void startActivityWithErrorToast(Context context, Intent intent) { startActivityWithErrorToast(context, intent, R.string.activity_not_available); } /** * Attempts to start an activity and displays a toast with a provided error message if the * activity is not found, instead of throwing an exception. * * @param context to start the activity with. * @param intent to start the activity with. * @param msgId Resource ID of the string to display in an error message if the activity is * not found. */ public static void startActivityWithErrorToast(Context context, Intent intent, int msgId) { try { // if (Intent.ACTION_CALL.equals(intent.getAction())) { // // All dialer-initiated calls should pass the touch point to the InCallUI // Point touchPoint = TouchPointManager.getInstance().getPoint(); // if (touchPoint.x != 0 || touchPoint.y != 0) { // Bundle extras = new Bundle(); // extras.putParcelable(TouchPointManager.TOUCH_POINT, touchPoint); // intent.putExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS, extras); // } // // ((Activity) context).startActivityForResult(intent, 0); // } // else { context.startActivity(intent); // } } catch (ActivityNotFoundException e) { Toast.makeText(context, msgId, Toast.LENGTH_SHORT).show(); } } /** * Joins a list of {@link CharSequence} into a single {@link CharSequence} seperated by a * localized delimiter such as ", ". * * @param resources Resources used to get list delimiter. * @param list List of char sequences to join. * @return Joined char sequences. */ public static CharSequence join(Resources resources, Iterable<CharSequence> list) { final CharSequence separator = resources.getString(R.string.list_delimeter); return TextUtils.join(separator, list); } /** * Sets the image asset and text for an empty list view (see empty_list_view.xml). * * @param emptyListView The empty list view. * @param imageResId The resource id for the drawable to set as the image. * @param strResId The resource id for the string to set as the message. * @param res The resources to obtain the image and string from. */ public static void configureEmptyListView( View emptyListView, int imageResId, int strResId, Resources res) { configureEmptyListView( emptyListView, imageResId, strResId, -1, res); } public static void configureEmptyListView( View emptyListView, int imageResId, int strResId, int headerResId, Resources res) { ImageView emptyListViewImage = (ImageView) emptyListView.findViewById(R.id.emptyListViewImage); if (imageResId != -1) { emptyListViewImage.setImageDrawable( ContextCompat.getDrawable(SilentPhoneApplication.getAppContext(), imageResId)); emptyListViewImage.setContentDescription(res.getString(strResId)); emptyListViewImage.setVisibility(View.VISIBLE); } else { emptyListViewImage.setVisibility(View.GONE); } if (headerResId != -1) { TextView emptyListViewHeader = (TextView) emptyListView.findViewById(R.id.emptyListViewHeader); emptyListViewHeader.setText(res.getString(headerResId)); emptyListViewHeader.setVisibility(View.VISIBLE); } TextView emptyListViewMessage = (TextView) emptyListView.findViewById(R.id.emptyListViewMessage); emptyListViewMessage.setText(res.getString(strResId)); } /** * Closes an {@link AutoCloseable}, silently ignoring any checked exceptions. Does nothing if * null. * * @param closeable to close. */ // public static void closeQuietly(AutoCloseable closeable) { // if (closeable != null) { // try { // closeable.close(); // } catch (RuntimeException rethrown) { // throw rethrown; // } catch (Exception ignored) { // } // } // } public static void showInputMethod(View view) { final InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService( Context.INPUT_METHOD_SERVICE); if (imm != null) { imm.showSoftInput(view, 0); } } public static void hideInputMethod(View view) { final InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService( Context.INPUT_METHOD_SERVICE); if (imm != null) { imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } } public static void showInputMethod(Context ctx) { InputMethodManager imm = (InputMethodManager) ctx.getSystemService( Context.INPUT_METHOD_SERVICE); if (imm != null) { imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0); } } public static void hideInputMethod(Activity activity) { View view = activity.getCurrentFocus(); if (view != null) { InputMethodManager imm = (InputMethodManager) activity.getSystemService( Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } } }
{ "pile_set_name": "Github" }
'use strict'; var tm = require( '../lib/index.js' ); var corpus = new tm.Corpus( [] ); corpus.addDoc( 'wat you cash money go to boots and cats and dogs with me' ); corpus.removeWords( tm.STOPWORDS.EN ) ; var terms = new tm.Terms( corpus ); console.log( terms );
{ "pile_set_name": "Github" }
--- redirect_to: 'https://design.gitlab.com/' --- The content of this document was moved into the [GitLab Design System](https://design.gitlab.com/).
{ "pile_set_name": "Github" }
// Copyright (c) 2015-2016 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package chainec import ( "bytes" "encoding/hex" "testing" "github.com/davecgh/go-spew/spew" ) func TestGeneralSecp256k1(t *testing.T) { // Sample expanded pubkey (Satoshi from Genesis block) samplePubkey, _ := hex.DecodeString("04" + "678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb6" + "49f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") _, err := Secp256k1.ParsePubKey(samplePubkey) if err != nil { t.Errorf("failure parsing pubkey: %v", err) } // Sample compressed pubkey samplePubkey, _ = hex.DecodeString("02" + "4627032575180c2773b3eedd3a163dc2f3c6c84f9d0a1fc561a9578a15e6d0e3") _, err = Secp256k1.ParsePubKey(samplePubkey) if err != nil { t.Errorf("failure parsing pubkey: %v", err) } // Sample signature from https://en.bitcoin.it/wiki/Transaction sampleSig, _ := hex.DecodeString("30" + "45" + "02" + "20" + "6e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d1090db" + "02" + "21" + "00e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b2415") _, err = Secp256k1.ParseDERSignature(sampleSig) if err != nil { t.Errorf("failure parsing DER signature: %v", err) } } type signatureTest struct { name string sig []byte der bool isValid bool } // decodeHex decodes the passed hex string and returns the resulting bytes. It // panics if an error occurs. This is only used in the tests as a helper since // the only way it can fail is if there is an error in the test source code. func decodeHex(hexStr string) []byte { b, err := hex.DecodeString(hexStr) if err != nil { panic("invalid hex string in test source: err " + err.Error() + ", hex: " + hexStr) } return b } type pubKeyTest struct { name string key []byte format byte isValid bool } const ( TstPubkeyUncompressed byte = 0x4 // x coord + y coord TstPubkeyCompressed byte = 0x2 // y_bit + x coord TstPubkeyHybrid byte = 0x6 // y_bit + x coord + y coord ) var pubKeyTests = []pubKeyTest{ // pubkey from bitcoin blockchain tx // 0437cd7f8525ceed2324359c2d0ba26006d92d85 { name: "uncompressed ok", key: []byte{0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3, }, isValid: true, format: TstPubkeyUncompressed, }, { name: "uncompressed as hybrid ok", key: []byte{0x07, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3, }, isValid: true, format: TstPubkeyHybrid, }, // from tx 0b09c51c51ff762f00fb26217269d2a18e77a4fa87d69b3c363ab4df16543f20 { name: "compressed ok (ybit = 0)", key: []byte{0x02, 0xce, 0x0b, 0x14, 0xfb, 0x84, 0x2b, 0x1b, 0xa5, 0x49, 0xfd, 0xd6, 0x75, 0xc9, 0x80, 0x75, 0xf1, 0x2e, 0x9c, 0x51, 0x0f, 0x8e, 0xf5, 0x2b, 0xd0, 0x21, 0xa9, 0xa1, 0xf4, 0x80, 0x9d, 0x3b, 0x4d, }, isValid: true, format: TstPubkeyCompressed, }, // from tx fdeb8e72524e8dab0da507ddbaf5f88fe4a933eb10a66bc4745bb0aa11ea393c { name: "compressed ok (ybit = 1)", key: []byte{0x03, 0x26, 0x89, 0xc7, 0xc2, 0xda, 0xb1, 0x33, 0x09, 0xfb, 0x14, 0x3e, 0x0e, 0x8f, 0xe3, 0x96, 0x34, 0x25, 0x21, 0x88, 0x7e, 0x97, 0x66, 0x90, 0xb6, 0xb4, 0x7f, 0x5b, 0x2a, 0x4b, 0x7d, 0x44, 0x8e, }, isValid: true, format: TstPubkeyCompressed, }, { name: "hybrid", key: []byte{0x06, 0x79, 0xbe, 0x66, 0x7e, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xce, 0x87, 0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xce, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8, 0x17, 0x98, 0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65, 0x5d, 0xa4, 0xfb, 0xfc, 0x0e, 0x11, 0x08, 0xa8, 0xfd, 0x17, 0xb4, 0x48, 0xa6, 0x85, 0x54, 0x19, 0x9c, 0x47, 0xd0, 0x8f, 0xfb, 0x10, 0xd4, 0xb8, }, format: TstPubkeyHybrid, isValid: true, }, } func TestPubKeys(t *testing.T) { for _, test := range pubKeyTests { pk, err := Secp256k1.ParsePubKey(test.key) if err != nil { if test.isValid { t.Errorf("%s pubkey failed when shouldn't %v", test.name, err) } continue } if !test.isValid { t.Errorf("%s counted as valid when it should fail", test.name) continue } var pkStr []byte switch test.format { case TstPubkeyUncompressed: pkStr = (PublicKey)(pk).SerializeUncompressed() case TstPubkeyCompressed: pkStr = (PublicKey)(pk).SerializeCompressed() case TstPubkeyHybrid: pkStr = (PublicKey)(pk).SerializeHybrid() } if !bytes.Equal(test.key, pkStr) { t.Errorf("%s pubkey: serialized keys do not match.", test.name) spew.Dump(test.key) spew.Dump(pkStr) } } } func TestPrivKeys(t *testing.T) { tests := []struct { name string key []byte }{ { name: "check curve", key: []byte{ 0xea, 0xf0, 0x2c, 0xa3, 0x48, 0xc5, 0x24, 0xe6, 0x39, 0x26, 0x55, 0xba, 0x4d, 0x29, 0x60, 0x3c, 0xd1, 0xa7, 0x34, 0x7d, 0x9d, 0x65, 0xcf, 0xe9, 0x3c, 0xe1, 0xeb, 0xff, 0xdc, 0xa2, 0x26, 0x94, }, }, } for _, test := range tests { priv, pub := Secp256k1.PrivKeyFromBytes(test.key) _, err := Secp256k1.ParsePubKey(pub.SerializeUncompressed()) if err != nil { t.Errorf("%s privkey: %v", test.name, err) continue } hash := []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9} r, s, err := Secp256k1.Sign(priv, hash) if err != nil { t.Errorf("%s could not sign: %v", test.name, err) continue } sig := Secp256k1.NewSignature(r, s) if !Secp256k1.Verify(pub, hash, sig.GetR(), sig.GetS()) { t.Errorf("%s could not verify: %v", test.name, err) continue } serializedKey := priv.Serialize() if !bytes.Equal(serializedKey, test.key) { t.Errorf("%s unexpected serialized bytes - got: %x, "+ "want: %x", test.name, serializedKey, test.key) } } } var signatureTests = []signatureTest{ // signatures from bitcoin blockchain tx // 0437cd7f8525ceed2324359c2d0ba26006d92d85 { name: "valid signature.", sig: []byte{0x30, 0x44, 0x02, 0x20, 0x4e, 0x45, 0xe1, 0x69, 0x32, 0xb8, 0xaf, 0x51, 0x49, 0x61, 0xa1, 0xd3, 0xa1, 0xa2, 0x5f, 0xdf, 0x3f, 0x4f, 0x77, 0x32, 0xe9, 0xd6, 0x24, 0xc6, 0xc6, 0x15, 0x48, 0xab, 0x5f, 0xb8, 0xcd, 0x41, 0x02, 0x20, 0x18, 0x15, 0x22, 0xec, 0x8e, 0xca, 0x07, 0xde, 0x48, 0x60, 0xa4, 0xac, 0xdd, 0x12, 0x90, 0x9d, 0x83, 0x1c, 0xc5, 0x6c, 0xbb, 0xac, 0x46, 0x22, 0x08, 0x22, 0x21, 0xa8, 0x76, 0x8d, 0x1d, 0x09, }, der: true, isValid: true, }, { name: "empty.", sig: []byte{}, isValid: false, }, { name: "bad magic.", sig: []byte{0x31, 0x44, 0x02, 0x20, 0x4e, 0x45, 0xe1, 0x69, 0x32, 0xb8, 0xaf, 0x51, 0x49, 0x61, 0xa1, 0xd3, 0xa1, 0xa2, 0x5f, 0xdf, 0x3f, 0x4f, 0x77, 0x32, 0xe9, 0xd6, 0x24, 0xc6, 0xc6, 0x15, 0x48, 0xab, 0x5f, 0xb8, 0xcd, 0x41, 0x02, 0x20, 0x18, 0x15, 0x22, 0xec, 0x8e, 0xca, 0x07, 0xde, 0x48, 0x60, 0xa4, 0xac, 0xdd, 0x12, 0x90, 0x9d, 0x83, 0x1c, 0xc5, 0x6c, 0xbb, 0xac, 0x46, 0x22, 0x08, 0x22, 0x21, 0xa8, 0x76, 0x8d, 0x1d, 0x09, }, der: true, isValid: false, }, } func TestSignatures(t *testing.T) { for _, test := range signatureTests { var err error if test.der { _, err = Secp256k1.ParseDERSignature(test.sig) } else { _, err = Secp256k1.ParseSignature(test.sig) } if err != nil { if test.isValid { t.Errorf("%s signature failed when shouldn't %v", test.name, err) } continue } if !test.isValid { t.Errorf("%s counted as valid when it should fail", test.name) } } }
{ "pile_set_name": "Github" }
// // BABaseViewController.h // 博爱微信 // // Created by 博爱 on 2016/10/20. // Copyright © 2016年 博爱之家. All rights reserved. // #import <UIKit/UIKit.h> @interface BABaseViewController : UIViewController /*! * 设置UI */ - (void)setupUI; @end
{ "pile_set_name": "Github" }
import java.util.*; public class BinaryOps { public static void main(String[] args) //@ requires true; //@ ensures true; { int a = 60; /* 60 = 0011 1100 */ int b = 13; /* 13 = 0000 1101 */ int c = 0; c = a & b; c = a | b; c = a ^ b; c = ~a; c = a << 2; c = a >> 2; } }
{ "pile_set_name": "Github" }
<?php // hellow world; // echo "hello world"; // $a= 'hah'; // function test(){ // global $a; // echo $a; // } // test() // 引入的三种方式 02php $b='world'; // require('02.php'); // require_once('02.php'); // include_once('02.php') // var_dump($b) //isset() // 判断是否有这个变量 // $a = 'hah'; // var_dump(isset($a)); // php中数组定义 // $shuzu = array('0'=>'haha','1'=>'xixi'); // 数组转换为json // echo(json_encode($shuzu)); ?>
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf8" /> <meta name="generator" content="JsDoc Toolkit" /> <title>JsDoc Reference - mindmaps.CreateNodeCommand</title> <style type="text/css"> /* default.css */ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; width: 800px; } .header { clear: both; background-color: #ccc; padding: 8px; } h1 { font-size: 150%; font-weight: bold; padding: 0; margin: 1em 0 0 .3em; } hr { border: none 0; border-top: 1px solid #7F8FB1; height: 1px; } pre.code { display: block; padding: 8px; border: 1px dashed #ccc; } #index { margin-top: 24px; float: left; width: 270px; position: absolute; left: 8px; background-color: #F3F3F3; padding: 8px; } #content { margin-left: 300px; width: 600px; } .classList { list-style-type: none; padding: 0; margin: 0 0 0 8px; font-family: arial, sans-serif; font-size: 1em; overflow: auto; } .classList li { padding: 0; margin: 0 0 8px 0; } .summaryTable { width: 100%; } h1.classTitle { font-size:170%; line-height:130%; } h2 { font-size: 110%; } caption, div.sectionTitle { background-color: #7F8FB1; color: #fff; font-size:130%; text-align: left; padding: 2px 6px 2px 6px; border: 1px #7F8FB1 solid; } div.sectionTitle { margin-bottom: 8px; } .summaryTable thead { display: none; } .summaryTable td { vertical-align: top; padding: 4px; border-bottom: 1px #7F8FB1 solid; border-right: 1px #7F8FB1 solid; } /*col#summaryAttributes {}*/ .summaryTable td.attributes { border-left: 1px #7F8FB1 solid; width: 140px; text-align: right; } td.attributes, .fixedFont { line-height: 15px; color: #002EBE; font-family: "Courier New",Courier,monospace; font-size: 13px; } .summaryTable td.nameDescription { text-align: left; font-size: 13px; line-height: 15px; } .summaryTable td.nameDescription, .description { line-height: 15px; padding: 4px; padding-left: 4px; } .summaryTable { margin-bottom: 8px; } ul.inheritsList { list-style: square; margin-left: 20px; padding-left: 0; } .detailList { margin-left: 20px; line-height: 15px; } .detailList dt { margin-left: 20px; } .detailList .heading { font-weight: bold; padding-bottom: 6px; margin-left: 0; } .light, td.attributes, .light a:link, .light a:visited { color: #777; font-style: italic; } .fineprint { text-align: right; font-size: 10px; } </style> </head> <body> <!-- ============================== header ================================= --> <!-- begin static/header.html --> <div id="header"> </div> <!-- end static/header.html --> <!-- ============================== classes index ============================ --> <div id="index"> <!-- begin publish.classesIndex --> <div align="center"><a href="../index.html">Class Index</a> | <a href="../files.html">File Index</a></div> <hr /> <h2>Classes</h2> <ul class="classList"> <li><i><a href="../symbols/_global_.html">_global_</a></i></li> <li><a href="../symbols/mindmaps.html">mindmaps</a></li> <li><a href="../symbols/mindmaps.action.html">mindmaps.action</a></li> <li><a href="../symbols/mindmaps.action.Action.html">mindmaps.action.Action</a></li> <li><a href="../symbols/mindmaps.action.ChangeNodeCaptionAction.html">mindmaps.action.ChangeNodeCaptionAction</a></li> <li><a href="../symbols/mindmaps.action.ChangeNodeFontSizeAction.html">mindmaps.action.ChangeNodeFontSizeAction</a></li> <li><a href="../symbols/mindmaps.action.CloseNodeAction.html">mindmaps.action.CloseNodeAction</a></li> <li><a href="../symbols/mindmaps.action.CreateAutoPositionedNodeAction.html">mindmaps.action.CreateAutoPositionedNodeAction</a></li> <li><a href="../symbols/mindmaps.action.CreateNodeAction.html">mindmaps.action.CreateNodeAction</a></li> <li><a href="../symbols/mindmaps.action.DecreaseNodeFontSizeAction.html">mindmaps.action.DecreaseNodeFontSizeAction</a></li> <li><a href="../symbols/mindmaps.action.DeleteNodeAction.html">mindmaps.action.DeleteNodeAction</a></li> <li><a href="../symbols/mindmaps.action.IncreaseNodeFontSizeAction.html">mindmaps.action.IncreaseNodeFontSizeAction</a></li> <li><a href="../symbols/mindmaps.action.MoveNodeAction.html">mindmaps.action.MoveNodeAction</a></li> <li><a href="../symbols/mindmaps.action.OpenNodeAction.html">mindmaps.action.OpenNodeAction</a></li> <li><a href="../symbols/mindmaps.action.SetBranchColorAction.html">mindmaps.action.SetBranchColorAction</a></li> <li><a href="../symbols/mindmaps.action.SetFontColorAction.html">mindmaps.action.SetFontColorAction</a></li> <li><a href="../symbols/mindmaps.action.SetFontDecorationAction.html">mindmaps.action.SetFontDecorationAction</a></li> <li><a href="../symbols/mindmaps.action.SetFontStyleAction.html">mindmaps.action.SetFontStyleAction</a></li> <li><a href="../symbols/mindmaps.action.SetFontWeightAction.html">mindmaps.action.SetFontWeightAction</a></li> <li><a href="../symbols/mindmaps.action.ToggleNodeFoldAction.html">mindmaps.action.ToggleNodeFoldAction</a></li> <li><a href="../symbols/mindmaps.ApplicationController.html">mindmaps.ApplicationController</a></li> <li><a href="../symbols/mindmaps.CanvasContainer.html">mindmaps.CanvasContainer</a></li> <li><a href="../symbols/mindmaps.CanvasContainer.Event.html">mindmaps.CanvasContainer.Event</a></li> <li><a href="../symbols/mindmaps.CanvasPresenter.html">mindmaps.CanvasPresenter</a></li> <li><a href="../symbols/mindmaps.CanvasView.html">mindmaps.CanvasView</a></li> <li><a href="../symbols/mindmaps.ClipboardController.html">mindmaps.ClipboardController</a></li> <li><a href="../symbols/mindmaps.CloseDocumentCommand.html">mindmaps.CloseDocumentCommand</a></li> <li><a href="../symbols/mindmaps.Command.html">mindmaps.Command</a></li> <li><a href="../symbols/mindmaps.Command.Event.html">mindmaps.Command.Event</a></li> <li><a href="../symbols/mindmaps.CommandRegistry.html">mindmaps.CommandRegistry</a></li> <li><a href="../symbols/mindmaps.CopyNodeCommand.html">mindmaps.CopyNodeCommand</a></li> <li><a href="../symbols/mindmaps.CreateNodeCommand.html">mindmaps.CreateNodeCommand</a></li> <li><a href="../symbols/mindmaps.CutNodeCommand.html">mindmaps.CutNodeCommand</a></li> <li><a href="../symbols/mindmaps.DefaultCanvasView.html">mindmaps.DefaultCanvasView</a></li> <li><a href="../symbols/mindmaps.DefaultCanvasView-CaptionEditor.html">mindmaps.DefaultCanvasView-CaptionEditor</a></li> <li><a href="../symbols/mindmaps.DefaultCanvasView-Creator.html">mindmaps.DefaultCanvasView-Creator</a></li> <li><a href="../symbols/mindmaps.DefaultCanvasView-TextMetrics.html">mindmaps.DefaultCanvasView-TextMetrics</a></li> <li><a href="../symbols/mindmaps.DeleteNodeCommand.html">mindmaps.DeleteNodeCommand</a></li> <li><a href="../symbols/mindmaps.Document.html">mindmaps.Document</a></li> <li><a href="../symbols/mindmaps.EditNodeCaptionCommand.html">mindmaps.EditNodeCaptionCommand</a></li> <li><a href="../symbols/mindmaps.Event.html">mindmaps.Event</a></li> <li><a href="../symbols/mindmaps.EventBus.html">mindmaps.EventBus</a></li> <li><a href="../symbols/mindmaps.FloatPanel.html">mindmaps.FloatPanel</a></li> <li><a href="../symbols/mindmaps.FloatPanelFactory.html">mindmaps.FloatPanelFactory</a></li> <li><a href="../symbols/mindmaps.HelpCommand.html">mindmaps.HelpCommand</a></li> <li><a href="../symbols/mindmaps.HelpController.html">mindmaps.HelpController</a></li> <li><a href="../symbols/mindmaps.InspectorPresenter.html">mindmaps.InspectorPresenter</a></li> <li><a href="../symbols/mindmaps.InspectorView.html">mindmaps.InspectorView</a></li> <li><a href="../symbols/mindmaps.LocalDocumentStorage.html">mindmaps.LocalDocumentStorage</a></li> <li><a href="../symbols/mindmaps.MainViewController.html">mindmaps.MainViewController</a></li> <li><a href="../symbols/mindmaps.MindMap.html">mindmaps.MindMap</a></li> <li><a href="../symbols/mindmaps.MindMapModel.html">mindmaps.MindMapModel</a></li> <li><a href="../symbols/mindmaps.NavigatorPresenter.html">mindmaps.NavigatorPresenter</a></li> <li><a href="../symbols/mindmaps.NavigatorView.html">mindmaps.NavigatorView</a></li> <li><a href="../symbols/mindmaps.NewDocumentCommand.html">mindmaps.NewDocumentCommand</a></li> <li><a href="../symbols/mindmaps.NewDocumentPresenter.html">mindmaps.NewDocumentPresenter</a></li> <li><a href="../symbols/mindmaps.NewDocumentView.html">mindmaps.NewDocumentView</a></li> <li><a href="../symbols/mindmaps.Node.html">mindmaps.Node</a></li> <li><a href="../symbols/mindmaps.NodeMap.html">mindmaps.NodeMap</a></li> <li><a href="../symbols/mindmaps.Notification.html">mindmaps.Notification</a></li> <li><a href="../symbols/mindmaps.OpenDocumentCommand.html">mindmaps.OpenDocumentCommand</a></li> <li><a href="../symbols/mindmaps.OpenDocumentPresenter.html">mindmaps.OpenDocumentPresenter</a></li> <li><a href="../symbols/mindmaps.OpenDocumentView.html">mindmaps.OpenDocumentView</a></li> <li><a href="../symbols/mindmaps.PasteNodeCommand.html">mindmaps.PasteNodeCommand</a></li> <li><a href="../symbols/mindmaps.Point.html">mindmaps.Point</a></li> <li><a href="../symbols/mindmaps.RedoCommand.html">mindmaps.RedoCommand</a></li> <li><a href="../symbols/mindmaps.SaveDocumentCommand.html">mindmaps.SaveDocumentCommand</a></li> <li><a href="../symbols/mindmaps.SaveDocumentPresenter.html">mindmaps.SaveDocumentPresenter</a></li> <li><a href="../symbols/mindmaps.SaveDocumentView.html">mindmaps.SaveDocumentView</a></li> <li><a href="../symbols/mindmaps.ShortcutController.html">mindmaps.ShortcutController</a></li> <li><a href="../symbols/mindmaps.StatusBarPresenter.html">mindmaps.StatusBarPresenter</a></li> <li><a href="../symbols/mindmaps.StatusBarView.html">mindmaps.StatusBarView</a></li> <li><a href="../symbols/mindmaps.StatusNotificationController.html">mindmaps.StatusNotificationController</a></li> <li><a href="../symbols/mindmaps.ToggleNodeFoldedCommand.html">mindmaps.ToggleNodeFoldedCommand</a></li> <li><a href="../symbols/mindmaps.ToolBarButton.html">mindmaps.ToolBarButton</a></li> <li><a href="../symbols/mindmaps.ToolBarMenu.html">mindmaps.ToolBarMenu</a></li> <li><a href="../symbols/mindmaps.ToolBarPresenter.html">mindmaps.ToolBarPresenter</a></li> <li><a href="../symbols/mindmaps.ToolBarView.html">mindmaps.ToolBarView</a></li> <li><a href="../symbols/mindmaps.UndoCommand.html">mindmaps.UndoCommand</a></li> <li><a href="../symbols/mindmaps.UndoController.html">mindmaps.UndoController</a></li> <li><a href="../symbols/mindmaps.Util.html">mindmaps.Util</a></li> <li><a href="../symbols/mindmaps.ZoomController.html">mindmaps.ZoomController</a></li> <li><a href="../symbols/UndoManager.html">UndoManager</a></li> <li><a href="../symbols/UndoManager.CircularStack.html">UndoManager.CircularStack</a></li> </ul> <hr /> <!-- end publish.classesIndex --> </div> <div id="content"> <!-- ============================== class title ============================ --> <h1 class="classTitle"> Class mindmaps.CreateNodeCommand </h1> <!-- ============================== class summary ========================== --> <p class="description"> <br />Extends <a href="../symbols/mindmaps.Command.html">mindmaps.Command</a>.<br /> <br /><i>Defined in: </i> <a href="../symbols/src/src_js_Command.js.html">Command.js</a>. </p> <!-- ============================== constructor summary ==================== --> <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class mindmaps.CreateNodeCommand."> <caption>Class Summary</caption> <thead> <tr> <th scope="col">Constructor Attributes</th> <th scope="col">Constructor Name and Description</th> </tr> </thead> <tbody> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription" > <div class="fixedFont"> <b><a href="../symbols/mindmaps.CreateNodeCommand.html#constructor">mindmaps.CreateNodeCommand</a></b>() </div> <div class="description">Creates a new CreateNodeCommand.</div> </td> </tr> </tbody> </table> <!-- ============================== properties summary ===================== --> <dl class="inheritsList"> <dt>Fields borrowed from class <a href="../symbols/mindmaps.Command.html">mindmaps.Command</a>: </dt><dd><a href="../symbols/mindmaps.Command.html#enabled">enabled</a></dd> </dl> <!-- ============================== methods summary ======================== --> <dl class="inheritsList"> <dt>Methods borrowed from class <a href="../symbols/mindmaps.Command.html">mindmaps.Command</a>: </dt><dd><a href="../symbols/mindmaps.Command.html#execute">execute</a>, <a href="../symbols/mindmaps.Command.html#handler">handler</a>, <a href="../symbols/mindmaps.Command.html#removeHandler">removeHandler</a>, <a href="../symbols/mindmaps.Command.html#setEnabled">setEnabled</a>, <a href="../symbols/mindmaps.Command.html#setHandler">setHandler</a></dd> </dl> <!-- ============================== events summary ======================== --> <!-- ============================== constructor details ==================== --> <div class="details"><a name="constructor"> </a> <div class="sectionTitle"> Class Detail </div> <div class="fixedFont"> <b>mindmaps.CreateNodeCommand</b>() </div> <div class="description"> Creates a new CreateNodeCommand. </div> </div> <!-- ============================== field details ========================== --> <!-- ============================== method details ========================= --> <!-- ============================== event details ========================= --> <hr /> </div> <!-- ============================== footer ================================= --> <div class="fineprint" style="clear:both"> Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Mon Jul 18 2011 18:03:15 GMT+0000 (WEST) </div> </body> </html>
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: e109905c411b0f84e82eaaf2705ece30 TextureImporter: fileIDToRecycleName: {} externalObjects: {} serializedVersion: 5 mipmaps: mipMapMode: 0 enableMipMap: 1 sRGBTexture: 0 linearTexture: 0 fadeOut: 0 borderMipMap: 0 mipMapsPreserveCoverage: 0 alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 seamlessCubemap: 0 textureFormat: 1 maxTextureSize: 2048 textureSettings: serializedVersion: 2 filterMode: 2 aniso: 2 mipBias: -1 wrapU: -1 wrapV: -1 wrapW: -1 nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 100 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 1 textureShape: 1 singleChannelComponent: 0 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 platformSettings: - serializedVersion: 2 buildTarget: DefaultTexturePlatform maxTextureSize: 8192 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - serializedVersion: 2 buildTarget: Standalone maxTextureSize: 8192 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - serializedVersion: 2 buildTarget: iPhone maxTextureSize: 8192 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - serializedVersion: 2 buildTarget: Android maxTextureSize: 8192 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - serializedVersion: 2 buildTarget: Windows Store Apps maxTextureSize: 8192 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] bones: [] spriteID: vertices: [] indices: edges: [] weights: [] spritePackingTag: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # Media Device Allocator API test script # Copyright (c) 2019 Shuah Khan <[email protected]> echo "Media Device Allocator testing: unbind and bind" echo "media driver $1 audio driver $2" MDRIVER=/sys/bus/usb/drivers/$1 cd $MDRIVER MDEV=$(ls -d *\-*) ADRIVER=/sys/bus/usb/drivers/$2 cd $ADRIVER ADEV=$(ls -d *\-*.1) echo "==================================" echo "Test unbind both devices - start" echo "Running unbind of $MDEV from $MDRIVER" echo $MDEV > $MDRIVER/unbind; echo "Media device should still be present!" ls -l /dev/media* echo "sound driver is at: $ADRIVER" echo "Device is: $ADEV" echo "Running unbind of $ADEV from $ADRIVER" echo $ADEV > $ADRIVER/unbind; echo "Media device should have been deleted!" ls -l /dev/media* echo "Test unbind both devices - end" echo "==================================" echo "Test bind both devices - start" echo "Running bind of $MDEV from $MDRIVER" echo $MDEV > $MDRIVER/bind; echo "Media device should be present!" ls -l /dev/media* echo "Running bind of $ADEV from $ADRIVER" echo $ADEV > $ADRIVER/bind; echo "Media device should be there!" ls -l /dev/media* echo "Test bind both devices - end" echo "==================================" echo "Test unbind $MDEV - bind $MDEV - unbind $ADEV - bind $ADEV start" echo "Running unbind of $MDEV from $MDRIVER" echo $MDEV > $MDRIVER/unbind; echo "Media device should be there!" ls -l /dev/media* sleep 1 echo "Running bind of $MDEV from $MDRIVER" echo $MDEV > $MDRIVER/bind; echo "Media device should be there!" ls -l /dev/media* echo "Running unbind of $ADEV from $ADRIVER" echo $ADEV > $ADRIVER/unbind; echo "Media device should be there!" ls -l /dev/media* sleep 1 echo "Running bind of $ADEV from $ADRIVER" echo $ADEV > $ADRIVER/bind; echo "Media device should be there!" ls -l /dev/media* echo "Test unbind $MDEV - bind $MDEV - unbind $ADEV - bind $ADEV end" echo "=================================="
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:e4601606f048f7f1e06eaecc5d19f0cd489d50739555968f4627d0a9869f64d8 size 7924
{ "pile_set_name": "Github" }
import Simple from "./simple.js"; import Speed from "./speed.js"; import Action from "./action.js"; export default { Simple, Speed, Action }; export { SpeedActor } from "./speed.js"
{ "pile_set_name": "Github" }
@import UIKit; @protocol VeeContactPickerDelegate; @interface VeeContactPickerExampleViewController : UIViewController <VeeContactPickerDelegate> @end
{ "pile_set_name": "Github" }
#include <stdlib.h> #include <nan.h> #include "src/rabin_wrap.h" using namespace v8; NAN_METHOD(Rabin) { info.GetReturnValue().Set(RabinWrap::NewInstance()); } NAN_MODULE_INIT(InitAll) { RabinWrap::Init(); Nan::Set(target, Nan::New<String>("rabin").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(Rabin)).ToLocalChecked()); } NODE_MODULE(rabin, InitAll)
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 1a0f3888fa18d9342b2bbd7b7f172130 folderAsset: yes timeCreated: 1460638843 licenseType: Pro DefaultImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
use crate::error; use crate::value; use avro_rs; use std; use std::fmt; use std::io; pub struct Source<'a, R>(avro_rs::Reader<'a, R>) where R: io::Read; pub struct Sink<'a, W>(avro_rs::Writer<'a, W>) where W: io::Write; #[inline] pub fn source<'a, R>(r: R) -> error::Result<Source<'a, R>> where R: io::Read, { Ok(Source(avro_rs::Reader::new(r).map_err(|e| { error::Error::Avro(error::Avro::downcast(e)) })?)) } #[inline] pub fn sink<W>(schema: &avro_rs::Schema, w: W, codec: avro_rs::Codec) -> error::Result<Sink<W>> where W: io::Write, { Ok(Sink(avro_rs::Writer::with_codec(schema, w, codec))) } impl<'a, R> value::Source for Source<'a, R> where R: io::Read, { #[inline] fn read(&mut self) -> error::Result<Option<value::Value>> { match self.0.next() { Some(Ok(v)) => Ok(Some(value_from_avro(v))), Some(Err(e)) => Err(error::Error::Avro(error::Avro::downcast(e))), None => Ok(None), } } } fn value_from_avro(value: avro_rs::types::Value) -> value::Value { use avro_rs::types::Value; match value { Value::Null => value::Value::Unit, Value::Boolean(v) => value::Value::Bool(v), Value::Int(v) => value::Value::I32(v), Value::Long(v) => value::Value::I64(v), Value::Float(v) => value::Value::from_f32(v), Value::Double(v) => value::Value::from_f64(v), Value::Bytes(v) | Value::Fixed(_, v) => value::Value::Bytes(v), Value::String(v) | Value::Enum(_, v) => value::Value::String(v), Value::Union(boxed) => value_from_avro(*boxed), Value::Array(v) => value::Value::Sequence(v.into_iter().map(value_from_avro).collect()), Value::Map(v) => value::Value::Map( v.into_iter() .map(|(k, v)| (value::Value::String(k), value_from_avro(v))) .collect(), ), Value::Record(v) => value::Value::Map( v.into_iter() .map(|(k, v)| (value::Value::String(k), value_from_avro(v))) .collect(), ), } } impl<'a, W> value::Sink for Sink<'a, W> where W: io::Write, { #[inline] fn write(&mut self, value: value::Value) -> error::Result<()> { self.0 .append(value_to_avro(value)?) .map_err(|e| error::Error::Avro(error::Avro::downcast(e)))?; Ok(()) } } fn value_to_avro(value: value::Value) -> error::Result<avro_rs::types::Value> { use avro_rs::types::Value; use std::convert::TryFrom; match value { value::Value::Unit => Ok(Value::Null), value::Value::Bool(v) => Ok(Value::Boolean(v)), value::Value::I8(v) => Ok(Value::Int(i32::from(v))), value::Value::I16(v) => Ok(Value::Int(i32::from(v))), value::Value::I32(v) => Ok(Value::Int(v)), value::Value::I64(v) => Ok(Value::Long(v)), value::Value::U8(v) => Ok(Value::Int(i32::from(v))), value::Value::U16(v) => Ok(Value::Int(i32::from(v))), value::Value::U32(v) => Ok(Value::Long(i64::from(v))), value::Value::U64(v) => { if let Ok(v) = i64::try_from(v) { Ok(Value::Long(v)) } else { Err(error::Error::Format { msg: format!( "Avro output does not support unsigned 64 bit integer: {}", v ), }) } } value::Value::F32(ordered_float::OrderedFloat(v)) => Ok(Value::Float(v)), value::Value::F64(ordered_float::OrderedFloat(v)) => Ok(Value::Double(v)), value::Value::Char(v) => Ok(Value::String(format!("{}", v))), value::Value::String(v) => Ok(Value::String(v)), value::Value::Bytes(v) => Ok(Value::Bytes(v)), value::Value::Sequence(v) => Ok(Value::Array( v.into_iter() .map(value_to_avro) .collect::<error::Result<Vec<_>>>()?, )), value::Value::Map(v) => Ok(Value::Record( v.into_iter() .map(|(k, v)| match (value_to_string(k), value_to_avro(v)) { (Ok(k), Ok(v)) => Ok((k, v)), (Ok(_), Err(e)) | (Err(e), Ok(_)) | (Err(_), Err(e)) => Err(e), }) .collect::<error::Result<Vec<_>>>()?, )), } } fn value_to_string(value: value::Value) -> error::Result<String> { match value { value::Value::Char(v) => Ok(format!("{}", v)), value::Value::String(v) => Ok(v), x => Err(error::Error::Format { msg: format!("Avro can only output string keys, got: {:?}", x), }), } } impl<'a, R> fmt::Debug for Source<'a, R> where R: io::Read, { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("AvroSource").finish() } } impl<'a, W> fmt::Debug for Sink<'a, W> where W: io::Write, { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("AvroSink").finish() } } impl<'a, W> Drop for Sink<'a, W> where W: io::Write, { fn drop(&mut self) { match self.0.flush() { Ok(_) => (), Err(error) => panic!(error), } } }
{ "pile_set_name": "Github" }
use crate::diagn::RcReport; use crate::util::FileServer; use crate::util::enable_windows_ansi_support; use crate::asm::AssemblerState; use std::io::stdout; use getopts; enum OutputFormat { Binary, AnnotatedHex, AnnotatedBin, BinStr, HexStr, BinDump, HexDump, Mif, IntelHex, DecComma, HexComma, DecC, HexC, LogiSim8, LogiSim16, } pub fn drive(args: &Vec<String>, fileserver: &mut dyn FileServer) -> Result<(), ()> { let opts = make_opts(); let report = RcReport::new(); let result = drive_inner(report.clone(), &opts, args, fileserver); if report.has_messages() { println!(""); } enable_windows_ansi_support(); report.print_all(&mut stdout(), fileserver); if let Err(show_usage) = result { if show_usage { print_version_short(); print_usage(&opts); } } result.map_err(|_| ()) } fn drive_inner(report: RcReport, opts: &getopts::Options, args: &Vec<String>, fileserver: &mut dyn FileServer) -> Result<(), bool> { let matches = parse_opts(report.clone(), opts, args).map_err(|_| true)?; if matches.opt_present("h") { print_version_full(); print_usage(&opts); return Ok(()); } if matches.opt_present("v") { print_version_full(); return Ok(()); } let quiet = matches.opt_present("q"); let out_stdout = matches.opt_present("p"); let out_format = match matches.opt_str("f").as_ref().map(|s| s.as_ref()) { Some("annotated") => OutputFormat::AnnotatedHex, Some("annotatedhex") => OutputFormat::AnnotatedHex, Some("annotatedbin") => OutputFormat::AnnotatedBin, Some("binstr") => OutputFormat::BinStr, Some("bindump") => OutputFormat::BinDump, Some("hexstr") => OutputFormat::HexStr, Some("hexdump") => OutputFormat::HexDump, Some("binary") => OutputFormat::Binary, Some("mif") => OutputFormat::Mif, Some("intelhex") => OutputFormat::IntelHex, Some("deccomma") => OutputFormat::DecComma, Some("hexcomma") => OutputFormat::HexComma, Some("decc") => OutputFormat::DecC, Some("hexc") => OutputFormat::HexC, Some("c") => OutputFormat::HexC, Some("logisim8") => OutputFormat::LogiSim8, Some("logisim16") => OutputFormat::LogiSim16, None => if out_stdout { OutputFormat::AnnotatedHex } else { OutputFormat::Binary }, Some(_) => { report.error("invalid output format"); return Err(true); } }; if matches.free.len() < 1 { return Err(true); } let main_asm_file = matches.free[0].clone(); let output_symbol_requested = matches.opt_present("s"); let output_requested = matches.opt_present("o"); let output_symbol_file = matches.opt_str("s"); let output_file = match matches.opt_str("o") { Some(f) => Some(f), None => { if output_symbol_requested || output_symbol_file.is_some() { None } else { match get_default_output_filename(report.clone(), &main_asm_file) { Ok(f) => Some(f), Err(_) => None, } } } }; let mut filenames = matches.opt_strs("i"); for filename in matches.free { filenames.push(filename); } let assembled = assemble(report.clone(), fileserver, &filenames, quiet).map_err(|_| false)?; let output = assembled.get_binary_output(); let output_symbol_data = assembled.get_symbol_output(); let output_data = match out_format { OutputFormat::Binary => output.generate_binary(0, output.len()), OutputFormat::BinStr => output.generate_binstr (0, output.len()).bytes().collect::<Vec<u8>>(), OutputFormat::BinDump => output.generate_bindump (0, output.len()).bytes().collect::<Vec<u8>>(), OutputFormat::HexStr => output.generate_hexstr (0, output.len()).bytes().collect::<Vec<u8>>(), OutputFormat::HexDump => output.generate_hexdump (0, output.len()).bytes().collect::<Vec<u8>>(), OutputFormat::Mif => output.generate_mif (0, output.len()).bytes().collect::<Vec<u8>>(), OutputFormat::IntelHex => output.generate_intelhex(0, output.len()).bytes().collect::<Vec<u8>>(), OutputFormat::DecComma => output.generate_comma (0, output.len(), 10).bytes().collect::<Vec<u8>>(), OutputFormat::HexComma => output.generate_comma (0, output.len(), 16).bytes().collect::<Vec<u8>>(), OutputFormat::DecC => output.generate_c_array (0, output.len(), 10).bytes().collect::<Vec<u8>>(), OutputFormat::HexC => output.generate_c_array (0, output.len(), 16).bytes().collect::<Vec<u8>>(), OutputFormat::LogiSim8 => output.generate_logisim (0, output.len(), 8).bytes().collect::<Vec<u8>>(), OutputFormat::LogiSim16 => output.generate_logisim (0, output.len(), 16).bytes().collect::<Vec<u8>>(), OutputFormat::AnnotatedHex => output.generate_annotated_hex(fileserver, 0, output.len()).bytes().collect::<Vec<u8>>(), OutputFormat::AnnotatedBin => output.generate_annotated_bin(fileserver, 0, output.len()).bytes().collect::<Vec<u8>>(), }; if out_stdout { if !quiet { println!("success"); println!(""); } if output_requested || output_file.is_some() { println!("{}", String::from_utf8_lossy(&output_data)); } if output_symbol_requested || output_symbol_file.is_some() { println!("{}", &output_symbol_data); } } else { let mut any_files_written = false; if let Some(ref output_file) = output_file { println!("writing `{}`...", &output_file); fileserver.write_bytes(report.clone(), &output_file, &output_data, None).map_err(|_| false)?; any_files_written = true; } if let Some(ref output_symbol_file) = output_symbol_file { println!("writing `{}`...", &output_symbol_file); fileserver.write_bytes(report.clone(), &output_symbol_file, &output_symbol_data.bytes().collect::<Vec<u8>>(), None).map_err(|_| false)?; any_files_written = true; } if !any_files_written { println!("no files written"); } if !quiet { println!("success"); } } Ok(()) } fn make_opts() -> getopts::Options { let mut opts = getopts::Options::new(); opts.optopt("f", "format", "The format of the output file. Possible formats: binary, annotated, annotatedbin, binstr, hexstr, bindump, hexdump, mif, intelhex, deccomma, hexcomma, decc, hexc, logisim8, logisim16", "FORMAT"); opts.optmulti("i", "include", "Specifies an additional file for processing before the given <asm-files>. [deprecated]", "FILE"); opts.opt("o", "output", "The name of the output file.", "FILE", getopts::HasArg::Maybe, getopts::Occur::Optional); opts.opt("s", "symbol", "The name of the output symbol file.", "FILE", getopts::HasArg::Maybe, getopts::Occur::Optional); opts.optflag("p", "print", "Print output to stdout instead of writing to a file."); opts.optflag("q", "quiet", "Suppress progress reports."); opts.optflag("v", "version", "Display version information."); opts.optflag("h", "help", "Display this information."); opts } fn parse_opts(report: RcReport, opts: &getopts::Options, args: &Vec<String>) -> Result<getopts::Matches, ()> { match opts.parse(&args[1..]) { Ok(m) => Ok(m), Err(f) => Err(report.error(format!("{}", f))) } } fn print_usage(opts: &getopts::Options) { println!(""); println!("{}", opts.usage(&format!("Usage: {} [options] <asm-file-1> ... <asm-file-N>", env!("CARGO_PKG_NAME")))); } fn print_version_short() { println!("{} {} ({}, {})", env!("CARGO_PKG_NAME"), env!("VERGEN_SEMVER_LIGHTWEIGHT"), env!("VERGEN_COMMIT_DATE"), env!("VERGEN_TARGET_TRIPLE")); } fn print_version_full() { println!("{} {} ({}, {})", env!("CARGO_PKG_NAME"), env!("VERGEN_SEMVER_LIGHTWEIGHT"), env!("VERGEN_COMMIT_DATE"), env!("VERGEN_TARGET_TRIPLE")); println!("https://github.com/hlorenzi/customasm"); } fn get_default_output_filename(report: RcReport, input_filename: &str) -> Result<String, ()> { use std::path::PathBuf; let mut output_filename = PathBuf::from(input_filename); output_filename.set_extension("bin"); let output_filename = output_filename.to_string_lossy().into_owned().replace("\\", "/"); if output_filename == input_filename { return Err(report.error("cannot derive safe output filename")); } Ok(output_filename) } pub fn assemble(report: RcReport, fileserver: &dyn FileServer, filenames: &[String], quiet: bool) -> Result<AssemblerState, ()> { if !quiet { print_version_short(); } let mut asm = AssemblerState::new(); for filename in filenames { let filename_owned = filename.clone(); if !quiet { println!("assembling `{}`...", &filename_owned); } asm.process_file(report.clone(), fileserver, filename_owned)?; } asm.wrapup(report)?; Ok(asm) }
{ "pile_set_name": "Github" }
{ "name": "svelte-app", "version": "1.0.0", "scripts": { "build": "rollup -c", "dev": "rollup -c -w", "start": "sirv public" }, "devDependencies": { "@fullhuman/postcss-purgecss": "^3.0.0", "@mdi/js": "^5.5.55", "@rollup/plugin-commonjs": "^14.0.0", "@rollup/plugin-html": "^0.2.0", "@rollup/plugin-node-resolve": "^9.0.0", "bulma": "^0.9.0", "compare-versions": "^3.6.0", "mdi-svelte": "^1.1.1", "node-sass": "^4.14.1", "obs-websocket-js": "github:Niek/obs-websocket-js", "rollup": "^2.26.9", "rollup-plugin-livereload": "^2.0.0", "rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-postcss": "^3.1.8", "rollup-plugin-svelte": "^6.0.0", "rollup-plugin-terser": "^7.0.1", "svelte": "^3.24.1" }, "dependencies": { "sirv-cli": "^1.0.6" } }
{ "pile_set_name": "Github" }
GtkBalls is a simple logic game. The goal of the game is to make the maximum number of lines with balls of the same color. A line is made of five balls. Each time you don't make a line, extra balls appear on the grid. You lose when the grid is full.
{ "pile_set_name": "Github" }
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build amd64,linux // +build !gccgo package unix import "syscall" //go:noescape func gettimeofday(tv *Timeval) (err syscall.Errno)
{ "pile_set_name": "Github" }
#include <assert.h> #include <intrin.h> int main() { _InterlockedOr8(); assert(0); return 0; }
{ "pile_set_name": "Github" }
{ "Information for OEMs": "", "Give your customers the best experience with elementary OS.": "", "Partners &amp; Retailers": "", "We offer two ways to be listed as an OEM of elementary OS in <a href=\"store/\">our store</a>, with differing requirements and benefits.": "", "Partner": "", "Model-by-model approval with those specific models featured in <a href=\"store/\">our store</a>.": "", "Requirements:": "", "Official involvement from elementary, Inc.": "", "Negotiable per-device royalty": "", "Strict software guidelines": "", "Trademark compliance": "", "Retailer": "", "A link to your website or landing page listed in <a href=\"store/\">our store</a>.": "", "Selling devices with elementary OS": "", "Per-device royalty encouraged": "", "Resources": "", "Installation": "", "We recommend using the built-in OEM installation procedure provided by the Ubuntu installer. OEMs can install the OS, configure anything necessary, and then prepare the device for shipping to end users.": "", "<a href=\"https://help.ubuntu.com/community/Ubuntu_OEM_Installer_Overview\" target=\"_blank\" rel=\"noopener\" class=\"read-more\">Ubuntu Instructions</a>": "", "<strong>Note:</strong> a new installer is being developed that will simplify the installation process.": "", "<a href=\"https://github.com/elementary/installer\" target=\"_blank\" rel=\"noopener\" class=\"read-more\">New Installer</a>": "", "System Settings": "", "System Settings offers several advantages to OEMs shipping elementary OS. From its pluggable architecture to easily-provided branding, System Settings was designed with OEMs in mind.": "", "Plugs": "", "System Settings (codenamed <a href=\"https://github.com/elementary/switchboard\" target=\"_blank\" rel=\"noopener\">Switchboard</a>) uses a concept of “Plugs” to provide pluggable settings for various hardware and software concerns. For example, <a href=\"https://github.com/elementary/switchboard-plug-mouse-touchpad/\" target=\"_blank\" rel=\"noopener\">Mouse & Touchpad settings</a> are provided by a plug.": "", "Switchboard": "", "OEMs are able to develop and ship custom plugs if there is special or unique hardware in the machine that would require configuration outside of what is available by default in elementary OS; for example, special sensors or input methods that are not present in most hardware and therefor not implemented by default. Of course if this configuration could be relevant to a broader set of users, contributing upstream to the <a href=\"https://github.com/elementary?q=switchboard-plug\" target=\"_blank\" rel=\"noopener\">existing plugs</a> is heavily encouraged.": "", "Documentation": "", "OEM Info in About": "", "The <a href=\"https://github.com/elementary/switchboard-plug-about/\" target=\"_blank\" rel=\"noopener\">About</a> plug displays system information to the user and provides several system-wide actions, such as restoring settings, reporting issues, and getting help. In addition to software information (like the OS version), it also provides a space for hardware information. By default, this is filled in with a generic image and the system’s hostname. However, OEMs can provide custom branded data for this section.": "", "Switchboard About": "", "By providing an <code>oem.conf</code> file, OEMs can fill in the manufacturer name, product name, model number, and manufacturer URL. An image can also be provided which replaces the generic hardware icon.": "", "Learn More": "", "Third-Party Repositories": "", "It is highly discouraged to ship elementary OS with software repositories other than the defaults in elementary OS plus a single repository provided and controlled by the OEM. <strong>Third-party repos effectively give root access and the ability to overwrite any system packages to potentially untrusted third parties.</strong> Even if the party is trustworthy, an OEM’s customer’s security and privacy are now at stake if third parties are compromised, reuse their password on multiple services, etc.": "", "Further, if a third-party repository ever becomes unmaintained or unpublished, <strong>it may prevent normal system upgrades.</strong> This could hold back potentially serious security and stability updates from reaching the OEM’s customers.": "", "News &amp; Announcements": "", "We share frequent updates on development, major announcements, tips for developers, featured apps, and other new content via our Blog.": "", "Visit our Blog": "", "Brand Resources": "", "View the elementary logos, brand usage guidelines, color palette, and community logo. Plus download the official high-resolution and vector elementary logo assets.": "", "View Brand Resources": "", "Get in Touch": "", "Talk directly with the team by emailing us at <a href=\"mailto:[email protected]\">[email protected]</a>. Whether you’re an existing partner or want to explore offering elementary OS, we look forward to chatting.": "", "Send an Email": "", "Information for OEMs &sdot; elementary": "" }
{ "pile_set_name": "Github" }
/* * This file is part of Mixin, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.spongepowered.asm.mixin.injection.struct; import org.objectweb.asm.tree.AnnotationNode; import org.objectweb.asm.tree.MethodNode; import org.spongepowered.asm.mixin.injection.ModifyArgs; import org.spongepowered.asm.mixin.injection.code.Injector; import org.spongepowered.asm.mixin.injection.invoke.ModifyArgsInjector; import org.spongepowered.asm.mixin.injection.struct.InjectionInfo.AnnotationType; import org.spongepowered.asm.mixin.injection.struct.InjectionInfo.HandlerPrefix; import org.spongepowered.asm.mixin.transformer.MixinTargetContext; /** * Information about a {@link ModifyArgs} injector */ @AnnotationType(ModifyArgs.class) @HandlerPrefix("args") public class ModifyArgsInjectionInfo extends InjectionInfo { public ModifyArgsInjectionInfo(MixinTargetContext mixin, MethodNode method, AnnotationNode annotation) { super(mixin, method, annotation); } @Override protected Injector parseInjector(AnnotationNode injectAnnotation) { return new ModifyArgsInjector(this); } @Override protected String getDescription() { return "Multi-argument modifier method"; } }
{ "pile_set_name": "Github" }
namespace BasicPhysic2D { [global::Foundation.Register ("AppDelegate")] public partial class AppDelegate { } }
{ "pile_set_name": "Github" }
SyntaxError: Incompatible units. Change the units or use the unit function. Bad units: 'px' and 'em'. in {path}add-mixed-units.less on line null, column 0: 1 error: (1px + 3em);
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>gallery-yql-rest-client-oauth - YQL REST Client OAuth</title> <link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.4.0&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css"> <link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css"> <link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles"> <script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.4.0&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script> </head> <body class="yui3-skin-sam"> <div id="doc"> <div id="hd" class="yui3-g header"> <div class="yui3-u-3-4"> <h1><img src="..&#x2F;assets/css/logo.png"></h1> </div> <div class="yui3-u-1-4 version"> <em>API Docs for: undefined</em> </div> </div> <div id="bd" class="yui3-g"> <div class="yui3-u-1-4"> <div id="docs-sidebar" class="sidebar apidocs"> <div id="api-list"> <h2 class="off-left">APIs</h2> <div id="api-tabview" class="tabview"> <ul class="tabs"> <li><a href="#api-classes">Classes</a></li> <li><a href="#api-modules">Modules</a></li> </ul> <div id="api-tabview-filter"> <input type="search" id="api-filter" placeholder="Type to filter APIs"> </div> <div id="api-tabview-panel"> <ul id="api-classes" class="apis classes"> <li><a href="..&#x2F;classes/YQLRESTClient.html">YQLRESTClient</a></li> </ul> <ul id="api-modules" class="apis modules"> <li><a href="..&#x2F;modules/gallery-yql-rest-client-oauth.html">gallery-yql-rest-client-oauth</a></li> </ul> </div> </div> </div> </div> </div> <div class="yui3-u-3-4"> <div id="api-options"> Show: <label for="api-show-inherited"> <input type="checkbox" id="api-show-inherited" checked> Inherited </label> <label for="api-show-protected"> <input type="checkbox" id="api-show-protected"> Protected </label> <label for="api-show-private"> <input type="checkbox" id="api-show-private"> Private </label> </div> <div class="apidocs"> <div id="docs-main" class="content"> <h1>gallery-yql-rest-client-oauth Module</h1> <div class="box clearfix meta"> <div class="foundat"> Defined in: <a href="../files&#x2F;js_yql-rest-client-oauth.js.html#l1"><code>js&#x2F;yql-rest-client-oauth.js:1</code></a> </div> </div> <div class="box intro"> <p>This module is a REST client supporting OAuth signatures.</p> </div> <div class="yui3-g"> <div class="yui3-u-1-2"> <p>This module provides the following classes:</p> <ul class="module-classes"> <li class="module-class"> <a href="..&#x2F;classes/YQLRESTClient.html"> YQLRESTClient </a> </li> </ul> </div> <div class="yui3-u-1-2"> </div> </div> </div> </div> </div> </div> </div> <script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script> <script>prettyPrint();</script> <script src="..&#x2F;assets/js/yui-prettify.js"></script> <!--script src="..&#x2F;assets/js/tabs.js"></script--> <script src="..&#x2F;assets/../api.js"></script> <script src="..&#x2F;assets/js/api-filter.js"></script> <script src="..&#x2F;assets/js/api-list.js"></script> <script src="..&#x2F;assets/js/api-search.js"></script> <script src="..&#x2F;assets/js/apidocs.js"></script> </body> </html>
{ "pile_set_name": "Github" }
// Copyright 2019 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package procfs import ( "strings" "github.com/prometheus/procfs/internal/util" ) // Environ reads process environments from /proc/<pid>/environ func (p Proc) Environ() ([]string, error) { environments := make([]string, 0) data, err := util.ReadFileNoStat(p.path("environ")) if err != nil { return environments, err } environments = strings.Split(string(data), "\000") if len(environments) > 0 { environments = environments[:len(environments)-1] } return environments, nil }
{ "pile_set_name": "Github" }
{ "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
## set_display_mode ## ```python fpdf.set_display_mode(zoom, layout: str) ``` ### Description ### Defines the way the document is to be displayed by the viewer. The zoom level can be set: pages can be displayed entirely on screen, occupy the full width of the window, use the real size, be scaled by a specific zooming factor or use the viewer default (configured in the Preferences menu of Adobe Reader). The page layout can be specified too: single page at a time, continuous display, two columns or viewer default. If this method is not called, the zoom mode is set to _fullwidth_ and the layout is set to _continuous_ by default. ### Parameters ### zoom: > The zoom to use. It can be one of the following string values: >> * `fullpage`: displays the entire page on the screen >> * `fullwidth`: uses the maximum width of the window >> * `real`: uses the real size (equivalent to 100% zoom) >> * `default`: uses the viewer default mode > > or a number indicating the zooming factor to use, as a percentage. layout: > The page layout. Possible values are: >> * `single`: displays one page at a time >> * `continuous`: displays pages continuously >> * `two`: displays two pages in two columns >> * `default`: uses the viewer default mode > > The default value is `continuous`.
{ "pile_set_name": "Github" }
Educational Community License, Version 2.0 (ECL-2.0) (plain text) Educational Community License Version 2.0, April 2007 http://www.osedu.org/licenses/ The Educational Community License version 2.0 ("ECL") consists of the Apache 2.0 license, modified to change the scope of the patent grant in section 3 to be specific to the needs of the education communities using this license. The original Apache 2.0 license can be found at: http://www.apache.org/licenses/LICENSE-2.0 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. Any patent license granted hereby with respect to contributions by an individual employed by an institution or organization is limited to patent claims where the individual that is the author of the Work is also the inventor of the patent claims licensed, and where the organization or institution has the right to grant such license under applicable grant and research funding agreements. No other express or implied licenses are granted. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Educational Community License to your work To apply the Educational Community License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Educational Community 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.osedu.org/licenses/ECL-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.
{ "pile_set_name": "Github" }
/****************************************************************************** * * Copyright(c) 2007 - 2017 Realtek Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * *****************************************************************************/ /*Image2HeaderVersion: 3.5.2*/ #include "mp_precomp.h" #include "../phydm_precomp.h" #if (RTL8723D_SUPPORT == 1) static boolean check_positive( struct dm_struct *dm, const u32 condition1, const u32 condition2, const u32 condition3, const u32 condition4 ) { u8 _board_type = ((dm->board_type & BIT(4)) >> 4) << 0 | /* _GLNA*/ ((dm->board_type & BIT(3)) >> 3) << 1 | /* _GPA*/ ((dm->board_type & BIT(7)) >> 7) << 2 | /* _ALNA*/ ((dm->board_type & BIT(6)) >> 6) << 3 | /* _APA */ ((dm->board_type & BIT(2)) >> 2) << 4 | /* _BT*/ ((dm->board_type & BIT(1)) >> 1) << 5 | /* _NGFF*/ ((dm->board_type & BIT(5)) >> 5) << 6; /* _TRSWT*/ u32 cond1 = condition1, cond2 = condition2, cond3 = condition3, cond4 = condition4; u8 cut_version_for_para = (dm->cut_version == ODM_CUT_A) ? 15 : dm->cut_version; u8 pkg_type_for_para = (dm->package_type == 0) ? 15 : dm->package_type; u32 driver1 = cut_version_for_para << 24 | (dm->support_interface & 0xF0) << 16 | dm->support_platform << 16 | pkg_type_for_para << 12 | (dm->support_interface & 0x0F) << 8 | _board_type; u32 driver2 = (dm->type_glna & 0xFF) << 0 | (dm->type_gpa & 0xFF) << 8 | (dm->type_alna & 0xFF) << 16 | (dm->type_apa & 0xFF) << 24; u32 driver3 = 0; u32 driver4 = (dm->type_glna & 0xFF00) >> 8 | (dm->type_gpa & 0xFF00) | (dm->type_alna & 0xFF00) << 8 | (dm->type_apa & 0xFF00) << 16; PHYDM_DBG(dm, ODM_COMP_INIT, "===> %s (cond1, cond2, cond3, cond4) = (0x%X 0x%X 0x%X 0x%X)\n", __func__, cond1, cond2, cond3, cond4); PHYDM_DBG(dm, ODM_COMP_INIT, "===> %s (driver1, driver2, driver3, driver4) = (0x%X 0x%X 0x%X 0x%X)\n", __func__, driver1, driver2, driver3, driver4); PHYDM_DBG(dm, ODM_COMP_INIT, " (Platform, Interface) = (0x%X, 0x%X)\n", dm->support_platform, dm->support_interface); PHYDM_DBG(dm, ODM_COMP_INIT, " (Board, Package) = (0x%X, 0x%X)\n", dm->board_type, dm->package_type); /*============== value Defined Check ===============*/ /*QFN type [15:12] and cut version [27:24] need to do value check*/ if (((cond1 & 0x0000F000) != 0) && ((cond1 & 0x0000F000) != (driver1 & 0x0000F000))) return false; if (((cond1 & 0x0F000000) != 0) && ((cond1 & 0x0F000000) != (driver1 & 0x0F000000))) return false; /*=============== Bit Defined Check ================*/ /* We don't care [31:28] */ cond1 &= 0x00FF0FFF; driver1 &= 0x00FF0FFF; if ((cond1 & driver1) == cond1) { u32 bit_mask = 0; if ((cond1 & 0x0F) == 0) /* board_type is DONTCARE*/ return true; if ((cond1 & BIT(0)) != 0) /*GLNA*/ bit_mask |= 0x000000FF; if ((cond1 & BIT(1)) != 0) /*GPA*/ bit_mask |= 0x0000FF00; if ((cond1 & BIT(2)) != 0) /*ALNA*/ bit_mask |= 0x00FF0000; if ((cond1 & BIT(3)) != 0) /*APA*/ bit_mask |= 0xFF000000; if (((cond2 & bit_mask) == (driver2 & bit_mask)) && ((cond4 & bit_mask) == (driver4 & bit_mask))) /* board_type of each RF path is matched*/ return true; else return false; } else return false; } static boolean check_negative( struct dm_struct *dm, const u32 condition1, const u32 condition2 ) { return true; } /****************************************************************************** * mac_reg.TXT ******************************************************************************/ u32 array_mp_8723d_mac_reg[] = { 0x020, 0x00000013, 0x02F, 0x00000010, 0x077, 0x00000007, 0x421, 0x0000000F, 0x422, 0x00000078, 0x428, 0x0000000A, 0x429, 0x00000010, 0x430, 0x00000000, 0x431, 0x00000000, 0x432, 0x00000000, 0x433, 0x00000001, 0x434, 0x00000002, 0x435, 0x00000003, 0x436, 0x00000005, 0x437, 0x00000007, 0x438, 0x00000000, 0x439, 0x00000000, 0x43A, 0x00000000, 0x43B, 0x00000001, 0x43C, 0x00000002, 0x43D, 0x00000003, 0x43E, 0x00000005, 0x43F, 0x00000007, 0x440, 0x0000005D, 0x441, 0x00000001, 0x442, 0x00000000, 0x444, 0x00000010, 0x445, 0x00000000, 0x446, 0x00000000, 0x447, 0x00000000, 0x448, 0x00000000, 0x449, 0x000000F0, 0x44A, 0x0000000F, 0x44B, 0x0000003E, 0x44C, 0x00000010, 0x44D, 0x00000000, 0x44E, 0x00000000, 0x44F, 0x00000000, 0x450, 0x00000000, 0x451, 0x000000F0, 0x452, 0x0000000F, 0x453, 0x00000000, 0x456, 0x0000005E, 0x460, 0x00000066, 0x461, 0x00000066, 0x4C8, 0x000000FF, 0x4C9, 0x00000008, 0x4CC, 0x000000FF, 0x4CD, 0x000000FF, 0x4CE, 0x00000001, 0x500, 0x00000026, 0x501, 0x000000A2, 0x502, 0x0000002F, 0x503, 0x00000000, 0x504, 0x00000028, 0x505, 0x000000A3, 0x506, 0x0000005E, 0x507, 0x00000000, 0x508, 0x0000002B, 0x509, 0x000000A4, 0x50A, 0x0000005E, 0x50B, 0x00000000, 0x50C, 0x0000004F, 0x50D, 0x000000A4, 0x50E, 0x00000000, 0x50F, 0x00000000, 0x512, 0x0000001C, 0x514, 0x0000000A, 0x516, 0x0000000A, 0x525, 0x0000004F, 0x550, 0x00000010, 0x551, 0x00000010, 0x559, 0x00000002, 0x55C, 0x00000028, 0x55D, 0x000000FF, 0x605, 0x00000030, 0x608, 0x0000000E, 0x609, 0x0000002A, 0x620, 0x000000FF, 0x621, 0x000000FF, 0x622, 0x000000FF, 0x623, 0x000000FF, 0x624, 0x000000FF, 0x625, 0x000000FF, 0x626, 0x000000FF, 0x627, 0x000000FF, 0x638, 0x00000028, 0x63C, 0x0000000A, 0x63D, 0x0000000A, 0x63E, 0x0000000C, 0x63F, 0x0000000C, 0x640, 0x00000040, 0x642, 0x00000040, 0x643, 0x00000000, 0x652, 0x000000C8, 0x66A, 0x000000B0, 0x66E, 0x00000005, 0x700, 0x00000021, 0x701, 0x00000043, 0x702, 0x00000065, 0x703, 0x00000087, 0x708, 0x00000021, 0x709, 0x00000043, 0x70A, 0x00000065, 0x70B, 0x00000087, 0x765, 0x00000018, 0x76E, 0x00000004, 0x7C0, 0x00000038, 0x7C2, 0x0000000F, 0x7C3, 0x000000C0, 0x073, 0x00000004, 0x7C4, 0x00000077, 0x07C, 0x00000003, 0x016, 0x000000B3, }; void odm_read_and_config_mp_8723d_mac_reg(struct dm_struct *dm) { u32 i = 0; u8 c_cond; boolean is_matched = true, is_skipped = false; u32 array_len = sizeof(array_mp_8723d_mac_reg) / sizeof(u32); u32 *array = array_mp_8723d_mac_reg; u32 v1 = 0, v2 = 0, pre_v1 = 0, pre_v2 = 0; PHYDM_DBG(dm, ODM_COMP_INIT, "===> %s\n", __func__); while ((i + 1) < array_len) { v1 = array[i]; v2 = array[i + 1]; if (v1 & (BIT(31) | BIT(30))) {/*positive & negative condition*/ if (v1 & BIT(31)) {/* positive condition*/ c_cond = (u8)((v1 & (BIT(29) | BIT(28))) >> 28); if (c_cond == COND_ENDIF) {/*end*/ is_matched = true; is_skipped = false; PHYDM_DBG(dm, ODM_COMP_INIT, "ENDIF\n"); } else if (c_cond == COND_ELSE) { /*else*/ is_matched = is_skipped ? false : true; PHYDM_DBG(dm, ODM_COMP_INIT, "ELSE\n"); } else {/*if , else if*/ pre_v1 = v1; pre_v2 = v2; PHYDM_DBG(dm, ODM_COMP_INIT, "IF or ELSE IF\n"); } } else if (v1 & BIT(30)) { /*negative condition*/ if (is_skipped == false) { if (check_positive(dm, pre_v1, pre_v2, v1, v2)) { is_matched = true; is_skipped = true; } else { is_matched = false; is_skipped = false; } } else is_matched = false; } } else { if (is_matched) odm_config_mac_8723d(dm, v1, (u8)v2); } i = i + 2; } } u32 odm_get_version_mp_8723d_mac_reg(void) { return 39; } #endif /* end of HWIMG_SUPPORT*/
{ "pile_set_name": "Github" }
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first)
{ "pile_set_name": "Github" }
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <[email protected]> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0 FUTEX_WAKE = 1 FUTEX_PRIVATE_FLAG = 128 FUTEX_CLOCK_REALTIME = 256 FUTEX_CMD_MASK = ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME) NSECS_PER_SEC = 1000000000 def avg(total, n): return total / n def nsecs(secs, nsecs): return secs * NSECS_PER_SEC + nsecs def nsecs_secs(nsecs): return nsecs / NSECS_PER_SEC def nsecs_nsecs(nsecs): return nsecs % NSECS_PER_SEC def nsecs_str(nsecs): str = "%5u.%09u" % (nsecs_secs(nsecs), nsecs_nsecs(nsecs)), return str def add_stats(dict, key, value): if not dict.has_key(key): dict[key] = (value, value, value, 1) else: min, max, avg, count = dict[key] if value < min: min = value if value > max: max = value avg = (avg + value) / 2 dict[key] = (min, max, avg, count + 1) def clear_term(): print("\x1b[H\x1b[2J") audit_package_warned = False try: import audit machine_to_id = { 'x86_64': audit.MACH_86_64, 'alpha' : audit.MACH_ALPHA, 'ia64' : audit.MACH_IA64, 'ppc' : audit.MACH_PPC, 'ppc64' : audit.MACH_PPC64, 'ppc64le' : audit.MACH_PPC64LE, 's390' : audit.MACH_S390, 's390x' : audit.MACH_S390X, 'i386' : audit.MACH_X86, 'i586' : audit.MACH_X86, 'i686' : audit.MACH_X86, } try: machine_to_id['armeb'] = audit.MACH_ARMEB except: pass machine_id = machine_to_id[os.uname()[4]] except: if not audit_package_warned: audit_package_warned = True print "Install the audit-libs-python package to get syscall names.\n" \ "For example:\n # apt-get install python-audit (Ubuntu)" \ "\n # yum install audit-libs-python (Fedora)" \ "\n etc.\n" def syscall_name(id): try: return audit.audit_syscall_to_name(id, machine_id) except: return str(id) def strerror(nr): try: return errno.errorcode[abs(nr)] except: return "Unknown %d errno" % nr
{ "pile_set_name": "Github" }
for (var i: i32 = 0; i < 10; ++i) { ; } for (i = 0; i < 10; ++i) { ; } for (;;) { ; }
{ "pile_set_name": "Github" }
// /** @file // HII Library implementation using UEFI HII protocols and services. // // HII Library implementation using UEFI HII protocols and services. // // Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> // // SPDX-License-Identifier: BSD-2-Clause-Patent // // **/ #string STR_MODULE_ABSTRACT #language en-US "HII Library implementation using UEFI HII protocols and services" #string STR_MODULE_DESCRIPTION #language en-US "HII Library implementation using UEFI HII protocols and services."
{ "pile_set_name": "Github" }
unit MakeDistGui; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, CheckLst, MakeDistMain; type TMainForm = class(TForm) PanelFile: TPanel; ButtonNewDistribution: TButton; ButtonOpenDistribution: TButton; ButtonSaveDistribution: TButton; ButtonSaveDistributionAs: TButton; PanelTasks: TPanel; CheckListBoxTasks: TCheckListBox; LabelTaskList: TLabel; SplitterTasks: TSplitter; ButtonNewTask: TButton; ButtonDeleteTask: TButton; ButtonExecuteSelectedTask: TButton; ButtonExecuteCheckedTasks: TButton; PanelActions: TPanel; ListBoxActionList: TListBox; LabelActionList: TLabel; SplitterActions: TSplitter; ButtonAddActionToTask: TButton; PanelMiddle: TPanel; PanelConfiguration: TPanel; PanelTaskActions: TPanel; LabelTaskActionList: TLabel; ListBoxTaskActions: TListBox; ButtonMoveUp: TButton; ButtonMoveDown: TButton; ButtonDeleteAction: TButton; PanelMessages: TPanel; SplitterMessages: TSplitter; MemoMessages: TMemo; OpenDialogConfiguration: TOpenDialog; SaveDialogConfiguration: TSaveDialog; ButtonRenameTask: TButton; procedure FormCreate(Sender: TObject); procedure ListBoxActionListDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); procedure ButtonAddActionToTaskClick(Sender: TObject); procedure ButtonNewTaskClick(Sender: TObject); procedure ButtonDeleteTaskClick(Sender: TObject); procedure ButtonExecuteSelectedTaskClick(Sender: TObject); procedure ButtonExecuteCheckedTasksClick(Sender: TObject); procedure ButtonMoveUpClick(Sender: TObject); procedure ButtonMoveDownClick(Sender: TObject); procedure ButtonDeleteActionClick(Sender: TObject); procedure ButtonNewDistributionClick(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure CheckListBoxTasksClickCheck(Sender: TObject); procedure ListBoxTaskActionsClick(Sender: TObject); procedure ListBoxTaskActionsDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); procedure EditConfigurationChange(Sender: TObject); procedure ButtonOpenDistributionClick(Sender: TObject); procedure ButtonSaveDistributionClick(Sender: TObject); procedure ButtonSaveDistributionAsClick(Sender: TObject); procedure CheckListBoxTasksClick(Sender: TObject); procedure ButtonRenameTaskClick(Sender: TObject); private FConfigurationFileName: string; FDistActions: TDistActions; FDistribution: TDistribution; FWorkingDirectory: string; procedure OutputMessage(const Text: string); procedure RefreshConfig; procedure RefreshTaskActions; procedure RefreshTasks; public end; var MainForm: TMainForm; implementation {$R *.dfm} uses JclFileUtils; procedure TMainForm.ButtonAddActionToTaskClick(Sender: TObject); var CurrentTask: TDistTask; ActionClass: TDistActionClass; TaskIndex, ActionIndex, NewActionIndex: Integer; begin TaskIndex := CheckListBoxTasks.ItemIndex; ActionIndex := ListBoxActionList.ItemIndex; if (TaskIndex >= 0) and (ActionIndex >= 0) then begin CurrentTask := FDistribution.Tasks[TaskIndex]; ActionClass := FDistActions.Actions[ActionIndex]; NewActionIndex := CurrentTask.AddAction(ActionClass); RefreshTaskActions; ListBoxTaskActions.ItemIndex := NewActionIndex; RefreshConfig; end; end; procedure TMainForm.ButtonDeleteActionClick(Sender: TObject); var TaskIndex, ActionIndex: Integer; Task: TDistTask; begin TaskIndex := CheckListBoxTasks.ItemIndex; ActionIndex := ListBoxTaskActions.ItemIndex; if (TaskIndex >= 0) and (ActionIndex >= 0) then begin Task := FDistribution.Tasks[TaskIndex]; Task.DeleteAction(ActionIndex); RefreshTaskActions; RefreshConfig; end; end; procedure TMainForm.ButtonDeleteTaskClick(Sender: TObject); var TaskIndex: Integer; begin TaskIndex := CheckListBoxTasks.ItemIndex; if TaskIndex >= 0 then begin FDistribution.DeleteTask(TaskIndex); RefreshTasks; RefreshTaskActions; RefreshConfig; end; end; procedure TMainForm.ButtonExecuteCheckedTasksClick(Sender: TObject); begin FDistribution.WorkingDirectory := FWorkingDirectory; FDistribution.OnMessage := OutputMessage; MemoMessages.Clear; if FDistribution.ExecuteSelected then MemoMessages.Lines.Add('Success.') else MemoMessages.Lines.Add('Failure.'); end; procedure TMainForm.ButtonExecuteSelectedTaskClick(Sender: TObject); var TaskIndex: Integer; begin TaskIndex := CheckListBoxTasks.ItemIndex; if TaskIndex >= 0 then begin FDistribution.WorkingDirectory := FWorkingDirectory; FDistribution.OnMessage := OutputMessage; MemoMessages.Clear; if FDistribution.ExecuteTask(TaskIndex) then MemoMessages.Lines.Add('Success.') else MemoMessages.Lines.Add('Failure.'); end; end; procedure TMainForm.ButtonMoveDownClick(Sender: TObject); var TaskIndex, ActionIndex: Integer; Task: TDistTask; begin TaskIndex := CheckListBoxTasks.ItemIndex; ActionIndex := ListBoxTaskActions.ItemIndex; if (TaskIndex >= 0) and (ActionIndex >= 0) then begin Task := FDistribution.Tasks[TaskIndex]; if Task.MoveAction(ActionIndex, ActionIndex + 1) then begin RefreshTaskActions; if ActionIndex < (ListBoxTaskActions.Count - 1) then ListBoxTaskActions.ItemIndex := ActionIndex + 1 else ListBoxTaskActions.ItemIndex := ActionIndex; RefreshConfig; end; end; end; procedure TMainForm.ButtonMoveUpClick(Sender: TObject); var TaskIndex, ActionIndex: Integer; Task: TDistTask; begin TaskIndex := CheckListBoxTasks.ItemIndex; ActionIndex := ListBoxTaskActions.ItemIndex; if (TaskIndex >= 0) and (ActionIndex >= 0) then begin Task := FDistribution.Tasks[TaskIndex]; if Task.MoveAction(ActionIndex, ActionIndex - 1) then begin RefreshTaskActions; if ActionIndex > 0 then ListBoxTaskActions.ItemIndex := ActionIndex - 1 else ListBoxTaskActions.ItemIndex := ActionIndex; RefreshConfig; end; end; end; procedure TMainForm.ButtonNewDistributionClick(Sender: TObject); begin FreeAndNil(FDistribution); FDistribution := TDistribution.Create; RefreshTasks; RefreshTaskActions; RefreshConfig; end; procedure TMainForm.ButtonNewTaskClick(Sender: TObject); var TaskName: string; TaskIndex: Integer; Task: TDistTask; begin TaskName := 'TaskName'; if InputQuery('New task', 'Task name:', TaskName) then begin TaskIndex := FDistribution.AddTask; Task := FDistribution.Tasks[TaskIndex]; Task.Name := TaskName; RefreshTasks; CheckListBoxTasks.ItemIndex := TaskIndex; RefreshTaskActions; RefreshConfig; end; end; procedure TMainForm.ButtonOpenDistributionClick(Sender: TObject); begin if OpenDialogConfiguration.Execute then begin FConfigurationFileName := OpenDialogConfiguration.FileName; FreeAndNil(FDistribution); FDistribution := TDistribution.Create; FDistribution.LoadConfiguration(FConfigurationFileName); FWorkingDirectory := ExtractFilePath(FConfigurationFileName); RefreshTasks; RefreshTaskActions; RefreshConfig; end; end; procedure TMainForm.ButtonRenameTaskClick(Sender: TObject); var TaskIndex: Integer; Task: TDistTask; TaskName: string; begin TaskIndex := CheckListBoxTasks.ItemIndex; if TaskIndex >= 0 then begin Task := FDistribution.Tasks[TaskIndex]; TaskName := Task.Name; if InputQuery(Application.Title, 'New name:', TaskName) then begin Task.Name := TaskName; RefreshTasks; end; end; end; procedure TMainForm.ButtonSaveDistributionAsClick(Sender: TObject); begin if SaveDialogConfiguration.Execute then begin FConfigurationFileName := SaveDialogConfiguration.FileName; FDistribution.SaveConfiguration(FConfigurationFileName); FWorkingDirectory := ExtractFilePath(FConfigurationFileName); end; end; procedure TMainForm.ButtonSaveDistributionClick(Sender: TObject); begin if FConfigurationFileName <> '' then FDistribution.SaveConfiguration(FConfigurationFileName) else ButtonSaveDistributionAsClick(ButtonSaveDistributionAs); end; procedure TMainForm.CheckListBoxTasksClick(Sender: TObject); begin RefreshTaskActions; RefreshConfig; end; procedure TMainForm.CheckListBoxTasksClickCheck(Sender: TObject); var CheckListBox: TCheckListBox; TaskIndex: Integer; begin CheckListBox := Sender as TCheckListBox; TaskIndex := CheckListBox.ItemIndex; FDistribution.Tasks[TaskIndex].Selected := CheckListBox.Checked[TaskIndex]; end; procedure TMainForm.EditConfigurationChange(Sender: TObject); var Edit: TEdit; Task: TDistTask; Action: TDistAction; TaskIndex, ActionIndex, ConfigIndex: Integer; ActionRect: TRect; begin Edit := Sender as TEdit; TaskIndex := CheckListBoxTasks.ItemIndex; ActionIndex := ListBoxTaskActions.ItemIndex; ConfigIndex := Edit.Tag; if (TaskIndex >= 0) and (ActionIndex >= 0) and (ConfigIndex >= 0) then begin Task := FDistribution.Tasks[TaskIndex]; Action := Task.Actions[ActionIndex]; // update configuration value Action.ConfigValues[ConfigIndex] := Edit.Text; // refresh caption of the action ActionRect := ListBoxTaskActions.ItemRect(ActionIndex); InvalidateRect(ListBoxTaskActions.Handle, @ActionRect, False); end; end; procedure TMainForm.FormCreate(Sender: TObject); var Index, ConfigurationPos: Integer; ActionClass: TDistActionClass; begin FDistActions := GetDistActions; FWorkingDirectory := GetCurrentDir; // fill actions for Index := 0 to FDistActions.ActionCount - 1 do begin ActionClass := FDistActions.Actions[Index]; ListBoxActionList.Items.Add(ActionClass.ClassName); end; ListBoxActionList.ItemHeight := 3*ListBoxActionList.Canvas.TextHeight('Wg'); ListBoxTaskActions.ItemHeight := 3*ListBoxTaskActions.Canvas.TextHeight('Wg'); FDistribution := TDistribution.Create; // load distribution ConfigurationPos := ParamPos('c'); if ConfigurationPos >= 1 then begin FConfigurationFileName := ParamValue(ConfigurationPos); FDistribution.LoadConfiguration(FConfigurationFileName); if ExtractFilePath(FConfigurationFileName) <> '' then FWorkingDirectory := ExtractFilePath(FConfigurationFileName); end; OpenDialogConfiguration.InitialDir := FWorkingDirectory; SaveDialogConfiguration.InitialDir := FWorkingDirectory; RefreshTasks; RefreshTaskActions; RefreshConfig; end; procedure TMainForm.FormDestroy(Sender: TObject); begin FDistribution.Free; end; procedure TMainForm.ListBoxActionListDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var AListBox: TListBox; ACanvas: TCanvas; ActionClass: TDistActionClass; TextHeight, SpaceHeight: Integer; begin AListBox := Control as TListBox; ACanvas := AListBox.Canvas; ActionClass := FDistActions.Actions[Index]; TextHeight := ACanvas.TextHeight('Hg'); SpaceHeight := AListBox.ItemHeight - 2 * TextHeight; ACanvas.FillRect(Rect); ACanvas.Font.Style := [fsBold]; ACanvas.TextOut(Rect.Left + SpaceHeight div 4, Rect.Top + SpaceHeight div 4, ActionClass.ClassName); ACanvas.Font.Style := [fsItalic]; ACanvas.TextOut(Rect.Left + SpaceHeight div 2, Rect.Top + TextHeight + 3 * SpaceHeight div 4, ActionClass.GetDescription); end; procedure TMainForm.ListBoxTaskActionsClick(Sender: TObject); begin RefreshConfig; end; procedure TMainForm.ListBoxTaskActionsDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var AListBox: TListBox; ACanvas: TCanvas; Task: TDistTask; Action: TDistAction; TaskIndex, TextHeight, SpaceHeight: Integer; begin AListBox := Control as TListBox; ACanvas := AListBox.Canvas; TextHeight := ACanvas.TextHeight('Hg'); SpaceHeight := AListBox.ItemHeight - 2 * TextHeight; ACanvas.FillRect(Rect); TaskIndex := CheckListBoxTasks.ItemIndex; if TaskIndex >= 0 then begin Task := FDistribution.Tasks[TaskIndex]; Action := Task.Actions[Index]; ACanvas.Font.Style := [fsBold]; ACanvas.TextOut(Rect.Left + SpaceHeight div 4, Rect.Top + SpaceHeight div 4, Format('[%d] %s', [Index + 1, Action.ClassName])); ACanvas.Font.Style := [fsItalic]; ACanvas.TextOut(Rect.Left + SpaceHeight div 2, Rect.Top + TextHeight + 3 * SpaceHeight div 4, Action.Caption); end; end; procedure TMainForm.OutputMessage(const Text: string); begin if (Length(Text) > 0) and (Text[1] = #0) then MemoMessages.Lines.Add(Copy(Text, 2, Length(Text) - 1)) else MemoMessages.Lines.Add(Text); Application.ProcessMessages; end; procedure TMainForm.RefreshConfig; var Task: TDistTask; Action: TDistAction; TaskIndex, ActionIndex, ConfigurationIndex, CaptionWidth, CaptionWidest, LineTop: Integer; AEdit: TEdit; ALabel: TLabel; begin while PanelConfiguration.ControlCount > 0 do PanelConfiguration.Controls[0].Free; TaskIndex := CheckListBoxTasks.ItemIndex; ActionIndex := ListBoxTaskActions.ItemIndex; if (TaskIndex >= 0) and (ActionIndex >= 0) then begin Task := FDistribution.Tasks[TaskIndex]; Action := Task.Actions[ActionIndex]; if Action.ConfigCount > 0 then begin CaptionWidest := 0; for ConfigurationIndex := 0 to Action.ConfigCount - 1 do begin CaptionWidth := MainForm.Canvas.TextWidth(Action.ConfigCaptions[ConfigurationIndex]); if CaptionWidest < CaptionWidth then CaptionWidest := CaptionWidth; end; LineTop := 8; for ConfigurationIndex := 0 to Action.ConfigCount - 1 do begin AEdit := TEdit.Create(PanelConfiguration); AEdit.Parent := PanelConfiguration; AEdit.SetBounds(16 + CaptionWidest, LineTop, PanelConfiguration.Width - 24 - CaptionWidest, AEdit.Height); AEdit.Anchors := [akLeft, akTop, akRight]; AEdit.Tag := ConfigurationIndex; AEdit.Text := Action.ConfigValues[ConfigurationIndex]; AEdit.OnChange := EditConfigurationChange; ALabel := TLabel.Create(PanelConfiguration); ALabel.Parent := PanelConfiguration; ALabel.SetBounds(8, LineTop, CaptionWidest, ALabel.Height); ALabel.FocusControl := AEdit; ALabel.Caption := Action.ConfigCaptions[ConfigurationIndex]; ALabel.Tag := ConfigurationIndex; if AEdit.Height > ALabel.Height then Inc(LineTop, AEdit.Height) else Inc(LineTop, ALabel.Height); Inc(LineTop, 8); end; PanelConfiguration.Height := LineTop; end else PanelConfiguration.Height := 0; end else PanelConfiguration.Height := 0; end; procedure TMainForm.RefreshTaskActions; var Index: Integer; Task: TDistTask; Action: TDistAction; begin ListBoxTaskActions.Clear; Index := CheckListBoxTasks.ItemIndex; if Index >= 0 then begin Task := FDistribution.Tasks[Index]; for Index := 0 to Task.ActionCount - 1 do begin Action := Task.Actions[Index]; ListBoxTaskActions.Items.Add(Action.Caption); end; end; end; procedure TMainForm.RefreshTasks; var Index: Integer; Task: TDistTask; begin CheckListBoxTasks.Clear; for Index := 0 to FDistribution.TaskCount - 1 do begin Task := FDistribution.Tasks[Index]; CheckListBoxTasks.Items.Add(Task.Name); CheckListBoxTasks.Checked[Index] := Task.Selected; end; end; end.
{ "pile_set_name": "Github" }
--- title: SNMPv1 Trap Types (Snmp.h) description: The SNMPv1 trap types describe a predefined set of generic trap types that are formatted to comply with the SNMPv1 trap PDU standard. ms.assetid: 3a652b8f-2ae1-4f8c-b0d6-388bc9171427 topic_type: - apiref api_name: - SNMP_GENERICTRAP_COLDSTART - SNMP_GENERICTRAP_WARMSTART - SNMP_GENERICTRAP_LINKDOWN - SNMP_GENERICTRAP_LINKUP - SNMP_GENERICTRAP_AUTHFAILURE - SNMP_GENERICTRAP_EGPNEIGHLOSS - SNMP_GENERICTRAP_ENTERSPECIFIC api_location: - Snmp.h api_type: - HeaderDef ms.topic: reference ms.date: 05/31/2018 --- # SNMPv1 Trap Types \[SNMP is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use [Windows Remote Management](/windows/desktop/WinRM/portal), which is the Microsoft implementation of WS-Man.\] The SNMPv1 trap types describe a predefined set of generic trap types that are formatted to comply with the SNMPv1 trap PDU standard. | Constant | Description | |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <span id="SNMP_GENERICTRAP_COLDSTART"></span><span id="snmp_generictrap_coldstart"></span><dl> <dt>**SNMP\_GENERICTRAP\_COLDSTART**</dt> </dl> | Indicates a cold start trap. The agent is initializing protocol entities on the managed mode. It may alter objects in its view.<br/> | | <span id="SNMP_GENERICTRAP_WARMSTART"></span><span id="snmp_generictrap_warmstart"></span><dl> <dt>**SNMP\_GENERICTRAP\_WARMSTART**</dt> </dl> | Indicates a warm start trap. The agent is reinitializing itself but it will not alter objects in its view.<br/> | | <span id="SNMP_GENERICTRAP_LINKDOWN"></span><span id="snmp_generictrap_linkdown"></span><dl> <dt>**SNMP\_GENERICTRAP\_LINKDOWN**</dt> </dl> | Indicates a link-down trap. An attached interface has changed from the up state to the down state. The first variable in the variable bindings list identifies the interface.<br/> | | <span id="SNMP_GENERICTRAP_LINKUP"></span><span id="snmp_generictrap_linkup"></span><dl> <dt>**SNMP\_GENERICTRAP\_LINKUP**</dt> </dl> | Indicates a link-up trap. An attached interface has changed from the down start to the up state. The first variable in the variable bindings list identifies the interface.<br/> | | <span id="SNMP_GENERICTRAP_AUTHFAILURE"></span><span id="snmp_generictrap_authfailure"></span><dl> <dt>**SNMP\_GENERICTRAP\_AUTHFAILURE**</dt> </dl> | Indicates an authentication failure trap. An SNMP entity has sent an SNMP message, but it has falsely claimed to belong to a known community.<br/> | | <span id="SNMP_GENERICTRAP_EGPNEIGHLOSS"></span><span id="snmp_generictrap_egpneighloss"></span><dl> <dt>**SNMP\_GENERICTRAP\_EGPNEIGHLOSS**</dt> </dl> | Indicates an EGP neighbor loss trap. An EGP peer has changed to the down state. The first variable in the variable bindings list identifies the IP address of the EGP peer.<br/> | | <span id="SNMP_GENERICTRAP_ENTERSPECIFIC"></span><span id="snmp_generictrap_enterspecific"></span><dl> <dt>**SNMP\_GENERICTRAP\_ENTERSPECIFIC**</dt> </dl> | Indicates an enterprise-specific trap. An extraordinary event has occurred. It is identified in the *specificTrap* parameter with an enterprise-specific value.<br/> | ## Requirements | | | |-------------------------------------|-----------------------------------------------------------------------------------| | Minimum supported client<br/> | Windows 2000 Professional \[desktop apps only\]<br/> | | Minimum supported server<br/> | Windows 2000 Server \[desktop apps only\]<br/> | | Header<br/> | <dl> <dt>Snmp.h</dt> </dl> | ## See also <dl> <dt> [Simple Network Management Protocol (SNMP) Overview](simple-network-management-protocol-snmp-.md) </dt> <dt> [SNMP Reference](snmp-reference.md) </dt> <dt> [SNMP Constants](snmp-constants.md) </dt> </dl>
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- from json import loads from thread import start_new_thread from openerp import api, fields, models, registry, SUPERUSER_ID from base_stream import Stream, StreamListener from oauth import Oauth class TwitterStream(models.Model, StreamListener): _name = 'twitter.stream' streams_objs = {} twitter_api_key = fields.Char() twitter_api_secret = fields.Char() model = fields.Char('Type of Model') agent_ids = fields.One2many('twitter.agent', 'stream_id') state = fields.Selection([('start', 'Start'), ('stop', 'Stop')], default='stop') def _register_hook(self, cr): """ Start streaming on server start """ super(TwitterStream, self)._register_hook(cr) self.start(cr) def start(self, cr): """ Start streaming """ if not hasattr(self, '_id'): stream_id = self.search(cr, SUPERUSER_ID, [], limit=1) for stream in self.browse(cr, SUPERUSER_ID, stream_id): stream.start_streaming() @api.one def start_streaming(self): if self.agent_ids: def func(stream, user_ids): return stream.filter(follow=user_ids) user_ids, last_agent = [], None for agent in self.agent_ids: if agent['auth_user'] and agent['state'] != 'archive': last_agent = agent user_ids.append(agent['auth_user']) if user_ids: auth = Oauth(self.twitter_api_key, self.twitter_api_secret) auth.set_access_token(last_agent['twitter_access_token'], last_agent['twitter_access_token_secret']) stream = Stream(auth, self) self.streams_objs[self.id] = stream start_new_thread(func, (stream, user_ids)) return True def stop(self): """ Stop streaming """ if self.streams_objs.get(self.id): self.streams_objs[self.id].disconnect() def restart(self): """ Restart streaming """ self.stop() self.start() def on_connect(self): super(TwitterStream, self).on_connect() with api.Environment.manage(): with registry(self.env.cr.dbname).cursor() as new_cr: self.env = api.Environment(new_cr, self.env.uid, self.env.context) self.state = 'start' pass def on_data(self, tweet): """ Call when tweet is come and store in twitter.tweet Model """ if 'delete' not in tweet: tweet = loads(tweet) with api.Environment.manage(): with registry(self.env.cr.dbname).cursor() as new_cr: self.env = api.Environment(new_cr, self.env.uid, self.env.context) agents = self.agent_ids.filtered(lambda o: o.auth_user == tweet['user']['id_str'] and o.state != 'archive').sorted(lambda r: r.create_date, reverse=True) if len(agents): self.env['twitter.tweet'].process_tweet(agents[0].id, tweet['retweeted_status']['id'] if tweet.get('retweeted_status') else tweet.get('id')) return True def on_error(self, status_code): super(TwitterStream, self).on_error(status_code) with api.Environment.manage(): with registry(self.env.cr.dbname).cursor() as new_cr: self.env = api.Environment(new_cr, self.env.uid, self.env.context) self.state = 'stop' return False def on_disconnect(self, notice): super(TwitterStream, self).on_disconnect(notice) with api.Environment.manage(): with registry(self.env.cr.dbname).cursor() as new_cr: self.env = api.Environment(new_cr, self.env.uid, self.env.context) self.state = 'stop' return False
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0+ // // soc-jack.c -- ALSA SoC jack handling // // Copyright 2008 Wolfson Microelectronics PLC. // // Author: Mark Brown <[email protected]> #include <sound/jack.h> #include <sound/soc.h> #include <linux/gpio.h> #include <linux/gpio/consumer.h> #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/delay.h> #include <linux/export.h> #include <linux/suspend.h> #include <trace/events/asoc.h> struct jack_gpio_tbl { int count; struct snd_soc_jack *jack; struct snd_soc_jack_gpio *gpios; }; /** * snd_soc_component_set_jack - configure component jack. * @component: COMPONENTs * @jack: structure to use for the jack * @data: can be used if codec driver need extra data for configuring jack * * Configures and enables jack detection function. */ int snd_soc_component_set_jack(struct snd_soc_component *component, struct snd_soc_jack *jack, void *data) { if (component->driver->set_jack) return component->driver->set_jack(component, jack, data); return -ENOTSUPP; } EXPORT_SYMBOL_GPL(snd_soc_component_set_jack); /** * snd_soc_card_jack_new - Create a new jack * @card: ASoC card * @id: an identifying string for this jack * @type: a bitmask of enum snd_jack_type values that can be detected by * this jack * @jack: structure to use for the jack * @pins: Array of jack pins to be added to the jack or NULL * @num_pins: Number of elements in the @pins array * * Creates a new jack object. * * Returns zero if successful, or a negative error code on failure. * On success jack will be initialised. */ int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type, struct snd_soc_jack *jack, struct snd_soc_jack_pin *pins, unsigned int num_pins) { int ret; mutex_init(&jack->mutex); jack->card = card; INIT_LIST_HEAD(&jack->pins); INIT_LIST_HEAD(&jack->jack_zones); BLOCKING_INIT_NOTIFIER_HEAD(&jack->notifier); ret = snd_jack_new(card->snd_card, id, type, &jack->jack, false, false); if (ret) return ret; if (num_pins) return snd_soc_jack_add_pins(jack, num_pins, pins); return 0; } EXPORT_SYMBOL_GPL(snd_soc_card_jack_new); /** * snd_soc_jack_report - Report the current status for a jack * * @jack: the jack * @status: a bitmask of enum snd_jack_type values that are currently detected. * @mask: a bitmask of enum snd_jack_type values that being reported. * * If configured using snd_soc_jack_add_pins() then the associated * DAPM pins will be enabled or disabled as appropriate and DAPM * synchronised. * * Note: This function uses mutexes and should be called from a * context which can sleep (such as a workqueue). */ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask) { struct snd_soc_dapm_context *dapm; struct snd_soc_jack_pin *pin; unsigned int sync = 0; int enable; if (!jack) return; trace_snd_soc_jack_report(jack, mask, status); dapm = &jack->card->dapm; mutex_lock(&jack->mutex); jack->status &= ~mask; jack->status |= status & mask; trace_snd_soc_jack_notify(jack, status); list_for_each_entry(pin, &jack->pins, list) { enable = pin->mask & jack->status; if (pin->invert) enable = !enable; if (enable) snd_soc_dapm_enable_pin(dapm, pin->pin); else snd_soc_dapm_disable_pin(dapm, pin->pin); /* we need to sync for this case only */ sync = 1; } /* Report before the DAPM sync to help users updating micbias status */ blocking_notifier_call_chain(&jack->notifier, jack->status, jack); if (sync) snd_soc_dapm_sync(dapm); snd_jack_report(jack->jack, jack->status); mutex_unlock(&jack->mutex); } EXPORT_SYMBOL_GPL(snd_soc_jack_report); /** * snd_soc_jack_add_zones - Associate voltage zones with jack * * @jack: ASoC jack * @count: Number of zones * @zones: Array of zones * * After this function has been called the zones specified in the * array will be associated with the jack. */ int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count, struct snd_soc_jack_zone *zones) { int i; for (i = 0; i < count; i++) { INIT_LIST_HEAD(&zones[i].list); list_add(&(zones[i].list), &jack->jack_zones); } return 0; } EXPORT_SYMBOL_GPL(snd_soc_jack_add_zones); /** * snd_soc_jack_get_type - Based on the mic bias value, this function returns * the type of jack from the zones declared in the jack type * * @jack: ASoC jack * @micbias_voltage: mic bias voltage at adc channel when jack is plugged in * * Based on the mic bias value passed, this function helps identify * the type of jack from the already declared jack zones */ int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage) { struct snd_soc_jack_zone *zone; list_for_each_entry(zone, &jack->jack_zones, list) { if (micbias_voltage >= zone->min_mv && micbias_voltage < zone->max_mv) return zone->jack_type; } return 0; } EXPORT_SYMBOL_GPL(snd_soc_jack_get_type); /** * snd_soc_jack_add_pins - Associate DAPM pins with an ASoC jack * * @jack: ASoC jack * @count: Number of pins * @pins: Array of pins * * After this function has been called the DAPM pins specified in the * pins array will have their status updated to reflect the current * state of the jack whenever the jack status is updated. */ int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, struct snd_soc_jack_pin *pins) { int i; for (i = 0; i < count; i++) { if (!pins[i].pin) { dev_err(jack->card->dev, "ASoC: No name for pin %d\n", i); return -EINVAL; } if (!pins[i].mask) { dev_err(jack->card->dev, "ASoC: No mask for pin %d" " (%s)\n", i, pins[i].pin); return -EINVAL; } INIT_LIST_HEAD(&pins[i].list); list_add(&(pins[i].list), &jack->pins); snd_jack_add_new_kctl(jack->jack, pins[i].pin, pins[i].mask); } /* Update to reflect the last reported status; canned jack * implementations are likely to set their state before the * card has an opportunity to associate pins. */ snd_soc_jack_report(jack, 0, 0); return 0; } EXPORT_SYMBOL_GPL(snd_soc_jack_add_pins); /** * snd_soc_jack_notifier_register - Register a notifier for jack status * * @jack: ASoC jack * @nb: Notifier block to register * * Register for notification of the current status of the jack. Note * that it is not possible to report additional jack events in the * callback from the notifier, this is intended to support * applications such as enabling electrical detection only when a * mechanical detection event has occurred. */ void snd_soc_jack_notifier_register(struct snd_soc_jack *jack, struct notifier_block *nb) { blocking_notifier_chain_register(&jack->notifier, nb); } EXPORT_SYMBOL_GPL(snd_soc_jack_notifier_register); /** * snd_soc_jack_notifier_unregister - Unregister a notifier for jack status * * @jack: ASoC jack * @nb: Notifier block to unregister * * Stop notifying for status changes. */ void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, struct notifier_block *nb) { blocking_notifier_chain_unregister(&jack->notifier, nb); } EXPORT_SYMBOL_GPL(snd_soc_jack_notifier_unregister); #ifdef CONFIG_GPIOLIB /* gpio detect */ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio) { struct snd_soc_jack *jack = gpio->jack; int enable; int report; enable = gpiod_get_value_cansleep(gpio->desc); if (gpio->invert) enable = !enable; if (enable) report = gpio->report; else report = 0; if (gpio->jack_status_check) report = gpio->jack_status_check(gpio->data); snd_soc_jack_report(jack, report, gpio->report); } /* irq handler for gpio pin */ static irqreturn_t gpio_handler(int irq, void *data) { struct snd_soc_jack_gpio *gpio = data; struct device *dev = gpio->jack->card->dev; trace_snd_soc_jack_irq(gpio->name); if (device_may_wakeup(dev)) pm_wakeup_event(dev, gpio->debounce_time + 50); queue_delayed_work(system_power_efficient_wq, &gpio->work, msecs_to_jiffies(gpio->debounce_time)); return IRQ_HANDLED; } /* gpio work */ static void gpio_work(struct work_struct *work) { struct snd_soc_jack_gpio *gpio; gpio = container_of(work, struct snd_soc_jack_gpio, work.work); snd_soc_jack_gpio_detect(gpio); } static int snd_soc_jack_pm_notifier(struct notifier_block *nb, unsigned long action, void *data) { struct snd_soc_jack_gpio *gpio = container_of(nb, struct snd_soc_jack_gpio, pm_notifier); switch (action) { case PM_POST_SUSPEND: case PM_POST_HIBERNATION: case PM_POST_RESTORE: /* * Use workqueue so we do not have to care about running * concurrently with work triggered by the interrupt handler. */ queue_delayed_work(system_power_efficient_wq, &gpio->work, 0); break; } return NOTIFY_DONE; } static void jack_free_gpios(struct snd_soc_jack *jack, int count, struct snd_soc_jack_gpio *gpios) { int i; for (i = 0; i < count; i++) { gpiod_unexport(gpios[i].desc); unregister_pm_notifier(&gpios[i].pm_notifier); free_irq(gpiod_to_irq(gpios[i].desc), &gpios[i]); cancel_delayed_work_sync(&gpios[i].work); gpiod_put(gpios[i].desc); gpios[i].jack = NULL; } } static void jack_devres_free_gpios(struct device *dev, void *res) { struct jack_gpio_tbl *tbl = res; jack_free_gpios(tbl->jack, tbl->count, tbl->gpios); } /** * snd_soc_jack_add_gpios - Associate GPIO pins with an ASoC jack * * @jack: ASoC jack * @count: number of pins * @gpios: array of gpio pins * * This function will request gpio, set data direction and request irq * for each gpio in the array. */ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, struct snd_soc_jack_gpio *gpios) { int i, ret; struct jack_gpio_tbl *tbl; tbl = devres_alloc(jack_devres_free_gpios, sizeof(*tbl), GFP_KERNEL); if (!tbl) return -ENOMEM; tbl->jack = jack; tbl->count = count; tbl->gpios = gpios; for (i = 0; i < count; i++) { if (!gpios[i].name) { dev_err(jack->card->dev, "ASoC: No name for gpio at index %d\n", i); ret = -EINVAL; goto undo; } if (gpios[i].desc) { /* Already have a GPIO descriptor. */ goto got_gpio; } else if (gpios[i].gpiod_dev) { /* Get a GPIO descriptor */ gpios[i].desc = gpiod_get_index(gpios[i].gpiod_dev, gpios[i].name, gpios[i].idx, GPIOD_IN); if (IS_ERR(gpios[i].desc)) { ret = PTR_ERR(gpios[i].desc); dev_err(gpios[i].gpiod_dev, "ASoC: Cannot get gpio at index %d: %d", i, ret); goto undo; } } else { /* legacy GPIO number */ if (!gpio_is_valid(gpios[i].gpio)) { dev_err(jack->card->dev, "ASoC: Invalid gpio %d\n", gpios[i].gpio); ret = -EINVAL; goto undo; } ret = gpio_request_one(gpios[i].gpio, GPIOF_IN, gpios[i].name); if (ret) goto undo; gpios[i].desc = gpio_to_desc(gpios[i].gpio); } got_gpio: INIT_DELAYED_WORK(&gpios[i].work, gpio_work); gpios[i].jack = jack; ret = request_any_context_irq(gpiod_to_irq(gpios[i].desc), gpio_handler, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, gpios[i].name, &gpios[i]); if (ret < 0) goto err; if (gpios[i].wake) { ret = irq_set_irq_wake(gpiod_to_irq(gpios[i].desc), 1); if (ret != 0) dev_err(jack->card->dev, "ASoC: Failed to mark GPIO at index %d as wake source: %d\n", i, ret); } /* * Register PM notifier so we do not miss state transitions * happening while system is asleep. */ gpios[i].pm_notifier.notifier_call = snd_soc_jack_pm_notifier; register_pm_notifier(&gpios[i].pm_notifier); /* Expose GPIO value over sysfs for diagnostic purposes */ gpiod_export(gpios[i].desc, false); /* Update initial jack status */ schedule_delayed_work(&gpios[i].work, msecs_to_jiffies(gpios[i].debounce_time)); } devres_add(jack->card->dev, tbl); return 0; err: gpio_free(gpios[i].gpio); undo: jack_free_gpios(jack, i, gpios); devres_free(tbl); return ret; } EXPORT_SYMBOL_GPL(snd_soc_jack_add_gpios); /** * snd_soc_jack_add_gpiods - Associate GPIO descriptor pins with an ASoC jack * * @gpiod_dev: GPIO consumer device * @jack: ASoC jack * @count: number of pins * @gpios: array of gpio pins * * This function will request gpio, set data direction and request irq * for each gpio in the array. */ int snd_soc_jack_add_gpiods(struct device *gpiod_dev, struct snd_soc_jack *jack, int count, struct snd_soc_jack_gpio *gpios) { int i; for (i = 0; i < count; i++) gpios[i].gpiod_dev = gpiod_dev; return snd_soc_jack_add_gpios(jack, count, gpios); } EXPORT_SYMBOL_GPL(snd_soc_jack_add_gpiods); /** * snd_soc_jack_free_gpios - Release GPIO pins' resources of an ASoC jack * * @jack: ASoC jack * @count: number of pins * @gpios: array of gpio pins * * Release gpio and irq resources for gpio pins associated with an ASoC jack. */ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, struct snd_soc_jack_gpio *gpios) { jack_free_gpios(jack, count, gpios); devres_destroy(jack->card->dev, jack_devres_free_gpios, NULL, NULL); } EXPORT_SYMBOL_GPL(snd_soc_jack_free_gpios); #endif /* CONFIG_GPIOLIB */
{ "pile_set_name": "Github" }
<Application x:Class="UWPSoundBoard.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UWPSoundBoard" RequestedTheme="Light"> </Application>
{ "pile_set_name": "Github" }
/*============================================================================= Copyright (c) 2011 Eric Niebler Copyright (c) 2018 Kohei Takahashi Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(BOOST_FUSION_FOR_EACH_FWD_HPP_INCLUDED) #define BOOST_FUSION_FOR_EACH_FWD_HPP_INCLUDED #include <boost/fusion/support/config.hpp> #include <boost/fusion/support/is_sequence.hpp> #include <boost/core/enable_if.hpp> namespace boost { namespace fusion { namespace result_of { template <typename Sequence, typename F> struct for_each; } template <typename Sequence, typename F> BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename enable_if<traits::is_sequence<Sequence> >::type for_each(Sequence& seq, F f); template <typename Sequence, typename F> BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename enable_if<traits::is_sequence<Sequence> >::type for_each(Sequence const& seq, F f); }} #endif
{ "pile_set_name": "Github" }
// go run mksyscall.go -tags freebsd,arm64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build freebsd,arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CapEnter() (err error) { _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsGet(version int, fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsLimit(fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat(fd int, stat *stat_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat_freebsd12(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatfs(fd int, stat *statfs_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func lstat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mknodat(fd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func statfs(path string, stat *statfs_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func statfs_freebsd12(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS_FREEBSD12, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return }
{ "pile_set_name": "Github" }
/***************************************************************************/ /* */ /* gxvmod.c */ /* */ /* FreeType's TrueTypeGX/AAT validation module implementation (body). */ /* */ /* Copyright 2004-2006, 2013 */ /* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* gxvalid is derived from both gxlayout module and otvalid module. */ /* Development of gxlayout is supported by the Information-technology */ /* Promotion Agency(IPA), Japan. */ /* */ /***************************************************************************/ #include <ft2build.h> #include FT_TRUETYPE_TABLES_H #include FT_TRUETYPE_TAGS_H #include FT_GX_VALIDATE_H #include FT_INTERNAL_OBJECTS_H #include FT_SERVICE_GX_VALIDATE_H #include "gxvmod.h" #include "gxvalid.h" #include "gxvcommn.h" /*************************************************************************/ /* */ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ /* messages during execution. */ /* */ #undef FT_COMPONENT #define FT_COMPONENT trace_gxvmodule static FT_Error gxv_load_table( FT_Face face, FT_Tag tag, FT_Byte* volatile* table, FT_ULong* table_len ) { FT_Error error; FT_Memory memory = FT_FACE_MEMORY( face ); error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len ); if ( FT_ERR_EQ( error, Table_Missing ) ) return FT_Err_Ok; if ( error ) goto Exit; if ( FT_ALLOC( *table, *table_len ) ) goto Exit; error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len ); Exit: return error; } #define GXV_TABLE_DECL( _sfnt ) \ FT_Byte* volatile _sfnt = NULL; \ FT_ULong len_ ## _sfnt = 0 #define GXV_TABLE_LOAD( _sfnt ) \ if ( ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) && \ ( gx_flags & FT_VALIDATE_ ## _sfnt ) ) \ { \ error = gxv_load_table( face, TTAG_ ## _sfnt, \ &_sfnt, &len_ ## _sfnt ); \ if ( error ) \ goto Exit; \ } #define GXV_TABLE_VALIDATE( _sfnt ) \ if ( _sfnt ) \ { \ ft_validator_init( &valid, _sfnt, _sfnt + len_ ## _sfnt, \ FT_VALIDATE_DEFAULT ); \ if ( ft_setjmp( valid.jump_buffer ) == 0 ) \ gxv_ ## _sfnt ## _validate( _sfnt, face, &valid ); \ error = valid.error; \ if ( error ) \ goto Exit; \ } #define GXV_TABLE_SET( _sfnt ) \ if ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) \ tables[FT_VALIDATE_ ## _sfnt ## _INDEX] = (FT_Bytes)_sfnt static FT_Error gxv_validate( FT_Face face, FT_UInt gx_flags, FT_Bytes tables[FT_VALIDATE_GX_LENGTH], FT_UInt table_count ) { FT_Memory volatile memory = FT_FACE_MEMORY( face ); FT_Error error = FT_Err_Ok; FT_ValidatorRec volatile valid; FT_UInt i; GXV_TABLE_DECL( feat ); GXV_TABLE_DECL( bsln ); GXV_TABLE_DECL( trak ); GXV_TABLE_DECL( just ); GXV_TABLE_DECL( mort ); GXV_TABLE_DECL( morx ); GXV_TABLE_DECL( kern ); GXV_TABLE_DECL( opbd ); GXV_TABLE_DECL( prop ); GXV_TABLE_DECL( lcar ); for ( i = 0; i < table_count; i++ ) tables[i] = 0; /* load tables */ GXV_TABLE_LOAD( feat ); GXV_TABLE_LOAD( bsln ); GXV_TABLE_LOAD( trak ); GXV_TABLE_LOAD( just ); GXV_TABLE_LOAD( mort ); GXV_TABLE_LOAD( morx ); GXV_TABLE_LOAD( kern ); GXV_TABLE_LOAD( opbd ); GXV_TABLE_LOAD( prop ); GXV_TABLE_LOAD( lcar ); /* validate tables */ GXV_TABLE_VALIDATE( feat ); GXV_TABLE_VALIDATE( bsln ); GXV_TABLE_VALIDATE( trak ); GXV_TABLE_VALIDATE( just ); GXV_TABLE_VALIDATE( mort ); GXV_TABLE_VALIDATE( morx ); GXV_TABLE_VALIDATE( kern ); GXV_TABLE_VALIDATE( opbd ); GXV_TABLE_VALIDATE( prop ); GXV_TABLE_VALIDATE( lcar ); /* Set results */ GXV_TABLE_SET( feat ); GXV_TABLE_SET( mort ); GXV_TABLE_SET( morx ); GXV_TABLE_SET( bsln ); GXV_TABLE_SET( just ); GXV_TABLE_SET( kern ); GXV_TABLE_SET( opbd ); GXV_TABLE_SET( trak ); GXV_TABLE_SET( prop ); GXV_TABLE_SET( lcar ); Exit: if ( error ) { FT_FREE( feat ); FT_FREE( bsln ); FT_FREE( trak ); FT_FREE( just ); FT_FREE( mort ); FT_FREE( morx ); FT_FREE( kern ); FT_FREE( opbd ); FT_FREE( prop ); FT_FREE( lcar ); } return error; } static FT_Error classic_kern_validate( FT_Face face, FT_UInt ckern_flags, FT_Bytes* ckern_table ) { FT_Memory volatile memory = FT_FACE_MEMORY( face ); FT_Byte* volatile ckern = NULL; FT_ULong len_ckern = 0; /* without volatile on `error' GCC 4.1.1. emits: */ /* warning: variable 'error' might be clobbered by 'longjmp' or 'vfork' */ /* this warning seems spurious but --- */ FT_Error volatile error; FT_ValidatorRec volatile valid; *ckern_table = NULL; error = gxv_load_table( face, TTAG_kern, &ckern, &len_ckern ); if ( error ) goto Exit; if ( ckern ) { ft_validator_init( &valid, ckern, ckern + len_ckern, FT_VALIDATE_DEFAULT ); if ( ft_setjmp( valid.jump_buffer ) == 0 ) gxv_kern_validate_classic( ckern, face, ckern_flags & FT_VALIDATE_CKERN, &valid ); error = valid.error; if ( error ) goto Exit; } *ckern_table = ckern; Exit: if ( error ) FT_FREE( ckern ); return error; } static const FT_Service_GXvalidateRec gxvalid_interface = { gxv_validate }; static const FT_Service_CKERNvalidateRec ckernvalid_interface = { classic_kern_validate }; static const FT_ServiceDescRec gxvalid_services[] = { { FT_SERVICE_ID_GX_VALIDATE, &gxvalid_interface }, { FT_SERVICE_ID_CLASSICKERN_VALIDATE, &ckernvalid_interface }, { NULL, NULL } }; static FT_Pointer gxvalid_get_service( FT_Module module, const char* service_id ) { FT_UNUSED( module ); return ft_service_list_lookup( gxvalid_services, service_id ); } FT_CALLBACK_TABLE_DEF const FT_Module_Class gxv_module_class = { 0, sizeof ( FT_ModuleRec ), "gxvalid", 0x10000L, 0x20000L, 0, /* module-specific interface */ (FT_Module_Constructor)0, (FT_Module_Destructor) 0, (FT_Module_Requester) gxvalid_get_service }; /* END */
{ "pile_set_name": "Github" }
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x // +build linux package socket import "unsafe" func (h *msghdr) setIov(vs []iovec) { h.Iov = &vs[0] h.Iovlen = uint64(len(vs)) } func (h *msghdr) setControl(b []byte) { h.Control = (*byte)(unsafe.Pointer(&b[0])) h.Controllen = uint64(len(b)) }
{ "pile_set_name": "Github" }
using Abp.Dependency; using Abp.Domain.Entities; namespace Abp.Dapper.Filters.Action { public interface IDapperActionFilter : ITransientDependency { void ExecuteFilter<TEntity, TPrimaryKey>(TEntity entity) where TEntity : class, IEntity<TPrimaryKey>; } }
{ "pile_set_name": "Github" }
package router import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" import actor "github.com/AsynkronIT/protoactor-go/actor" import strings "strings" import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" import sort "sort" import strconv "strconv" import reflect "reflect" import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type AddRoutee struct { PID *actor.PID `protobuf:"bytes,1,opt,name=PID" json:"PID,omitempty"` } func (m *AddRoutee) Reset() { *m = AddRoutee{} } func (*AddRoutee) ProtoMessage() {} func (*AddRoutee) Descriptor() ([]byte, []int) { return fileDescriptorProtos, []int{0} } func (m *AddRoutee) GetPID() *actor.PID { if m != nil { return m.PID } return nil } type RemoveRoutee struct { PID *actor.PID `protobuf:"bytes,1,opt,name=PID" json:"PID,omitempty"` } func (m *RemoveRoutee) Reset() { *m = RemoveRoutee{} } func (*RemoveRoutee) ProtoMessage() {} func (*RemoveRoutee) Descriptor() ([]byte, []int) { return fileDescriptorProtos, []int{1} } func (m *RemoveRoutee) GetPID() *actor.PID { if m != nil { return m.PID } return nil } type AdjustPoolSize struct { Change int32 `protobuf:"varint,1,opt,name=change,proto3" json:"change,omitempty"` } func (m *AdjustPoolSize) Reset() { *m = AdjustPoolSize{} } func (*AdjustPoolSize) ProtoMessage() {} func (*AdjustPoolSize) Descriptor() ([]byte, []int) { return fileDescriptorProtos, []int{2} } type GetRoutees struct { } func (m *GetRoutees) Reset() { *m = GetRoutees{} } func (*GetRoutees) ProtoMessage() {} func (*GetRoutees) Descriptor() ([]byte, []int) { return fileDescriptorProtos, []int{3} } type Routees struct { PIDs []*actor.PID `protobuf:"bytes,1,rep,name=PIDs" json:"PIDs,omitempty"` } func (m *Routees) Reset() { *m = Routees{} } func (*Routees) ProtoMessage() {} func (*Routees) Descriptor() ([]byte, []int) { return fileDescriptorProtos, []int{4} } func (m *Routees) GetPIDs() []*actor.PID { if m != nil { return m.PIDs } return nil } func init() { proto.RegisterType((*AddRoutee)(nil), "router.AddRoutee") proto.RegisterType((*RemoveRoutee)(nil), "router.RemoveRoutee") proto.RegisterType((*AdjustPoolSize)(nil), "router.AdjustPoolSize") proto.RegisterType((*GetRoutees)(nil), "router.GetRoutees") proto.RegisterType((*Routees)(nil), "router.Routees") } func (this *AddRoutee) Equal(that interface{}) bool { if that == nil { if this == nil { return true } return false } that1, ok := that.(*AddRoutee) if !ok { that2, ok := that.(AddRoutee) if ok { that1 = &that2 } else { return false } } if that1 == nil { if this == nil { return true } return false } else if this == nil { return false } if !this.PID.Equal(that1.PID) { return false } return true } func (this *RemoveRoutee) Equal(that interface{}) bool { if that == nil { if this == nil { return true } return false } that1, ok := that.(*RemoveRoutee) if !ok { that2, ok := that.(RemoveRoutee) if ok { that1 = &that2 } else { return false } } if that1 == nil { if this == nil { return true } return false } else if this == nil { return false } if !this.PID.Equal(that1.PID) { return false } return true } func (this *AdjustPoolSize) Equal(that interface{}) bool { if that == nil { if this == nil { return true } return false } that1, ok := that.(*AdjustPoolSize) if !ok { that2, ok := that.(AdjustPoolSize) if ok { that1 = &that2 } else { return false } } if that1 == nil { if this == nil { return true } return false } else if this == nil { return false } if this.Change != that1.Change { return false } return true } func (this *GetRoutees) Equal(that interface{}) bool { if that == nil { if this == nil { return true } return false } that1, ok := that.(*GetRoutees) if !ok { that2, ok := that.(GetRoutees) if ok { that1 = &that2 } else { return false } } if that1 == nil { if this == nil { return true } return false } else if this == nil { return false } return true } func (this *Routees) Equal(that interface{}) bool { if that == nil { if this == nil { return true } return false } that1, ok := that.(*Routees) if !ok { that2, ok := that.(Routees) if ok { that1 = &that2 } else { return false } } if that1 == nil { if this == nil { return true } return false } else if this == nil { return false } if len(this.PIDs) != len(that1.PIDs) { return false } for i := range this.PIDs { if !this.PIDs[i].Equal(that1.PIDs[i]) { return false } } return true } func (this *AddRoutee) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&router.AddRoutee{") if this.PID != nil { s = append(s, "PID: "+fmt.Sprintf("%#v", this.PID)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *RemoveRoutee) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&router.RemoveRoutee{") if this.PID != nil { s = append(s, "PID: "+fmt.Sprintf("%#v", this.PID)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *AdjustPoolSize) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&router.AdjustPoolSize{") s = append(s, "Change: "+fmt.Sprintf("%#v", this.Change)+",\n") s = append(s, "}") return strings.Join(s, "") } func (this *GetRoutees) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 4) s = append(s, "&router.GetRoutees{") s = append(s, "}") return strings.Join(s, "") } func (this *Routees) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&router.Routees{") if this.PIDs != nil { s = append(s, "PIDs: "+fmt.Sprintf("%#v", this.PIDs)+",\n") } s = append(s, "}") return strings.Join(s, "") } func valueToGoStringProtos(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } func extensionToGoStringProtos(m github_com_gogo_protobuf_proto.Message) string { e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m) if e == nil { return "nil" } s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{" keys := make([]int, 0, len(e)) for k := range e { keys = append(keys, int(k)) } sort.Ints(keys) ss := []string{} for _, k := range keys { ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) } s += strings.Join(ss, ",") + "})" return s } func (m *AddRoutee) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AddRoutee) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.PID != nil { dAtA[i] = 0xa i++ i = encodeVarintProtos(dAtA, i, uint64(m.PID.Size())) n1, err := m.PID.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n1 } return i, nil } func (m *RemoveRoutee) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveRoutee) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.PID != nil { dAtA[i] = 0xa i++ i = encodeVarintProtos(dAtA, i, uint64(m.PID.Size())) n2, err := m.PID.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n2 } return i, nil } func (m *AdjustPoolSize) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AdjustPoolSize) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Change != 0 { dAtA[i] = 0x8 i++ i = encodeVarintProtos(dAtA, i, uint64(m.Change)) } return i, nil } func (m *GetRoutees) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *GetRoutees) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *Routees) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Routees) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PIDs) > 0 { for _, msg := range m.PIDs { dAtA[i] = 0xa i++ i = encodeVarintProtos(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func encodeFixed64Protos(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) dAtA[offset+4] = uint8(v >> 32) dAtA[offset+5] = uint8(v >> 40) dAtA[offset+6] = uint8(v >> 48) dAtA[offset+7] = uint8(v >> 56) return offset + 8 } func encodeFixed32Protos(dAtA []byte, offset int, v uint32) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) return offset + 4 } func encodeVarintProtos(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *AddRoutee) Size() (n int) { var l int _ = l if m.PID != nil { l = m.PID.Size() n += 1 + l + sovProtos(uint64(l)) } return n } func (m *RemoveRoutee) Size() (n int) { var l int _ = l if m.PID != nil { l = m.PID.Size() n += 1 + l + sovProtos(uint64(l)) } return n } func (m *AdjustPoolSize) Size() (n int) { var l int _ = l if m.Change != 0 { n += 1 + sovProtos(uint64(m.Change)) } return n } func (m *GetRoutees) Size() (n int) { var l int _ = l return n } func (m *Routees) Size() (n int) { var l int _ = l if len(m.PIDs) > 0 { for _, e := range m.PIDs { l = e.Size() n += 1 + l + sovProtos(uint64(l)) } } return n } func sovProtos(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozProtos(x uint64) (n int) { return sovProtos(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *AddRoutee) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AddRoutee{`, `PID:` + strings.Replace(fmt.Sprintf("%v", this.PID), "PID", "actor.PID", 1) + `,`, `}`, }, "") return s } func (this *RemoveRoutee) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveRoutee{`, `PID:` + strings.Replace(fmt.Sprintf("%v", this.PID), "PID", "actor.PID", 1) + `,`, `}`, }, "") return s } func (this *AdjustPoolSize) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AdjustPoolSize{`, `Change:` + fmt.Sprintf("%v", this.Change) + `,`, `}`, }, "") return s } func (this *GetRoutees) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&GetRoutees{`, `}`, }, "") return s } func (this *Routees) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Routees{`, `PIDs:` + strings.Replace(fmt.Sprintf("%v", this.PIDs), "PID", "actor.PID", 1) + `,`, `}`, }, "") return s } func valueToStringProtos(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *AddRoutee) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AddRoutee: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AddRoutee: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PID", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtos } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.PID == nil { m.PID = &actor.PID{} } if err := m.PID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtos(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthProtos } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveRoutee) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveRoutee: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveRoutee: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PID", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtos } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.PID == nil { m.PID = &actor.PID{} } if err := m.PID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtos(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthProtos } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AdjustPoolSize) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AdjustPoolSize: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AdjustPoolSize: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Change", wireType) } m.Change = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Change |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipProtos(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthProtos } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *GetRoutees) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: GetRoutees: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: GetRoutees: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipProtos(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthProtos } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Routees) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Routees: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Routees: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PIDs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtos } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtos } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.PIDs = append(m.PIDs, &actor.PID{}) if err := m.PIDs[len(m.PIDs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtos(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthProtos } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipProtos(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowProtos } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowProtos } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowProtos } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthProtos } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowProtos } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipProtos(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthProtos = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowProtos = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("protos.proto", fileDescriptorProtos) } var fileDescriptorProtos = []byte{ // 250 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x28, 0xca, 0x2f, 0xc9, 0x2f, 0xd6, 0x03, 0x53, 0x42, 0x6c, 0x45, 0xf9, 0xa5, 0x25, 0xa9, 0x45, 0x52, 0x66, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x8e, 0xc5, 0x95, 0x79, 0xd9, 0x45, 0xf9, 0x79, 0x9e, 0x21, 0xfa, 0x60, 0x45, 0x89, 0xc9, 0x25, 0xf9, 0x45, 0xba, 0xe9, 0xf9, 0xfa, 0x60, 0x86, 0x3e, 0xb2, 0x7e, 0x25, 0x4d, 0x2e, 0x4e, 0xc7, 0x94, 0x94, 0x20, 0x90, 0x21, 0xa9, 0x42, 0x32, 0x5c, 0xcc, 0x01, 0x9e, 0x2e, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x5c, 0x7a, 0x60, 0xe5, 0x7a, 0x01, 0x9e, 0x2e, 0x41, 0x20, 0x61, 0x25, 0x1d, 0x2e, 0x9e, 0xa0, 0xd4, 0xdc, 0xfc, 0xb2, 0x54, 0xa2, 0x54, 0x6b, 0x70, 0xf1, 0x39, 0xa6, 0x64, 0x95, 0x16, 0x97, 0x04, 0xe4, 0xe7, 0xe7, 0x04, 0x67, 0x56, 0xa5, 0x0a, 0x89, 0x71, 0xb1, 0x25, 0x67, 0x24, 0xe6, 0xa5, 0xa7, 0x82, 0xb5, 0xb0, 0x06, 0x41, 0x79, 0x4a, 0x3c, 0x5c, 0x5c, 0xee, 0xa9, 0x25, 0x10, 0x43, 0x8b, 0x95, 0x34, 0xb9, 0xd8, 0xa1, 0x4c, 0x21, 0x39, 0x2e, 0x96, 0x00, 0x4f, 0x97, 0x62, 0x09, 0x46, 0x05, 0x66, 0x34, 0x1b, 0xc0, 0xe2, 0x4e, 0x3a, 0x17, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0x21, 0x89, 0x0d, 0xec, 0x61, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, 0xa2, 0x60, 0x23, 0x40, 0x01, 0x00, 0x00, }
{ "pile_set_name": "Github" }
#include "CCCommon.h" #include <stdarg.h> #include <stdio.h> #import <UIKit/UIAlert.h> NS_CC_BEGIN void CCLog(const char * pszFormat, ...) { printf("CrossApp: "); char szBuf[kMaxLogLen+1] = {0}; va_list ap; va_start(ap, pszFormat); vsnprintf(szBuf, kMaxLogLen, pszFormat, ap); va_end(ap); printf("%s", szBuf); printf("\n"); } // ios no MessageBox, use CCLog instead void CCMessageBox(const char * pszMsg, const char * pszTitle) { NSString * title = (pszTitle) ? [NSString stringWithUTF8String : pszTitle] : nil; NSString * msg = (pszMsg) ? [NSString stringWithUTF8String : pszMsg] : nil; UIAlertView * messageBox = [[UIAlertView alloc] initWithTitle: title message: msg delegate: nil cancelButtonTitle: @"OK" otherButtonTitles: nil]; [messageBox autorelease]; [messageBox show]; } void CCLuaLog(const char * pszFormat) { puts(pszFormat); } NS_CC_END
{ "pile_set_name": "Github" }
# Event 8 - task_0 ###### Version: 0 ## Description None ## Data Dictionary |Standard Name|Field Name|Type|Description|Sample Value| |---|---|---|---|---| |TBD|Matches|Boolean|None|`None`| |TBD|CheckerName|UnicodeString|None|`None`| |TBD|AttributeName|UnicodeString|None|`None`| |TBD|AttributeExpectedValue|UInt32|None|`None`| ## Tags * etw_level_Informational * etw_task_task_0
{ "pile_set_name": "Github" }
module Haml module Util class << self; include Haml::Util; end RUBY_VERSION = ::RUBY_VERSION.split(".").map {|s| s.to_i} def ruby1_8? Haml::Util::RUBY_VERSION[0] == 1 && Haml::Util::RUBY_VERSION[1] < 9 end def has?(attr, klass, method) klass.send("#{attr}s").include?(ruby1_8? ? method.to_s : method.to_sym) end end end
{ "pile_set_name": "Github" }
// Copyright 2015 Tim Heckman. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. package flock import ( "syscall" ) // ErrorLockViolation is the error code returned from the Windows syscall when a // lock would block and you ask to fail immediately. const ErrorLockViolation syscall.Errno = 0x21 // 33 // Lock is a blocking call to try and take an exclusive file lock. It will wait // until it is able to obtain the exclusive file lock. It's recommended that // TryLock() be used over this function. This function may block the ability to // query the current Locked() or RLocked() status due to a RW-mutex lock. // // If we are already locked, this function short-circuits and returns // immediately assuming it can take the mutex lock. func (f *Flock) Lock() error { return f.lock(&f.l, winLockfileExclusiveLock) } // RLock is a blocking call to try and take a shared file lock. It will wait // until it is able to obtain the shared file lock. It's recommended that // TryRLock() be used over this function. This function may block the ability to // query the current Locked() or RLocked() status due to a RW-mutex lock. // // If we are already locked, this function short-circuits and returns // immediately assuming it can take the mutex lock. func (f *Flock) RLock() error { return f.lock(&f.r, winLockfileSharedLock) } func (f *Flock) lock(locked *bool, flag uint32) error { f.m.Lock() defer f.m.Unlock() if *locked { return nil } if f.fh == nil { if err := f.setFh(); err != nil { return err } } if _, errNo := lockFileEx(syscall.Handle(f.fh.Fd()), flag, 0, 1, 0, &syscall.Overlapped{}); errNo > 0 { return errNo } *locked = true return nil } // Unlock is a function to unlock the file. This file takes a RW-mutex lock, so // while it is running the Locked() and RLocked() functions will be blocked. // // This function short-circuits if we are unlocked already. If not, it calls // UnlockFileEx() on the file and closes the file descriptor. It does not remove // the file from disk. It's up to your application to do. func (f *Flock) Unlock() error { f.m.Lock() defer f.m.Unlock() // if we aren't locked or if the lockfile instance is nil // just return a nil error because we are unlocked if (!f.l && !f.r) || f.fh == nil { return nil } // mark the file as unlocked if _, errNo := unlockFileEx(syscall.Handle(f.fh.Fd()), 0, 1, 0, &syscall.Overlapped{}); errNo > 0 { return errNo } f.fh.Close() f.l = false f.r = false f.fh = nil return nil } // TryLock is the preferred function for taking an exclusive file lock. This // function does take a RW-mutex lock before it tries to lock the file, so there // is the possibility that this function may block for a short time if another // goroutine is trying to take any action. // // The actual file lock is non-blocking. If we are unable to get the exclusive // file lock, the function will return false instead of waiting for the lock. If // we get the lock, we also set the *Flock instance as being exclusive-locked. func (f *Flock) TryLock() (bool, error) { return f.try(&f.l, winLockfileExclusiveLock) } // TryRLock is the preferred function for taking a shared file lock. This // function does take a RW-mutex lock before it tries to lock the file, so there // is the possibility that this function may block for a short time if another // goroutine is trying to take any action. // // The actual file lock is non-blocking. If we are unable to get the shared file // lock, the function will return false instead of waiting for the lock. If we // get the lock, we also set the *Flock instance as being shared-locked. func (f *Flock) TryRLock() (bool, error) { return f.try(&f.r, winLockfileSharedLock) } func (f *Flock) try(locked *bool, flag uint32) (bool, error) { f.m.Lock() defer f.m.Unlock() if *locked { return true, nil } if f.fh == nil { if err := f.setFh(); err != nil { return false, err } } _, errNo := lockFileEx(syscall.Handle(f.fh.Fd()), flag|winLockfileFailImmediately, 0, 1, 0, &syscall.Overlapped{}) if errNo > 0 { if errNo == ErrorLockViolation || errNo == syscall.ERROR_IO_PENDING { return false, nil } return false, errNo } *locked = true return true, nil }
{ "pile_set_name": "Github" }
package concurrent_test import ( "github.com/modern-go/concurrent" "testing" ) func TestMap_Load(t *testing.T) { m := concurrent.NewMap() m.Store("hello", "world") value, found := m.Load("hello") if !found { t.Fail() } if value != "world" { t.Fail() } }
{ "pile_set_name": "Github" }
PCBNEW-LibModule-V1 Вс 09 мар 2014 20:04:06 # encoding utf-8 Units mm $INDEX FUSEHOLDER JUMPER-2 PIN_1_16AWG PIN_1_20AWG $EndINDEX $MODULE FUSEHOLDER Po 0 0 0 15 531C90F2 00000000 ~~ Li FUSEHOLDER Sc 0 AR Op 0 0 0 T0 0 2.54 1 1 0 0.15 N V 21 N "FUSEHOLDER" T1 0 -2.54 1 1 0 0.15 N V 21 N "VAL**" DS -7.493 -2.413 7.493 -2.413 0.15 21 DS 7.493 -2.413 7.493 2.413 0.15 21 DS 7.493 2.413 -7.493 2.413 0.15 21 DS -7.493 2.413 -7.493 -2.413 0.15 21 $PAD Sh "1" R 2.54 3.048 0 0 0 Dr 1.524 0 0 At STD N 00E0FFFF Ne 0 "" Po -5.842 0 $EndPAD $PAD Sh "1" R 2.54 3.048 0 0 0 Dr 1.524 0 0 At STD N 00E0FFFF Ne 0 "" Po -2.286 0 $EndPAD $PAD Sh "2" R 2.54 3.048 0 0 0 Dr 1.524 0 0 At STD N 00E0FFFF Ne 0 "" Po 2.286 0 $EndPAD $PAD Sh "2" R 2.54 3.048 0 0 0 Dr 1.524 0 0 At STD N 00E0FFFF Ne 0 "" Po 5.842 0 $EndPAD $SHAPE3D Na "3d/fuse-bk-6013.wrl" Sc 1 1 1 Of 0 0 0 Ro 0 180 0 $EndSHAPE3D $EndMODULE FUSEHOLDER $MODULE JUMPER-2 Po 0 0 0 15 52F777F3 00000000 ~~ Li JUMPER-2 Cd Jumper 2 pins Kw JUMPER Sc 0 AR Op 0 0 0 T0 0 0 0.762 0.762 0 0.0762 N V 21 N "JUMPER-2" T1 0 -2.54 0.762 0.762 0 0.1524 N I 21 N "Val**" DS -2.54 1.27 -2.54 -1.27 0.3048 21 DS -2.54 -1.27 2.54 -1.27 0.3048 21 DS 2.54 -1.27 2.54 1.27 0.3048 21 DS 2.54 1.27 -2.54 1.27 0.3048 21 $PAD Sh "1" R 1.397 1.397 0 0 0 Dr 0.8128 0 0 At STD N 00E0FFFF Ne 0 "" Po -1.27 0 $EndPAD $PAD Sh "2" C 1.397 1.397 0 0 0 Dr 0.8128 0 0 At STD N 00E0FFFF Ne 0 "" Po 1.27 0 $EndPAD $SHAPE3D Na "../rusefi_lib/3d/jumper-2.wrl" Sc 1 1 1 Of 0 0 0 Ro 0 0 0 $EndSHAPE3D $EndMODULE JUMPER-2 $MODULE PIN_1_16AWG Po 0 0 0 15 52EA1F86 00000000 ~~ Li PIN_1_16AWG Sc 0 AR Op 0 0 0 T0 0 3.175 1 1 0 0.15 N V 21 N "PIN_1_16AWG" T1 0 -2.921 1 1 0 0.15 N V 21 N "VAL**" DS -5.08 0 -5.588 -1.905 0.15 21 DS -5.08 0 -5.588 1.905 0.15 21 DS -5.334 0 -5.842 1.905 0.15 21 DS -5.842 -1.905 -5.334 0 0.15 21 DS 4.953 -1.905 -5.842 -1.905 0.15 21 DS 4.953 -1.905 4.953 1.905 0.15 21 DS 4.953 1.905 -5.842 1.905 0.15 21 $PAD Sh "1" R 3.048 3.048 0 0 0 Dr 1.524 0 0 At STD N 00E0FFFF Ne 0 "" Po 3.048 0 $EndPAD $PAD Sh "" C 3.048 3.048 0 0 0 Dr 2.54 0 0 At STD N 00E0FFFF Ne 0 "" Po -3.048 0 $EndPAD $EndMODULE PIN_1_16AWG $MODULE PIN_1_20AWG Po 0 0 0 15 52EA1F3F 00000000 ~~ Li PIN_1_20AWG Sc 0 AR Op 0 0 0 T0 0 3.175 1 1 0 0.15 N V 21 N "PIN_1_20AWG" T1 0 -2.921 1 1 0 0.15 N V 21 N "VAL**" DS -5.334 0 -5.842 1.651 0.15 21 DS -5.842 -1.651 -5.334 0 0.15 21 DS 4.699 1.651 -5.842 1.651 0.15 21 DS 4.699 -1.651 -5.842 -1.651 0.15 21 DS 4.699 -1.651 4.699 1.651 0.15 21 $PAD Sh "1" C 2.54 2.54 0 0 0 Dr 1.016 0 0 At STD N 00E0FFFF Ne 0 "" Po 3.048 0 $EndPAD $PAD Sh "" C 2.54 2.54 0 0 0 Dr 2.032 0 0 At STD N 00E0FFFF Ne 0 "" Po -3.048 0 $EndPAD $EndMODULE PIN_1_20AWG $EndLIBRARY
{ "pile_set_name": "Github" }
<?php $foo === 123; $foo === true; $foo === false; $foo === null; $foo === []; $foo === array(); BAR === 123; Foo::BAR === 123; Foo::BAR === 123.0; $e === \Foo\Bar::BAR; foo() === Foo::BAR; foo() + 2 === Foo::BAR; $foo === Foo::BAR; $foo + 2 === Foo::BAR; $this->foo() === Foo::BAR; $foo === -1; $foo === +1; (foo() === BAR || ( Foo::BAR === ['test'] )) ? Foo::BAR === 123.0 : $foo === null; (foo() === BAR || ( Foo::BAR === array('test') )) ? Foo::BAR === 123.0 : $foo === null; if ( $foo($bar) === [Foo::BAR, Foo::BAZ] && ( $bar === true || $bar === null ) ) { } if ( $foo($bar) === array(Foo::BAR, Foo::BAZ) && ( $bar === true || $bar === null ) ) { } $x = $a ?? $b === 123; switch ($c) { case $d === 123: break; } $$a === $x; (int) $bar === FOO; $x = [$username === self::ADMIN_EMAIL ? self::ROLE_ADMIN : self::ROLE_CUSTOMER]; $x = [$username === self::ADMIN_EMAIL ? self::ROLE_ADMIN : self::ROLE_CUSTOMER]; $x = array($username === self::ADMIN_EMAIL ? self::ROLE_ADMIN : self::ROLE_CUSTOMER); $x = array($username === self::ADMIN_EMAIL ? self::ROLE_ADMIN : self::ROLE_CUSTOMER); $x = array($username === array() ? true : false); $x = array($username === [] ? true : false); $x = [$username === array() ? true : false]; $x = [$username === [] ? true : false]; $x = $username === [$a, $b, $c]; $param === A::TYPE_A and $param === A::TYPE_B; $param === A::TYPE_A or $param === A::TYPE_B; $param === A::TYPE_A xor $param === A::TYPE_B; if (null === $env = $parameters['env']) { // ... }
{ "pile_set_name": "Github" }
<?php namespace Minify\StaticService; /** * Build a URI for the static cache * * @param string $static_uri E.g. "/min/static" * @param string $query E.g. "b=scripts&f=1.js,2.js" * @param string $type "css" or "js" * @return string */ function build_uri($static_uri, $query, $type) { $static_uri = rtrim($static_uri, '/'); $query = ltrim($query, '?'); $ext = ".$type"; if (substr($query, - strlen($ext)) !== $ext) { $query .= "&z=$ext"; } $cache_time = get_cache_time(); return "$static_uri/$cache_time/$query"; } /** * Get the name of the current cache directory within static/. E.g. "1467089473" * * @param bool $auto_create Automatically create the directory if missing? * @return null|string null if missing or can't create */ function get_cache_time($auto_create = true) { foreach (scandir(__DIR__) as $entry) { if (ctype_digit($entry)) { return $entry; break; } } if (!$auto_create) { return null; } $time = (string)time(); if (!mkdir(__DIR__ . "/$time")) { return null; } return $time; } function flush_cache() { $time = get_cache_time(false); if ($time) { remove_tree(__DIR__ . "/$time"); } } function remove_tree($dir) { $files = array_diff(scandir($dir), array('.', '..')); foreach ($files as $file) { is_dir("$dir/$file") ? remove_tree("$dir/$file") : unlink("$dir/$file"); } return rmdir($dir); }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Amatsukaze.Views { /// <summary> /// SummaryPanel.xaml の相互作用ロジック /// </summary> public partial class SummaryPanel : UserControl { public SummaryPanel() { InitializeComponent(); } } }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) STMicroelectronics SA 2014 * Authors: Fabien Dessenne <[email protected]> for STMicroelectronics. */ #include <linux/errno.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> #include <linux/pm_runtime.h> #include <linux/slab.h> #include <media/v4l2-event.h> #include <media/v4l2-ioctl.h> #include "bdisp.h" #define BDISP_MAX_CTRL_NUM 10 #define BDISP_WORK_TIMEOUT ((100 * HZ) / 1000) /* User configuration change */ #define BDISP_PARAMS BIT(0) /* Config updated */ #define BDISP_SRC_FMT BIT(1) /* Source set */ #define BDISP_DST_FMT BIT(2) /* Destination set */ #define BDISP_CTX_STOP_REQ BIT(3) /* Stop request */ #define BDISP_CTX_ABORT BIT(4) /* Abort while device run */ #define BDISP_MIN_W 1 #define BDISP_MAX_W 8191 #define BDISP_MIN_H 1 #define BDISP_MAX_H 8191 #define fh_to_ctx(__fh) container_of(__fh, struct bdisp_ctx, fh) enum bdisp_dev_flags { ST_M2M_OPEN, /* Driver opened */ ST_M2M_RUNNING, /* HW device running */ ST_M2M_SUSPENDED, /* Driver suspended */ ST_M2M_SUSPENDING, /* Driver being suspended */ }; static const struct bdisp_fmt bdisp_formats[] = { /* ARGB888. [31:0] A:R:G:B 8:8:8:8 little endian */ { .pixelformat = V4L2_PIX_FMT_ABGR32, /* is actually ARGB */ .nb_planes = 1, .bpp = 32, .bpp_plane0 = 32, .w_align = 1, .h_align = 1 }, /* XRGB888. [31:0] x:R:G:B 8:8:8:8 little endian */ { .pixelformat = V4L2_PIX_FMT_XBGR32, /* is actually xRGB */ .nb_planes = 1, .bpp = 32, .bpp_plane0 = 32, .w_align = 1, .h_align = 1 }, /* RGB565. [15:0] R:G:B 5:6:5 little endian */ { .pixelformat = V4L2_PIX_FMT_RGB565, .nb_planes = 1, .bpp = 16, .bpp_plane0 = 16, .w_align = 1, .h_align = 1 }, /* NV12. YUV420SP - 1 plane for Y + 1 plane for (CbCr) */ { .pixelformat = V4L2_PIX_FMT_NV12, .nb_planes = 2, .bpp = 12, .bpp_plane0 = 8, .w_align = 2, .h_align = 2 }, /* RGB888. [23:0] B:G:R 8:8:8 little endian */ { .pixelformat = V4L2_PIX_FMT_RGB24, .nb_planes = 1, .bpp = 24, .bpp_plane0 = 24, .w_align = 1, .h_align = 1 }, /* YU12. YUV420P - 1 plane for Y + 1 plane for Cb + 1 plane for Cr * To keep as the LAST element of this table (no support on capture) */ { .pixelformat = V4L2_PIX_FMT_YUV420, .nb_planes = 3, .bpp = 12, .bpp_plane0 = 8, .w_align = 2, .h_align = 2 } }; /* Default format : HD ARGB32*/ #define BDISP_DEF_WIDTH 1920 #define BDISP_DEF_HEIGHT 1080 static const struct bdisp_frame bdisp_dflt_fmt = { .width = BDISP_DEF_WIDTH, .height = BDISP_DEF_HEIGHT, .fmt = &bdisp_formats[0], .field = V4L2_FIELD_NONE, .bytesperline = BDISP_DEF_WIDTH * 4, .sizeimage = BDISP_DEF_WIDTH * BDISP_DEF_HEIGHT * 4, .colorspace = V4L2_COLORSPACE_REC709, .crop = {0, 0, BDISP_DEF_WIDTH, BDISP_DEF_HEIGHT}, .paddr = {0, 0, 0, 0} }; static inline void bdisp_ctx_state_lock_set(u32 state, struct bdisp_ctx *ctx) { unsigned long flags; spin_lock_irqsave(&ctx->bdisp_dev->slock, flags); ctx->state |= state; spin_unlock_irqrestore(&ctx->bdisp_dev->slock, flags); } static inline void bdisp_ctx_state_lock_clear(u32 state, struct bdisp_ctx *ctx) { unsigned long flags; spin_lock_irqsave(&ctx->bdisp_dev->slock, flags); ctx->state &= ~state; spin_unlock_irqrestore(&ctx->bdisp_dev->slock, flags); } static inline bool bdisp_ctx_state_is_set(u32 mask, struct bdisp_ctx *ctx) { unsigned long flags; bool ret; spin_lock_irqsave(&ctx->bdisp_dev->slock, flags); ret = (ctx->state & mask) == mask; spin_unlock_irqrestore(&ctx->bdisp_dev->slock, flags); return ret; } static const struct bdisp_fmt *bdisp_find_fmt(u32 pixelformat) { const struct bdisp_fmt *fmt; unsigned int i; for (i = 0; i < ARRAY_SIZE(bdisp_formats); i++) { fmt = &bdisp_formats[i]; if (fmt->pixelformat == pixelformat) return fmt; } return NULL; } static struct bdisp_frame *ctx_get_frame(struct bdisp_ctx *ctx, enum v4l2_buf_type type) { switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT: return &ctx->src; case V4L2_BUF_TYPE_VIDEO_CAPTURE: return &ctx->dst; default: dev_err(ctx->bdisp_dev->dev, "Wrong buffer/video queue type (%d)\n", type); break; } return ERR_PTR(-EINVAL); } static void bdisp_job_finish(struct bdisp_ctx *ctx, int vb_state) { struct vb2_v4l2_buffer *src_vb, *dst_vb; if (WARN(!ctx || !ctx->fh.m2m_ctx, "Null hardware context\n")) return; dev_dbg(ctx->bdisp_dev->dev, "%s\n", __func__); src_vb = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); dst_vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); if (src_vb && dst_vb) { dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; dst_vb->timecode = src_vb->timecode; dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; dst_vb->flags |= src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK; v4l2_m2m_buf_done(src_vb, vb_state); v4l2_m2m_buf_done(dst_vb, vb_state); v4l2_m2m_job_finish(ctx->bdisp_dev->m2m.m2m_dev, ctx->fh.m2m_ctx); } } static int bdisp_ctx_stop_req(struct bdisp_ctx *ctx) { struct bdisp_ctx *curr_ctx; struct bdisp_dev *bdisp = ctx->bdisp_dev; int ret; dev_dbg(ctx->bdisp_dev->dev, "%s\n", __func__); cancel_delayed_work(&bdisp->timeout_work); curr_ctx = v4l2_m2m_get_curr_priv(bdisp->m2m.m2m_dev); if (!test_bit(ST_M2M_RUNNING, &bdisp->state) || (curr_ctx != ctx)) return 0; bdisp_ctx_state_lock_set(BDISP_CTX_STOP_REQ, ctx); ret = wait_event_timeout(bdisp->irq_queue, !bdisp_ctx_state_is_set(BDISP_CTX_STOP_REQ, ctx), BDISP_WORK_TIMEOUT); if (!ret) { dev_err(ctx->bdisp_dev->dev, "%s IRQ timeout\n", __func__); return -ETIMEDOUT; } return 0; } static void __bdisp_job_abort(struct bdisp_ctx *ctx) { int ret; ret = bdisp_ctx_stop_req(ctx); if ((ret == -ETIMEDOUT) || (ctx->state & BDISP_CTX_ABORT)) { bdisp_ctx_state_lock_clear(BDISP_CTX_STOP_REQ | BDISP_CTX_ABORT, ctx); bdisp_job_finish(ctx, VB2_BUF_STATE_ERROR); } } static void bdisp_job_abort(void *priv) { __bdisp_job_abort((struct bdisp_ctx *)priv); } static int bdisp_get_addr(struct bdisp_ctx *ctx, struct vb2_buffer *vb, struct bdisp_frame *frame, dma_addr_t *paddr) { if (!vb || !frame) return -EINVAL; paddr[0] = vb2_dma_contig_plane_dma_addr(vb, 0); if (frame->fmt->nb_planes > 1) /* UV (NV12) or U (420P) */ paddr[1] = (dma_addr_t)(paddr[0] + frame->bytesperline * frame->height); if (frame->fmt->nb_planes > 2) /* V (420P) */ paddr[2] = (dma_addr_t)(paddr[1] + (frame->bytesperline * frame->height) / 4); if (frame->fmt->nb_planes > 3) dev_dbg(ctx->bdisp_dev->dev, "ignoring some planes\n"); dev_dbg(ctx->bdisp_dev->dev, "%s plane[0]=%pad plane[1]=%pad plane[2]=%pad\n", __func__, &paddr[0], &paddr[1], &paddr[2]); return 0; } static int bdisp_get_bufs(struct bdisp_ctx *ctx) { struct bdisp_frame *src, *dst; struct vb2_v4l2_buffer *src_vb, *dst_vb; int ret; src = &ctx->src; dst = &ctx->dst; src_vb = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); ret = bdisp_get_addr(ctx, &src_vb->vb2_buf, src, src->paddr); if (ret) return ret; dst_vb = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); ret = bdisp_get_addr(ctx, &dst_vb->vb2_buf, dst, dst->paddr); if (ret) return ret; dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp; return 0; } static void bdisp_device_run(void *priv) { struct bdisp_ctx *ctx = priv; struct bdisp_dev *bdisp; unsigned long flags; int err = 0; if (WARN(!ctx, "Null hardware context\n")) return; bdisp = ctx->bdisp_dev; dev_dbg(bdisp->dev, "%s\n", __func__); spin_lock_irqsave(&bdisp->slock, flags); if (bdisp->m2m.ctx != ctx) { dev_dbg(bdisp->dev, "ctx updated: %p -> %p\n", bdisp->m2m.ctx, ctx); ctx->state |= BDISP_PARAMS; bdisp->m2m.ctx = ctx; } if (ctx->state & BDISP_CTX_STOP_REQ) { ctx->state &= ~BDISP_CTX_STOP_REQ; ctx->state |= BDISP_CTX_ABORT; wake_up(&bdisp->irq_queue); goto out; } err = bdisp_get_bufs(ctx); if (err) { dev_err(bdisp->dev, "cannot get address\n"); goto out; } bdisp_dbg_perf_begin(bdisp); err = bdisp_hw_reset(bdisp); if (err) { dev_err(bdisp->dev, "could not get HW ready\n"); goto out; } err = bdisp_hw_update(ctx); if (err) { dev_err(bdisp->dev, "could not send HW request\n"); goto out; } queue_delayed_work(bdisp->work_queue, &bdisp->timeout_work, BDISP_WORK_TIMEOUT); set_bit(ST_M2M_RUNNING, &bdisp->state); out: ctx->state &= ~BDISP_PARAMS; spin_unlock_irqrestore(&bdisp->slock, flags); if (err) bdisp_job_finish(ctx, VB2_BUF_STATE_ERROR); } static const struct v4l2_m2m_ops bdisp_m2m_ops = { .device_run = bdisp_device_run, .job_abort = bdisp_job_abort, }; static int __bdisp_s_ctrl(struct bdisp_ctx *ctx, struct v4l2_ctrl *ctrl) { if (ctrl->flags & V4L2_CTRL_FLAG_INACTIVE) return 0; switch (ctrl->id) { case V4L2_CID_HFLIP: ctx->hflip = ctrl->val; break; case V4L2_CID_VFLIP: ctx->vflip = ctrl->val; break; default: dev_err(ctx->bdisp_dev->dev, "unknown control %d\n", ctrl->id); return -EINVAL; } ctx->state |= BDISP_PARAMS; return 0; } static int bdisp_s_ctrl(struct v4l2_ctrl *ctrl) { struct bdisp_ctx *ctx = container_of(ctrl->handler, struct bdisp_ctx, ctrl_handler); unsigned long flags; int ret; spin_lock_irqsave(&ctx->bdisp_dev->slock, flags); ret = __bdisp_s_ctrl(ctx, ctrl); spin_unlock_irqrestore(&ctx->bdisp_dev->slock, flags); return ret; } static const struct v4l2_ctrl_ops bdisp_c_ops = { .s_ctrl = bdisp_s_ctrl, }; static int bdisp_ctrls_create(struct bdisp_ctx *ctx) { if (ctx->ctrls_rdy) return 0; v4l2_ctrl_handler_init(&ctx->ctrl_handler, BDISP_MAX_CTRL_NUM); ctx->bdisp_ctrls.hflip = v4l2_ctrl_new_std(&ctx->ctrl_handler, &bdisp_c_ops, V4L2_CID_HFLIP, 0, 1, 1, 0); ctx->bdisp_ctrls.vflip = v4l2_ctrl_new_std(&ctx->ctrl_handler, &bdisp_c_ops, V4L2_CID_VFLIP, 0, 1, 1, 0); if (ctx->ctrl_handler.error) { int err = ctx->ctrl_handler.error; v4l2_ctrl_handler_free(&ctx->ctrl_handler); return err; } ctx->ctrls_rdy = true; return 0; } static void bdisp_ctrls_delete(struct bdisp_ctx *ctx) { if (ctx->ctrls_rdy) { v4l2_ctrl_handler_free(&ctx->ctrl_handler); ctx->ctrls_rdy = false; } } static int bdisp_queue_setup(struct vb2_queue *vq, unsigned int *nb_buf, unsigned int *nb_planes, unsigned int sizes[], struct device *alloc_devs[]) { struct bdisp_ctx *ctx = vb2_get_drv_priv(vq); struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type); if (IS_ERR(frame)) { dev_err(ctx->bdisp_dev->dev, "Invalid frame (%p)\n", frame); return PTR_ERR(frame); } if (!frame->fmt) { dev_err(ctx->bdisp_dev->dev, "Invalid format\n"); return -EINVAL; } if (*nb_planes) return sizes[0] < frame->sizeimage ? -EINVAL : 0; *nb_planes = 1; sizes[0] = frame->sizeimage; return 0; } static int bdisp_buf_prepare(struct vb2_buffer *vb) { struct bdisp_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue); struct bdisp_frame *frame = ctx_get_frame(ctx, vb->vb2_queue->type); if (IS_ERR(frame)) { dev_err(ctx->bdisp_dev->dev, "Invalid frame (%p)\n", frame); return PTR_ERR(frame); } if (vb->vb2_queue->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) vb2_set_plane_payload(vb, 0, frame->sizeimage); return 0; } static void bdisp_buf_queue(struct vb2_buffer *vb) { struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct bdisp_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue); /* return to V4L2 any 0-size buffer so it can be dequeued by user */ if (!vb2_get_plane_payload(vb, 0)) { dev_dbg(ctx->bdisp_dev->dev, "0 data buffer, skip it\n"); vb2_buffer_done(vb, VB2_BUF_STATE_DONE); return; } if (ctx->fh.m2m_ctx) v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf); } static int bdisp_start_streaming(struct vb2_queue *q, unsigned int count) { struct bdisp_ctx *ctx = q->drv_priv; struct vb2_v4l2_buffer *buf; int ret = pm_runtime_get_sync(ctx->bdisp_dev->dev); if (ret < 0) { dev_err(ctx->bdisp_dev->dev, "failed to set runtime PM\n"); if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { while ((buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx))) v4l2_m2m_buf_done(buf, VB2_BUF_STATE_QUEUED); } else { while ((buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx))) v4l2_m2m_buf_done(buf, VB2_BUF_STATE_QUEUED); } return ret; } return 0; } static void bdisp_stop_streaming(struct vb2_queue *q) { struct bdisp_ctx *ctx = q->drv_priv; __bdisp_job_abort(ctx); pm_runtime_put(ctx->bdisp_dev->dev); } static const struct vb2_ops bdisp_qops = { .queue_setup = bdisp_queue_setup, .buf_prepare = bdisp_buf_prepare, .buf_queue = bdisp_buf_queue, .wait_prepare = vb2_ops_wait_prepare, .wait_finish = vb2_ops_wait_finish, .stop_streaming = bdisp_stop_streaming, .start_streaming = bdisp_start_streaming, }; static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq) { struct bdisp_ctx *ctx = priv; int ret; memset(src_vq, 0, sizeof(*src_vq)); src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; src_vq->io_modes = VB2_MMAP | VB2_DMABUF; src_vq->drv_priv = ctx; src_vq->ops = &bdisp_qops; src_vq->mem_ops = &vb2_dma_contig_memops; src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; src_vq->lock = &ctx->bdisp_dev->lock; src_vq->dev = ctx->bdisp_dev->v4l2_dev.dev; ret = vb2_queue_init(src_vq); if (ret) return ret; memset(dst_vq, 0, sizeof(*dst_vq)); dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; dst_vq->io_modes = VB2_MMAP | VB2_DMABUF; dst_vq->drv_priv = ctx; dst_vq->ops = &bdisp_qops; dst_vq->mem_ops = &vb2_dma_contig_memops; dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; dst_vq->lock = &ctx->bdisp_dev->lock; dst_vq->dev = ctx->bdisp_dev->v4l2_dev.dev; return vb2_queue_init(dst_vq); } static int bdisp_open(struct file *file) { struct bdisp_dev *bdisp = video_drvdata(file); struct bdisp_ctx *ctx = NULL; int ret; if (mutex_lock_interruptible(&bdisp->lock)) return -ERESTARTSYS; /* Allocate memory for both context and node */ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); if (!ctx) { ret = -ENOMEM; goto unlock; } ctx->bdisp_dev = bdisp; if (bdisp_hw_alloc_nodes(ctx)) { dev_err(bdisp->dev, "no memory for nodes\n"); ret = -ENOMEM; goto mem_ctx; } v4l2_fh_init(&ctx->fh, bdisp->m2m.vdev); ret = bdisp_ctrls_create(ctx); if (ret) { dev_err(bdisp->dev, "Failed to create control\n"); goto error_fh; } /* Use separate control handler per file handle */ ctx->fh.ctrl_handler = &ctx->ctrl_handler; file->private_data = &ctx->fh; v4l2_fh_add(&ctx->fh); /* Default format */ ctx->src = bdisp_dflt_fmt; ctx->dst = bdisp_dflt_fmt; /* Setup the device context for mem2mem mode. */ ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(bdisp->m2m.m2m_dev, ctx, queue_init); if (IS_ERR(ctx->fh.m2m_ctx)) { dev_err(bdisp->dev, "Failed to initialize m2m context\n"); ret = PTR_ERR(ctx->fh.m2m_ctx); goto error_ctrls; } bdisp->m2m.refcnt++; set_bit(ST_M2M_OPEN, &bdisp->state); dev_dbg(bdisp->dev, "driver opened, ctx = 0x%p\n", ctx); mutex_unlock(&bdisp->lock); return 0; error_ctrls: bdisp_ctrls_delete(ctx); v4l2_fh_del(&ctx->fh); error_fh: v4l2_fh_exit(&ctx->fh); bdisp_hw_free_nodes(ctx); mem_ctx: kfree(ctx); unlock: mutex_unlock(&bdisp->lock); return ret; } static int bdisp_release(struct file *file) { struct bdisp_ctx *ctx = fh_to_ctx(file->private_data); struct bdisp_dev *bdisp = ctx->bdisp_dev; dev_dbg(bdisp->dev, "%s\n", __func__); if (mutex_lock_interruptible(&bdisp->lock)) return -ERESTARTSYS; v4l2_m2m_ctx_release(ctx->fh.m2m_ctx); bdisp_ctrls_delete(ctx); v4l2_fh_del(&ctx->fh); v4l2_fh_exit(&ctx->fh); if (--bdisp->m2m.refcnt <= 0) clear_bit(ST_M2M_OPEN, &bdisp->state); bdisp_hw_free_nodes(ctx); kfree(ctx); mutex_unlock(&bdisp->lock); return 0; } static const struct v4l2_file_operations bdisp_fops = { .owner = THIS_MODULE, .open = bdisp_open, .release = bdisp_release, .poll = v4l2_m2m_fop_poll, .unlocked_ioctl = video_ioctl2, .mmap = v4l2_m2m_fop_mmap, }; static int bdisp_querycap(struct file *file, void *fh, struct v4l2_capability *cap) { struct bdisp_ctx *ctx = fh_to_ctx(fh); struct bdisp_dev *bdisp = ctx->bdisp_dev; strlcpy(cap->driver, bdisp->pdev->name, sizeof(cap->driver)); strlcpy(cap->card, bdisp->pdev->name, sizeof(cap->card)); snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s%d", BDISP_NAME, bdisp->id); cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M; cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } static int bdisp_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f) { struct bdisp_ctx *ctx = fh_to_ctx(fh); const struct bdisp_fmt *fmt; if (f->index >= ARRAY_SIZE(bdisp_formats)) return -EINVAL; fmt = &bdisp_formats[f->index]; if ((fmt->pixelformat == V4L2_PIX_FMT_YUV420) && (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)) { dev_dbg(ctx->bdisp_dev->dev, "No YU12 on capture\n"); return -EINVAL; } f->pixelformat = fmt->pixelformat; return 0; } static int bdisp_g_fmt(struct file *file, void *fh, struct v4l2_format *f) { struct bdisp_ctx *ctx = fh_to_ctx(fh); struct v4l2_pix_format *pix; struct bdisp_frame *frame = ctx_get_frame(ctx, f->type); if (IS_ERR(frame)) { dev_err(ctx->bdisp_dev->dev, "Invalid frame (%p)\n", frame); return PTR_ERR(frame); } pix = &f->fmt.pix; pix->width = frame->width; pix->height = frame->height; pix->pixelformat = frame->fmt->pixelformat; pix->field = frame->field; pix->bytesperline = frame->bytesperline; pix->sizeimage = frame->sizeimage; pix->colorspace = (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) ? frame->colorspace : bdisp_dflt_fmt.colorspace; return 0; } static int bdisp_try_fmt(struct file *file, void *fh, struct v4l2_format *f) { struct bdisp_ctx *ctx = fh_to_ctx(fh); struct v4l2_pix_format *pix = &f->fmt.pix; const struct bdisp_fmt *format; u32 in_w, in_h; format = bdisp_find_fmt(pix->pixelformat); if (!format) { dev_dbg(ctx->bdisp_dev->dev, "Unknown format 0x%x\n", pix->pixelformat); return -EINVAL; } /* YUV420P only supported for VIDEO_OUTPUT */ if ((format->pixelformat == V4L2_PIX_FMT_YUV420) && (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)) { dev_dbg(ctx->bdisp_dev->dev, "No YU12 on capture\n"); return -EINVAL; } /* Field (interlaced only supported on OUTPUT) */ if ((f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) || (pix->field != V4L2_FIELD_INTERLACED)) pix->field = V4L2_FIELD_NONE; /* Adjust width & height */ in_w = pix->width; in_h = pix->height; v4l_bound_align_image(&pix->width, BDISP_MIN_W, BDISP_MAX_W, ffs(format->w_align) - 1, &pix->height, BDISP_MIN_H, BDISP_MAX_H, ffs(format->h_align) - 1, 0); if ((pix->width != in_w) || (pix->height != in_h)) dev_dbg(ctx->bdisp_dev->dev, "%s size updated: %dx%d -> %dx%d\n", __func__, in_w, in_h, pix->width, pix->height); pix->bytesperline = (pix->width * format->bpp_plane0) / 8; pix->sizeimage = (pix->width * pix->height * format->bpp) / 8; if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) pix->colorspace = bdisp_dflt_fmt.colorspace; return 0; } static int bdisp_s_fmt(struct file *file, void *fh, struct v4l2_format *f) { struct bdisp_ctx *ctx = fh_to_ctx(fh); struct vb2_queue *vq; struct bdisp_frame *frame; struct v4l2_pix_format *pix; int ret; u32 state; ret = bdisp_try_fmt(file, fh, f); if (ret) { dev_err(ctx->bdisp_dev->dev, "Cannot set format\n"); return ret; } vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); if (vb2_is_streaming(vq)) { dev_err(ctx->bdisp_dev->dev, "queue (%d) busy\n", f->type); return -EBUSY; } frame = (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) ? &ctx->src : &ctx->dst; pix = &f->fmt.pix; frame->fmt = bdisp_find_fmt(pix->pixelformat); if (!frame->fmt) { dev_err(ctx->bdisp_dev->dev, "Unknown format 0x%x\n", pix->pixelformat); return -EINVAL; } frame->width = pix->width; frame->height = pix->height; frame->bytesperline = pix->bytesperline; frame->sizeimage = pix->sizeimage; frame->field = pix->field; if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) frame->colorspace = pix->colorspace; frame->crop.width = frame->width; frame->crop.height = frame->height; frame->crop.left = 0; frame->crop.top = 0; state = BDISP_PARAMS; state |= (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) ? BDISP_DST_FMT : BDISP_SRC_FMT; bdisp_ctx_state_lock_set(state, ctx); return 0; } static int bdisp_g_selection(struct file *file, void *fh, struct v4l2_selection *s) { struct bdisp_frame *frame; struct bdisp_ctx *ctx = fh_to_ctx(fh); frame = ctx_get_frame(ctx, s->type); if (IS_ERR(frame)) { dev_err(ctx->bdisp_dev->dev, "Invalid frame (%p)\n", frame); return PTR_ERR(frame); } switch (s->type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT: switch (s->target) { case V4L2_SEL_TGT_CROP: /* cropped frame */ s->r = frame->crop; break; case V4L2_SEL_TGT_CROP_DEFAULT: case V4L2_SEL_TGT_CROP_BOUNDS: /* complete frame */ s->r.left = 0; s->r.top = 0; s->r.width = frame->width; s->r.height = frame->height; break; default: dev_err(ctx->bdisp_dev->dev, "Invalid target\n"); return -EINVAL; } break; case V4L2_BUF_TYPE_VIDEO_CAPTURE: switch (s->target) { case V4L2_SEL_TGT_COMPOSE: case V4L2_SEL_TGT_COMPOSE_PADDED: /* composed (cropped) frame */ s->r = frame->crop; break; case V4L2_SEL_TGT_COMPOSE_DEFAULT: case V4L2_SEL_TGT_COMPOSE_BOUNDS: /* complete frame */ s->r.left = 0; s->r.top = 0; s->r.width = frame->width; s->r.height = frame->height; break; default: dev_err(ctx->bdisp_dev->dev, "Invalid target\n"); return -EINVAL; } break; default: dev_err(ctx->bdisp_dev->dev, "Invalid type\n"); return -EINVAL; } return 0; } static int is_rect_enclosed(struct v4l2_rect *a, struct v4l2_rect *b) { /* Return 1 if a is enclosed in b, or 0 otherwise. */ if (a->left < b->left || a->top < b->top) return 0; if (a->left + a->width > b->left + b->width) return 0; if (a->top + a->height > b->top + b->height) return 0; return 1; } static int bdisp_s_selection(struct file *file, void *fh, struct v4l2_selection *s) { struct bdisp_frame *frame; struct bdisp_ctx *ctx = fh_to_ctx(fh); struct v4l2_rect *in, out; bool valid = false; if ((s->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) && (s->target == V4L2_SEL_TGT_CROP)) valid = true; if ((s->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) && (s->target == V4L2_SEL_TGT_COMPOSE)) valid = true; if (!valid) { dev_err(ctx->bdisp_dev->dev, "Invalid type / target\n"); return -EINVAL; } frame = ctx_get_frame(ctx, s->type); if (IS_ERR(frame)) { dev_err(ctx->bdisp_dev->dev, "Invalid frame (%p)\n", frame); return PTR_ERR(frame); } in = &s->r; out = *in; /* Align and check origin */ out.left = ALIGN(in->left, frame->fmt->w_align); out.top = ALIGN(in->top, frame->fmt->h_align); if ((out.left < 0) || (out.left >= frame->width) || (out.top < 0) || (out.top >= frame->height)) { dev_err(ctx->bdisp_dev->dev, "Invalid crop: %dx%d@(%d,%d) vs frame: %dx%d\n", out.width, out.height, out.left, out.top, frame->width, frame->height); return -EINVAL; } /* Align and check size */ out.width = ALIGN(in->width, frame->fmt->w_align); out.height = ALIGN(in->height, frame->fmt->w_align); if (((out.left + out.width) > frame->width) || ((out.top + out.height) > frame->height)) { dev_err(ctx->bdisp_dev->dev, "Invalid crop: %dx%d@(%d,%d) vs frame: %dx%d\n", out.width, out.height, out.left, out.top, frame->width, frame->height); return -EINVAL; } /* Checks adjust constraints flags */ if (s->flags & V4L2_SEL_FLAG_LE && !is_rect_enclosed(&out, in)) return -ERANGE; if (s->flags & V4L2_SEL_FLAG_GE && !is_rect_enclosed(in, &out)) return -ERANGE; if ((out.left != in->left) || (out.top != in->top) || (out.width != in->width) || (out.height != in->height)) { dev_dbg(ctx->bdisp_dev->dev, "%s crop updated: %dx%d@(%d,%d) -> %dx%d@(%d,%d)\n", __func__, in->width, in->height, in->left, in->top, out.width, out.height, out.left, out.top); *in = out; } frame->crop = out; bdisp_ctx_state_lock_set(BDISP_PARAMS, ctx); return 0; } static int bdisp_streamon(struct file *file, void *fh, enum v4l2_buf_type type) { struct bdisp_ctx *ctx = fh_to_ctx(fh); if ((type == V4L2_BUF_TYPE_VIDEO_OUTPUT) && !bdisp_ctx_state_is_set(BDISP_SRC_FMT, ctx)) { dev_err(ctx->bdisp_dev->dev, "src not defined\n"); return -EINVAL; } if ((type == V4L2_BUF_TYPE_VIDEO_CAPTURE) && !bdisp_ctx_state_is_set(BDISP_DST_FMT, ctx)) { dev_err(ctx->bdisp_dev->dev, "dst not defined\n"); return -EINVAL; } return v4l2_m2m_streamon(file, ctx->fh.m2m_ctx, type); } static const struct v4l2_ioctl_ops bdisp_ioctl_ops = { .vidioc_querycap = bdisp_querycap, .vidioc_enum_fmt_vid_cap = bdisp_enum_fmt, .vidioc_enum_fmt_vid_out = bdisp_enum_fmt, .vidioc_g_fmt_vid_cap = bdisp_g_fmt, .vidioc_g_fmt_vid_out = bdisp_g_fmt, .vidioc_try_fmt_vid_cap = bdisp_try_fmt, .vidioc_try_fmt_vid_out = bdisp_try_fmt, .vidioc_s_fmt_vid_cap = bdisp_s_fmt, .vidioc_s_fmt_vid_out = bdisp_s_fmt, .vidioc_g_selection = bdisp_g_selection, .vidioc_s_selection = bdisp_s_selection, .vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs, .vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs, .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, .vidioc_querybuf = v4l2_m2m_ioctl_querybuf, .vidioc_qbuf = v4l2_m2m_ioctl_qbuf, .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf, .vidioc_streamon = bdisp_streamon, .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; static int bdisp_register_device(struct bdisp_dev *bdisp) { int ret; if (!bdisp) return -ENODEV; bdisp->vdev.fops = &bdisp_fops; bdisp->vdev.ioctl_ops = &bdisp_ioctl_ops; bdisp->vdev.release = video_device_release_empty; bdisp->vdev.lock = &bdisp->lock; bdisp->vdev.vfl_dir = VFL_DIR_M2M; bdisp->vdev.v4l2_dev = &bdisp->v4l2_dev; snprintf(bdisp->vdev.name, sizeof(bdisp->vdev.name), "%s.%d", BDISP_NAME, bdisp->id); video_set_drvdata(&bdisp->vdev, bdisp); bdisp->m2m.vdev = &bdisp->vdev; bdisp->m2m.m2m_dev = v4l2_m2m_init(&bdisp_m2m_ops); if (IS_ERR(bdisp->m2m.m2m_dev)) { dev_err(bdisp->dev, "failed to initialize v4l2-m2m device\n"); return PTR_ERR(bdisp->m2m.m2m_dev); } ret = video_register_device(&bdisp->vdev, VFL_TYPE_GRABBER, -1); if (ret) { dev_err(bdisp->dev, "%s(): failed to register video device\n", __func__); v4l2_m2m_release(bdisp->m2m.m2m_dev); return ret; } return 0; } static void bdisp_unregister_device(struct bdisp_dev *bdisp) { if (!bdisp) return; if (bdisp->m2m.m2m_dev) v4l2_m2m_release(bdisp->m2m.m2m_dev); video_unregister_device(bdisp->m2m.vdev); } static irqreturn_t bdisp_irq_thread(int irq, void *priv) { struct bdisp_dev *bdisp = priv; struct bdisp_ctx *ctx; spin_lock(&bdisp->slock); bdisp_dbg_perf_end(bdisp); cancel_delayed_work(&bdisp->timeout_work); if (!test_and_clear_bit(ST_M2M_RUNNING, &bdisp->state)) goto isr_unlock; if (test_and_clear_bit(ST_M2M_SUSPENDING, &bdisp->state)) { set_bit(ST_M2M_SUSPENDED, &bdisp->state); wake_up(&bdisp->irq_queue); goto isr_unlock; } ctx = v4l2_m2m_get_curr_priv(bdisp->m2m.m2m_dev); if (!ctx || !ctx->fh.m2m_ctx) goto isr_unlock; spin_unlock(&bdisp->slock); bdisp_job_finish(ctx, VB2_BUF_STATE_DONE); if (bdisp_ctx_state_is_set(BDISP_CTX_STOP_REQ, ctx)) { bdisp_ctx_state_lock_clear(BDISP_CTX_STOP_REQ, ctx); wake_up(&bdisp->irq_queue); } return IRQ_HANDLED; isr_unlock: spin_unlock(&bdisp->slock); return IRQ_HANDLED; } static irqreturn_t bdisp_irq_handler(int irq, void *priv) { if (bdisp_hw_get_and_clear_irq((struct bdisp_dev *)priv)) return IRQ_NONE; else return IRQ_WAKE_THREAD; } static void bdisp_irq_timeout(struct work_struct *ptr) { struct delayed_work *twork = to_delayed_work(ptr); struct bdisp_dev *bdisp = container_of(twork, struct bdisp_dev, timeout_work); struct bdisp_ctx *ctx; ctx = v4l2_m2m_get_curr_priv(bdisp->m2m.m2m_dev); dev_err(ctx->bdisp_dev->dev, "Device work timeout\n"); spin_lock(&bdisp->slock); clear_bit(ST_M2M_RUNNING, &bdisp->state); spin_unlock(&bdisp->slock); bdisp_hw_reset(bdisp); bdisp_job_finish(ctx, VB2_BUF_STATE_ERROR); } static int bdisp_m2m_suspend(struct bdisp_dev *bdisp) { unsigned long flags; int timeout; spin_lock_irqsave(&bdisp->slock, flags); if (!test_bit(ST_M2M_RUNNING, &bdisp->state)) { spin_unlock_irqrestore(&bdisp->slock, flags); return 0; } clear_bit(ST_M2M_SUSPENDED, &bdisp->state); set_bit(ST_M2M_SUSPENDING, &bdisp->state); spin_unlock_irqrestore(&bdisp->slock, flags); timeout = wait_event_timeout(bdisp->irq_queue, test_bit(ST_M2M_SUSPENDED, &bdisp->state), BDISP_WORK_TIMEOUT); clear_bit(ST_M2M_SUSPENDING, &bdisp->state); if (!timeout) { dev_err(bdisp->dev, "%s IRQ timeout\n", __func__); return -EAGAIN; } return 0; } static int bdisp_m2m_resume(struct bdisp_dev *bdisp) { struct bdisp_ctx *ctx; unsigned long flags; spin_lock_irqsave(&bdisp->slock, flags); ctx = bdisp->m2m.ctx; bdisp->m2m.ctx = NULL; spin_unlock_irqrestore(&bdisp->slock, flags); if (test_and_clear_bit(ST_M2M_SUSPENDED, &bdisp->state)) bdisp_job_finish(ctx, VB2_BUF_STATE_ERROR); return 0; } static int bdisp_runtime_resume(struct device *dev) { struct bdisp_dev *bdisp = dev_get_drvdata(dev); int ret = clk_enable(bdisp->clock); if (ret) return ret; return bdisp_m2m_resume(bdisp); } static int bdisp_runtime_suspend(struct device *dev) { struct bdisp_dev *bdisp = dev_get_drvdata(dev); int ret = bdisp_m2m_suspend(bdisp); if (!ret) clk_disable(bdisp->clock); return ret; } static int bdisp_resume(struct device *dev) { struct bdisp_dev *bdisp = dev_get_drvdata(dev); unsigned long flags; int opened; spin_lock_irqsave(&bdisp->slock, flags); opened = test_bit(ST_M2M_OPEN, &bdisp->state); spin_unlock_irqrestore(&bdisp->slock, flags); if (!opened) return 0; if (!pm_runtime_suspended(dev)) return bdisp_runtime_resume(dev); return 0; } static int bdisp_suspend(struct device *dev) { if (!pm_runtime_suspended(dev)) return bdisp_runtime_suspend(dev); return 0; } static const struct dev_pm_ops bdisp_pm_ops = { .suspend = bdisp_suspend, .resume = bdisp_resume, .runtime_suspend = bdisp_runtime_suspend, .runtime_resume = bdisp_runtime_resume, }; static int bdisp_remove(struct platform_device *pdev) { struct bdisp_dev *bdisp = platform_get_drvdata(pdev); bdisp_unregister_device(bdisp); bdisp_hw_free_filters(bdisp->dev); pm_runtime_disable(&pdev->dev); bdisp_debugfs_remove(bdisp); v4l2_device_unregister(&bdisp->v4l2_dev); if (!IS_ERR(bdisp->clock)) clk_unprepare(bdisp->clock); dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); return 0; } static int bdisp_probe(struct platform_device *pdev) { struct bdisp_dev *bdisp; struct resource *res; struct device *dev = &pdev->dev; int ret; dev_dbg(dev, "%s\n", __func__); bdisp = devm_kzalloc(dev, sizeof(struct bdisp_dev), GFP_KERNEL); if (!bdisp) return -ENOMEM; ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); if (ret) return ret; bdisp->pdev = pdev; bdisp->dev = dev; platform_set_drvdata(pdev, bdisp); if (dev->of_node) bdisp->id = of_alias_get_id(pdev->dev.of_node, BDISP_NAME); else bdisp->id = pdev->id; init_waitqueue_head(&bdisp->irq_queue); INIT_DELAYED_WORK(&bdisp->timeout_work, bdisp_irq_timeout); bdisp->work_queue = create_workqueue(BDISP_NAME); spin_lock_init(&bdisp->slock); mutex_init(&bdisp->lock); /* get resources */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); bdisp->regs = devm_ioremap_resource(dev, res); if (IS_ERR(bdisp->regs)) { dev_err(dev, "failed to get regs\n"); return PTR_ERR(bdisp->regs); } bdisp->clock = devm_clk_get(dev, BDISP_NAME); if (IS_ERR(bdisp->clock)) { dev_err(dev, "failed to get clock\n"); return PTR_ERR(bdisp->clock); } ret = clk_prepare(bdisp->clock); if (ret < 0) { dev_err(dev, "clock prepare failed\n"); bdisp->clock = ERR_PTR(-EINVAL); return ret; } res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(dev, "failed to get IRQ resource\n"); ret = -EINVAL; goto err_clk; } ret = devm_request_threaded_irq(dev, res->start, bdisp_irq_handler, bdisp_irq_thread, IRQF_ONESHOT, pdev->name, bdisp); if (ret) { dev_err(dev, "failed to install irq\n"); goto err_clk; } /* v4l2 register */ ret = v4l2_device_register(dev, &bdisp->v4l2_dev); if (ret) { dev_err(dev, "failed to register\n"); goto err_clk; } /* Debug */ ret = bdisp_debugfs_create(bdisp); if (ret) { dev_err(dev, "failed to create debugfs\n"); goto err_v4l2; } /* Power management */ pm_runtime_enable(dev); ret = pm_runtime_get_sync(dev); if (ret < 0) { dev_err(dev, "failed to set PM\n"); goto err_dbg; } /* Filters */ if (bdisp_hw_alloc_filters(bdisp->dev)) { dev_err(bdisp->dev, "no memory for filters\n"); ret = -ENOMEM; goto err_pm; } /* Register */ ret = bdisp_register_device(bdisp); if (ret) { dev_err(dev, "failed to register\n"); goto err_filter; } dev_info(dev, "%s%d registered as /dev/video%d\n", BDISP_NAME, bdisp->id, bdisp->vdev.num); pm_runtime_put(dev); return 0; err_filter: bdisp_hw_free_filters(bdisp->dev); err_pm: pm_runtime_put(dev); err_dbg: bdisp_debugfs_remove(bdisp); err_v4l2: v4l2_device_unregister(&bdisp->v4l2_dev); err_clk: if (!IS_ERR(bdisp->clock)) clk_unprepare(bdisp->clock); return ret; } static const struct of_device_id bdisp_match_types[] = { { .compatible = "st,stih407-bdisp", }, { /* end node */ } }; MODULE_DEVICE_TABLE(of, bdisp_match_types); static struct platform_driver bdisp_driver = { .probe = bdisp_probe, .remove = bdisp_remove, .driver = { .name = BDISP_NAME, .of_match_table = bdisp_match_types, .pm = &bdisp_pm_ops, }, }; module_platform_driver(bdisp_driver); MODULE_DESCRIPTION("2D blitter for STMicroelectronics SoC"); MODULE_AUTHOR("Fabien Dessenne <[email protected]>"); MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <ContactsUICore/NSObject-Protocol.h> @class CNContact; @protocol CNUIRTTUtilities <NSObject> - (BOOL)relayIsSupported; - (BOOL)contactIsTTYContact:(CNContact *)arg1; @end
{ "pile_set_name": "Github" }
ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTM5LjE2Mi42Ny40MDo4MDk3#翻墙党131.52日本 ss://YWVzLTI1Ni1jZmI6Uktjak9Fb2tRb2xqQDEzOS4xNjIuNjguNzA6MzQ5NzA=#翻墙党127.71日本 ss://YWVzLTI1Ni1jZmI6VTVTTjdXcXFEQXZwQDEzOS4xNjIuNjguNzE6NTk5OTA=#翻墙党107.75日本 ss://YWVzLTI1Ni1jZmI6SHhNbW5WYkVhOE1iQDEzOS4xNjIuODQuOTY6MTkzMDQ=#翻墙党106.19日本 ss://YWVzLTI1Ni1jZmI6Wm11WGtHZmNrZmZZQDEzOS4xNjIuMTAxLjY2OjM4MjUw#翻墙党117.06日本 ss://YWVzLTI1Ni1jZmI6R1hnQUZzZWVBUlkwQDEzOS4xNjIuMTE2LjIzNzoxNTUyNw==#翻墙党98.34日本 ss://YWVzLTI1Ni1jZmI6Rko1VzZGbWVOdWpFQDEzOS4xNjIuMTI1LjgwOjM0OTA1#翻墙党109.49日本 ss://YWVzLTI1Ni1jZmI6WW5vUUNnYUFIOWJZQDE3Mi4xMDQuNjguMjI4OjU2OTcy#翻墙党114.84日本 ss://YWVzLTI1Ni1jZmI6aTRvTWozdnRmR0t2QDE3Mi4xMDQuNzQuNjg6MTM0NTU=#翻墙党112.96日本 ss://YWVzLTI1Ni1jZmI6bGp1QnNuM2JFWnpRQDE3Mi4xMDQuNzcuNDY6MTA0NTY=#翻墙党116.47日本 ss://YWVzLTI1Ni1jZmI6UEhWMFpGQVdHMExqQDE3Mi4xMDQuOTAuMTc3OjE0MjYy#翻墙党111.36日本 ss://YWVzLTI1Ni1jZmI6eUtEYVd3THZEeDh1QDE3Mi4xMDQuMTA5LjIxOTo1NDQ0OA==#翻墙党116.30日本 ss://YWVzLTI1Ni1jZmI6SXBSQU5kOXNhSWVwQDE3Mi4xMDQuMTI0LjE3MzozMjUyNw==#翻墙党121.66日本 ss://YWVzLTI1Ni1jZmI6UGZ1djVzUXRiN3lWQDE3Mi4xMDUuMjE1LjUzOjM1ODIz#翻墙党98.06日本 ss://YWVzLTI1Ni1jZmI6OG43RElBVFI2VFZZQDUyLjE5NC4yMTkuMTg4OjQ1Mzk0#翻墙党150.73日本 ss://YWVzLTI1Ni1jZmI6Wld2UWtnU2NrcmhhQDUyLjY5LjI0OC4xMDY6NDIyMDA=#翻墙党106.47日本 ss://YWVzLTI1Ni1jZmI6TURhcnZsT0ZLN05TQDU0LjI0OC43MS4xNDU6NTI1NjI=#翻墙党107.07日本 ss://YWVzLTI1Ni1jZmI6OFdYYWxaclFnZ0E2QDU0Ljk1LjE3Mi40MjozMzEwNA==#翻墙党107.30日本 以上为日本地区节点 ss://YWVzLTI1Ni1jZmI6b0ljT1ZQcnVBMzQ4QDEzLjExNS4xNzUuODk6MTA1NTU=#翻墙党117.57美国 ss://YWVzLTI1Ni1jZmI6UEdOQU90eHZDNzNFQDEzLjExMi4xODAuMTUzOjI4MjMy#翻墙党112.20美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTYyLjIyMC41MS41ODo4MDk3#翻墙党255.30美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTcyLjEwNS43MS40OjgwOTk=#翻墙党325.24美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTcyLjEwNS43MS44Mjo4MDk5#翻墙党325.06美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTg1LjE4Ni4yNDUuNDQ6ODA5Nw==#翻墙党309.27美国 ss://YWVzLTI1Ni1jZmI6Q1g0NTNwOUh2YmNTQDE4LjE3Ni41NC4yMTk6NDM0NzE=#翻墙党105.12美国 ss://YWVzLTI1Ni1jZmI6bGhUVkh1Vko5djN0QDE4LjE3Ni41NS40MDoyNjA3MA==#翻墙党105.61美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTk5LjIyMy4xMTkuODM6ODA5Nw==#翻墙党291.03美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTk5LjIyMy4xMTkuOTI6ODA5OQ==#翻墙党295.29美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMjMuMjU0LjIwNC4yMDM6ODA5OQ==#翻墙党285.18美国 ss://YWVzLTI1Ni1jZmI6N0JiZ0FJVTB5MzJGQDMuMTEyLjE3MS4xMTY6NDUwODM=#翻墙党99.13美国 ss://YWVzLTI1Ni1jZmI6R3dsTjB3ejUyQVlLQDMuMTEyLjIxNy4xMDU6NDA2NzY=#翻墙党124.12美国 ss://YWVzLTI1Ni1jZmI6YmFubmVkYm9vay5vcmdAMzguMTAwLjIyOS44NDozOQ==#翻墙党324.94美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERANTAuNy4xMi4xNDc6ODA5OQ==#翻墙党299.86美国 ss://YWVzLTI1Ni1jZmI6ZG9uZ3RhaXdhbmcuY29tQDY3LjIxLjk0LjE5Mjo0OQ==#翻墙党218.56美国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERANjkuMzYuMTgyLjUyOjgwOTc=#翻墙党300.27美国 ss://cmM0LW1kNTp0Lm1lL1NTUlNVQkB1czIuc3Nyc3ViLnh5ejo5OTk5#翻墙党366.87美国 以上为美国地区节点 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMjA5LjU4LjE4OC4xMjo4MDk3#翻墙党420.09中国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMjA5LjU4LjE4OC4xNTc6ODA5OQ==#翻墙党222.70中国 ss://YWVzLTI1Ni1jZmI6YlR1SzVJSnI5aHpsQDIxMS4yMS4yMTQuMjM0OjIxOTcx#翻墙党68.25中国 ss://cmM0LW1kNTpjaHQxOTk3Li4uLy8vQGpwMy5veXZwbnNlcnZlci5jb206MzU3Mg==#翻墙党110.47丹麦 ss://YWVzLTI1Ni1jZmI6cWpnaldlazhXTkJ1QDgwLjkzLjE4Mi42Mzo0MzM3Mg==#翻墙党334.29俄罗斯 ss://YWVzLTI1Ni1jZmI6T1dxUG9td3g0QzcwQDgyLjIwMi4yMjYuMTAyOjUzNjE3#翻墙党353.51俄罗斯 ss://YWVzLTI1Ni1jZmI6eXA2bDZadEI0NWRyQDkyLjUzLjY3LjcxOjQ1NDE1#翻墙党339.26俄罗斯 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTcyLjEwNC4xNDkuNTY6ODA5OQ==#翻墙党316.66德国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTM5LjE2Mi4xNS40NTo4MDk5#翻墙党127.11新加坡 ss://cmM0LW1kNTpjaHQxOTk3Li4uLy8vQDQ1Ljg4LjQyLjU4OjM1NzI=#翻墙党96.19欧洲 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTc2LjU4Ljk3LjEzNzo4MDk5#翻墙党324.48英国 ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMjEyLjg0LjE2OS43Mjo4MDk5#翻墙党308.69英国 以上为其他地区节点 ============================= 链接数量:48 检测时间:2019-11-26 22:03:50 =============================
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <CloudDocsDaemon/PQLBindable-Protocol.h> @protocol PQLValuable <PQLBindable> @optional + (id)newFromSqliteStatement:(struct sqlite3_stmt *)arg1 atIndex:(int)arg2; + (id)newFromSqliteValue:(struct sqlite3_value *)arg1; @end
{ "pile_set_name": "Github" }
{ "type": "tfc:shaped_skill", "pattern": [ "X", "S" ], "key": { "X": { "item": "tfc:metal/knife_blade/blue_steel" }, "S": { "type": "forge:ore_dict", "ore": "stickWood" } }, "result": { "item": "tfc:metal/knife/blue_steel" } }
{ "pile_set_name": "Github" }
import React from 'react' import PropTypes from 'prop-types' function getProps(children, prop) { if (!children || !children.props) return null const { onError, onLoad, ...childProps } = children.props switch (prop) { case 'onError': return onError case 'onLoad': return onLoad default: return childProps } } class LazyChild extends React.PureComponent { constructor(props) { super(props) this.state = { isFailed: false, isLoaded: false } this.handleError = this.handleError.bind(this) this.handleLoad = this.handleLoad.bind(this) } componentDidMount() { this.setState({ childProps: getProps(this.props.children) }) } componentDidUpdate(prevProps) { if (prevProps.children === this.props.children) { return } this.setState({ childProps: getProps(this.props.children) }) } handleError(event) { this.setState({ isFailed: true }, this.props.callback) const onError = getProps(this.props.children, 'onError') if (onError) onError(event) } handleLoad(event) { this.setState({ isLoaded: true }, this.props.callback) const onLoad = getProps(this.props.children, 'onLoad') if (onLoad) onLoad(event) } render() { const { callback, children, wrapper, ...props } = this.props const child = children ? React.Children.only(children) : null return React.createElement( wrapper, { ...props, ...this.state }, child && !this.state.isFailed && !this.state.isLoaded ? React.cloneElement(child, { onError: this.handleError, onLoad: this.handleLoad }) : child, ) } } LazyChild.propTypes = { callback: PropTypes.func, children: PropTypes.node, wrapper: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired, } export default LazyChild
{ "pile_set_name": "Github" }
'use strict'; /*jshint unused:false */ function Store() { } exports.Store = Store; // Stores may be synchronous, but are still required to use a // Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" // API that converts from synchronous-callbacks to imperative style. Store.prototype.synchronous = false; Store.prototype.findCookie = function(domain, path, key, cb) { throw new Error('findCookie is not implemented'); }; Store.prototype.findCookies = function(domain, path, cb) { throw new Error('findCookies is not implemented'); }; Store.prototype.putCookie = function(cookie, cb) { throw new Error('putCookie is not implemented'); }; Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { // recommended default implementation: // return this.putCookie(newCookie, cb); throw new Error('updateCookie is not implemented'); }; Store.prototype.removeCookie = function(domain, path, key, cb) { throw new Error('removeCookie is not implemented'); }; Store.prototype.removeCookies = function removeCookies(domain, path, cb) { throw new Error('removeCookies is not implemented'); };
{ "pile_set_name": "Github" }
gperftools (2.1-1) unstable; urgency=low * New upstream release. -- gperftools Contributors <[email protected]> Tue, 30 Jul 2013 11:51:13 +0300 gperftools (2.0.99-1) unstable; urgency=low * New upstream release. -- gperftools Contributors <[email protected]> Sat, 20 Jul 2013 14:21:10 -0700 gperftools (2.0-1) unstable; urgency=low * New upstream release. * Package renamed from google-perftools to gperftools. -- Google Inc. and others <[email protected]> Fri, 03 Feb 2012 15:40:45 -0800 google-perftools (1.10-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Tue, 31 Jan 2012 10:43:50 -0800 google-perftools (1.9-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Thu, 22 Dec 2011 16:22:45 -0800 google-perftools (1.8-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Fri, 15 Jul 2011 16:10:51 -0700 google-perftools (1.7-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Fri, 04 Feb 2011 15:54:31 -0800 google-perftools (1.6-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Thu, 05 Aug 2010 12:48:03 -0700 google-perftools (1.5-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Tue, 19 Jan 2010 14:46:12 -0800 google-perftools (1.4-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Thu, 10 Sep 2009 13:51:15 -0700 google-perftools (1.3-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Tue, 09 Jun 2009 18:19:06 -0700 google-perftools (1.2-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Fri, 17 Apr 2009 16:40:48 -0700 google-perftools (1.1-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Wed, 11 Mar 2009 11:25:34 -0700 google-perftools (1.0-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Tue, 06 Jan 2009 13:58:56 -0800 google-perftools (1.0rc1-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Thu, 11 Dec 2008 16:01:32 -0800 google-perftools (0.99.1-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Sat, 20 Sep 2008 09:37:18 -0700 google-perftools (0.99-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Thu, 18 Sep 2008 16:00:27 -0700 google-perftools (0.98-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Mon, 09 Jun 2008 16:47:03 -0700 google-perftools (0.97-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Mon, 21 Apr 2008 15:20:52 -0700 google-perftools (0.96-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Tue, 18 Mar 2008 14:30:44 -0700 google-perftools (0.95-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Tue, 12 Feb 2008 12:28:32 -0800 google-perftools (0.94-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Thu, 29 Nov 2007 07:59:43 -0800 google-perftools (0.93-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Fri, 17 Aug 2007 12:32:56 -0700 google-perftools (0.92-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Tue, 17 Jul 2007 22:26:27 -0700 google-perftools (0.91-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Wed, 18 Apr 2007 16:43:55 -0700 google-perftools (0.90-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Fri, 13 Apr 2007 14:50:51 -0700 google-perftools (0.8-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Wed, 14 Jun 2006 15:11:14 -0700 google-perftools (0.7-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Thu, 13 Apr 2006 20:59:09 -0700 google-perftools (0.6-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Fri, 27 Jan 2006 14:04:27 -0800 google-perftools (0.5-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Mon, Nov 14 17:28:59 2005 -0800 google-perftools (0.4-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Wed, 26 Oct 2005 15:19:16 -0700 google-perftools (0.3-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Fri, 24 Jun 2005 18:02:26 -0700 google-perftools (0.2-1) unstable; urgency=low * New upstream release. -- Google Inc. <[email protected]> Tue, 31 May 2005 08:14:38 -0700 google-perftools (0.1-1) unstable; urgency=low * Initial release. The google-perftools package contains some utilities to improve and analyze the performance of C++ programs. This includes an optimized thread-caching malloc() and cpu and heap profiling utilities. -- Google Inc. <[email protected]> Fri, 11 Mar 2005 08:07:33 -0800
{ "pile_set_name": "Github" }
# These are supported funding model platforms custom: https://www.paypal.me/mchome19
{ "pile_set_name": "Github" }
{ "packageId": "0acb228c-17ab-4e50-85e9-ffc7102ea423", "name": "airflow", "normalizedName": "airflow", "logoImageId": "", "repository": { "repositoryId": "0acb228c-17ab-4e50-85e9-ffc7102ea423", "kind": 0, "name": "stable", "displayName": "Stable", "userAlias": null, "organizationName": "helm", "organizationDisplayName": "Helm" }, "eventKinds": [0] }
{ "pile_set_name": "Github" }
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gccgo #include "textflag.h" // // System call support for ARM, FreeBSD // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-28 B syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-40 B syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-52 B syscall·Syscall9(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-28 B syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 B syscall·RawSyscall6(SB)
{ "pile_set_name": "Github" }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = cloneDeep; var _cloneNode = _interopRequireDefault(require("./cloneNode")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function cloneDeep(node) { return (0, _cloneNode.default)(node); }
{ "pile_set_name": "Github" }
(function($){ var withinBox = function(x, y, left, top, width, height ){ return (y >= top && y < top + height && x >= left && x < left + width); } /** * @function within * @parent dom * Returns if the elements are within the position * @param {Object} x * @param {Object} y * @param {Object} cache */ $.fn.within= function(x, y, cache) { var ret = [] this.each(function(){ var q = jQuery(this); if(this == document.documentElement) return ret.push(this); var offset = cache ? jQuery.data(this,"offset", q.offset()) : q.offset(); var res = withinBox(x, y, offset.left, offset.top, this.offsetWidth, this.offsetHeight ); if(res) ret.push(this); }); return this.pushStack( jQuery.unique( ret ), "within", x+","+y ); } /** * @function withinBox * returns if elements are within the box * @param {Object} left * @param {Object} top * @param {Object} width * @param {Object} height * @param {Object} cache */ $.fn.withinBox = function(left, top, width, height, cache){ var ret = [] this.each(function(){ var q = jQuery(this); if(this == document.documentElement) return this.ret.push(this); var offset = cache ? jQuery.data(this,"offset", q.offset()) : q.offset(); var ew = q.width(), eh = q.height(); res = !( (offset.top > top+height) || (offset.top +eh < top) || (offset.left > left+width ) || (offset.left+ew < left)); if(res) ret.push(this); }); return this.pushStack( jQuery.unique( ret ), "withinBox", jQuery.makeArray(arguments).join(",") ); } })(jQuery); (function($){ /** * @function compare * @parent dom * @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/dom/compare/compare.js * Compares the position of two nodes and returns a bitmask detailing how they are positioned * relative to each other. You can expect it to return the same results as * [http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition | compareDocumentPosition]. * Parts of this documentation and source come from [http://ejohn.org/blog/comparing-document-position | John Resig]. * <h2>Demo</h2> * @demo jquery/dom/compare/compare.html * @test jquery/dom/compare/qunit.html * @plugin dom/compare * @param {HTMLElement} a the first node * @param {HTMLElement} b the second node * @return {Number} A bitmap with the following digit values: * <table class='options'> * <tr><th>Bits</th><th>Number</th><th>Meaning</th></tr> * <tr><td>000000</td><td>0</td><td>Elements are identical.</td></tr> * <tr><td>000001</td><td>1</td><td>The nodes are in different documents (or one is outside of a document).</td></tr> * <tr><td>000010</td><td>2</td><td>Node B precedes Node A.</td></tr> * <tr><td>000100</td><td>4</td><td>Node A precedes Node B.</td></tr> * <tr><td>001000</td><td>8</td><td>Node B contains Node A.</td></tr> * <tr><td>010000</td><td>16</td><td>Node A contains Node B.</td></tr> * </table> */ jQuery.fn.compare = function(b){ //usually //b is usually a relatedTarget, but b/c it is we have to avoid a few FF errors try{ //FF3 freaks out with XUL b = b.jquery ? b[0] : b; }catch(e){ return null; } if (window.HTMLElement) { //make sure we aren't coming from XUL element var s = HTMLElement.prototype.toString.call(b) if (s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]') return null; } if(this[0].compareDocumentPosition){ return this[0].compareDocumentPosition(b); } if(this[0] == document && b != document) return 8; var number = (this[0] !== b && this[0].contains(b) && 16) + (this[0] != b && b.contains(this[0]) && 8), docEl = document.documentElement; if(this[0].sourceIndex){ number += (this[0].sourceIndex < b.sourceIndex && 4) number += (this[0].sourceIndex > b.sourceIndex && 2) number += (this[0].ownerDocument !== b.ownerDocument || (this[0] != docEl && this[0].sourceIndex <= 0 ) || (b != docEl && b.sourceIndex <= 0 )) && 1 }else{ var range = document.createRange(), sourceRange = document.createRange(), compare; range.selectNode(this[0]); sourceRange.selectNode(b); compare = range.compareBoundaryPoints(Range.START_TO_START, sourceRange); } return number; } })(jQuery); (function($){ var event = $.event, callHanders = function(){ }; //somehow need to keep track of elements with selectors on them. When element is removed, somehow we need to know that // /** * @add jQuery.event.special */ var eventNames = [ /** * @attribute dropover * Called when a drag is first moved over this drop element. * <p>Drop events are covered in more detail in [jQuery.Drop].</p> */ "dropover", /** * @attribute dropon * Called when a drag is dropped on a drop element. * <p>Drop events are covered in more detail in [jQuery.Drop].</p> */ "dropon", /** * @attribute dropout * Called when a drag is moved out of this drop. * <p>Drop events are covered in more detail in [jQuery.Drop].</p> */ "dropout", /** * @attribute dropinit * Called when a drag motion starts and the drop elements are initialized. * <p>Drop events are covered in more detail in [jQuery.Drop].</p> */ "dropinit", /** * @attribute dropmove * Called repeatedly when a drag is moved over a drop. * <p>Drop events are covered in more detail in [jQuery.Drop].</p> */ "dropmove", /** * @attribute dropend * Called when the drag is done for this drop. * <p>Drop events are covered in more detail in [jQuery.Drop].</p> */ "dropend"]; /** * @class jQuery.Drop * @parent specialevents * @plugin jquery/event/drop * @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/event/drop/drop.js * @test jquery/event/drag/qunit.html * * Provides drop events as a special event to jQuery. * By binding to a drop event, the your callback functions will be * called during the corresponding phase of drag. * <h2>Drop Events</h2> * All drop events are called with the native event, an instance of drop, and the drag. Here are the available drop * events: * <ul> * <li><code>dropinit</code> - the drag motion is started, drop positions are calculated.</li> * <li><code>dropover</code> - a drag moves over a drop element, called once as the drop is dragged over the element.</li> * <li><code>dropout</code> - a drag moves out of the drop element.</li> * <li><code>dropmove</code> - a drag is moved over a drop element, called repeatedly as the element is moved.</li> * <li><code>dropon</code> - a drag is released over a drop element.</li> * <li><code>dropend</code> - the drag motion has completed.</li> * </ul> * <h2>Examples</h2> * Here's how to listen for when a drag moves over a drop: * @codestart * $('.drop').live("dropover", function(ev, drop, drag){ * $(this).addClass("drop-over") * }) * @codeend * A bit more complex example: * @demo jquery/event/drop/drop.html 1000 * @constructor * The constructor is never called directly. */ $.Drop = function(callbacks, element){ jQuery.extend(this,callbacks); this.element = element; } $.each(eventNames, function(){ event.special[this] = { add: function( handleObj ) { //add this element to the compiles list var el = $(this), current = (el.data("dropEventCount") || 0); el.data("dropEventCount", current+1 ) if(current==0){ $.Drop.addElement(this); } }, remove: function() { var el = $(this), current = (el.data("dropEventCount") || 0); el.data("dropEventCount", current-1 ) if(current<=1){ $.Drop.removeElement(this); } } } }) $.extend($.Drop,{ lowerName: "drop", _elements: [], //elements that are listening for drops _responders: [], //potential drop points last_active: [], endName: "dropon", addElement: function( el ) { //check other elements for(var i =0; i < this._elements.length ; i++ ){ if(el ==this._elements[i]) return; } this._elements.push(el); }, removeElement: function( el ) { for(var i =0; i < this._elements.length ; i++ ){ if(el == this._elements[i]){ this._elements.splice(i,1) return; } } }, /** * @hide * For a list of affected drops, sorts them by which is deepest in the DOM first. */ sortByDeepestChild: function( a, b ) { var compare = a.element.compare(b.element); if(compare & 16 || compare & 4) return 1; if(compare & 8 || compare & 2) return -1; return 0; }, /** * @hide * Tests if a drop is within the point. */ isAffected: function( point, moveable, responder ) { return ((responder.element != moveable.element) && (responder.element.within(point[0], point[1], responder).length == 1)); }, /** * @hide * Calls dropout and sets last active to null * @param {Object} drop * @param {Object} drag * @param {Object} event */ deactivate: function( responder, mover, event ) { mover.out(event, responder) responder.callHandlers(this.lowerName+'out',responder.element[0], event, mover) }, /** * @hide * Calls dropover * @param {Object} drop * @param {Object} drag * @param {Object} event */ activate: function( responder, mover, event ) { //this is where we should call over mover.over(event, responder) //this.last_active = responder; responder.callHandlers(this.lowerName+'over',responder.element[0], event, mover); }, move: function( responder, mover, event ) { responder.callHandlers(this.lowerName+'move',responder.element[0], event, mover) }, /** * Gets all elements that are droppable, adds them */ compile: function( event, drag ) { var el, drops, selector, sels; this.last_active = []; for(var i=0; i < this._elements.length; i++){ //for each element el = this._elements[i] var drops = $.event.findBySelector(el, eventNames) for(selector in drops){ //find the selectors sels = selector ? jQuery(selector, el) : [el]; for(var e= 0; e < sels.length; e++){ //for each found element, create a drop point jQuery.removeData(sels[e],"offset"); this.add(sels[e], new this(drops[selector]), event, drag); } } } }, add: function( element, callbacks, event, drag ) { element = jQuery(element); var responder = new $.Drop(callbacks, element); responder.callHandlers(this.lowerName+'init', element[0], event, drag) if(!responder._canceled){ this._responders.push(responder); } }, show: function( point, moveable, event ) { var element = moveable.element; if(!this._responders.length) return; var respondable, affected = [], propagate = true, i,j, la, toBeActivated, aff, oldLastActive = this.last_active; for(var d =0 ; d < this._responders.length; d++ ){ if(this.isAffected(point, moveable, this._responders[d])){ affected.push(this._responders[d]); } } affected.sort(this.sortByDeepestChild); //we should only trigger on lowest children event.stopRespondPropagate = function(){ propagate = false; } //deactivate everything in last_active that isn't active toBeActivated = affected.slice(); this.last_active = affected; for (j = 0; j < oldLastActive.length; j++) { la = oldLastActive[j] i = 0; while((aff = toBeActivated[i])){ if(la == aff){ toBeActivated.splice(i,1);break; }else{ i++; } } if(!aff){ this.deactivate(la, moveable, event); } if(!propagate) return; } for(var i =0; i < toBeActivated.length; i++){ this.activate(toBeActivated[i], moveable, event); if(!propagate) return; } //activate everything in affected that isn't in last_active for (i = 0; i < affected.length; i++) { this.move(affected[i], moveable, event); if(!propagate) return; } }, end: function( event, moveable ) { var responder, la; for(var r =0; r<this._responders.length; r++){ this._responders[r].callHandlers(this.lowerName+'end', null, event, moveable); } //go through the actives ... if you are over one, call dropped on it for(var i = 0; i < this.last_active.length; i++){ la = this.last_active[i] if( this.isAffected(event.vector(), moveable, la) && la[this.endName]){ la.callHandlers(this.endName, null, event, moveable); } } this.clear(); }, /** * Called after dragging has stopped. * @hide */ clear: function() { this._responders = []; } }) $.Drag.responder = $.Drop; $.extend($.Drop.prototype,{ callHandlers: function( method, el, ev, drag ) { var length = this[method] ? this[method].length : 0 for(var i =0; i < length; i++){ this[method][i].call(el || this.element[0], ev, this, drag) } }, /** * Caches positions of draggable elements. This should be called in dropinit. For example: * @codestart * dropinit: function( el, ev, drop ) { drop.cache_position() } * @codeend */ cache: function( value ) { this._cache = value != null ? value : true; }, /** * Prevents this drop from being dropped on. */ cancel: function() { this._canceled = true; } } ) })(jQuery)
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ @protocol QLPreviewControllerDataSource - (id)previewController:(id)arg1 previewItemAtIndex:(int)arg2; - (int)numberOfPreviewItemsInPreviewController:(id)arg1; @end
{ "pile_set_name": "Github" }
/* contrib/dict_int/dict_int--unpackaged--1.0.sql */ -- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION dict_int FROM unpackaged" to load this file. \quit ALTER EXTENSION dict_int ADD function dintdict_init(internal); ALTER EXTENSION dict_int ADD function dintdict_lexize(internal,internal,internal,internal); ALTER EXTENSION dict_int ADD text search template intdict_template; ALTER EXTENSION dict_int ADD text search dictionary intdict;
{ "pile_set_name": "Github" }
@ RUN: llvm-nm -print-size -arch armv7m %p/Inputs/print-size.macho-armv7m 2>&1 | FileCheck %s @ CHECK: warning: sizes with -print-size for Mach-O files are always zero.
{ "pile_set_name": "Github" }