code stringlengths 3 1.01M | repo_name stringlengths 5 116 | path stringlengths 3 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 3 1.01M |
|---|---|---|---|---|---|
<div class="row">
<div id="sidebar" class="span3">
<ul class="nav nav-list bs-docs-sidenav" style="display: block;">
<?php if (count($product_categories)): ?>
<?php foreach ($product_categories as $key => $list): ?>
<li class="subMenu"><a> <?= $list['category_description'] ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
<div class="span9">
<ul class="breadcrumb">
<li><a href="<?= base_url() ?>">Home</a> <span class="divider">/</span></li>
<li><a href="<?= base_url() ?>products">Products</a> <span class="divider">/</span></li>
<li class="active">product Details</li>
</ul>
<div class="row">
<div id="gallery" class="span3">
<style>
#jquery-overlay {position: absolute;top: 0;left: 0;z-index: 90;width: 100%;height: 500px;}
#jquery-lightbox {position: absolute;top: 0;left: 0;width: 100%;z-index: 100;text-align: center;line-height: 0;}
#jquery-lightbox a img { border: none; }#lightbox-container-image-box {position: relative;background-color: #fff;width: 250px;height: 250px;margin: 0 auto;}
#lightbox-container-image { padding: 10px; }#lightbox-loading {position: absolute;top: 40%;left: 0%;height: 25%;width: 100%;text-align: center;line-height: 0;}
#lightbox-nav { position: absolute;top: 0;left: 0;height: 100%;width: 100%;z-index: 10;}#lightbox-container-image-box > #lightbox-nav { left: 0; }#lightbox-nav a { outline: none;}
#lightbox-nav-btnPrev, #lightbox-nav-btnNext {width: 49%;height: 100%;zoom: 1;display: block;}
#lightbox-nav-btnPrev { left: 0; float: left;}#lightbox-nav-btnNext { right: 0; float: right;}
#lightbox-container-image-data-box {font: 10px Verdana, Helvetica, sans-serif;background-color: #fff;margin: 0 auto;line-height: 1.4em;overflow: auto;width: 100%;padding: 0 10px 0;}
#lightbox-container-image-data { padding: 0 10px; color: #666; }
#lightbox-container-image-data #lightbox-image-details {width: 70%; float: left; text-align: left; }
#lightbox-image-details-caption { font-weight: bold; }#lightbox-image-details-currentNumber {display: block; clear: left; padding-bottom: 1.0em;}
#lightbox-secNav-btnClose {width: 66px; float: right;padding-bottom: 0.7em; }
</style>
<a href="<?= base_url() . $featured_image['image_path'] ?>" title="<h4><?= $product['product_name'] ?> </h4>">
<img src="<?= base_url() . $featured_image['image_path'] ?>" width="100%" alt="<?= $product['product_name'] ?> "/>
</a>
<div id="myCarousel" class="moreOptopm carousel slide">
<div class="carousel-inner">
<?php if (count($product_images)): ?>
<div class="item active">
<?php foreach ($product_images as $key => $list): ?>
<a href="<?= base_url() . $list['image_path'] ?>"> <img width="29%" src="<?= base_url() . $list['image_path'] ?>" alt=""/></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<!--
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
-->
</div>
<div class="btn-toolbar">
<div class="btn-group">
<span class="btn"><i class="icon-envelope"></i></span>
<span class="btn" ><i class="icon-print"></i></span>
<span class="btn" ><i class="icon-zoom-in"></i></span>
<span class="btn" ><i class="icon-star"></i></span>
<span class="btn" ><i class=" icon-thumbs-up"></i></span>
<span class="btn" ><i class="icon-thumbs-down"></i></span>
</div>
</div>
</div>
<div class="span6">
<h3><?= $product['product_name'] ?> </h3>
<small><?= $product['tag_line'] ?></small>
<hr class="soft"/>
<form class="form-horizontal qtyFrm">
<div class="control-group">
<label class="control-label"><span>$<?= $product['product_price'] ?></span></label>
<div class="controls">
<input type="number" class="span1" placeholder="Qty."/>
<button type="submit" class="btn btn-large pull-right"><i class=" icon-shopping-cart"></i> Add to cart</button>
</div>
</div>
</form>
<hr class="soft"/>
<h4>100 items in stock</h4>
<form class="form-horizontal qtyFrm pull-right">
<div class="control-group">
<label class="control-label"><span>Color</span></label>
<div class="controls">
<select class="span2">
<option>Black</option>
<option>Red</option>
<option>Blue</option>
<option>Brown</option>
</select>
</div>
</div>
<!-- <div class="control-group">
<label class="control-label"><span>Materials</span></label>
<div class="controls">
<select class="span2">
<option>Slik</option>
<option>Cotton</option>
<option>Mix</option>
<option>Ruby</option>
</select>
</div>
</div> -->
</form>
<hr class="soft clr"/>
<p>
<?= $product['features_description'] ?>
</p>
<a class="btn btn-small pull-right" href="#detail">More Details</a>
<br class="clr"/>
<a name="detail"></a>
<hr class="soft"/>
</div>
<div class="span9">
<ul id="productDetail" class="nav nav-tabs">
<li class="active"><a href="#home" data-toggle="tab">Product Details</a></li>
<li><a href="#profile" data-toggle="tab">Related Products</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="home">
<h4>Product Information</h4>
<table class="table table-bordered" cellspacing="0">
<tbody>
<tr class="techSpecRow"><th colspan="2">Product Details</th></tr>
<tr class="techSpecRow"><td class="techSpecTD1">Brand: </td><td class="techSpecTD2"><?= $product['brand_name'] ?></td></tr>
<tr class="techSpecRow"><td class="techSpecTD1">Model:</td><td class="techSpecTD2"><?= $product['product_model'] ?></td></tr>
</tbody>
</table>
<h5>Features</h5>
<p>
<?= $product['features_description'] ?>
</p>
</div>
<div class="tab-pane fade" id="profile">
<div id="myTab" class="pull-right">
<a href="#listView" data-toggle="tab"><span class="btn btn-large"><i class="icon-list"></i></span></a>
<a href="#blockView" data-toggle="tab"><span class="btn btn-large active"><i class="icon-th-large icon-white"></i></span></a>
</div>
<br class="clr"/>
<hr class="soft"/>
<div class="tab-content">
<div class="tab-pane" id="listView">
<div class="row">
<div id="productView" class="span2">
<img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/>
</div>
<div class="span4">
<h3>New | Available</h3>
<hr class="soft"/>
<h5>Product Name </h5>
<p>
Nowadays the lingerie industry is one of the most successful business spheres.We always stay in touch with the latest fashion tendencies -
that is why our goods are so popular..
</p>
<a class="btn btn-small pull-right" href="product_details.html">View Details</a>
<br class="clr"/>
</div>
<div class="span3 alignR">
<form class="form-horizontal qtyFrm">
<h3> $222.00</h3>
<label class="checkbox">
<input type="checkbox"> Adds product to compair
</label><br/>
<div class="btn-group">
<a href="product_details.html" class="btn btn-large"><i class=" icon-shopping-cart"></i> Add to cart</a>
<a href="product_details.html" class="btn btn-large">VIEW</a>
</div>
</form>
</div>
</div>
<hr class="soft"/>
<div class="row">
<div id="productView" class="span2">
<img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/>
</div>
<div class="span4">
<h3>New | Available</h3>
<hr class="soft"/>
<h5>Product Name </h5>
<p>
Nowadays the lingerie industry is one of the most successful business spheres.We always stay in touch with the latest fashion tendencies -
that is why our goods are so popular..
</p>
<a class="btn btn-small pull-right" href="product_details.html">View Details</a>
<br class="clr"/>
</div>
<div class="span3 alignR">
<form class="form-horizontal qtyFrm">
<h3> $222.00</h3>
<label class="checkbox">
<input type="checkbox"> Adds product to compair
</label><br/>
<div class="btn-group">
<a href="product_details.html" class="btn btn-large"><i class=" icon-shopping-cart"></i> Add to cart</a>
<a href="product_details.html" class="btn btn-large">VIEW</a>
</div>
</form>
</div>
</div>
<hr class="soft"/>
<div class="row">
<div id="productView" class="span2">
<img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/>
</div>
<div class="span4">
<h3>New | Available</h3>
<hr class="soft"/>
<h5>Product Name </h5>
<p>
Nowadays the lingerie industry is one of the most successful business spheres.We always stay in touch with the latest fashion tendencies -
that is why our goods are so popular..
</p>
<a class="btn btn-small pull-right" href="product_details.html">View Details</a>
<br class="clr"/>
</div>
<div class="span3 alignR">
<form class="form-horizontal qtyFrm">
<h3> $222.00</h3>
<label class="checkbox">
<input type="checkbox"> Adds product to compair
</label><br/>
<div class="btn-group">
<a href="product_details.html" class="btn btn-large"><i class=" icon-shopping-cart"></i> Add to cart</a>
<a href="product_details.html" class="btn btn-large">VIEW</a>
</div>
</form>
</div>
</div>
<hr class="soft"/>
<div class="row">
<div id="productView" class="span2">
<img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/>
</div>
<div class="span4">
<h3>New | Available</h3>
<hr class="soft"/>
<h5>Product Name </h5>
<p>
Nowadays the lingerie industry is one of the most successful business spheres.We always stay in touch with the latest fashion tendencies -
that is why our goods are so popular..
</p>
<a class="btn btn-small pull-right" href="product_details.html">View Details</a>
<br class="clr"/>
</div>
<div class="span3 alignR">
<form class="form-horizontal qtyFrm">
<h3> $222.00</h3>
<label class="checkbox">
<input type="checkbox"> Adds product to compair
</label><br/>
<div class="btn-group">
<a href="product_details.html" class="btn btn-large"><i class=" icon-shopping-cart"></i> Add to cart</a>
<a href="product_details.html" class="btn btn-large">VIEW</a>
</div>
</form>
</div>
</div>
<hr class="soft"/>
<div class="row">
<div id="productView" class="span2">
<img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/>
</div>
<div class="span4">
<h3>New | Available</h3>
<hr class="soft"/>
<h5>Product Name </h5>
<p>
Nowadays the lingerie industry is one of the most successful business spheres.We always stay in touch with the latest fashion tendencies -
that is why our goods are so popular..
</p>
<a class="btn btn-small pull-right" href="product_details.html">View Details</a>
<br class="clr"/>
</div>
<div class="span3 alignR">
<form class="form-horizontal qtyFrm">
<h3> $222.00</h3>
<label class="checkbox">
<input type="checkbox"> Adds product to compair
</label><br/>
<div class="btn-group">
<a href="product_details.html" class="btn btn-large"><i class=" icon-shopping-cart"></i> Add to cart</a>
<a href="product_details.html" class="btn btn-large">VIEW</a>
</div>
</form>
</div>
</div>
<hr class="soft"/>
<div class="row">
<div id="productView" class="span2">
<img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/>
</div>
<div class="span4">
<h3>New | Available</h3>
<hr class="soft"/>
<h5>Product Name </h5>
<p>
Nowadays the lingerie industry is one of the most successful business spheres.We always stay in touch with the latest fashion tendencies -
that is why our goods are so popular..
</p>
<a class="btn btn-small pull-right" href="product_details.html">View Details</a>
<br class="clr"/>
</div>
<div class="span3 alignR">
<form class="form-horizontal qtyFrm">
<h3> $222.00</h3>
<label class="checkbox">
<input type="checkbox"> Adds product to compair
</label><br/>
<div class="btn-group">
<a href="product_details.html" class="btn btn-large"><i class=" icon-shopping-cart"></i> Add to cart</a>
<a href="product_details.html" class="btn btn-large">VIEW</a>
</div>
</form>
</div>
</div>
<hr class="soft"/>
</div>
<div class="tab-pane active" id="blockView">
<ul class="thumbnails">
<li class="span3">
<div class="thumbnail">
<a href="product_details.html"><img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/></a>
<div class="caption">
<h5>Manicure & Pedicure</h5>
<p>
Lorem Ipsum is simply dummy text.
</p>
<h4><a class="btn btn-large" href="product_details.html">VIEW</a> <span class="pull-right">$222.00</span></h4>
</div>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="product_details.html"><img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/></a>
<div class="caption">
<h5>Manicure & Pedicure</h5>
<p>
Lorem Ipsum is simply dummy text.
</p>
<h4><a class="btn btn-large" href="product_details.html">VIEW</a> <span class="pull-right">$222.00</span></h4>
</div>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="product_details.html"><img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/></a>
<div class="caption">
<h5>Manicure & Pedicure</h5>
<p>
Lorem Ipsum is simply dummy text.
</p>
<h4><a class="btn btn-large" href="product_details.html">VIEW</a> <span class="pull-right">$222.00</span></h4>
</div>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="product_details.html"><img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/></a>
<div class="caption">
<h5>Manicure & Pedicure</h5>
<p>
Lorem Ipsum is simply dummy text.
</p>
<h4><a class="btn btn-large" href="product_details.html">VIEW</a> <span class="pull-right">$222.00</span></h4>
</div>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="product_details.html"><img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/></a>
<div class="caption">
<h5>Manicure & Pedicure</h5>
<p>
Lorem Ipsum is simply dummy text.
</p>
<h4><a class="btn btn-large" href="product_details.html">VIEW</a> <span class="pull-right">$222.00</span></h4>
</div>
</div>
</li>
<li class="span3">
<div class="thumbnail">
<a href="product_details.html"><img src="<?= base_url() ?>assets/frontend/assets/products/4.jpg" alt=""/></a>
<div class="caption">
<h5>Manicure & Pedicure</h5>
<p>
Lorem Ipsum is simply dummy text.
</p>
<h4><a class="btn btn-large" href="product_details.html">VIEW</a> <span class="pull-right">$222.00</span></h4>
</div>
</div>
</li>
</ul>
<hr class="soft"/>
</div>
</div>
<br class="clr">
</div>
</div>
</div>
</div>
</div> | KodeBlog/CIBootsShop | application/modules/welcome/views/themes/default/product_details.php | PHP | mit | 27,201 |
define("foo", [ "./bar", "./baz/baz" ], function(require, exports, module) {
require("./bar");
require("./baz/baz");
}); | katosun2/grunt-imiku-cmd-transport | test/expected/relative/foo.js | JavaScript | mit | 128 |
/// Debug
#[macro_use]
pub mod debug;
/// ELF File Support
pub mod elf;
/// Event input
pub mod event;
/// Get slice implementation
pub mod get_slice;
/// Kernel memory allocation
pub mod memory;
/// Paging (x86)
#[cfg(target_arch = "x86")]
#[path="paging-i386.rs"]
pub mod paging;
/// Paging (x86_64)
#[cfg(target_arch = "x86_64")]
#[path="paging-x86_64.rs"]
pub mod paging;
/// A module for parsing paths
pub mod parse_path;
/// A module for parsing IP related string
pub mod parse_ip;
/// A module for queues
pub mod queue;
/// A module for pseudorandom generator
pub mod random;
/// A module for time
pub mod time;
/// String to number
pub mod to_num;
| NobbZ/redox | kernel/common/mod.rs | Rust | mit | 656 |
exports.config = {
specs: require('./index-webdriver.js').specs(),
framework: 'qunit',
baseUrl: './',
capabilities: [{
browserName: 'phantomjs',
exclude: require('./index-webdriver.js').exclude('phantomjs')
}],
updateJob: false,
waitforTimeout: 1000,
logLevel: 'silent',
coloredLogs: true,
screenshotPath: 'build/webdriver/failed',
onPrepare: require('./index-webdriver.js').onPrepare,
before: require('./index-webdriver.js').before,
after: require('./index-webdriver.js').after,
onComplete: require('./index-webdriver.js').onComplete
};
| maciekwie/Crafty | tests/webdriver/index-webdriver-local.js | JavaScript | mit | 613 |
<!DOCTYPE html>
<html lang="en">
<head>
<title>ColorHash Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ColorHash" class="dashAnchor"></a>
<a title="ColorHash Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
Mia Docs
</a>
(23% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
<p class="header-col header-col--secondary">
<a class="header-link" href="https://github.com/multinerd/Mia">
<img class="header-icon" src="../img/gh.png"/>
View on GitHub
</a>
</p>
<p class="header-col header-col--secondary">
<a class="header-link" href="dash-feed://https%3A%2F%2Fmultinerd%2Egithub%2Eio%2FMia%2Fdocsets%2Frealm%2Exml">
<img class="header-icon" src="../img/dash.png"/>
Install in Dash
</a>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">Mia Reference</a>
<img class="carat" src="../img/carat.png" />
ColorHash Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/AppStore_5FApps_5FVersion.html">AppStore_Apps_Version</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/BarButtonItemTarget.html">BarButtonItemTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/BlurredBackgroundView.html">BlurredBackgroundView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ButtonTarget.html">ButtonTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CodableKit.html">CodableKit</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CodableKit/Configurations.html">– Configurations</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CollapsibleTableSectionViewController.html">CollapsibleTableSectionViewController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CollapsibleTableViewHeader.html">CollapsibleTableViewHeader</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CollapsibleTableViewHeaderHelper.html">CollapsibleTableViewHeaderHelper</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CollectionStackViewController.html">CollectionStackViewController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CollectionViewStackCell.html">CollectionViewStackCell</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CollectionViewStackFlowLayout.html">CollectionViewStackFlowLayout</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ColorHash.html">ColorHash</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ContactImageView.html">ContactImageView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ContactImageView/Display.html">– Display</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ContactImageView/Shape.html">– Shape</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Container.html">Container</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ControlTarget.html">ControlTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CountedColor.html">CountedColor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DatePickerTarget.html">DatePickerTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/GestureTarget.html">GestureTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/GradientLoadingBar.html">GradientLoadingBar</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/GradientLoadingBar/DefaultValues.html">– DefaultValues</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/GradientView.html">GradientView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/HTMLtoPDF.html">HTMLtoPDF</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/HTMLtoPDFPrintPageRenderer.html">HTMLtoPDFPrintPageRenderer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/HighlightableButton.html">HighlightableButton</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/IBGradientView.html">IBGradientView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/KeyPathTarget.html">KeyPathTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/KeyPathTarget/Item.html">– Item</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Lazy.html">Lazy</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes.html#/c:@M@Mia@objc(cs)MiaDummy">MiaDummy</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ModalController.html">ModalController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ModalNavigationController.html">ModalNavigationController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ModalNavigationController/Configurations.html">– Configurations</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/NavigationStack.html">NavigationStack</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/NotificationTarget.html">NotificationTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/PFSceenshot.html">PFSceenshot</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Reachability.html">Reachability</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Reachability/Connection.html">– Connection</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/RevealingSplashView.html">RevealingSplashView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SANotificationView.html">SANotificationView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SearchBarTarget.html">SearchBarTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SearchFooter.html">SearchFooter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SliderTarget.html">SliderTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/TextFieldTarget.html">TextFieldTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/TextViewTarget.html">TextViewTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ThemeKit.html">ThemeKit</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/TimerTarget.html">TimerTarget</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/UpdateKitWBObjC.html">UpdateKitWBObjC</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebView.html">WebView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebViewModal.html">WebViewModal</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebViewModal/Theme.html">– Theme</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/XibView.html">XibView</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:3Mia23__internalActivityCountSivp">__internalActivityCount</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:3Mia11internalKeySSvp">internalKey</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/DeviceModel.html">DeviceModel</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/DeviceType.html">DeviceType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/DismissType.html">DismissType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/LastRunType.html">LastRunType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/LogLevel.html">LogLevel</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/MiaError.html">MiaError</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/PageSize.html">PageSize</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/ReachabilityError.html">ReachabilityError</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/Regex.html">Regex</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/ScreenFamily.html">ScreenFamily</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/ScreenScale.html">ScreenScale</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/ScreenSize.html">ScreenSize</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SelectedType.html">SelectedType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SplashAnimation.html">SplashAnimation</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/UIColorSpace.html">UIColorSpace</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/UpdateType.html">UpdateType</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Array.html">Array</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Character.html">Character</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Date.html">Date</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Date/Component.html">– Component</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Date/Comparators.html">– Comparators</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Date/WeekDay.html">– WeekDay</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Date/For.html">– For</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Date/TimeOfDay.html">– TimeOfDay</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/DateComponents.html">DateComponents</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/DateFormatter.html">DateFormatter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/DateFormatter/Presets.html">– Presets</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Decodable.html">Decodable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Double.html">Double</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Encodable.html">Encodable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Float.html">Float</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Int.html">Int</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Int64.html">Int64</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/JSONDecoder.html">JSONDecoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/JSONDecoder/DateDecodingStrategy.html">– DateDecodingStrategy</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/JSONEncoder.html">JSONEncoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/JSONEncoder/DateEncodingStrategy.html">– DateEncodingStrategy</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/NSManagedObject.html">NSManagedObject</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/NSNumber.html">NSNumber</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Notification.html">Notification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Notification/Name.html">– Name</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/NumberFormatter.html">NumberFormatter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Optional.html">Optional</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/String.html">String</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Timer.html">Timer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UIBarButtonItem.html">UIBarButtonItem</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UICollectionView.html">UICollectionView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UICollectionViewCell.html">UICollectionViewCell</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UIColor.html">UIColor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UIColor/ContrastDisplayContext.html">– ContrastDisplayContext</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UIFont.html">UIFont</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UIImage.html">UIImage</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UIImageView.html">UIImageView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UISearchController.html">UISearchController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UISegmentedControl.html">UISegmentedControl</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UITableView.html">UITableView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UITableViewCell.html">UITableViewCell</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UIView.html">UIView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UIViewController.html">UIViewController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/UnicodeScalar.html">UnicodeScalar</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Functions.html">Functions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia14UIColorFromRGBSo0B0CSSF">UIColorFromRGB(_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia8callbackySo21SCNetworkReachabilityC12reachability_SC0cD5FlagsV5flagsSvSg4infotF">callback(reachability:flags:info:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia4clipxx_xxts10ComparableRzlF">clip(_:_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia20getTopMostControllerSo06UIViewE0CSgyF">getTopMostController()</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia19hideNetworkActivityyyycSgF">hideNetworkActivity(_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia20localThreadSingletonxSS3key_xyc6createtRlzClF">localThreadSingleton(key:create:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia6modulo12CoreGraphics7CGFloatVAE_AE1mtF">modulo(_:m:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia12openSettingsyyF">openSettings()</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia11randomColorSo7UIColorCSS4seed_tF">randomColor(seed:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia12roundDecimal12CoreGraphics7CGFloatVAE_AE9precisiontF">roundDecimal(_:precision:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia19showNetworkActivityyyF">showNetworkActivity()</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:3Mia7vibrateyyF">vibrate()</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/CollapsibleTableSectionDelegate.html">CollapsibleTableSectionDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/CollapsibleTableViewHeaderDelegate.html">CollapsibleTableViewHeaderDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/CollectionStackViewControllerDelegate.html">CollectionStackViewControllerDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/EnumCollection.html">EnumCollection</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/FontRepresentable.html">FontRepresentable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/HTMLtoPDFDelegate.html">HTMLtoPDFDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/OnAware.html">OnAware</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:3Mia14OptionalStringP">OptionalString</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/PFScreenshotCompatible.html">PFScreenshotCompatible</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/StoryboardConvertible.html">StoryboardConvertible</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:3Mia5ThemeP">Theme</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/ThemeUser.html">ThemeUser</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/Then.html">Then</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/URLStringConvertible.html">URLStringConvertible</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/ViewControllerInitializer.html">ViewControllerInitializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebViewDelegate.html">WebViewDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Application.html">Application</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Application/BundleInfo.html">– BundleInfo</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/BundleK.html">BundleK</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/CollapsibleTableViewModel.html">CollapsibleTableViewModel</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device.html">Device</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Accessories.html">– Accessories</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Carrier.html">– Carrier</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Disk.html">– Disk</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device.html#/s:3Mia6DeviceV8FirmwareV">– Firmware</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Processors.html">– Processors</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Screen.html">– Screen</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Sensors.html">– Sensors</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Settings.html">– Settings</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Battery.html">– Battery</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device/Network.html">– Network</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Device.html#/s:3Mia6DeviceV7ScreensV">– Screens</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Durations.html">Durations</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/FontKit.html">FontKit</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/FontKit/Configuration.html">– Configuration</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/FontKit/Font.html">– Font</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/HSL.html">HSL</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Icon.html">Icon</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Icon/WebView.html">– WebView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Mia.html">Mia</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/NetworkKit.html">NetworkKit</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/NetworkKit.html#/s:3Mia10NetworkKitV0B9IndicatorV">– NetworkIndicator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/NetworkKit.html#/s:3Mia10NetworkKitV9AlamofireV">– Alamofire</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Rosewood.html">Rosewood</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Rosewood/Configuration.html">– Configuration</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Rosewood/Benchmark.html">– Benchmark</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Rosewood/Framework.html">– Framework</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Rosewood/Log.html">– Log</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Rosewood/PrettyPrint.html">– PrettyPrint</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/RosewoodFormatter.html">RosewoodFormatter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/RosewoodFormatter/Component.html">– Component</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/UpdateKit.html">UpdateKit</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/UpdateKit/Configurations.html">– Configurations</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/UpdateKitWB.html">UpdateKitWB</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/UpdateKitWB/Configurations.html">– Configurations</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia6Actiona">Action</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia9AnyActiona">AnyAction</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia10BoolActiona">BoolAction</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia10CheckBlocka">CheckBlock</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia10DateActiona">DateAction</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia11FloatActiona">FloatAction</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia14GradientColorsa">GradientColors</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia18HSBAComponentsTypea">HSBAComponentsType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia17HSLComponentsTypea">HSLComponentsType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia14HTMLtoPDFBlocka">HTMLtoPDFBlock</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia9JSONArraya">JSONArray</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia14JSONDictionarya">JSONDictionary</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia17LABComponentsTypea">LABComponentsType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia20NetworkActivityBlocka">NetworkActivityBlock</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia18NotificationActiona">NotificationAction</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia18RGBAComponentsTypea">RGBAComponentsType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia29RevealingSplashViewCompletiona">RevealingSplashViewCompletion</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia28RevealingSplashViewExecutiona">RevealingSplashViewExecution</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia12StringActiona">StringAction</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:3Mia17XYZComponentsTypea">XYZComponentsType</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>ColorHash</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ColorHash</span></code></pre>
</div>
</div>
<p><small>[undocumented]</small></p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashC9lightnessSaySdGvp"></a>
<a name="//apple_ref/swift/Property/lightness" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashC9lightnessSaySdGvp">lightness</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">lazy</span> <span class="k">var</span> <span class="nv">lightness</span><span class="p">:</span> <span class="p">[</span><span class="kt">Double</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.35</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.65</span><span class="p">]</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashC10saturationSaySdGvp"></a>
<a name="//apple_ref/swift/Property/saturation" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashC10saturationSaySdGvp">saturation</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">lazy</span> <span class="k">var</span> <span class="nv">saturation</span><span class="p">:</span> <span class="p">[</span><span class="kt">Double</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.35</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.65</span><span class="p">]</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashC4hashs5Int64VSScvp"></a>
<a name="//apple_ref/swift/Property/hash" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashC4hashs5Int64VSScvp">hash</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">lazy</span> <span class="k">var</span> <span class="nv">hash</span> <span class="o">=</span> <span class="p">{</span> <span class="p">(</span><span class="n">_</span> <span class="nv">str</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Int64</span> <span class="k">in</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Init%20Methods"></a>
<a name="//apple_ref/swift/Section/Init Methods" class="dashAnchor"></a>
<a href="#/Init%20Methods">
<h3 class="section-name">Init Methods</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashCACycfc"></a>
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashCACycfc">init()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashCACSaySdG9lightness_tcfc"></a>
<a name="//apple_ref/swift/Method/init(lightness:)" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashCACSaySdG9lightness_tcfc">init(lightness:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">lightness</span><span class="p">:</span> <span class="p">[</span><span class="kt">Double</span><span class="p">])</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L45-L47">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashCACSaySdG10saturation_tcfc"></a>
<a name="//apple_ref/swift/Method/init(saturation:)" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashCACSaySdG10saturation_tcfc">init(saturation:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">saturation</span><span class="p">:</span> <span class="p">[</span><span class="kt">Double</span><span class="p">])</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L49-L51">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashCACSaySdG9lightness_AD10saturationtcfc"></a>
<a name="//apple_ref/swift/Method/init(lightness:saturation:)" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashCACSaySdG9lightness_AD10saturationtcfc">init(lightness:saturation:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">lightness</span><span class="p">:</span> <span class="p">[</span><span class="kt">Double</span><span class="p">],</span> <span class="nv">saturation</span><span class="p">:</span> <span class="p">[</span><span class="kt">Double</span><span class="p">])</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L53-L56">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashCACs5Int64VSSc4hash_tcfc"></a>
<a name="//apple_ref/swift/Method/init(hash:)" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashCACs5Int64VSSc4hash_tcfc">init(hash:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">hash</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Int64</span><span class="p">)</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L58-L60">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Public%20Methods"></a>
<a name="//apple_ref/swift/Section/Public Methods" class="dashAnchor"></a>
<a href="#/Public%20Methods">
<h3 class="section-name">Public Methods</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashC3hslSd1h_Sd1sSd1ltSSF"></a>
<a name="//apple_ref/swift/Method/hsl(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashC3hslSd1h_Sd1sSd1ltSSF">hsl(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="nf">hsl</span><span class="p">(</span><span class="n">_</span> <span class="nv">str</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="p">(</span><span class="nv">h</span><span class="p">:</span> <span class="kt">Double</span><span class="p">,</span> <span class="nv">s</span><span class="p">:</span> <span class="kt">Double</span><span class="p">,</span> <span class="nv">l</span><span class="p">:</span> <span class="kt">Double</span><span class="p">)</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L63-L78">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashC3rgbSi1r_Si1gSi1btSSF"></a>
<a name="//apple_ref/swift/Method/rgb(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashC3rgbSi1r_Si1gSi1btSSF">rgb(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="nf">rgb</span><span class="p">(</span><span class="n">_</span> <span class="nv">str</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="p">(</span><span class="nv">r</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">g</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L81-L84">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashC03rgbB0So7UIColorCSSF"></a>
<a name="//apple_ref/swift/Method/rgbColor(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashC03rgbB0So7UIColorCSSF">rgbColor(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="nf">rgbColor</span><span class="p">(</span><span class="n">_</span> <span class="nv">str</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">UIColor</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L86-L90">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:3Mia9ColorHashC3hexS2SF"></a>
<a name="//apple_ref/swift/Method/hex(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:3Mia9ColorHashC3hexS2SF">hex(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><small>[undocumented]</small></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="nf">hex</span><span class="p">(</span><span class="n">_</span> <span class="nv">str</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">String</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/multinerd/Mia/tree/master/Mia/Mia/Libraries/ColorHash.swift#L92-L95">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>Made with ♥ by Multinerd</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>
| multinerd/Mia | docs/docsets/Mia.docset/Contents/Resources/Documents/Classes/ColorHash.html | HTML | mit | 61,176 |
class CreateTranslations < ActiveRecord::Migration
def self.up
create_table ActiveRecord::Base.pluralize_table_names ? :translations : :translation do |t|
t.string :locale, :null => false, :limit => 6
t.string :key, :null => false
t.string :scope
t.text :default, :null => false
t.text :translation
t.text :zero
t.text :one
t.text :many
t.text :few
t.string :state, :null => false
t.timestamps
end
add_index :translations, [:locale, :key, :scope], :unique => true
end
def self.down
drop_table ActiveRecord::Base.pluralize_table_names ? :translations : :translation
end
end | bragi/trendi18n | spec/test_application/db/migrate/20091208195455_create_translations.rb | Ruby | mit | 663 |
var equal = require('assert').equal,
notEqual = require('assert').notEqual,
Pool = require('../lib').Pool;
describe('Pool', function () {
it('should run multiple scripts', function (finished) {
var pool = new Pool({numberOfInstances: 5});
var scriptsExited = 0;
for (var i = 0; i < 20; ++i) {
var script = pool.createScript("\
exports.main = function() {\n\
exit(testGlobal);\n\
}\n\
"
);
script.on('exit', function (err, result) {
scriptsExited++;
if (scriptsExited == 10) {
pool.kill();
equal(10, result);
finished();
}
});
script.run({testGlobal: 10});
}
});
it('should run scripts on non blocking instances', function (finished) {
var pool = new Pool({numberOfInstances: 2});
var exited = false;
// Create blocking script.
var script = pool.createScript("\
exports.main = function() {\n\
while(true);\
}\n\
"
);
script.run();
var scriptsExited = 0;
for (var i = 0; i < 10; ++i) {
var script2 = pool.createScript("\
exports.main = function() {\n\
exit(10);\n\
}\n\
"
);
script2.on('exit', function (err, result) {
scriptsExited++;
if (scriptsExited == 10) {
pool.kill();
equal(10, result);
exited = true;
finished();
}
});
script2.run();
}
setTimeout(function () {
if (!exited) {
equal(false, true);
}
}, 3000);
});
it('should not be created if there are zero or negative amount of specified instances', function (finished) {
var pool = null;
try {
pool = new Pool({numberOfInstances: 0});
equal(false, true);
} catch (error) {
notEqual(-1, error.indexOf("Can't create a pool with zero instances"));
finished();
}
});
});
| bcoe/sandcastle | test/pool-test.js | JavaScript | mit | 1,957 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
import json
from io import open
import warnings
from pymatgen.electronic_structure.bandstructure import Kpoint
from pymatgen import Lattice
from pymatgen.electronic_structure.core import Spin, Orbital
from pymatgen.io.vasp import BSVasprun
from pymatgen.electronic_structure.bandstructure import BandStructureSymmLine, get_reconstructed_band_structure, \
LobsterBandStructureSymmLine
from pymatgen.util.testing import PymatgenTest
from monty.serialization import loadfn
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..",
'test_files')
class KpointTest(unittest.TestCase):
def setUp(self):
self.lattice = Lattice.cubic(10.0)
self.kpoint = Kpoint([0.1, 0.4, -0.5], self.lattice, label="X")
def test_properties(self):
self.assertEqual(self.kpoint.frac_coords[0], 0.1)
self.assertEqual(self.kpoint.frac_coords[1], 0.4)
self.assertEqual(self.kpoint.frac_coords[2], -0.5)
self.assertEqual(self.kpoint.a, 0.1)
self.assertEqual(self.kpoint.b, 0.4)
self.assertEqual(self.kpoint.c, -0.5)
self.assertEqual(self.lattice, Lattice.cubic(10.0))
self.assertEqual(self.kpoint.cart_coords[0], 1.0)
self.assertEqual(self.kpoint.cart_coords[1], 4.0)
self.assertEqual(self.kpoint.cart_coords[2], -5.0)
self.assertEqual(self.kpoint.label, "X")
class BandStructureSymmLine_test(PymatgenTest):
def setUp(self):
self.bs = loadfn(os.path.join(test_dir, "Cu2O_361_bandstructure.json"))
self.bs2 = loadfn(os.path.join(test_dir, "CaO_2605_bandstructure.json"))
self.bs_spin = loadfn(os.path.join(test_dir, "NiO_19009_bandstructure.json"))
self.bs_cbm0 = loadfn(os.path.join(test_dir, "InN_22205_bandstructure.json"))
self.bs_cu = loadfn(os.path.join(test_dir, "Cu_30_bandstructure.json"))
self.bs_diff_spins = loadfn(os.path.join(test_dir, "VBr2_971787_bandstructure.json"))
warnings.simplefilter("ignore")
def tearDown(self):
warnings.simplefilter("default")
def test_basic(self):
self.assertArrayAlmostEqual(self.bs.projections[Spin.up][10][12][0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0])
self.assertArrayAlmostEqual(self.bs.projections[Spin.up][25][0][
Orbital.dyz.value],
[0.0, 0.0, 0.0011, 0.0219, 0.0219, 0.069])
self.assertAlmostEqual(
self.bs.get_projection_on_elements()[Spin.up][25][10]['O'], 0.0328)
self.assertAlmostEqual(
self.bs.get_projection_on_elements()[Spin.up][22][25]['Cu'], 0.8327)
proj = self.bs.get_projections_on_elements_and_orbitals({'Cu': ['s',
'd']})
self.assertAlmostEqual(
proj[Spin.up][25][0]['Cu']['s'], 0.0027)
self.assertAlmostEqual(
proj[Spin.up][25][0]['Cu']['d'], 0.8495999999999999)
self.assertEqual(self.bs2.nb_bands, 16)
self.assertAlmostEqual(self.bs2.bands[Spin.up][5][10], 0.5608)
self.assertAlmostEqual(self.bs2.bands[Spin.up][5][10], 0.5608)
self.assertEqual(self.bs2.branches[5]['name'], "L-U")
self.assertEqual(self.bs2.branches[5]['start_index'], 80)
self.assertEqual(self.bs2.branches[5]['end_index'], 95)
self.assertAlmostEqual(self.bs2.distance[70], 4.2335127528765737)
self.assertEqual(self.bs_spin.nb_bands, 27)
self.assertAlmostEqual(self.bs_spin.bands[Spin.up][5][10], 0.262)
self.assertAlmostEqual(self.bs_spin.bands[Spin.down][5][10],
1.6156)
def test_properties(self):
self.one_kpoint = self.bs2.kpoints[31]
self.assertEqual(self.one_kpoint.frac_coords[0], 0.5)
self.assertEqual(self.one_kpoint.frac_coords[1], 0.25)
self.assertEqual(self.one_kpoint.frac_coords[2], 0.75)
self.assertAlmostEqual(self.one_kpoint.cart_coords[0], 0.64918757)
self.assertAlmostEqual(self.one_kpoint.cart_coords[1], 1.29837513)
self.assertAlmostEqual(self.one_kpoint.cart_coords[2], 0.0)
self.assertEqual(self.one_kpoint.label, "W")
self.assertAlmostEqual(self.bs2.efermi, 2.6211967, "wrong fermi energy")
def test_get_branch(self):
self.assertAlmostEqual(self.bs2.get_branch(110)[0]['name'], "U-W")
def test_get_direct_band_gap_dict(self):
direct_dict = self.bs_diff_spins.get_direct_band_gap_dict()
self.assertEqual(direct_dict[Spin.down]['value'], 4.5365)
for bs in [self.bs2, self.bs_spin]:
dg_dict = bs.get_direct_band_gap_dict()
for spin, v in bs.bands.items():
kpt = dg_dict[spin]['kpoint_index']
vb, cb = dg_dict[spin]['band_indices']
gap = v[cb][kpt] - v[vb][kpt]
self.assertEqual(gap, dg_dict[spin]['value'])
self.assertRaises(ValueError, self.bs_cu.get_direct_band_gap_dict)
def test_get_direct_band_gap(self):
self.assertAlmostEqual(self.bs2.get_direct_band_gap(),
4.0125999999999999)
self.assertTrue(self.bs_diff_spins.get_direct_band_gap() > 0)
self.assertEqual(self.bs_cu.get_direct_band_gap(), 0)
def test_is_metal(self):
self.assertFalse(self.bs2.is_metal(), "wrong metal assignment")
self.assertFalse(self.bs_spin.is_metal(), "wrong metal assignment")
self.assertTrue(self.bs_cu.is_metal(), "wrong metal assignment")
def test_get_cbm(self):
cbm = self.bs2.get_cbm()
self.assertAlmostEqual(cbm['energy'], 5.8709, "wrong CBM energy")
self.assertEqual(cbm['band_index'][Spin.up][0], 8, "wrong CBM band index")
self.assertEqual(cbm['kpoint_index'][0], 15, "wrong CBM kpoint index")
self.assertEqual(cbm['kpoint'].frac_coords[0], 0.5, "wrong CBM kpoint frac coords")
self.assertEqual(cbm['kpoint'].frac_coords[1], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm['kpoint'].frac_coords[2], 0.5, "wrong CBM kpoint frac coords")
self.assertEqual(cbm['kpoint'].label, "X", "wrong CBM kpoint label")
cbm_spin = self.bs_spin.get_cbm()
self.assertAlmostEqual(cbm_spin['energy'], 8.0458, "wrong CBM energy")
self.assertEqual(cbm_spin['band_index'][Spin.up][0], 12, "wrong CBM band index")
self.assertEqual(len(cbm_spin['band_index'][Spin.down]), 0, "wrong CBM band index")
self.assertEqual(cbm_spin['kpoint_index'][0], 0, "wrong CBM kpoint index")
self.assertEqual(cbm_spin['kpoint'].frac_coords[0], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm_spin['kpoint'].frac_coords[1], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm_spin['kpoint'].frac_coords[2], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm_spin['kpoint'].label, "\\Gamma", "wrong CBM kpoint label")
def test_get_vbm(self):
vbm = self.bs2.get_vbm()
self.assertAlmostEqual(vbm['energy'], 2.2361, "wrong VBM energy")
self.assertEqual(len(vbm['band_index'][Spin.up]), 3, "wrong VBM number of bands")
self.assertEqual(vbm['band_index'][Spin.up][0], 5, "wrong VBM band index")
self.assertEqual(vbm['kpoint_index'][0], 0, "wrong VBM kpoint index")
self.assertEqual(vbm['kpoint'].frac_coords[0], 0.0, "wrong VBM kpoint frac coords")
self.assertEqual(vbm['kpoint'].frac_coords[1], 0.0, "wrong VBM kpoint frac coords")
self.assertEqual(vbm['kpoint'].frac_coords[2], 0.0, "wrong VBM kpoint frac coords")
self.assertEqual(vbm['kpoint'].label, "\\Gamma", "wrong VBM kpoint label")
vbm_spin = self.bs_spin.get_vbm()
self.assertAlmostEqual(vbm_spin['energy'], 5.731, "wrong VBM energy")
self.assertEqual(len(vbm_spin['band_index'][Spin.up]), 2, "wrong VBM number of bands")
self.assertEqual(len(vbm_spin['band_index'][Spin.down]), 0, "wrong VBM number of bands")
self.assertEqual(vbm_spin['band_index'][Spin.up][0], 10, "wrong VBM band index")
self.assertEqual(vbm_spin['kpoint_index'][0], 79, "wrong VBM kpoint index")
self.assertEqual(vbm_spin['kpoint'].frac_coords[0], 0.5, "wrong VBM kpoint frac coords")
self.assertEqual(vbm_spin['kpoint'].frac_coords[1], 0.5, "wrong VBM kpoint frac coords")
self.assertEqual(vbm_spin['kpoint'].frac_coords[2], 0.5, "wrong VBM kpoint frac coords")
self.assertEqual(vbm_spin['kpoint'].label, "L", "wrong VBM kpoint label")
def test_get_band_gap(self):
bg = self.bs2.get_band_gap()
self.assertAlmostEqual(bg['energy'], 3.6348, "wrong gap energy")
self.assertEqual(bg['transition'], "\\Gamma-X", "wrong kpoint transition")
self.assertFalse(bg['direct'], "wrong nature of the gap")
bg_spin = self.bs_spin.get_band_gap()
self.assertAlmostEqual(bg_spin['energy'], 2.3148, "wrong gap energy")
self.assertEqual(bg_spin['transition'], "L-\\Gamma", "wrong kpoint transition")
self.assertFalse(bg_spin['direct'], "wrong nature of the gap")
bg_cbm0 = self.bs_cbm0.get_band_gap()
self.assertAlmostEqual(bg_cbm0['energy'], 0, places=3, msg="wrong gap energy")
def test_get_sym_eq_kpoints_and_degeneracy(self):
bs = self.bs2
cbm_k = bs.get_cbm()['kpoint'].frac_coords
vbm_k = bs.get_vbm()['kpoint'].frac_coords
self.assertEqual(bs.get_kpoint_degeneracy(cbm_k), None)
bs.structure = loadfn(os.path.join(test_dir, "CaO_2605_structure.json"))
self.assertEqual(bs.get_kpoint_degeneracy(cbm_k), 3)
self.assertEqual(bs.get_kpoint_degeneracy(vbm_k), 1)
cbm_eqs = bs.get_sym_eq_kpoints(cbm_k)
self.assertTrue([0.5, 0., 0.5] in cbm_eqs)
self.assertTrue([0., 0.5, 0.5] in cbm_eqs)
self.assertTrue([0.5, 0.5, 0.] in cbm_eqs)
vbm_eqs = bs.get_sym_eq_kpoints(vbm_k)
self.assertTrue([0., 0., 0.] in vbm_eqs)
def test_as_dict(self):
s = json.dumps(self.bs.as_dict())
self.assertIsNotNone(s)
s = json.dumps(self.bs2.as_dict())
self.assertIsNotNone(s)
s = json.dumps(self.bs_spin.as_dict())
self.assertIsNotNone(s)
def test_old_format_load(self):
with open(os.path.join(test_dir, "bs_ZnS_old.json"),
"r", encoding='utf-8') as f:
d = json.load(f)
bs_old = BandStructureSymmLine.from_dict(d)
self.assertEqual(bs_old.get_projection_on_elements()[
Spin.up][0][0]['Zn'], 0.0971)
class ReconstructBandStructureTest(PymatgenTest):
def setUp(self):
self.bs_cu = loadfn(os.path.join(test_dir, "Cu_30_bandstructure.json"))
self.bs_cu2 = loadfn(os.path.join(test_dir, "Cu_30_bandstructure.json"))
warnings.simplefilter("ignore")
def tearDown(self):
warnings.simplefilter("default")
def test_reconstruct_band_structure(self):
bs = get_reconstructed_band_structure([self.bs_cu, self.bs_cu2])
self.assertEqual(bs.bands[Spin.up].shape, (20, 700), "wrong number of bands or kpoints")
def test_vasprun_bs(self):
bsv = BSVasprun(os.path.join(test_dir, "vasprun.xml"),
parse_projected_eigen=True,
parse_potcar_file=True)
bs = bsv.get_band_structure(kpoints_filename=os.path.join(test_dir, "KPOINTS.band"),
line_mode=True)
bs.get_projection_on_elements()
class LobsterBandStructureSymmLine_test(PymatgenTest):
def setUp(self):
warnings.simplefilter("ignore")
with open(os.path.join(test_dir, "cohp/Fatband_SiO2/Test_p/lobster_band_structure_spin.json"), 'r') as f:
bs_spin_dict = json.load(f)
self.bs_spin = LobsterBandStructureSymmLine.from_dict(bs_spin_dict)
with open(os.path.join(test_dir, "cohp/Fatband_SiO2/Test_p/lobster_band_structure.json"), 'r') as f:
bs_dict = json.load(f)
self.bs_p = LobsterBandStructureSymmLine.from_dict(bs_dict)
def tearDown(self):
warnings.simplefilter("default")
def test_basic(self):
bs_p = self.bs_p
bs_spin = self.bs_spin
self.assertAlmostEqual(bs_p.structure[0].frac_coords[0], 0.)
self.assertAlmostEqual(bs_p.structure[0].frac_coords[1], 0.47634315)
self.assertAlmostEqual(bs_p.structure[0].frac_coords[2], 0.666667)
self.assertEqual(bs_p.structure[0].species_string, 'Si')
self.assertAlmostEqual(bs_p.structure[0].coords[0], -1.19607309)
self.assertAlmostEqual(bs_p.structure[0].coords[1], 2.0716597)
self.assertAlmostEqual(bs_p.structure[0].coords[2], 3.67462144)
self.assertAlmostEqual(bs_p.efermi, 1.06470288)
lattice = bs_p.lattice_rec.as_dict()
self.assertAlmostEqual(lattice["matrix"][0][0], 1.2511575194890285)
self.assertAlmostEqual(lattice["matrix"][0][1], 0.7223560132915973)
self.assertAlmostEqual(lattice["matrix"][0][2], 0.0)
self.assertAlmostEqual(lattice["matrix"][1][0], 0.0)
self.assertAlmostEqual(lattice["matrix"][1][1], 1.4447123171425553)
self.assertAlmostEqual(lattice["matrix"][1][2], 0.0)
self.assertAlmostEqual(lattice["matrix"][2][0], 0.0)
self.assertAlmostEqual(lattice["matrix"][2][1], 0.0)
self.assertAlmostEqual(lattice["matrix"][2][2], 1.1399248502312707)
self.assertAlmostEqual(bs_p.kpoints[8].frac_coords[0], 0.09090909)
self.assertAlmostEqual(bs_p.kpoints[8].frac_coords[1], 0.0)
self.assertAlmostEqual(bs_p.kpoints[8].frac_coords[2], 0.0)
self.assertAlmostEqual(bs_p.kpoints[8].cart_coords[0], 0.11374159)
self.assertAlmostEqual(bs_p.kpoints[8].cart_coords[1], 0.06566873)
self.assertAlmostEqual(bs_p.kpoints[8].cart_coords[2], 0.)
self.assertAlmostEqual(bs_p.kpoints[50].frac_coords[0], 0.46153846)
self.assertAlmostEqual(bs_p.kpoints[50].frac_coords[1], 0.07692308)
self.assertAlmostEqual(bs_p.kpoints[50].frac_coords[2], 0.0)
self.assertAlmostEqual(bs_p.kpoints[50].cart_coords[0], 0.57745732)
self.assertAlmostEqual(bs_p.kpoints[50].cart_coords[1], 0.4445268)
self.assertAlmostEqual(bs_p.kpoints[50].cart_coords[2], 0.0)
self.assertAlmostEqual(bs_p.distance[30], 0.49251552363382556)
self.assertTrue(bs_p.branches[0]["name"], '\\Gamma-K')
self.assertAlmostEqual(bs_p.get_band_gap()["energy"], 5.6739999999999995)
self.assertAlmostEqual(bs_p.get_projection_on_elements()[Spin.up][0][0]["Si"], 3 * (0.001 + 0.064))
self.assertAlmostEqual(bs_p.get_projections_on_elements_and_orbitals({"Si": ["3p"]})[Spin.up][0][0]["Si"]["3p"],
0.003)
self.assertAlmostEqual(bs_p.get_projections_on_elements_and_orbitals({"O": ["2p"]})[Spin.up][0][0]["O"]["2p"],
0.002 * 3 + 0.003 * 3)
dict_here = bs_p.get_projections_on_elements_and_orbitals({"Si": ["3s", "3p"], "O": ["2s", "2p"]})[Spin.up][0][
0]
self.assertAlmostEqual(dict_here["Si"]["3s"], 0.192)
self.assertAlmostEqual(dict_here["Si"]["3p"], 0.003)
self.assertAlmostEqual(dict_here["O"]["2s"], 0.792)
self.assertAlmostEqual(dict_here["O"]["2p"], 0.015)
self.assertAlmostEqual(bs_spin.get_projection_on_elements()[Spin.up][0][0]["Si"], 3 * (0.001 + 0.064))
self.assertAlmostEqual(
bs_spin.get_projections_on_elements_and_orbitals({"Si": ["3p"]})[Spin.up][0][0]["Si"]["3p"],
0.003)
self.assertAlmostEqual(
bs_spin.get_projections_on_elements_and_orbitals({"O": ["2p"]})[Spin.up][0][0]["O"]["2p"],
0.002 * 3 + 0.003 * 3)
dict_here = \
bs_spin.get_projections_on_elements_and_orbitals({"Si": ["3s", "3p"], "O": ["2s", "2p"]})[Spin.up][0][0]
self.assertAlmostEqual(dict_here["Si"]["3s"], 0.192)
self.assertAlmostEqual(dict_here["Si"]["3p"], 0.003)
self.assertAlmostEqual(dict_here["O"]["2s"], 0.792)
self.assertAlmostEqual(dict_here["O"]["2p"], 0.015)
self.assertAlmostEqual(bs_spin.get_projection_on_elements()[Spin.up][0][0]["Si"], 3 * (0.001 + 0.064))
self.assertAlmostEqual(
bs_spin.get_projections_on_elements_and_orbitals({"Si": ["3p"]})[Spin.down][0][0]["Si"]["3p"],
0.003)
self.assertAlmostEqual(
bs_spin.get_projections_on_elements_and_orbitals({"O": ["2p"]})[Spin.down][0][0]["O"]["2p"],
0.002 * 3 + 0.003 * 3)
dict_here = \
bs_spin.get_projections_on_elements_and_orbitals({"Si": ["3s", "3p"], "O": ["2s", "2p"]})[Spin.down][0][0]
self.assertAlmostEqual(dict_here["Si"]["3s"], 0.192)
self.assertAlmostEqual(dict_here["Si"]["3p"], 0.003)
self.assertAlmostEqual(dict_here["O"]["2s"], 0.792)
self.assertAlmostEqual(dict_here["O"]["2p"], 0.015)
def test_get_branch(self):
branch = self.bs_p.get_branch(0)[0]
self.assertEqual(branch["name"], '\\Gamma-K')
self.assertEqual(branch["start_index"], 0)
self.assertEqual(branch["end_index"], 70)
self.assertEqual(branch["index"], 0)
def test_get_direct_band_gap_dict(self):
direct_dict = self.bs_p.get_direct_band_gap_dict()
self.assertAlmostEqual(direct_dict[Spin.up]["value"], 6.005999999999999)
self.assertEqual(direct_dict[Spin.up]["kpoint_index"], 0)
self.assertListEqual(direct_dict[Spin.up]["band_indices"], [22, 24])
direct_dict = self.bs_spin.get_direct_band_gap_dict()
self.assertAlmostEqual(direct_dict[Spin.up]["value"], 6.005999999999999)
self.assertEqual(direct_dict[Spin.up]["kpoint_index"], 0)
self.assertListEqual(direct_dict[Spin.up]["band_indices"], [22, 24])
self.assertAlmostEqual(direct_dict[Spin.down]["value"], 6.005999999999999)
self.assertEqual(direct_dict[Spin.down]["kpoint_index"], 0)
self.assertListEqual(direct_dict[Spin.down]["band_indices"], [22, 24])
def test_get_direct_band_gap(self):
self.assertAlmostEqual(self.bs_p.get_direct_band_gap(), 6.005999999999999)
self.assertAlmostEqual(self.bs_spin.get_direct_band_gap(), 6.005999999999999)
def test_is_metal(self):
self.assertFalse(self.bs_p.is_metal(), "wrong metal assignment")
self.assertFalse(self.bs_spin.is_metal(), "wrong metal assignment")
def test_get_cbm(self):
cbm = self.bs_p.get_cbm()
self.assertAlmostEqual(cbm['energy'], 6.3037028799999995, "wrong CBM energy")
self.assertEqual(cbm['band_index'][Spin.up][0], 24, "wrong CBM band index")
self.assertEqual(cbm['kpoint_index'][0], 0, "wrong CBM kpoint index")
self.assertEqual(cbm['kpoint'].frac_coords[0], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm['kpoint'].frac_coords[1], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm['kpoint'].frac_coords[2], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm['kpoint'].label, "\\Gamma", "wrong CBM kpoint label")
cbm_spin = self.bs_spin.get_cbm()
self.assertAlmostEqual(cbm_spin['energy'], 6.30370274, "wrong CBM energy")
self.assertEqual(cbm_spin['band_index'][Spin.up][0], 24, "wrong CBM band index")
self.assertEqual(len(cbm_spin['band_index'][Spin.down]), 1, "wrong CBM band index")
self.assertEqual(cbm_spin['kpoint_index'][0], 0, "wrong CBM kpoint index")
self.assertEqual(cbm_spin['kpoint'].frac_coords[0], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm_spin['kpoint'].frac_coords[1], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm_spin['kpoint'].frac_coords[2], 0.0, "wrong CBM kpoint frac coords")
self.assertEqual(cbm_spin['kpoint'].label, "\\Gamma", "wrong CBM kpoint label")
def test_get_vbm(self):
vbm = self.bs_p.get_vbm()
self.assertAlmostEqual(vbm['energy'], 0.62970288, "wrong VBM energy")
self.assertEqual(len(vbm['band_index'][Spin.up]), 1, "wrong VBM number of bands")
self.assertEqual(vbm['band_index'][Spin.up][0], 23, "wrong VBM band index")
self.assertEqual(vbm['kpoint_index'][0], 68, "wrong VBM kpoint index")
self.assertAlmostEqual(vbm['kpoint'].frac_coords[0], 0.34615384615385, "wrong VBM kpoint frac coords")
self.assertAlmostEqual(vbm['kpoint'].frac_coords[1], 0.30769230769231, "wrong VBM kpoint frac coords")
self.assertAlmostEqual(vbm['kpoint'].frac_coords[2], 0.0, "wrong VBM kpoint frac coords")
self.assertEqual(vbm['kpoint'].label, None, "wrong VBM kpoint label")
vbm_spin = self.bs_spin.get_vbm()
self.assertAlmostEqual(vbm_spin['energy'], 0.6297027399999999, "wrong VBM energy")
self.assertEqual(len(vbm_spin['band_index'][Spin.up]), 1, "wrong VBM number of bands")
self.assertEqual(len(vbm_spin['band_index'][Spin.down]), 1, "wrong VBM number of bands")
self.assertEqual(vbm_spin['band_index'][Spin.up][0], 23, "wrong VBM band index")
self.assertEqual(vbm_spin['kpoint_index'][0], 68, "wrong VBM kpoint index")
self.assertAlmostEqual(vbm_spin['kpoint'].frac_coords[0], 0.34615384615385, "wrong VBM kpoint frac coords")
self.assertAlmostEqual(vbm_spin['kpoint'].frac_coords[1], 0.30769230769231, "wrong VBM kpoint frac coords")
self.assertAlmostEqual(vbm_spin['kpoint'].frac_coords[2], 0.0, "wrong VBM kpoint frac coords")
self.assertEqual(vbm_spin['kpoint'].label, None, "wrong VBM kpoint label")
def test_get_band_gap(self):
bg = self.bs_p.get_band_gap()
self.assertAlmostEqual(bg['energy'], 5.6739999999999995, "wrong gap energy")
self.assertEqual(bg['transition'], "(0.346,0.308,0.000)-\\Gamma", "wrong kpoint transition")
self.assertFalse(bg['direct'], "wrong nature of the gap")
bg_spin = self.bs_spin.get_band_gap()
self.assertAlmostEqual(bg_spin['energy'], 5.674, "wrong gap energy")
self.assertEqual(bg_spin['transition'], "(0.346,0.308,0.000)-\\Gamma", "wrong kpoint transition")
self.assertFalse(bg_spin['direct'], "wrong nature of the gap")
def test_get_sym_eq_kpoints_and_degeneracy(self):
bs = self.bs_p
cbm_k = bs.get_cbm()['kpoint'].frac_coords
vbm_k = bs.get_vbm()['kpoint'].frac_coords
self.assertEqual(bs.get_kpoint_degeneracy(cbm_k), 1)
self.assertEqual(bs.get_kpoint_degeneracy(vbm_k), 3)
def test_as_dict(self):
s = json.dumps(self.bs_p.as_dict())
self.assertIsNotNone(s)
s = json.dumps(self.bs_spin.as_dict())
self.assertIsNotNone(s)
def test_old_format_load(self):
# this method will use the loading from the old dict
self.bs_spin.apply_scissor(3.0)
if __name__ == '__main__':
unittest.main()
| dongsenfo/pymatgen | pymatgen/electronic_structure/tests/test_bandstructure.py | Python | mit | 23,174 |
require "active_model/type"
require "active_record/type/internal/timezone"
require "active_record/type/date"
require "active_record/type/date_time"
require "active_record/type/decimal_without_scale"
require "active_record/type/json"
require "active_record/type/time"
require "active_record/type/text"
require "active_record/type/unsigned_integer"
require "active_record/type/serialized"
require "active_record/type/adapter_specific_registry"
require "active_record/type/type_map"
require "active_record/type/hash_lookup_type_map"
module ActiveRecord
module Type
@registry = AdapterSpecificRegistry.new
class << self
attr_accessor :registry # :nodoc:
delegate :add_modifier, to: :registry
# Add a new type to the registry, allowing it to be referenced as a
# symbol by {ActiveRecord::Base.attribute}[rdoc-ref:Attributes::ClassMethods#attribute].
# If your type is only meant to be used with a specific database adapter, you can
# do so by passing <tt>adapter: :postgresql</tt>. If your type has the same
# name as a native type for the current adapter, an exception will be
# raised unless you specify an +:override+ option. <tt>override: true</tt> will
# cause your type to be used instead of the native type. <tt>override:
# false</tt> will cause the native type to be used over yours if one exists.
def register(type_name, klass = nil, **options, &block)
registry.register(type_name, klass, **options, &block)
end
def lookup(*args, adapter: current_adapter_name, **kwargs) # :nodoc:
registry.lookup(*args, adapter: adapter, **kwargs)
end
def default_value # :nodoc:
@default_value ||= Value.new
end
private
def current_adapter_name
ActiveRecord::Base.connection.adapter_name.downcase.to_sym
end
end
Helpers = ActiveModel::Type::Helpers
BigInteger = ActiveModel::Type::BigInteger
Binary = ActiveModel::Type::Binary
Boolean = ActiveModel::Type::Boolean
Decimal = ActiveModel::Type::Decimal
Float = ActiveModel::Type::Float
Integer = ActiveModel::Type::Integer
String = ActiveModel::Type::String
Value = ActiveModel::Type::Value
register(:big_integer, Type::BigInteger, override: false)
register(:binary, Type::Binary, override: false)
register(:boolean, Type::Boolean, override: false)
register(:date, Type::Date, override: false)
register(:datetime, Type::DateTime, override: false)
register(:decimal, Type::Decimal, override: false)
register(:float, Type::Float, override: false)
register(:integer, Type::Integer, override: false)
register(:json, Type::Json, override: false)
register(:string, Type::String, override: false)
register(:text, Type::Text, override: false)
register(:time, Type::Time, override: false)
end
end
| maicher/rails | activerecord/lib/active_record/type.rb | Ruby | mit | 2,884 |
//////////////////////////////////////////
//
// ONLY EDIT babel-plugin.js at ./src/babel-plugin.js, not ./babel-plugin.js!
//
//////////////////////////////////////////
var plugin = function(babel) {
return {
visitor: {
ObjectExpression(path) {
path.node.properties.forEach(function(prop){
if (prop.key.type === "Identifier") {
var keyLoc = prop.key.loc
prop.key = babel.types.stringLiteral(prop.key.name)
prop.key.loc = keyLoc
}
})
var call = babel.types.callExpression(
babel.types.identifier("__ohdMakeObject"), [babel.types.arrayExpression(
path.node.properties.map(function(prop) {
var type = babel.types.stringLiteral(prop.type)
type.ignore = true
if (prop.type === "ObjectMethod") {
// getter/setter
var kind = babel.types.stringLiteral(prop.kind);
kind.ignore = true;
var propArray = babel.types.arrayExpression([
type,
prop.key,
kind,
babel.types.functionExpression(
null,
prop.params,
prop.body
)
])
return propArray
} else {
var propArray = babel.types.arrayExpression([
type,
prop.key,
prop.value
])
return propArray
}
console.log("continue with type", prop.type)
})
)]
)
path.replaceWith(call)
},
AssignmentExpression(path) {
if (path.node.ignore) {
return
}
if (["+=", "-=", "/=", "*="].indexOf(path.node.operator) !== -1){
// I don't think this replacement is always going to be 100% equivalent
// to the +=/... operation, but it's close enough for now
// e.g. maybe there'd be props if path.node.left is sth like a.sth().aa would
// call sth twice
var operator = {"+=": "+", "-=": "-", "/=": "/", "*=": "*"}[path.node.operator]
var value = babel.types.binaryExpression(operator, path.node.left, path.node.right)
var replacement = babel.types.assignmentExpression("=", path.node.left, value)
path.replaceWith(replacement)
}
if (path.node.operator === "=" && path.node.left.type === "MemberExpression") {
var property;
if (path.node.left.computed === true) {
property = path.node.left.property
} else {
property = babel.types.stringLiteral(path.node.left.property.name)
property.loc = path.node.left.property.loc
}
var assignExpression = babel.types.callExpression(
babel.types.identifier("__ohdAssign"), [
path.node.left.object,
property,
path.node.right
]
)
assignExpression.loc = path.node.loc
path.replaceWith(assignExpression)
}
},
UnaryExpression(path) {
if (path.node.operator === "delete"){
var prop = path.node.argument.property
if (prop.type === "Identifier"){
prop = babel.types.stringLiteral(prop.name)
}
var call = babel.types.callExpression(
babel.types.identifier("__ohdDeleteProperty"),
[
path.node.argument.object,
prop
]
)
path.replaceWith(call)
}
}
}
}
}
if (typeof module === "undefined"){
window.babelPlugin = plugin;
} else {
module.exports = plugin
}
| mattzeunert/Object-History-Debugger | src/babel-plugin.js | JavaScript | mit | 4,875 |
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>indir (Sys)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
<pre> <span class="ruby-comment cmt"># File lib/rake/contrib/sys.rb, line 144</span>
144: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">indir</span>(<span class="ruby-identifier">dir</span>)
145: <span class="ruby-identifier">olddir</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>
146: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">dir</span>)
147: <span class="ruby-keyword kw">yield</span>
148: <span class="ruby-keyword kw">ensure</span>
149: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">olddir</span>)
150: <span class="ruby-keyword kw">end</span></pre>
</body>
</html> | michaelsync/Giles | tools/Rake/lib/ruby/gems/1.8/doc/rake-0.8.7/rdoc/classes/Sys.src/M000042.html | HTML | mit | 1,247 |
package de.bitshares_munich.smartcoinswallet;
import android.util.Log;
import com.neovisionaries.ws.client.WebSocket;
import com.neovisionaries.ws.client.WebSocketException;
import com.neovisionaries.ws.client.WebSocketFactory;
import com.neovisionaries.ws.client.WebSocketListener;
import java.io.IOException;
import de.bitshares_munich.utils.Application;
/**
* Created by nelson on 11/17/16.
*/
public class WebsocketWorkerThread extends Thread {
private final String TAG = this.getClass().getName();
private WebSocket mWebSocket;
public WebsocketWorkerThread(WebSocketListener webSocketListener) {
this(webSocketListener, 0);
}
public WebsocketWorkerThread(WebSocketListener webSocketListener, int socketIndex) {
WebSocketFactory factory = new WebSocketFactory().setConnectionTimeout(5000);
try {
mWebSocket = factory.createSocket(Application.urlsSocketConnection[socketIndex]);
mWebSocket.addListener(webSocketListener);
} catch (IOException e) {
Log.e(TAG, "IOException. Msg: " + e.getMessage());
} catch (NullPointerException e) {
Log.e(TAG, "NullPointerException at WebsocketWorkerThreas. Msg: " + e.getMessage());
}
}
@Override
public void run() {
// Moves the current Thread into the background
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
try {
mWebSocket.connect();
} catch (WebSocketException e) {
Log.e(TAG, "WebSocketException. Msg: " + e.getMessage());
} catch (NullPointerException e) {
Log.e(TAG, "NullPointerException. Msg: " + e.getMessage());
}
}
}
| kenCode-de/smartcoins-wallet | app/src/main/java/de/bitshares_munich/smartcoinswallet/WebsocketWorkerThread.java | Java | mit | 1,736 |
'use strict';
module.exports = function(app) {
var users = require('../../app/controllers/users.server.controller');
var companies = require('../../app/controllers/companies.server.controller');
var fields = require('../../app/controllers/fields.server.controller');
var schedules = require('../../app/controllers/schedules.server.controller');
// Companies Routes
app.route('/companies')
.get(companies.list)
.post(users.requiresLogin, companies.create);
app.route('/companies/:companyId')
.get(companies.read)
.put(users.requiresLogin, users.requiresAdmin, companies.update)
.delete(users.requiresLogin, users.requiresAdmin, companies.delete);
app.route('/companies/:companyId/fields')
.get(fields.list)
app.route('/companies/:companyId/schedules')
.get(schedules.list)
// Finish by binding the Company middleware
app.param('companyId', companies.companyByID);
};
| forres/canchapp | app/routes/companies.server.routes.js | JavaScript | mit | 897 |
<?php
namespace AE\DataBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Discipulado
*
* @ORM\Table(name="discipulado")
* @ORM\Entity
*/
class Discipulado
{
/**
* @var boolean
*
* @ORM\Column(name="apto_consolidar", type="boolean", nullable=false)
*/
private $aptoConsolidar;
/**
* @var \DateTime
*
* @ORM\Column(name="fecha_obtencion", type="date", nullable=false)
*/
private $fechaObtencion;
/**
* @var boolean
*
* @ORM\Column(name="activo", type="boolean", nullable=true)
*/
private $activo;
/**
* @var integer
*
* @ORM\Column(name="id_celula", type="bigint", nullable=true)
*/
private $idCelula;
/**
* @var string
*
* @ORM\Column(name="id_red", type="string", length=10, nullable=true)
*/
private $idRed;
/**
* @var \Persona
*
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
* @ORM\OneToOne(targetEntity="Persona")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="id", referencedColumnName="id")
* })
*/
private $id;
/**
* Set aptoConsolidar
*
* @param boolean $aptoConsolidar
* @return Discipulado
*/
public function setAptoConsolidar($aptoConsolidar)
{
$this->aptoConsolidar = $aptoConsolidar;
return $this;
}
/**
* Get aptoConsolidar
*
* @return boolean
*/
public function getAptoConsolidar()
{
return $this->aptoConsolidar;
}
/**
* Set fechaObtencion
*
* @param \DateTime $fechaObtencion
* @return Discipulado
*/
public function setFechaObtencion($fechaObtencion)
{
$this->fechaObtencion = $fechaObtencion;
return $this;
}
/**
* Get fechaObtencion
*
* @return \DateTime
*/
public function getFechaObtencion()
{
return $this->fechaObtencion;
}
/**
* Set activo
*
* @param boolean $activo
* @return Discipulado
*/
public function setActivo($activo)
{
$this->activo = $activo;
return $this;
}
/**
* Get activo
*
* @return boolean
*/
public function getActivo()
{
return $this->activo;
}
/**
* Set idCelula
*
* @param integer $idCelula
* @return Discipulado
*/
public function setIdCelula($idCelula)
{
$this->idCelula = $idCelula;
return $this;
}
/**
* Get idCelula
*
* @return integer
*/
public function getIdCelula()
{
return $this->idCelula;
}
/**
* Set idRed
*
* @param string $idRed
* @return Discipulado
*/
public function setIdRed($idRed)
{
$this->idRed = $idRed;
return $this;
}
/**
* Get idRed
*
* @return string
*/
public function getIdRed()
{
return $this->idRed;
}
/**
* Set id
*
* @param \AE\DataBundle\Entity\Persona $id
* @return Discipulado
*/
public function setId(\AE\DataBundle\Entity\Persona $id)
{
$this->id = $id;
return $this;
}
/**
* Get id
*
* @return \AE\DataBundle\Entity\Persona
*/
public function getId()
{
return $this->id;
}
} | marx8926/ae | src/AE/DataBundle/Entity/Discipulado.php | PHP | mit | 3,426 |
package mundosk_libraries.java_websocket;
import java.net.InetSocketAddress;
import mundosk_libraries.java_websocket.drafts.Draft;
import mundosk_libraries.java_websocket.framing.Framedata;
import mundosk_libraries.java_websocket.handshake.ClientHandshake;
import mundosk_libraries.java_websocket.exceptions.InvalidDataException;
import mundosk_libraries.java_websocket.exceptions.InvalidHandshakeException;
import mundosk_libraries.java_websocket.framing.FramedataImpl1;
import mundosk_libraries.java_websocket.handshake.HandshakeImpl1Server;
import mundosk_libraries.java_websocket.handshake.ServerHandshake;
import mundosk_libraries.java_websocket.handshake.ServerHandshakeBuilder;
/**
* This class default implements all methods of the WebSocketListener that can be overridden optionally when advances functionalities is needed.<br>
**/
public abstract class WebSocketAdapter implements WebSocketListener {
/**
* This default implementation does not do anything. Go ahead and overwrite it.
*
* @see WebSocketListener#onWebsocketHandshakeReceivedAsServer(WebSocket, Draft, ClientHandshake)
*/
@Override
public ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer( WebSocket conn, Draft draft, ClientHandshake request ) throws InvalidDataException {
return new HandshakeImpl1Server();
}
@Override
public void onWebsocketHandshakeReceivedAsClient( WebSocket conn, ClientHandshake request, ServerHandshake response ) throws InvalidDataException {
}
/**
* This default implementation does not do anything which will cause the connections to always progress.
*
* @see WebSocketListener#onWebsocketHandshakeSentAsClient(WebSocket, ClientHandshake)
*/
@Override
public void onWebsocketHandshakeSentAsClient( WebSocket conn, ClientHandshake request ) throws InvalidDataException {
}
/**
* This default implementation does not do anything. Go ahead and overwrite it
*
* @see WebSocketListener#onWebsocketMessageFragment(WebSocket, Framedata)
*/
@Override
public void onWebsocketMessageFragment( WebSocket conn, Framedata frame ) {
}
/**
* This default implementation will send a pong in response to the received ping.
* The pong frame will have the same payload as the ping frame.
*
* @see WebSocketListener#onWebsocketPing(WebSocket, Framedata)
*/
@Override
public void onWebsocketPing( WebSocket conn, Framedata f ) {
FramedataImpl1 resp = new FramedataImpl1( f );
resp.setOptcode( Framedata.Opcode.PONG );
conn.sendFrame( resp );
}
/**
* This default implementation does not do anything. Go ahead and overwrite it.
*
* @see WebSocketListener#onWebsocketPong(WebSocket, Framedata)
*/
@Override
public void onWebsocketPong( WebSocket conn, Framedata f ) {
}
/**
* Gets the XML string that should be returned if a client requests a Flash
* security policy.
*
* The default implementation allows access from all remote domains, but
* only on the port that this WebSocketServer is listening on.
*
* This is specifically implemented for gitime's WebSocket client for Flash:
* http://github.com/gimite/web-socket-js
*
* @return An XML String that comforts to Flash's security policy. You MUST
* not include the null char at the end, it is appended automatically.
* @throws InvalidDataException thrown when some data that is required to generate the flash-policy like the websocket local port could not be obtained e.key because the websocket is not connected.
*/
@Override
public String getFlashPolicy( WebSocket conn ) throws InvalidDataException {
InetSocketAddress adr = conn.getLocalSocketAddress();
if(null == adr){
throw new InvalidHandshakeException( "socket not bound" );
}
return "<cross-domain-policy><allow-access-from domain=\"*\" to-ports=\"" + adr.getPort() +"\" /></cross-domain-policy>\0";
}
}
| TlatoaniHJ/MundoSK | src/mundosk_libraries/java_websocket/WebSocketAdapter.java | Java | mit | 3,846 |
---
layout: page
title: radxa产品及配件
category: 硬件信息
tags: [产品, 配置]
keywords: 产品, 配置
description:
---
>Radxa Rock是Radxa公司生产的基于RK3188的单板计算机(SBC,Single Board Computer)。它有**4核**的ARM处理器,可以运行一些Linux的发行版。它也有80个2.54mm的pin,这使得连接其他传感器或者使用GPIO变得非常简单。
Radxa Rock支持Android 4.2.2(Jelly Bean)和Ubuntu/Linaro 13.09在NAND falsh(板上存储)上双启动。Rock Pro支持Android 4.4.2(Kitkat)在NAND flash上启动。
你可以[烧写](http://radxa.com/Rock/flash_the_image)最新的[Android镜像和各种Linux镜像](http://radxa.com/Rock/prebuilt_images),或者你可以尝试[从SD card启动](http://radxa.com/Rock/SD_images)Android/Linux。你可以[编译你自己的Android](http://radxa.com/Rock/Android_Build)、[编译自己的内核](http://radxa.com/Rock/Booting_Linux)、[编译自己的Ubuntu 根文件系统](http://radxa.com/Rock/ubuntu),或者做你喜欢的其他事情。
### 随板配件
- radxa rock 开发板
- USB转直流电源线
- WiFi 天线
- 你可以买 Full Transparent Case来更好的保护开发板。
你也可以需要下面的基础外设让Radxa工作:
- 带有A类型USB的电源适配器,至少5V/2A(这点很重要)
- TV显示器(接口为HDMI或者AV)
- HDMI或者AV线
- 网线或者使用WiFi
- USB键盘/鼠标或者USB无线空鼠
- 红外IR遥控器
如果你有下面这些那就更好了:
- micro USB线
- 串口TTL转USB线
当一切准备妥当,它和下面的样子就差不多了

### 开机
将直流转USB线连接上USB电源,另一端插入开发板的DC直流接口。电源键下面的红色指示灯应该亮起,同时HDMI应该输出radxa的启动logo动画。等一会绿色或者蓝色指示灯会亮起。
参考:
1. http://radxa.com/Rock/Getting_Started
| radxa/docs | _posts/hardware/2014-12-29-products.md | Markdown | mit | 1,986 |
package org.carbon.authentication.conf;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.carbon.authentication.AuthIdentity;
import org.carbon.authentication.conf.rule.APIOrientedRule;
import org.carbon.authentication.conf.rule.ConfigurableRule;
import org.carbon.authentication.conf.rule.PageOrientedRule;
import org.carbon.authentication.conf.rule.Rule;
import org.carbon.authentication.strategy.AuthStrategyRepository;
import org.carbon.component.annotation.Assemble;
import org.carbon.component.annotation.Component;
import org.carbon.util.format.ChapterAttr;
import org.carbon.web.context.session.SessionPool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Shota Oda 2016/11/03.
*/
@Component
public class AuthDefinitionBuilder {
private static final Logger logger = LoggerFactory.getLogger(AuthDefinitionBuilder.class);
private List<Rule> rules;
@Assemble
private ObjectMapper objectMapper;
public AuthDefinitionBuilder() {
rules = new ArrayList<>();
}
public <IDENTITY extends AuthIdentity> ConfigurableRule<IDENTITY> define(Class<IDENTITY> identity) {
return new ConfigurableRule<>(identity, this);
}
public <IDENTITY extends AuthIdentity> PageOrientedRule<IDENTITY> defineForPage(Class<IDENTITY> identity) {
return new PageOrientedRule<>(identity, this);
}
public <IDENTITY extends AuthIdentity> APIOrientedRule<IDENTITY> defineForAPI(Class<IDENTITY> identity) {
return new APIOrientedRule<>(identity, this);
}
void addRule(Rule rule) {
rules.add(rule);
}
AuthStrategyRepository buildRepository(SessionPool sessionContext) {
AuthStrategyRepository repo = new AuthStrategyRepository();
if (logger.isInfoEnabled()) {
String descriptions = this.rules.stream()
.map(Rule::describe)
.collect(Collectors.joining("\n"));
logger.info(ChapterAttr.getBuilder("Authentication Rules").appendLine(descriptions).toString());
}
this.rules.stream()
.map(rule -> rule.convert(sessionContext))
.forEach(repo::save);
return repo;
}
}
| ShotaOd/Carbon | carbon-authentication/src/main/java/org/carbon/authentication/conf/AuthDefinitionBuilder.java | Java | mit | 2,301 |
// ***********************************************************************
// Copyright (c) 2016 Charlie Poole
//
// 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.
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace TestCentric.Gui.Views
{
using Settings;
using SettingsPages;
public partial class SettingsDialog : Form, IDialog
{
private readonly SettingsModel _settings;
private readonly List<SettingsPage> _pageList = new List<SettingsPage>();
private readonly Form _owner;
private SettingsPage _currentPage;
public SettingsDialog(Form owner, SettingsModel settings)
{
InitializeComponent();
//owner.Site.Container.Add(dialog);
this.Font = owner.Font;
_settings = settings;
_pageList.AddRange(new SettingsPage[] {
new GuiSettingsPage(_settings),
new AssemblyReloadSettingsPage(_settings)
});
_owner = owner;
}
public void ApplySettings()
{
foreach (SettingsPage page in _pageList)
if (page.SettingsLoaded)
page.ApplySettings();
}
void IDialog.ShowDialog()
{
ShowDialog(_owner);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
foreach (SettingsPage page in _pageList)
AddBranchToTree(treeView1.Nodes, page.Key);
if (treeView1.VisibleCount >= treeView1.GetNodeCount(true))
treeView1.ExpandAll();
SelectInitialPage();
treeView1.Select();
}
private void SelectInitialPage()
{
string initialPage = _settings.Gui.InitialSettingsPage as string;
if (initialPage != null)
SelectPage(initialPage);
else if (treeView1.Nodes.Count > 0)
SelectFirstPage(treeView1.Nodes);
}
private void SelectPage(string initialPage)
{
TreeNode node = FindNode(treeView1.Nodes, initialPage);
if (node != null)
treeView1.SelectedNode = node;
else
SelectFirstPage(treeView1.Nodes);
}
private TreeNode FindNode(TreeNodeCollection nodes, string key)
{
int dot = key.IndexOf('.');
string tail = null;
if (dot >= 0)
{
tail = key.Substring(dot + 1);
key = key.Substring(0, dot);
}
foreach (TreeNode node in nodes)
if (node.Text == key)
return tail == null
? node
: FindNode(node.Nodes, tail);
return null;
}
private void SelectFirstPage(TreeNodeCollection nodes)
{
if (nodes[0].Nodes.Count == 0)
treeView1.SelectedNode = nodes[0];
else
{
nodes[0].Expand();
SelectFirstPage(nodes[0].Nodes);
}
}
private void AddBranchToTree(TreeNodeCollection nodes, string key)
{
int dot = key.IndexOf('.');
if (dot < 0)
{
nodes.Add(new TreeNode(key, 2, 2));
return;
}
string name = key.Substring(0, dot);
key = key.Substring(dot + 1);
TreeNode node = FindOrAddNode(nodes, name);
if (key != null)
AddBranchToTree(node.Nodes, key);
}
private TreeNode FindOrAddNode(TreeNodeCollection nodes, string name)
{
foreach (TreeNode node in nodes)
if (node.Text == name)
return node;
TreeNode newNode = new TreeNode(name, 0, 0);
nodes.Add(newNode);
return newNode;
}
private SettingsPage FindPage(string key)
{
foreach (SettingsPage page in _pageList)
if (page.Key == key)
return page;
return null;
}
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
string key = e.Node.FullPath.Replace('\\', '.');
SettingsPage page = FindPage(key);
_settings.Gui.InitialSettingsPage = key;
if (page != null && page != _currentPage)
{
panel1.Controls.Clear();
panel1.Controls.Add(page);
page.Dock = DockStyle.Fill;
_currentPage = page;
return;
}
}
private void treeView1_AfterExpand(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
e.Node.ImageIndex = e.Node.SelectedImageIndex = 1;
}
private void treeView1_AfterCollapse(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
e.Node.ImageIndex = e.Node.SelectedImageIndex = 0;
}
private void okButton_Click(object sender, System.EventArgs e)
{
//if (Services.TestLoader.IsTestLoaded && this.HasChangesRequiringReload)
//{
// DialogResult answer = MessageDisplay.Ask(
// "Some changes will only take effect when you reload the test project. Do you want to reload now?");
// if (answer == DialogResult.Yes)
// this.reloadProjectOnClose = true;
//}
ApplySettings();
DialogResult = System.Windows.Forms.DialogResult.OK;
Close();
}
}
}
| nunit/nunit-gui | src/TestCentric/testcentric.gui/Views/SettingsDialog.cs | C# | mit | 6,876 |
import phantom from 'phantom';
import logger from '../Logger';
export default class PhantomFetcher {
initialize() {
if (this.instance && this.page) {
return Promise.resolve(this.page);
}
logger.info('Creating new PhantomJS instance');
return phantom.create()
.then(
(instance) => {
this.instance = instance;
return instance.createPage();
}
)
.then((page) => {
this.page = page;
// page.on('onResourceRequested', (requestData) => {
// console.info('Requesting', requestData.url);
// });
})
;
}
get(url) {
return new Promise((resolve, reject) => {
this.page.property('onError', (msg) => {
reject(msg);
});
this.page.open(url)
.then(
(/* status */) => {
// console.log(status);
return this.page.property('content');
},
(err) => {
reject(err);
}
)
.then(
(content) => {
// console.log(content);
this.page.evaluate(() => {
return document.location;
}).then((location) => {
resolve({
text: content,
location
});
}).catch((err) => {
reject(err);
});
}
);
});
}
}
| ApolloCrawler/microcrawler-worker | src/Fetcher/PhantomFetcher.js | JavaScript | mit | 1,401 |
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.0-rc.5-master-3a0f323
*/md-sidenav.md-THEME_NAME-theme,md-sidenav.md-THEME_NAME-theme md-content{background-color:'{{background-hue-1}}'} | rebeccaForster/ThinkTank | Iteration5_Prototype/v1/node_modules/angular-material/modules/js/sidenav/sidenav-default-theme.min.css | CSS | mit | 232 |
#ifndef REQUEST_H
#define REQUEST_H
#include "response.h"
#include "QThread"
#include <QTcpServer>
#include <QFile>
#include <QStringList>
#include <QTimer>
#include <database.h>
class Request: public QThread
{
Q_OBJECT
public:
Request(int socketDescriptor, QObject* parent = 0);
virtual void run();
private:
int socketDescriptor;
QTcpSocket* socket;
Database* redis;
bool keep_alive;
int keep_alive_timeout;
QTimer* keep_alive_timer;
QMap<QString, QString> request_header, response_header;
int response_code;
QString response_filename;
Response* response;
static bool s_initialized;
static QString s_root_path;
static QStringList s_index;
static bool s_dir_listing;
static bool s_keep_alive_enable;
static bool s_keep_alive_default;
static int s_keep_alive_timeout;
static int s_keep_alive_timeout_max;
void clearStatus();
bool getRequestHeader();
void tryResponseFile(QString filename);
static void initialize();
public slots:
void onReadyRead();
void onDisconnected();
void onTimeout();
};
#endif // REQUEST_H
| oxmcvusd/Tinyhttpd | request.h | C | mit | 1,135 |
/*
* Copyright © 2008 Kristian Høgsberg
* Copyright © 2012-2013 Collabora, Ltd.
* Copyright © 2013 Jason Ekstrand
*
* 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 (including the
* next paragraph) 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.
*/
#include "config.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-util.h>
#include <linux/input.h>
#include "cairo-util.h"
enum frame_button_flags {
FRAME_BUTTON_ALIGN_RIGHT = 0x1,
FRAME_BUTTON_DECORATED = 0x2,
FRAME_BUTTON_CLICK_DOWN = 0x4,
};
struct frame_button {
struct frame *frame;
struct wl_list link; /* buttons_list */
cairo_surface_t *icon;
enum frame_button_flags flags;
int hover_count;
int press_count;
struct {
int x, y;
int width, height;
} allocation;
enum frame_status status_effect;
};
struct frame_pointer_button {
struct wl_list link;
uint32_t button;
enum theme_location press_location;
struct frame_button *frame_button;
};
struct frame_pointer {
struct wl_list link;
void *data;
int x, y;
struct frame_button *hover_button;
struct wl_list down_buttons;
};
struct frame_touch {
struct wl_list link;
void *data;
int x, y;
struct frame_button *button;
};
struct frame {
int32_t width, height;
char *title;
uint32_t flags;
struct theme *theme;
struct {
int32_t x, y;
int32_t width, height;
} interior;
int shadow_margin;
int opaque_margin;
int geometry_dirty;
uint32_t status;
struct wl_list buttons;
struct wl_list pointers;
struct wl_list touches;
};
static struct frame_button *
frame_button_create(struct frame *frame, const char *icon,
enum frame_status status_effect,
enum frame_button_flags flags)
{
struct frame_button *button;
button = calloc(1, sizeof *button);
if (!button)
return NULL;
button->icon = cairo_image_surface_create_from_png(icon);
if (!button->icon) {
free(button);
return NULL;
}
button->frame = frame;
button->flags = flags;
button->status_effect = status_effect;
wl_list_insert(frame->buttons.prev, &button->link);
return button;
}
static void
frame_button_destroy(struct frame_button *button)
{
cairo_surface_destroy(button->icon);
free(button);
}
static void
frame_button_enter(struct frame_button *button)
{
if (!button->hover_count)
button->frame->status |= FRAME_STATUS_REPAINT;
button->hover_count++;
}
static void
frame_button_leave(struct frame_button *button, struct frame_pointer *pointer)
{
button->hover_count--;
if (!button->hover_count)
button->frame->status |= FRAME_STATUS_REPAINT;
}
static void
frame_button_press(struct frame_button *button)
{
if (!button->press_count)
button->frame->status |= FRAME_STATUS_REPAINT;
button->press_count++;
if (button->flags & FRAME_BUTTON_CLICK_DOWN)
button->frame->status |= button->status_effect;
}
static void
frame_button_release(struct frame_button *button)
{
button->press_count--;
if (button->press_count)
return;
button->frame->status |= FRAME_STATUS_REPAINT;
if (!(button->flags & FRAME_BUTTON_CLICK_DOWN))
button->frame->status |= button->status_effect;
}
static void
frame_button_cancel(struct frame_button *button)
{
button->press_count--;
if (!button->press_count)
button->frame->status |= FRAME_STATUS_REPAINT;
}
static void
frame_button_repaint(struct frame_button *button, cairo_t *cr)
{
int x, y;
if (!button->allocation.width)
return;
if (!button->allocation.height)
return;
x = button->allocation.x;
y = button->allocation.y;
cairo_save(cr);
if (button->flags & FRAME_BUTTON_DECORATED) {
cairo_set_line_width(cr, 1);
cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
cairo_rectangle(cr, x, y, 25, 16);
cairo_stroke_preserve(cr);
if (button->press_count) {
cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
} else if (button->hover_count) {
cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
} else {
cairo_set_source_rgb(cr, 0.88, 0.88, 0.88);
}
cairo_fill (cr);
x += 4;
}
cairo_set_source_surface(cr, button->icon, x, y);
cairo_paint(cr);
cairo_restore(cr);
}
static struct frame_pointer *
frame_pointer_get(struct frame *frame, void *data)
{
struct frame_pointer *pointer;
wl_list_for_each(pointer, &frame->pointers, link)
if (pointer->data == data)
return pointer;
pointer = calloc(1, sizeof *pointer);
if (!pointer)
return NULL;
pointer->data = data;
wl_list_init(&pointer->down_buttons);
wl_list_insert(&frame->pointers, &pointer->link);
return pointer;
}
static void
frame_pointer_destroy(struct frame_pointer *pointer)
{
wl_list_remove(&pointer->link);
free(pointer);
}
static struct frame_touch *
frame_touch_get(struct frame *frame, void *data)
{
struct frame_touch *touch;
wl_list_for_each(touch, &frame->touches, link)
if (touch->data == data)
return touch;
touch = calloc(1, sizeof *touch);
if (!touch)
return NULL;
touch->data = data;
wl_list_insert(&frame->touches, &touch->link);
return touch;
}
static void
frame_touch_destroy(struct frame_touch *touch)
{
wl_list_remove(&touch->link);
free(touch);
}
void
frame_destroy(struct frame *frame)
{
struct frame_button *button, *next;
struct frame_touch *touch, *next_touch;
struct frame_pointer *pointer, *next_pointer;
wl_list_for_each_safe(button, next, &frame->buttons, link)
frame_button_destroy(button);
wl_list_for_each_safe(touch, next_touch, &frame->touches, link)
frame_touch_destroy(touch);
wl_list_for_each_safe(pointer, next_pointer, &frame->pointers, link)
frame_pointer_destroy(pointer);
free(frame->title);
free(frame);
}
struct frame *
frame_create(struct theme *t, int32_t width, int32_t height, uint32_t buttons,
const char *title)
{
struct frame *frame;
struct frame_button *button;
frame = calloc(1, sizeof *frame);
if (!frame)
return NULL;
frame->width = width;
frame->height = height;
frame->flags = 0;
frame->theme = t;
frame->status = FRAME_STATUS_REPAINT;
frame->geometry_dirty = 1;
wl_list_init(&frame->buttons);
wl_list_init(&frame->pointers);
wl_list_init(&frame->touches);
if (title) {
frame->title = strdup(title);
if (!frame->title)
goto free_frame;
}
if (title) {
button = frame_button_create(frame,
DATADIR "/weston/icon_window.png",
FRAME_STATUS_MENU,
FRAME_BUTTON_CLICK_DOWN);
if (!button)
goto free_frame;
}
if (buttons & FRAME_BUTTON_CLOSE) {
button = frame_button_create(frame,
DATADIR "/weston/sign_close.png",
FRAME_STATUS_CLOSE,
FRAME_BUTTON_ALIGN_RIGHT |
FRAME_BUTTON_DECORATED);
if (!button)
goto free_frame;
}
if (buttons & FRAME_BUTTON_MAXIMIZE) {
button = frame_button_create(frame,
DATADIR "/weston/sign_maximize.png",
FRAME_STATUS_MAXIMIZE,
FRAME_BUTTON_ALIGN_RIGHT |
FRAME_BUTTON_DECORATED);
if (!button)
goto free_frame;
}
if (buttons & FRAME_BUTTON_MINIMIZE) {
button = frame_button_create(frame,
DATADIR "/weston/sign_minimize.png",
FRAME_STATUS_MINIMIZE,
FRAME_BUTTON_ALIGN_RIGHT |
FRAME_BUTTON_DECORATED);
if (!button)
goto free_frame;
}
return frame;
free_frame:
frame_destroy(frame);
return NULL;
}
int
frame_set_title(struct frame *frame, const char *title)
{
char *dup = NULL;
if (title) {
dup = strdup(title);
if (!dup)
return -1;
}
free(frame->title);
frame->title = dup;
frame->geometry_dirty = 1;
frame->status |= FRAME_STATUS_REPAINT;
return 0;
}
void
frame_set_flag(struct frame *frame, enum frame_flag flag)
{
if (flag & FRAME_FLAG_MAXIMIZED && !(frame->flags & FRAME_FLAG_MAXIMIZED))
frame->geometry_dirty = 1;
frame->flags |= flag;
frame->status |= FRAME_STATUS_REPAINT;
}
void
frame_unset_flag(struct frame *frame, enum frame_flag flag)
{
if (flag & FRAME_FLAG_MAXIMIZED && frame->flags & FRAME_FLAG_MAXIMIZED)
frame->geometry_dirty = 1;
frame->flags &= ~flag;
frame->status |= FRAME_STATUS_REPAINT;
}
void
frame_resize(struct frame *frame, int32_t width, int32_t height)
{
frame->width = width;
frame->height = height;
frame->geometry_dirty = 1;
frame->status |= FRAME_STATUS_REPAINT;
}
void
frame_resize_inside(struct frame *frame, int32_t width, int32_t height)
{
struct theme *t = frame->theme;
int decoration_width, decoration_height, titlebar_height;
if (frame->title || !wl_list_empty(&frame->buttons))
titlebar_height = t->titlebar_height;
else
titlebar_height = t->width;
if (frame->flags & FRAME_FLAG_MAXIMIZED) {
decoration_width = t->width * 2;
decoration_height = t->width + titlebar_height;
} else {
decoration_width = (t->width + t->margin) * 2;
decoration_height = t->width +
titlebar_height + t->margin * 2;
}
frame_resize(frame, width + decoration_width,
height + decoration_height);
}
int32_t
frame_width(struct frame *frame)
{
return frame->width;
}
int32_t
frame_height(struct frame *frame)
{
return frame->height;
}
static void
frame_refresh_geometry(struct frame *frame)
{
struct frame_button *button;
struct theme *t = frame->theme;
int x_l, x_r, y, w, h, titlebar_height;
int32_t decoration_width, decoration_height;
if (!frame->geometry_dirty)
return;
if (frame->title || !wl_list_empty(&frame->buttons))
titlebar_height = t->titlebar_height;
else
titlebar_height = t->width;
if (frame->flags & FRAME_FLAG_MAXIMIZED) {
decoration_width = t->width * 2;
decoration_height = t->width + titlebar_height;
frame->interior.x = t->width;
frame->interior.y = titlebar_height;
frame->interior.width = frame->width - decoration_width;
frame->interior.height = frame->height - decoration_height;
frame->opaque_margin = 0;
frame->shadow_margin = 0;
} else {
decoration_width = (t->width + t->margin) * 2;
decoration_height = t->width + titlebar_height + t->margin * 2;
frame->interior.x = t->width + t->margin;
frame->interior.y = titlebar_height + t->margin;
frame->interior.width = frame->width - decoration_width;
frame->interior.height = frame->height - decoration_height;
frame->opaque_margin = t->margin + t->frame_radius;
frame->shadow_margin = t->margin;
}
x_r = frame->width - t->width - frame->shadow_margin;
x_l = t->width + frame->shadow_margin;
y = t->width + frame->shadow_margin;
wl_list_for_each(button, &frame->buttons, link) {
const int button_padding = 4;
w = cairo_image_surface_get_width(button->icon);
h = cairo_image_surface_get_height(button->icon);
if (button->flags & FRAME_BUTTON_DECORATED)
w += 10;
if (button->flags & FRAME_BUTTON_ALIGN_RIGHT) {
x_r -= w;
button->allocation.x = x_r;
button->allocation.y = y;
button->allocation.width = w + 1;
button->allocation.height = h + 1;
x_r -= button_padding;
} else {
button->allocation.x = x_l;
button->allocation.y = y;
button->allocation.width = w + 1;
button->allocation.height = h + 1;
x_l += w;
x_l += button_padding;
}
}
frame->geometry_dirty = 0;
}
void
frame_interior(struct frame *frame, int32_t *x, int32_t *y,
int32_t *width, int32_t *height)
{
frame_refresh_geometry(frame);
if (x)
*x = frame->interior.x;
if (y)
*y = frame->interior.y;
if (width)
*width = frame->interior.width;
if (height)
*height = frame->interior.height;
}
void
frame_input_rect(struct frame *frame, int32_t *x, int32_t *y,
int32_t *width, int32_t *height)
{
frame_refresh_geometry(frame);
if (x)
*x = frame->shadow_margin;
if (y)
*y = frame->shadow_margin;
if (width)
*width = frame->width - frame->shadow_margin * 2;
if (height)
*height = frame->height - frame->shadow_margin * 2;
}
void
frame_opaque_rect(struct frame *frame, int32_t *x, int32_t *y,
int32_t *width, int32_t *height)
{
frame_refresh_geometry(frame);
if (x)
*x = frame->opaque_margin;
if (y)
*y = frame->opaque_margin;
if (width)
*width = frame->width - frame->opaque_margin * 2;
if (height)
*height = frame->height - frame->opaque_margin * 2;
}
int
frame_get_shadow_margin(struct frame *frame)
{
frame_refresh_geometry(frame);
return frame->shadow_margin;
}
uint32_t
frame_status(struct frame *frame)
{
return frame->status;
}
void
frame_status_clear(struct frame *frame, enum frame_status status)
{
frame->status &= ~status;
}
static struct frame_button *
frame_find_button(struct frame *frame, int x, int y)
{
struct frame_button *button;
int rel_x, rel_y;
wl_list_for_each(button, &frame->buttons, link) {
rel_x = x - button->allocation.x;
rel_y = y - button->allocation.y;
if (0 <= rel_x && rel_x < button->allocation.width &&
0 <= rel_y && rel_y < button->allocation.height)
return button;
}
return NULL;
}
enum theme_location
frame_pointer_enter(struct frame *frame, void *data, int x, int y)
{
return frame_pointer_motion(frame, data, x, y);
}
enum theme_location
frame_pointer_motion(struct frame *frame, void *data, int x, int y)
{
struct frame_pointer *pointer = frame_pointer_get(frame, data);
struct frame_button *button = frame_find_button(frame, x, y);
enum theme_location location;
location = theme_get_location(frame->theme, x, y,
frame->width, frame->height,
frame->flags & FRAME_FLAG_MAXIMIZED ?
THEME_FRAME_MAXIMIZED : 0);
if (!pointer)
return location;
pointer->x = x;
pointer->y = y;
if (pointer->hover_button == button)
return location;
if (pointer->hover_button)
frame_button_leave(pointer->hover_button, pointer);
pointer->hover_button = button;
if (pointer->hover_button)
frame_button_enter(pointer->hover_button);
return location;
}
static void
frame_pointer_button_destroy(struct frame_pointer_button *button)
{
wl_list_remove(&button->link);
free(button);
}
static void
frame_pointer_button_press(struct frame *frame, struct frame_pointer *pointer,
struct frame_pointer_button *button)
{
if (button->button == BTN_RIGHT) {
if (button->press_location == THEME_LOCATION_TITLEBAR)
frame->status |= FRAME_STATUS_MENU;
frame_pointer_button_destroy(button);
} else if (button->button == BTN_LEFT) {
if (pointer->hover_button) {
frame_button_press(pointer->hover_button);
} else {
switch (button->press_location) {
case THEME_LOCATION_TITLEBAR:
frame->status |= FRAME_STATUS_MOVE;
frame_pointer_button_destroy(button);
break;
case THEME_LOCATION_RESIZING_TOP:
case THEME_LOCATION_RESIZING_BOTTOM:
case THEME_LOCATION_RESIZING_LEFT:
case THEME_LOCATION_RESIZING_RIGHT:
case THEME_LOCATION_RESIZING_TOP_LEFT:
case THEME_LOCATION_RESIZING_TOP_RIGHT:
case THEME_LOCATION_RESIZING_BOTTOM_LEFT:
case THEME_LOCATION_RESIZING_BOTTOM_RIGHT:
frame->status |= FRAME_STATUS_RESIZE;
frame_pointer_button_destroy(button);
break;
default:
break;
}
}
}
}
static void
frame_pointer_button_release(struct frame *frame, struct frame_pointer *pointer,
struct frame_pointer_button *button)
{
if (button->button == BTN_LEFT && button->frame_button) {
if (button->frame_button == pointer->hover_button)
frame_button_release(button->frame_button);
else
frame_button_cancel(button->frame_button);
}
}
static void
frame_pointer_button_cancel(struct frame *frame, struct frame_pointer *pointer,
struct frame_pointer_button *button)
{
if (button->frame_button)
frame_button_cancel(button->frame_button);
}
void
frame_pointer_leave(struct frame *frame, void *data)
{
struct frame_pointer *pointer = frame_pointer_get(frame, data);
struct frame_pointer_button *button, *next;
if (!pointer)
return;
if (pointer->hover_button)
frame_button_leave(pointer->hover_button, pointer);
wl_list_for_each_safe(button, next, &pointer->down_buttons, link) {
frame_pointer_button_cancel(frame, pointer, button);
frame_pointer_button_destroy(button);
}
frame_pointer_destroy(pointer);
}
enum theme_location
frame_pointer_button(struct frame *frame, void *data,
uint32_t btn, enum frame_button_state state)
{
struct frame_pointer *pointer = frame_pointer_get(frame, data);
struct frame_pointer_button *button;
enum theme_location location = THEME_LOCATION_EXTERIOR;
if (!pointer)
return location;
location = theme_get_location(frame->theme, pointer->x, pointer->y,
frame->width, frame->height,
frame->flags & FRAME_FLAG_MAXIMIZED ?
THEME_FRAME_MAXIMIZED : 0);
if (state == FRAME_BUTTON_PRESSED) {
button = malloc(sizeof *button);
if (!button)
return location;
button->button = btn;
button->press_location = location;
button->frame_button = pointer->hover_button;
wl_list_insert(&pointer->down_buttons, &button->link);
frame_pointer_button_press(frame, pointer, button);
} else if (state == FRAME_BUTTON_RELEASED) {
button = NULL;
wl_list_for_each(button, &pointer->down_buttons, link)
if (button->button == btn)
break;
/* Make sure we didn't hit the end */
if (&button->link == &pointer->down_buttons)
return location;
location = button->press_location;
frame_pointer_button_release(frame, pointer, button);
frame_pointer_button_destroy(button);
}
return location;
}
enum theme_location
frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y)
{
struct frame_touch *touch = frame_touch_get(frame, data);
struct frame_button *button = frame_find_button(frame, x, y);
enum theme_location location;
location = theme_get_location(frame->theme, x, y,
frame->width, frame->height,
frame->flags & FRAME_FLAG_MAXIMIZED ?
THEME_FRAME_MAXIMIZED : 0);
if (id > 0)
return location;
if (touch && button) {
touch->button = button;
frame_button_press(touch->button);
return location;
}
switch (location) {
case THEME_LOCATION_TITLEBAR:
frame->status |= FRAME_STATUS_MOVE;
break;
case THEME_LOCATION_RESIZING_TOP:
case THEME_LOCATION_RESIZING_BOTTOM:
case THEME_LOCATION_RESIZING_LEFT:
case THEME_LOCATION_RESIZING_RIGHT:
case THEME_LOCATION_RESIZING_TOP_LEFT:
case THEME_LOCATION_RESIZING_TOP_RIGHT:
case THEME_LOCATION_RESIZING_BOTTOM_LEFT:
case THEME_LOCATION_RESIZING_BOTTOM_RIGHT:
frame->status |= FRAME_STATUS_RESIZE;
break;
default:
break;
}
return location;
}
void
frame_touch_up(struct frame *frame, void *data, int32_t id)
{
struct frame_touch *touch = frame_touch_get(frame, data);
if (id > 0)
return;
if (touch && touch->button) {
frame_button_release(touch->button);
frame_touch_destroy(touch);
}
}
enum theme_location
frame_double_click(struct frame *frame, void *data,
uint32_t btn, enum frame_button_state state)
{
struct frame_pointer *pointer = frame_pointer_get(frame, data);
struct frame_button *button;
enum theme_location location = THEME_LOCATION_EXTERIOR;
location = theme_get_location(frame->theme, pointer->x, pointer->y,
frame->width, frame->height,
frame->flags & FRAME_FLAG_MAXIMIZED ?
THEME_FRAME_MAXIMIZED : 0);
button = frame_find_button(frame, pointer->x, pointer->y);
if (location != THEME_LOCATION_TITLEBAR || btn != BTN_LEFT)
return location;
if (state == FRAME_BUTTON_PRESSED) {
if (button)
frame_button_press(button);
else
frame->status |= FRAME_STATUS_MAXIMIZE;
} else if (state == FRAME_BUTTON_RELEASED) {
if (button)
frame_button_release(button);
}
return location;
}
void
frame_double_touch_down(struct frame *frame, void *data, int32_t id,
int x, int y)
{
struct frame_touch *touch = frame_touch_get(frame, data);
struct frame_button *button = frame_find_button(frame, x, y);
enum theme_location location;
if (touch && button) {
touch->button = button;
frame_button_press(touch->button);
return;
}
location = theme_get_location(frame->theme, x, y,
frame->width, frame->height,
frame->flags & FRAME_FLAG_MAXIMIZED ?
THEME_FRAME_MAXIMIZED : 0);
switch (location) {
case THEME_LOCATION_TITLEBAR:
frame->status |= FRAME_STATUS_MAXIMIZE;
break;
case THEME_LOCATION_RESIZING_TOP:
case THEME_LOCATION_RESIZING_BOTTOM:
case THEME_LOCATION_RESIZING_LEFT:
case THEME_LOCATION_RESIZING_RIGHT:
case THEME_LOCATION_RESIZING_TOP_LEFT:
case THEME_LOCATION_RESIZING_TOP_RIGHT:
case THEME_LOCATION_RESIZING_BOTTOM_LEFT:
case THEME_LOCATION_RESIZING_BOTTOM_RIGHT:
frame->status |= FRAME_STATUS_RESIZE;
break;
default:
break;
}
}
void
frame_double_touch_up(struct frame *frame, void *data, int32_t id)
{
struct frame_touch *touch = frame_touch_get(frame, data);
if (touch && touch->button) {
frame_button_release(touch->button);
frame_touch_destroy(touch);
}
}
void
frame_repaint(struct frame *frame, cairo_t *cr)
{
struct frame_button *button;
uint32_t flags = 0;
frame_refresh_geometry(frame);
if (frame->flags & FRAME_FLAG_MAXIMIZED)
flags |= THEME_FRAME_MAXIMIZED;
if (frame->flags & FRAME_FLAG_ACTIVE)
flags |= THEME_FRAME_ACTIVE;
cairo_save(cr);
theme_render_frame(frame->theme, cr, frame->width, frame->height,
frame->title, &frame->buttons, flags);
cairo_restore(cr);
wl_list_for_each(button, &frame->buttons, link)
frame_button_repaint(button, cr);
frame_status_clear(frame, FRAME_STATUS_REPAINT);
}
| krezovic/weston | shared/frame.c | C | mit | 22,083 |
/***************************************************************
* Generated by Hottentot CC Generator
* Date: 02-05-2016 05:18:41
* Name: user.h
* Description:
* This file contains definition of User class.
***************************************************************/
#ifndef _NAEEM_HOTTENTOT_EXAMPLES_AUTH__USER_H_
#define _NAEEM_HOTTENTOT_EXAMPLES_AUTH__USER_H_
#include <string>
#include <org/labcrypto/hottentot/primitives.h>
#include "enums.h"
namespace naeem {
namespace hottentot {
namespace examples {
namespace auth {
class User : public ::org::labcrypto::hottentot::Serializable {
public:
User() {
}
User(const User &);
User(User *);
virtual ~User() {}
public:
inline ::org::labcrypto::hottentot::Utf8String GetName() const {
return name_;
}
inline void SetName(::org::labcrypto::hottentot::Utf8String name) {
name_ = name;
}
inline ::org::labcrypto::hottentot::Utf8String GetFamily() const {
return family_;
}
inline void SetFamily(::org::labcrypto::hottentot::Utf8String family) {
family_ = family;
}
inline ::org::labcrypto::hottentot::UInt8 GetAge() const {
return age_;
}
inline void SetAge(::org::labcrypto::hottentot::UInt8 age) {
age_ = age;
}
public:
virtual unsigned char * Serialize(uint32_t * /* Pointer to length */);
virtual void Deserialize(unsigned char * /* Data */, uint32_t /* Data length */);
private:
::org::labcrypto::hottentot::Utf8String name_;
::org::labcrypto::hottentot::Utf8String family_;
::org::labcrypto::hottentot::UInt8 age_;
};
} // END OF NAMESPACE auth
} // END OF NAMESPACE examples
} // END OF NAMESPACE hottentot
} // END OF NAMESPACE naeem
#endif | NTNAEEM/hottentot | examples/authentication/gen/user.h | C | mit | 1,765 |
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if($od['od_pg'] != 'kcp') return;
include_once(G5_SHOP_PATH.'/settle_kcp.inc.php');
include_once(G5_SHOP_PATH.'/kcp/pp_ax_hub_lib.php');
// locale ko_KR.euc-kr 로 설정
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
$req_tx = 'mod_escrow';
$mod_type = 'STE1';
$mod_desc = '에스크로 배송시작 등록';
$cust_ip = getenv('REMOTE_ADDR');
$c_PayPlus = new C_PP_CLI_T;
$c_PayPlus->mf_clear();
$tran_cd = "00200000";
// 에스크로 상태변경
$c_PayPlus->mf_set_modx_data( "tno", $escrow_tno );
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type );
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip );
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc );
$c_PayPlus->mf_set_modx_data( "deli_numb", $escrow_numb );
$c_PayPlus->mf_set_modx_data( "deli_corp", $escrow_corp );
$c_PayPlus->mf_do_tx( $trace_no, $g_conf_home_dir, $g_conf_site_cd, $g_conf_site_key, $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
$cust_ip, "3" , 0, 0, $g_conf_key_dir, $g_conf_log_dir); // 응답 전문 처리
$res_cd = $c_PayPlus->m_res_cd; // 결과 코드
$res_msg = $c_PayPlus->m_res_msg; // 결과 메시지
// locale 설정 초기화
setlocale(LC_CTYPE, '');
?> | yysun2000/delibelight | yc/shop/kcp/escrow.register.php | PHP | mit | 1,372 |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Controller extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->lang->load('general');
if (!$this->ion_auth->logged_in())
{
redirect('auth/login');
}
}
} | ismaelgaudioso/redirection | application/core/MY_Controller.php | PHP | mit | 290 |
# BodyBuilder
The main builder class.
**Examples**
```javascript
var body = new Bodybuilder()
.query('match', 'text', 'this is a test')
.build()
```
## aggregation
Apply a aggregation of a given type providing all the necessary arguments,
passing these arguments directly to the specified aggregation builder.
Merges existing aggregation(s) with the new aggregation. You may nest
aggregations by passing in a `Function` callback as the last parameter.
The callback will receive the newly built aggregation upon which you can
keep calling `aggregation(type, ...args)`.
**Parameters**
- `type` **String** Name of the aggregation type.
- `args` **...args** Arguments passed to aggregation builder. May include
am optional nesting function as its last element.
**Examples**
```javascript
var body = new Bodybuilder()
.query('match', 'text', 'this is a test')
.aggregation('terms', 'someField', 'bySomeField',
// Nest aggregations on "bySomeField"
agg =>
agg
.agregation('max', 'someOtherField')
.aggregation('missing', 'anotherField')
)
.build()
```
Returns **BodyBuilder** Builder class.
## build
Constructs the elasticsearch query body in its current state.
**Parameters**
- `version` **String** Version to generate.
Returns **Object** Query body.
## filter
Apply a filter of a given type providing all the necessary arguments,
passing these arguments directly to the specified filter builder. Merges
existing filter(s) with the new filter.
**Parameters**
- `type` **String** Name of the filter type.
- `args` **...args** Arguments passed to filter builder.
Returns **BodyBuilder** Builder class.
## from
Set a _from_ offset value, for paginating a query.
**Parameters**
- `quantity` **Number** The offset from the first result you want to
fetch.
Returns **BodyBuilder** Builder class.
## query
Apply a query of a given type providing all the necessary arguments,
passing these arguments directly to the specified query builder. Merges
existing query(s) with the new query.
**Parameters**
- `type` **String** Name of the query type.
- `args` **...args** Arguments passed to query builder.
Returns **BodyBuilder** Builder class.
## rawOption
Set any key-value on the elasticsearch body.
**Parameters**
- `k` **String** Key.
- `v` **String** Value.
Returns **BodyBuilder** Builder class.
## size
Set a _size_ value for maximum results to return.
**Parameters**
- `quantity` **Number** Maximum number of results to return.
Returns **BodyBuilder** Builder class.
## sort
Set a sort direction on a given field.
**Parameters**
- `field` **String** Field name.
- `direction` **[String]** A valid direction: 'asc' or 'desc'. (optional, default `'asc'`)
Returns **BodyBuilder** Builder class.
| arielshad/bodybuilder | docs/API.md | Markdown | mit | 2,853 |
package structures.data;
public class DataEvent {
}
| nrg12/VOOGASalad | Design/Interfaces/structures/data/DataEvent.java | Java | mit | 54 |
<?php
namespace EightPoints\Bundle\GuzzleBundle\Tests\Events;
use EightPoints\Bundle\GuzzleBundle\Events\PostTransactionEvent;
/**
* @version 4.5
* @since 2016-01
*/
class PostTransactionEventTest extends \PHPUnit_Framework_TestCase
{
/**
* Test Instance
*
* @version 4.5
* @since 2016-01
*
* @covers EightPoints\Bundle\GuzzleBundle\Events\PostTransactionEvent::__construct
*/
public function testConstruct()
{
$serviceName = 'service name';
$response = $this->createMock('GuzzleHttp\Psr7\Response');
$postEvent = new PostTransactionEvent($response, $serviceName);
$this->assertSame($serviceName, $postEvent->getServiceName());
}
/**
* Test Transaction
*
* @version 4.5
* @since 2016-01
*
* @covers EightPoints\Bundle\GuzzleBundle\Events\PostTransactionEvent::setTransaction
* @covers EightPoints\Bundle\GuzzleBundle\Events\PostTransactionEvent::getTransaction
*/
public function testTranscation()
{
$statusCode = 204;
$response = $this->createMock('GuzzleHttp\Psr7\Response');
$postEvent = new PostTransactionEvent($response, null);
$transMock = $this->getMockBuilder('GuzzleHttp\Psr7\Response')
->getMock();
$transMock->method('getStatusCode')->willReturn($statusCode);
$postEvent->setTransaction($transMock);
$transaction = $postEvent->getTransaction();
$this->assertSame($transaction, $transMock);
$this->assertSame($statusCode, $transaction->getStatusCode());
}
}
| odooo/design | vendor/eightpoints/guzzle-bundle/EightPoints/Bundle/GuzzleBundle/Tests/Events/PostTransactionEventTest.php | PHP | mit | 1,640 |
import * as React from 'react';
import { StandardProps } from '..';
export interface GridListProps extends StandardProps<
React.HTMLAttributes<HTMLUListElement>,
GridListClassKey
> {
cellHeight?: number | 'auto';
cols?: number;
component?: string | React.ComponentType<GridListProps>;
spacing?: number;
}
export type GridListClassKey =
| 'root'
;
declare const GridList: React.ComponentType<GridListProps>;
export default GridList;
| uplevel-technology/material-ui-next | es/GridList/GridList.d.ts | TypeScript | mit | 452 |
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM;
using TTC2017.SmartGrids.CIM.IEC61968.AssetModels;
using TTC2017.SmartGrids.CIM.IEC61968.Assets;
using TTC2017.SmartGrids.CIM.IEC61968.Common;
using TTC2017.SmartGrids.CIM.IEC61968.Customers;
using TTC2017.SmartGrids.CIM.IEC61968.PaymentMetering;
using TTC2017.SmartGrids.CIM.IEC61968.WiresExt;
using TTC2017.SmartGrids.CIM.IEC61968.Work;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Domain;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssetModels;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssets;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfCustomers;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfMetering;
using TTC2017.SmartGrids.CIM.IEC61970.Meas;
using TTC2017.SmartGrids.CIM.IEC61970.Wires;
namespace TTC2017.SmartGrids.CIM.IEC61968.Metering
{
public class EndDeviceAssetDeviceFunctionsCollection : ObservableOppositeOrderedSet<IEndDeviceAsset, IDeviceFunction>
{
public EndDeviceAssetDeviceFunctionsCollection(IEndDeviceAsset parent) :
base(parent)
{
}
private void OnItemDeleted(object sender, System.EventArgs e)
{
this.Remove(((IDeviceFunction)(sender)));
}
protected override void SetOpposite(IDeviceFunction item, IEndDeviceAsset parent)
{
if ((parent != null))
{
item.Deleted += this.OnItemDeleted;
item.EndDeviceAsset = parent;
}
else
{
item.Deleted -= this.OnItemDeleted;
if ((item.EndDeviceAsset == this.Parent))
{
item.EndDeviceAsset = parent;
}
}
}
}
}
| georghinkel/ttc2017smartGrids | solutions/NMF/Schema/IEC61968/Metering/EndDeviceAssetDeviceFunctionsCollection.cs | C# | mit | 2,730 |
`gulpt` changelog
======================
- v0.1.2 (2014.04.25)
+ Fix https://github.com/jaguard/gulpt/issues/1
- v0.1.1 (2014.04.25)
+ Add screenshoots
- v0.1.0 (2014.04.20)
+ Published `gulpt` module to [npm](https://www.npmjs.org/package/gulpt)
+ Initial release
| amacoder/gulpt | CHANGELOG.md | Markdown | mit | 270 |
<!DOCTYPE html>
<html lang="it" xmlns:th="http://www.thymeleaf.org">
<head>
<meta th:replace="partials/meta">
</head>
<body>
<header th:replace="partials/header"></header>
<main id="main" class="main">
<section class="section-template">
<header class="section__header">
<h2 class="section__title title-2">
Attributions
</h2>
</header>
<article class="attributions__content">
<p>
Ominidi.org è stato creato con software e materiali con licenza <a
href="https://www.gnu.org/licenses/license-list.it.html#GPLCompatibleLicenses"
title="Free Software license">
Free Software</a>, <a href="https://opensource.org/licenses" title="Open Source licenses">Open
Source</a> o <a href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons licese">Creative
Commons</a>. <br/>
</p>
<h3>Software</h3>
<p>
Segue un elenco di tutti i gli strumenti utilizzati per la creazione del sito web, degli adesivi e del
materiale relativo ad Ominidi.
</p>
<ul>
<li>
<a href="http://www.openoffice.org/it/" title="Apache Open Office">
Apache Open Office
</a>
</li>
<li>
<a href="https://inkscape.org/it/" title="Inkscape">
Inkscape
</a>
</li>
<li>
<a href="https://www.getpaint.net/" title="Paint.net">
Paint.net
</a>
</li>
<li>
<a href="http://pencil.evolus.vn/" title="Pencil Project">
Pencil Project
</a>
</li>
<li>
<a href="https://www.jetbrains.com/idea/#chooseYourEdition" title="IntelliJ Community Edition">
IntelliJ Community Edition
</a>
</li>
<li>
<a href="https://www.virtualbox.org/" title="Virtual Box">
Virtual Box
</a>
</li>
<li>
<a href="https://github.com/" title="Github">
Github
</a>
</li>
<li>
<a href="https://www.chromium.org/Home" title="Chromium">
Chromium
</a>
</li>
</ul>
<h3>Sviluppo</h3>
<p>Il sito web di Ominidi è stato sviluppato con le seguenti tecnologie</p>
<ul>
<li>
<a href="https://www.java.com/it/" title="Java">
Java
</a>
</li>
<li>
<a href="https://spring.io/" title="Spring">
Spring (mai più nella vita)
</a>
</li>
<li>
<a href="https://git-scm.com/" title="Git">
Git
</a>
</li>
<li>
<a href="https://www.docker.com/docker-ubuntu" title="Docker for Ubuntu">
Docker for Ubuntu
</a>
</li>
<li>
<a href="https://github.com/facebook/react" title="React">
React
</a>
</li>
<li>
<a href="https://threejs.org/" title="Three.js">
Three.js
</a>
</li>
</ul>
<h3>Materiali</h3>
<ul>
<li>
L'immagine del frattale è di
<a href="https://sciencevsmagic.net/" title="Nico Disseldrop">Nico Disseldrop</a>
</li>
<li>
L'immagine di Cueva de las Manos usata per la pagina di errore è di
<a href="//commons.wikimedia.org/wiki/User:Marianocecowski" title="User:Marianocecowski">Mariano</a>
</li>
<li>
I font del sito web appartengono alla famiglia
<a href="https://pagure.io/liberation-fonts" title="Liberation Sans">Liberation Sans</a>
</li>
<li>
I testi e gli autori che hanno ispirato, o i cui lavori sono stati utilizzati da Ominidi, sono
citati nella pagina del <a th:href="@{/manifesto}" title="Manifesto">Manifesto </a>
</li>
</ul>
</article>
</section>
<footer th:replace="partials/footer"></footer>
</main>
</body>
</html> | ominidi/ominidi-web | src/main/resources/templates/attributions.html | HTML | mit | 5,217 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace TestLib.Extensions
{
public interface IRideable { void Mount(); void Start(); }
public abstract class Animal { public string Name { get; set; } }
public abstract class HorseAnimal : Animal { }
public class Zebra : HorseAnimal { }
public class Horse : HorseAnimal, IRideable
{
public virtual void Mount()
{
Debug.WriteLine("Swing into the saddle");
}
public virtual void Start()
{
Debug.WriteLine("Press heels into horse's side");
}
}
public class Elephant : Animal, IRideable
{
public void Mount()
{
Debug.WriteLine("Climb the ladder");
}
public void Start()
{
Debug.WriteLine("Poke behind ears with toes");
}
}
public static class RideableExtensions
{
public static void Ride(this IRideable animal)
{
animal.Mount();
animal.Start();
}
}
public class WildHorse : Horse
{
public void Catch()
{
Debug.WriteLine("Catch the horse with lasso");
}
public override void Mount()
{
Debug.WriteLine("Swing onto back");
}
public override void Start()
{
Debug.WriteLine("ERROR: Horse already running");
}
}
public static class WildHorseExtensions
{
public static void Ride(this WildHorse horse)
{
horse.Catch();
horse.Mount();
// No need to start, the wild horse is already
// running for it's life when someoune mounts.
}
}
}
| modulexcite/coding.abel.nu | TestLib/Extensions/Animals.cs | C# | mit | 1,628 |
"""
SPLIF Fingerprints for molecular complexes.
"""
import logging
import itertools
import numpy as np
from deepchem.utils.hash_utils import hash_ecfp_pair
from deepchem.utils.rdkit_utils import load_complex
from deepchem.utils.rdkit_utils import compute_all_ecfp
from deepchem.utils.rdkit_utils import MoleculeLoadException
from deepchem.utils.rdkit_utils import compute_contact_centroid
from deepchem.feat import ComplexFeaturizer
from deepchem.utils.hash_utils import vectorize
from deepchem.utils.voxel_utils import voxelize
from deepchem.utils.voxel_utils import convert_atom_pair_to_voxel
from deepchem.utils.geometry_utils import compute_pairwise_distances
from deepchem.utils.geometry_utils import subtract_centroid
from typing import Tuple, Dict, List
logger = logging.getLogger(__name__)
SPLIF_CONTACT_BINS = [(0, 2.0), (2.0, 3.0), (3.0, 4.5)]
def compute_splif_features_in_range(frag1: Tuple,
frag2: Tuple,
pairwise_distances: np.ndarray,
contact_bin: List,
ecfp_degree: int = 2) -> Dict:
"""Computes SPLIF features for close atoms in molecular complexes.
Finds all frag1 atoms that are > contact_bin[0] and <
contact_bin[1] away from frag2 atoms. Then, finds the ECFP
fingerprints for the contacting atoms. Returns a dictionary
mapping (frag1_index_i, frag2_index_j) --> (frag1_ecfp_i,
frag2_ecfp_j)
Parameters
----------
frag1: Tuple
A tuple of (coords, mol) returned by `load_molecule`.
frag2: Tuple
A tuple of (coords, mol) returned by `load_molecule`.
contact_bins: np.ndarray
Ranges of pair distances which are placed in separate bins.
pairwise_distances: np.ndarray
Array of pairwise fragment-fragment distances (Angstroms)
ecfp_degree: int
ECFP radius
"""
contacts = np.nonzero((pairwise_distances > contact_bin[0]) &
(pairwise_distances < contact_bin[1]))
frag1_atoms = set([int(c) for c in contacts[0].tolist()])
frag1_ecfp_dict = compute_all_ecfp(
frag1[1], indices=frag1_atoms, degree=ecfp_degree)
frag2_ecfp_dict = compute_all_ecfp(frag2[1], degree=ecfp_degree)
splif_dict = {
contact: (frag1_ecfp_dict[contact[0]], frag2_ecfp_dict[contact[1]])
for contact in zip(contacts[0], contacts[1])
}
return splif_dict
def featurize_splif(frag1, frag2, contact_bins, pairwise_distances,
ecfp_degree):
"""Computes SPLIF featurization of fragment interactions binding pocket.
For each contact range (i.e. 1 A to 2 A, 2 A to 3 A, etc.)
compute a dictionary mapping (frag1_index_i, frag2_index_j)
tuples --> (frag1_ecfp_i, frag2_ecfp_j) tuples. Return a
list of such splif dictionaries.
Parameters
----------
frag1: Tuple
A tuple of (coords, mol) returned by `load_molecule`.
frag2: Tuple
A tuple of (coords, mol) returned by `load_molecule`.
contact_bins: np.ndarray
Ranges of pair distances which are placed in separate bins.
pairwise_distances: np.ndarray
Array of pairwise fragment-fragment distances (Angstroms)
ecfp_degree: int
ECFP radius, the graph distance at which fragments are computed.
Returns
-------
Dictionaries of SPLIF interactions suitable for `vectorize` or
`voxelize`.
"""
splif_dicts = []
for i, contact_bin in enumerate(contact_bins):
splif_dicts.append(
compute_splif_features_in_range(frag1, frag2, pairwise_distances,
contact_bin, ecfp_degree))
return splif_dicts
class SplifFingerprint(ComplexFeaturizer):
"""Computes SPLIF Fingerprints for a macromolecular complex.
SPLIF fingerprints are based on a technique introduced in the
following paper.
Da, C., and D. Kireev. "Structural protein–ligand interaction
fingerprints (SPLIF) for structure-based virtual screening:
method and benchmark study." Journal of chemical information
and modeling 54.9 (2014): 2555-2561.
SPLIF fingerprints are a subclass of `ComplexFeaturizer`. It
requires 3D coordinates for a molecular complex. For each ligand
atom, it identifies close pairs of atoms from different molecules.
These atom pairs are expanded to 2D circular fragments and a
fingerprint for the union is turned on in the bit vector. Note that
we slightly generalize the original paper by not requiring the
interacting molecules to be proteins or ligands.
This is conceptually pretty similar to
`ContactCircularFingerprint` but computes ECFP fragments only
for direct contacts instead of the entire contact region.
For a macromolecular complex, returns a vector of shape
`(len(contact_bins)*size,)`
"""
def __init__(self, contact_bins=None, radius=2, size=8):
"""
Parameters
----------
contact_bins: list[tuple]
List of contact bins. If not specified is set to default
`[(0, 2.0), (2.0, 3.0), (3.0, 4.5)]`.
radius : int, optional (default 2)
Fingerprint radius used for circular fingerprints.
size: int, optional (default 8)
Length of generated bit vector.
"""
if contact_bins is None:
self.contact_bins = SPLIF_CONTACT_BINS
else:
self.contact_bins = contact_bins
self.size = size
self.radius = radius
def _featurize(self, datapoint, **kwargs):
"""
Compute featurization for a molecular complex
Parameters
----------
datapoint: Tuple[str, str]
Filenames for molecule and protein.
"""
if 'complex' in kwargs:
datapoint = kwargs.get("complex")
raise DeprecationWarning(
'Complex is being phased out as a parameter, please pass "datapoint" instead.'
)
try:
fragments = load_complex(datapoint, add_hydrogens=False)
except MoleculeLoadException:
logger.warning("This molecule cannot be loaded by Rdkit. Returning None")
return None
pairwise_features = []
# We compute pairwise contact fingerprints
for (frag1, frag2) in itertools.combinations(fragments, 2):
# Get coordinates
distances = compute_pairwise_distances(frag1[0], frag2[0])
# distances = compute_pairwise_distances(prot_xyz, lig_xyz)
vectors = [
vectorize(hash_ecfp_pair, feature_dict=splif_dict,
size=self.size) for splif_dict in featurize_splif(
frag1, frag2, self.contact_bins, distances, self.radius)
]
pairwise_features += vectors
pairwise_features = np.concatenate(pairwise_features)
return pairwise_features
class SplifVoxelizer(ComplexFeaturizer):
"""Computes SPLIF voxel grid for a macromolecular complex.
SPLIF fingerprints are based on a technique introduced in the
following paper [1]_.
The SPLIF voxelizer localizes local SPLIF descriptors in
space, by assigning features to the voxel in which they
originated. This technique may be useful for downstream
learning methods such as convolutional networks.
Featurizes a macromolecular complex into a tensor of shape
`(voxels_per_edge, voxels_per_edge, voxels_per_edge, size)`
where `voxels_per_edge = int(box_width/voxel_width)`.
References
----------
.. [1] Da, C., and D. Kireev. "Structural protein–ligand interaction
fingerprints (SPLIF) for structure-based virtual screening:
method and benchmark study." Journal of chemical information
and modeling 54.9 (2014): 2555-2561.
"""
def __init__(self,
cutoff: float = 4.5,
contact_bins: List = None,
radius: int = 2,
size: int = 8,
box_width: float = 16.0,
voxel_width: float = 1.0):
"""
Parameters
----------
cutoff: float (default 4.5)
Distance cutoff in angstroms for molecules in complex.
contact_bins: list[tuple]
List of contact bins. If not specified is set to default
`[(0, 2.0), (2.0, 3.0), (3.0, 4.5)]`.
radius : int, optional (default 2)
Fingerprint radius used for circular fingerprints.
size: int, optional (default 8)
Length of generated bit vector.
box_width: float, optional (default 16.0)
Size of a box in which voxel features are calculated. Box
is centered on a ligand centroid.
voxel_width: float, optional (default 1.0)
Size of a 3D voxel in a grid.
"""
self.cutoff = cutoff
if contact_bins is None:
self.contact_bins = SPLIF_CONTACT_BINS
else:
self.contact_bins = contact_bins
self.size = size
self.radius = radius
self.box_width = box_width
self.voxel_width = voxel_width
self.voxels_per_edge = int(self.box_width / self.voxel_width)
def _featurize(self, datapoint, **kwargs):
"""
Compute featurization for a molecular complex
Parameters
----------
datapoint: Tuple[str, str]
Filenames for molecule and protein.
"""
if 'complex' in kwargs:
datapoint = kwargs.get("complex")
raise DeprecationWarning(
'Complex is being phased out as a parameter, please pass "datapoint" instead.'
)
try:
fragments = load_complex(datapoint, add_hydrogens=False)
except MoleculeLoadException:
logger.warning("This molecule cannot be loaded by Rdkit. Returning None")
return None
pairwise_features = []
# We compute pairwise contact fingerprints
centroid = compute_contact_centroid(fragments, cutoff=self.cutoff)
for (frag1, frag2) in itertools.combinations(fragments, 2):
distances = compute_pairwise_distances(frag1[0], frag2[0])
frag1_xyz = subtract_centroid(frag1[0], centroid)
frag2_xyz = subtract_centroid(frag2[0], centroid)
xyzs = [frag1_xyz, frag2_xyz]
pairwise_features.append(
np.concatenate(
[
voxelize(
convert_atom_pair_to_voxel,
hash_function=hash_ecfp_pair,
coordinates=xyzs,
box_width=self.box_width,
voxel_width=self.voxel_width,
feature_dict=splif_dict,
nb_channel=self.size)
for splif_dict in featurize_splif(
frag1, frag2, self.contact_bins, distances, self.radius)
],
axis=-1))
# Features are of shape (voxels_per_edge, voxels_per_edge, voxels_per_edge, 1) so we should concatenate on the last axis.
return np.concatenate(pairwise_features, axis=-1)
| deepchem/deepchem | deepchem/feat/complex_featurizers/splif_fingerprints.py | Python | mit | 10,535 |
export default class UTTTError extends Error {
constructor(message: string, private code: number) {
super(message);
this.code = code;
}
} | socialgorithm/ultimate-ttt-js | src/model/UTTTError.ts | TypeScript | mit | 163 |
package com.example.hellorammus;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class HelloBMI extends Activity {
protected static final String TAG = "HelloBMI";
private static final int BMI_CALCULATE = 123;
private static final int BMI_RETURN = 111;
private TextView tv1, tv2;
private EditText et1, et2;
private Button btn, btnHome, btnBMI, btnAbout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bmi);
tv1 = (TextView) findViewById(R.id.bmi_textView3);
tv2 = (TextView) findViewById(R.id.bmi_textView4);
et1 = (EditText) findViewById(R.id.bmi_editText1);
et2 = (EditText) findViewById(R.id.bmi_editText2);
et1.setText("190");
et2.setText("75");
btn = (Button) findViewById(R.id.bmi_button1);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
Intent intent = new Intent();
intent.setClass(HelloBMI.this, BMICheck.class);
Bundle b = new Bundle();
b.putDouble("KEY_HEIGHT",
Double.valueOf(et1.getText().toString()) / 100);
b.putDouble("KEY_WEIGHT",
Double.valueOf(et2.getText().toString()));
intent.putExtras(b);
startActivityForResult(intent, 123);
} catch (Exception e) {
Log.e(TAG, e.toString());
}
}
});
btnHome = (Button) findViewById(R.id.navigation_buttonHome);
btnHome.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
Intent intent = new Intent(getApplicationContext(),
HelloRammus.class);
startActivity(intent);
finish();
} catch (Exception e) {
Log.e(TAG, e.toString());
}
}
});
btnBMI = (Button) findViewById(R.id.navigation_buttonBMI);
btnBMI.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
Intent intent = new Intent(getApplicationContext(),
HelloBMI.class);
startActivity(intent);
finish();
} catch (Exception e) {
Log.e(TAG, e.toString());
}
}
});
btnBMI.setEnabled(false);
btnAbout = (Button) findViewById(R.id.navigation_buttonAbout);
btnAbout.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
Intent intent = new Intent(getApplicationContext(),
AboutActivity.class);
startActivity(intent);
finish();
} catch (Exception e) {
Log.e(TAG, e.toString());
}
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case BMI_CALCULATE:
switch (resultCode) {
case BMI_RETURN:
if (data != null) {
tv1.setText(getString(R.string.label_bmi)
+ data.getExtras().getString("KEY_RESULT_BMI"));
tv2.setText(getString(R.string.label_BMIresult)
+ data.getExtras().getString("KEY_RESULT"));
}
break;
default:
break;
}
break;
default:
break;
}
}
}
| uunchpgney/HelloRammus | HelloRammus/src/com/example/hellorammus/HelloBMI.java | Java | mit | 3,521 |
package io.sniffy.test.testng;
import io.sniffy.Sniffy;
import io.sniffy.SniffyAssertionError;
import io.sniffy.Spy;
import io.sniffy.configuration.SniffyConfiguration;
import io.sniffy.registry.ConnectionsRegistry;
import io.sniffy.socket.*;
import io.sniffy.sql.SqlExpectation;
import io.sniffy.sql.SqlQueries;
import io.sniffy.test.AnnotationProcessor;
import io.sniffy.util.ExceptionUtil;
import io.sniffy.util.Range;
import org.testng.IInvokedMethod;
import org.testng.IInvokedMethodListener;
import org.testng.ITestResult;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.List;
/**
* Provides integration with TestNG. Add {@code SniffyTestNgListener} as a listener to your TestNG test:
* <pre>
* <code>
* {@literal @}Listeners(SniffyTestNgListener.class)
* public class SampleTestNgTestSuite {
* // ... here goes some test methods
* }
* </code>
* </pre>
* @see SocketExpectations
* @see SocketExpectation
* @see NoSocketsAllowed
* @since 3.1
*/
public class SniffyTestNgListener implements IInvokedMethodListener {
private static final String SPY_ATTRIBUTE_NAME = "spy";
private static final String DISABLE_SOCKETS_ATTRIBUTE_NAME = "disableSockets";
static {
SniffyConfiguration.INSTANCE.setMonitorSocket(true);
SniffyConfiguration.INSTANCE.setMonitorNio(true);
Sniffy.initialize();
}
private static void fail(ITestResult testResult, String message) {
testResult.setStatus(ITestResult.FAILURE);
IllegalArgumentException throwable = new IllegalArgumentException(message);
testResult.setThrowable(throwable);
throw throwable;
}
public void beforeInvocation(IInvokedMethod invokedMethod, ITestResult testResult) {
Method method = invokedMethod.getTestMethod().getConstructorOrMethod().getMethod();
List<SqlExpectation> sqlExpectationList = null;
try {
sqlExpectationList = AnnotationProcessor.buildSqlExpectationList(method);
} catch (IllegalArgumentException e) {
fail(testResult, e.getMessage());
}
List<SocketExpectation> socketExpectationList = null;
try {
socketExpectationList = AnnotationProcessor.buildSocketExpectationList(method);
} catch (IllegalArgumentException e) {
fail(testResult, e.getMessage());
}
if ((null != sqlExpectationList && !sqlExpectationList.isEmpty()) ||
(null != socketExpectationList && !socketExpectationList.isEmpty())) {
Spy spy = Sniffy.spy();
if (null != sqlExpectationList) {
for (SqlExpectation sqlExpectation : sqlExpectationList) {
spy = spy.expect(new SqlQueries.SqlExpectation(
Range.parse(sqlExpectation.count()).min,
Range.parse(sqlExpectation.count()).max,
Range.parse(sqlExpectation.rows()).min,
Range.parse(sqlExpectation.rows()).max,
sqlExpectation.threads(),
sqlExpectation.query()
));
}
}
if (null != socketExpectationList) {
for (SocketExpectation socketExpectation : socketExpectationList) {
spy = spy.expect(new TcpConnections.TcpExpectation(
Range.parse(socketExpectation.connections()).min,
Range.parse(socketExpectation.connections()).max,
socketExpectation.threads(),
"".equals(socketExpectation.hostName()) ?
null :
AddressMatchers.exactAddressMatcher(socketExpectation.hostName())
));
}
}
testResult.setAttribute(SPY_ATTRIBUTE_NAME, spy);
}
DisableSockets disableSockets = AnnotationProcessor.getAnnotationRecursive(method, DisableSockets.class);
if (null != disableSockets) {
ConnectionsRegistry.INSTANCE.setSocketAddressStatus(null, null, -1);
testResult.setAttribute(DISABLE_SOCKETS_ATTRIBUTE_NAME, disableSockets);
}
}
public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
Object spyAttribute = testResult.getAttribute(SPY_ATTRIBUTE_NAME);
if (null != spyAttribute) {
Spy spy = (Spy) spyAttribute;
try {
spy.close();
} catch (SniffyAssertionError sniffyError) {
testResult.setStatus(ITestResult.FAILURE);
Throwable throwable = testResult.getThrowable();
if (null != throwable) {
if (!ExceptionUtil.addSuppressed(throwable, sniffyError)) {
sniffyError.printStackTrace();
}
} else {
throwable = sniffyError;
}
testResult.setThrowable(throwable);
}
testResult.removeAttribute(SPY_ATTRIBUTE_NAME);
}
Object disableSockets = testResult.getAttribute(DISABLE_SOCKETS_ATTRIBUTE_NAME);
testResult.removeAttribute(DISABLE_SOCKETS_ATTRIBUTE_NAME);
if (null != disableSockets) {
ConnectionsRegistry.INSTANCE.clear();
}
}
}
| sniffy/sniffy | sniffy-test/sniffy-testng/src/main/java/io/sniffy/test/testng/SniffyTestNgListener.java | Java | mit | 5,637 |
Initiates a new script execution of shell commands.
## Dependencies
This playbook uses the following sub-playbooks, integrations, and scripts.
### Sub-playbooks
* Cortex XDR - Check Action Status
### Integrations
* CortexXDRIR
### Scripts
This playbook does not use any scripts.
### Commands
* xdr-get-script-execution-results
* xdr-run-script-execute-commands
## Playbook Inputs
---
| **Name** | **Description** | **Default Value** | **Required** |
| --- | --- | --- | --- |
| endpoint_ids | A comma-separated list of endpoint IDs. | | Optional |
| commands | A comma-separated list of shell commands to execute. | | Optional |
| script_timeout | The timeout in seconds for this execution.<br/>\(Default is: '600'\) | | Optional |
| polling_timeout | Amount of time to poll action status before declaring a timeout and resuming the playbook \(in minutes\). | 10 | Optional |
## Playbook Outputs
---
There are no outputs for this playbook.
## Playbook Image
---
 | demisto/content | Packs/CortexXDR/Playbooks/playbook-Cortex_XDR_-_execute_commands_README.md | Markdown | mit | 1,158 |
import { ICompilerOptions } from '../compilerOptions/interfaces';
import { transformModule } from './core/transformModule';
import { generate } from './generator/generator';
import { ASTNode } from './interfaces/AST';
import { ITransformer, ITransformerCommon } from './interfaces/ITransformer';
import { ITransformerRequireStatementCollection } from './interfaces/ITransformerRequireStatements';
import { ImportType } from './interfaces/ImportType';
import { parseTypeScript } from './parser';
import { ISerializableTransformationContext } from './transformer';
function cleanupForTest(node) {
delete node.loc;
delete node.raw;
delete node.range;
}
export function initCommonTransform(props: {
code: string;
compilerOptions?: ICompilerOptions;
jsx?: boolean;
props?: ISerializableTransformationContext;
transformers: Array<ITransformer>;
}) {
const requireStatementCollection: ITransformerRequireStatementCollection = [];
function onRequireCallExpression(importType: ImportType, statement: ASTNode) {
// making sure we have haven't emitted the same property twice
if (!statement['emitted']) {
Object.defineProperty(statement, 'emitted', { enumerable: false, value: true });
cleanupForTest(statement.arguments[0]);
cleanupForTest(statement);
cleanupForTest(statement.callee);
requireStatementCollection.push({ importType, statement });
}
}
const ast = parseTypeScript(props.code, { jsx: props.jsx });
const userProps: ISerializableTransformationContext = props.props || {};
userProps.compilerOptions = props.compilerOptions || {};
const visitorProps: ITransformerCommon = { onRequireCallExpression, transformationContext: userProps };
const tranformers = [];
for (const t of props.transformers) {
if (t.commonVisitors) {
tranformers.push(t.commonVisitors(visitorProps));
}
}
transformModule({ root: ast, transformers: tranformers });
const res = generate(ast, {});
return { code: res, requireStatementCollection };
}
| rs3d/fuse-box | src/compiler/testUtils.ts | TypeScript | mit | 2,022 |
import {Component} from '@angular/core';
@Component({
selector: 'ng2vd-progressbar-labels',
templateUrl: './progressbar-labels.html',
styles: [`
ng2v-progressbar {
margin-top: 5rem;
}
`]
})
export class Ng2vdProgressbarLabels {
}
| rajkeshwar/ng2v | demo/src/app/components/progressbar/demos/labels/progressbar-labels.ts | TypeScript | mit | 253 |
#include <stdio.h>
#include <math.h>
void integerPower(int y, int *base1, int *base2, int *base3, int *total) {
*base1 = pow(y, 2);
*base2 = pow(y, 3);
*base3 = pow(y, 4);
*total = *base1 + *base2 + *base3;
}
int main(void) {
int base1, base2, base3, total;
integerPower(5, &base1, &base2, &base3, &total);
printf("%d\n", base1);
printf("%d\n", base2);
printf("%d\n", base3);
printf("%d\n", total);
}
//https://pt.stackoverflow.com/q/171149/101
| bigown/SOpt | C/Function/ReturnMatrix3.c | C | mit | 470 |
require 'rails_helper'
describe CommentsController do
describe "routing" do
it "routes to #showcomment" do
expect(get("/comments/showcomment")).to route_to("comments#showcomment")
end
it "routes to #activity_comment" do
expect(post("/todos/1/comments/activity_comment")).to route_to("comments#activity_comment", todo_id: "1")
expect(post("/discussions/1/comments/activity_comment")).to route_to("comments#activity_comment", discussion_id: "1")
expect(post("/posts/1/comments/activity_comment")).to route_to("comments#activity_comment", post_id: "1")
expect(post("/questions/1/comments/activity_comment")).to route_to("comments#activity_comment", question_id: "1")
expect(post("/answers/1/comments/activity_comment")).to route_to("comments#activity_comment", answer_id: "1")
end
end
end
| srisa/teamroq | spec/routing/comments_routing_spec.rb | Ruby | mit | 850 |
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\Resolution\Reports;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Resolution\Columns\Configuration;
class GetConfiguration extends Base
{
protected function init()
{
parent::init();
$this->dimension = new Configuration();
$this->name = Piwik::translate('Resolution_WidgetGlobalVisitors');
$this->documentation = Piwik::translate('Resolution_WidgetGlobalVisitorsDocumentation', '<br />');
$this->order = 7;
$this->widgetTitle = 'Resolution_WidgetGlobalVisitors';
}
public function configureView(ViewDataTable $view)
{
$this->getBasicResolutionDisplayProperties($view);
$view->config->addTranslation('label', $this->dimension->getName());
$view->requestConfig->filter_limit = 3;
}
public function getRelatedReports()
{
return array(
new GetResolution()
);
}
}
| sunwooz/blogcog-piwik | vendor/piwik/piwik/plugins/Resolution/Reports/GetConfiguration.php | PHP | mit | 1,115 |
<a href='https://github.com/angular/angular.js/edit/v1.4.x/docs/content/guide/migration.ngdoc?message=docs(guide%2FMigrating from Previous Versions)%3A%20describe%20your%20change...' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit"> </i>Improve this Doc</a>
<p>Minor version releases in AngularJS introduce several breaking changes that may require changes to your
application's source code; for instance from 1.0 to 1.2 and from 1.2 to 1.3.</p>
<p>Although we try to avoid breaking changes, there are some cases where it is unavoidable.</p>
<ul>
<li>AngularJS has undergone thorough security reviews to make applications safer by default,
which drives many of these changes.</li>
<li>Several new features, especially animations, would not be possible without a few changes.</li>
<li>Finally, some outstanding bugs were best fixed by changing an existing API.</li>
</ul>
<h1 id="migrating-from-1-2-to-1-3">Migrating from 1.2 to 1.3</h1>
<h2 id="angular-expression-parsing-parse-interpolate-">Angular Expression Parsing (<code>$parse</code> + <code>$interpolate</code>)</h2>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/77ada4c82d6b8fc6d977c26f3cdb48c2f5fbe5a5">77ada4c8</a>,</li>
</ul>
<p>You can no longer invoke .bind, .call or .apply on a function in angular expressions.
This is to disallow changing the behaviour of existing functions
in an unforeseen fashion.</p>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/6081f20769e64a800ee8075c168412b21f026d99">6081f207</a>,</li>
</ul>
<p>The (deprecated) <strong>proto</strong> property does not work inside angular expressions
anymore.</p>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/48fa3aadd546036c7e69f71046f659ab1de244c6">48fa3aad</a>,</li>
</ul>
<p>This prevents the use of <strong>{define,lookup}{Getter,Setter}</strong> inside angular
expressions. If you really need them for some reason, please wrap/bind them to make them
less dangerous, then make them available through the scope object.</p>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/528be29d1662122a34e204dd607e1c0bd9c16bbc">528be29d</a>,</li>
</ul>
<p>This prevents the use of <code>Object</code> inside angular expressions.
If you need Object.keys, make it accessible in the scope.</p>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/bdfc9c02d021e08babfbc966a007c71b4946d69d">bdfc9c02</a>,
values 'f', '0', 'false', 'no', 'n', '[]' are no longer
treated as falsy. Only JavaScript falsy values are now treated as falsy by the
expression parser; there are six of them: false, null, undefined, NaN, 0 and "".</li>
</ul>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/fa6e411da26824a5bae55f37ce7dbb859653276d">fa6e411d</a>,
promise unwrapping has been removed. It has been deprecated since 1.2.0-rc.3.
It can no longer be turned on.
Two methods have been removed:<ul>
<li><code>$parseProvider.unwrapPromises</code></li>
<li><code>$parseProvider.logPromiseWarnings</code></li>
</ul>
</li>
</ul>
<ul>
<li><p><strong>$interpolate:</strong> due to <a href="https://github.com/angular/angular.js/commit/88c2193c71954b9e7e7e4bdf636a2b168d36300d">88c2193c</a>,
the function returned by <code>$interpolate</code>
no longer has a <code>.parts</code> array set on it.</p>
<p>Instead it has two arrays:</p>
<ul>
<li><code>.expressions</code>, an array of the expressions in the
interpolated text. The expressions are parsed with
<code>$parse</code>, with an extra layer converting them to strings
when computed</li>
<li><code>.separators</code>, an array of strings representing the
separations between interpolations in the text.
This array is <strong>always</strong> 1 item longer than the
<code>.expressions</code> array for easy merging with it</li>
</ul>
</li>
</ul>
<h2 id="miscellaneous-angular-helpers">Miscellaneous Angular helpers</h2>
<ul>
<li><strong>Angular.copy:</strong> due to <a href="https://github.com/angular/angular.js/commit/b59b04f98a0b59eead53f6a53391ce1bbcbe9b57">b59b04f9</a>,</li>
</ul>
<p>This changes <code>angular.copy</code> so that it applies the prototype of the original
object to the copied object. Previously, <code>angular.copy</code> would copy properties
of the original object's prototype chain directly onto the copied object.</p>
<p>This means that if you iterate over only the copied object's <code>hasOwnProperty</code>
properties, it will no longer contain the properties from the prototype.
This is actually much more reasonable behaviour and it is unlikely that
applications are actually relying on this.</p>
<p>If this behaviour is relied upon, in an app, then one should simply iterate
over all the properties on the object (and its inherited properties) and
not filter them with <code>hasOwnProperty</code>.</p>
<p><strong>Be aware that this change also uses a feature that is not compatible with
IE8.</strong> If you need this to work on IE8 then you would need to provide a polyfill
for <code>Object.create</code> and <code>Object.getPrototypeOf</code>.</p>
<ul>
<li><strong>forEach:</strong> due to <a href="https://github.com/angular/angular.js/commit/55991e33af6fece07ea347a059da061b76fc95f5">55991e33</a>,
forEach will iterate only over the initial number of items in
the array. So if items are added to the array during the iteration, these won't
be iterated over during the initial forEach call.</li>
</ul>
<p>This change also makes our forEach behave more like Array#forEach.</p>
<ul>
<li><strong>angular.toJson:</strong> due to <a href="https://github.com/angular/angular.js/commit/c054288c9722875e3595e6e6162193e0fb67a251">c054288c</a>,</li>
</ul>
<p>If you expected <code>toJson</code> to strip these types of properties before, you will have to
manually do this yourself now.</p>
<h2 id="jqlite-jquery">jqLite / JQuery</h2>
<ul>
<li><strong>jqLite:</strong> due to <a href="https://github.com/angular/angular.js/commit/a196c8bca82a28c08896d31f1863cf4ecd11401c">a196c8bc</a>,
previously it was possible to set jqLite data on Text/Comment
nodes, but now that is allowed only on Element and Document nodes just like in
jQuery. We don't expect that app code actually depends on this accidental feature.</li>
</ul>
<ul>
<li><strong>jqLite:</strong> due to <a href="https://github.com/angular/angular.js/commit/d71dbb1ae50f174680533492ce4c7db3ff74df00">d71dbb1a</a>,
the jQuery <code>detach()</code> method does not trigger the <code>$destroy</code> event.
If you want to destroy Angular data attached to the element, use <code>remove()</code>.</li>
</ul>
<h2 id="angular-html-compiler-compile-">Angular HTML Compiler (<code>$compile</code>)</h2>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/2ee29c5da81ffacdc1cabb438f5d125d5e116cb9">2ee29c5d</a>,</li>
</ul>
<p>The isolated scope of a component directive no longer leaks into the template
that contains the instance of the directive. This means that you can no longer
access the isolated scope from attributes on the element where the isolated
directive is defined.</p>
<p>See <a href="https://github.com/angular/angular.js/issues/10236">https://github.com/angular/angular.js/issues/10236</a> for an example.</p>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/2cde927e58c8d1588569d94a797e43cdfbcedaf9">2cde927e</a>,</li>
</ul>
<p>Requesting isolate scope and any other scope on a single element is an error.
Before this change, the compiler let two directives request a child scope
and an isolate scope if the compiler applied them in the order of non-isolate
scope directive followed by isolate scope directive.</p>
<p>Now the compiler will error regardless of the order.</p>
<p>If you find that your code is now throwing a <code>$compile:multidir</code> error,
check that you do not have directives on the same element that are trying
to request both an isolate and a non-isolate scope and fix your code.</p>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/eec6394a342fb92fba5270eee11c83f1d895e9fb">eec6394a</a>, The <code>replace</code> flag for defining directives that
replace the element that they are on will be removed in the next major angular version.
This feature has difficult semantics (e.g. how attributes are merged) and leads to more
problems compared to what it solves. Also, with Web Components it is normal to have
custom elements in the DOM.</li>
</ul>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/299b220f5e05e1d4e26bfd58d0b2fd7329ca76b1">299b220f</a>,
calling <code>attr.$observe</code> no longer returns the observer function, but a
deregistration function instead. To migrate the code follow the example below:</li>
</ul>
<p>Before:</p>
<pre><code>directive('directiveName', function() {
return {
link: function(scope, elm, attr) {
var observer = attr.$observe('someAttr', function(value) {
console.log(value);
});
}
};
});
</code></pre>
<p>After:</p>
<pre><code>directive('directiveName', function() {
return {
link: function(scope, elm, attr) {
var observer = function(value) {
console.log(value);
};
attr.$observe('someAttr', observer);
}
};
});
</code></pre>
<h2 id="forms-inputs-and-ngmodel">Forms, Inputs and ngModel</h2>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/1be9bb9d3527e0758350c4f7417a4228d8571440">1be9bb9d</a>,</li>
</ul>
<p>If an expression is used on ng-pattern (such as <code>ng-pattern="exp"</code>) or on the
pattern attribute (something like on <code>pattern="{{ exp }}"</code>) and the expression
itself evaluates to a string then the validator will not parse the string as a
literal regular expression object (a value like <code>/abc/i</code>). Instead, the entire
string will be created as the regular expression to test against. This means
that any expression flags will not be placed on the RegExp object. To get around
this limitation, use a regular expression object as the value for the expression.</p>
<pre><code>//before
$scope.exp = '/abc/i';
//after
$scope.exp = /abc/i;
</code></pre>
<ul>
<li><strong>ngModelOptions:</strong> due to <a href="https://github.com/angular/angular.js/commit/adfc322b04a58158fb9697e5b99aab9ca63c80bb">adfc322b</a>,</li>
</ul>
<p>This commit changes the API on <code>NgModelController</code>, both semantically and
in terms of adding and renaming methods.</p>
<ul>
<li><code>$setViewValue(value)</code> -
This method still changes the <code>$viewValue</code> but does not immediately commit this
change through to the <code>$modelValue</code> as it did previously.
Now the value is committed only when a trigger specified in an associated
<code>ngModelOptions</code> directive occurs. If <code>ngModelOptions</code> also has a <code>debounce</code> delay
specified for the trigger then the change will also be debounced before being
committed.
In most cases this should not have a significant impact on how <code>NgModelController</code>
is used: If <code>updateOn</code> includes <code>default</code> then <code>$setViewValue</code> will trigger
a (potentially debounced) commit immediately.</li>
<li><code>$cancelUpdate()</code> - is renamed to <code>$rollbackViewValue()</code> and has the same meaning,
which is to revert the current <code>$viewValue</code> back to the <code>$lastCommittedViewValue</code>,
to cancel any pending debounced updates and to re-render the input.</li>
</ul>
<p>To migrate code that used <code>$cancelUpdate()</code> follow the example below:</p>
<p>Before:</p>
<pre><code class="lang-js">$scope.resetWithCancel = function (e) {
if (e.keyCode == 27) {
$scope.myForm.myInput1.$cancelUpdate();
$scope.myValue = '';
}
};
</code></pre>
<p>After:</p>
<pre><code class="lang-js">$scope.resetWithCancel = function (e) {
if (e.keyCode == 27) {
$scope.myForm.myInput1.$rollbackViewValue();
$scope.myValue = '';
}
}
</code></pre>
<ul>
<li>types date, time, datetime-local, month, week now always
require a <code>Date</code> object as model (<a href="https://github.com/angular/angular.js/commit/46bd6dc88de252886d75426efc2ce8107a5134e9">46bd6dc8</a>,
<a href="https://github.com/angular/angular.js/issues/5864">#5864</a>)</li>
</ul>
<h2 id="scopes-and-digests-scope-">Scopes and Digests (<code>$scope</code>)</h2>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/8c6a8171f9bdaa5cdabc0cc3f7d3ce10af7b434d">8c6a8171</a>,
Scope#$id is now of type number rather than string. Since the
id is primarily being used for debugging purposes this change should not affect
anyone.</li>
</ul>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/82f45aee5bd84d1cc53fb2e8f645d2263cdaacbc">82f45aee</a>,
<a href="https://github.com/angular/angular.js/issues/7445">#7445</a>,
<a href="https://github.com/angular/angular.js/issues/7523">#7523</a>
<code>$broadcast</code> and <code>$emit</code> will now reset the <code>currentScope</code> property of the event to
null once the event finished propagating. If any code depends on asynchronously accessing their
<code>currentScope</code> property, it should be migrated to use <code>targetScope</code> instead. All of these cases
should be considered programming bugs.</li>
</ul>
<h2 id="server-requests-http-resource-">Server Requests (<code>$http</code>, <code>$resource</code>)</h2>
<ul>
<li><strong>$http:</strong> due to <a href="https://github.com/angular/angular.js/commit/ad4336f9359a073e272930f8f9bcd36587a8648f">ad4336f9</a>,</li>
</ul>
<p>Previously, it was possible to register a response interceptor like so:</p>
<pre><code class="lang-js">// register the interceptor as a service
$provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
return function(promise) {
return promise.then(function(response) {
// do something on success
return response;
}, function(response) {
// do something on error
if (canRecover(response)) {
return responseOrNewPromise
}
return $q.reject(response);
});
}
});
$httpProvider.responseInterceptors.push('myHttpInterceptor');
</code></pre>
<p>Now, one must use the newer API introduced in v1.1.4 (4ae46814), like so:</p>
<pre><code class="lang-js">$provide.factory('myHttpInterceptor', function($q) {
return {
response: function(response) {
// do something on success
return response;
},
responseError: function(response) {
// do something on error
if (canRecover(response)) {
return responseOrNewPromise
}
return $q.reject(response);
}
};
});
$httpProvider.interceptors.push('myHttpInterceptor');
</code></pre>
<p>More details on the new interceptors API (which has been around as of v1.1.4) can be found at
<a href="api/ng/service/$http#interceptors">interceptors</a></p>
<ul>
<li><strong>$httpBackend:</strong> due to <a href="https://github.com/angular/angular.js/commit/6680b7b97c0326a80bdccaf0a35031e4af641e0e">6680b7b9</a>, the JSONP behavior for erroneous and empty responses changed:
Previously, a JSONP response was regarded as erroneous if it was empty. Now Angular is listening to the
correct events to detect errors, i.e. even empty responses can be successful.</li>
</ul>
<ul>
<li><p><strong>$resource:</strong> due to <a href="https://github.com/angular/angular.js/commit/d3c50c845671f0f8bcc3f7842df9e2fb1d1b1c40">d3c50c84</a>,</p>
<p>If you expected <code>$resource</code> to strip these types of properties before,
you will have to manually do this yourself now.</p>
</li>
</ul>
<h2 id="modules-and-injector-inject-">Modules and Injector (<code>$inject</code>)</h2>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/c0b4e2db9cbc8bc3164cedc4646145d3ab72536e">c0b4e2db</a>,</li>
</ul>
<p>Previously, config blocks would be able to control behaviour of provider registration, due to being
invoked prior to provider registration. Now, provider registration always occurs prior to configuration
for a given module, and therefore config blocks are not able to have any control over a providers
registration.</p>
<p><strong>Example</strong>:</p>
<p>Previously, the following:</p>
<pre><code class="lang-js">angular.module('foo', [])
.provider('$rootProvider', function() {
this.$get = function() { ... }
})
.config(function($rootProvider) {
$rootProvider.dependentMode = "B";
})
.provider('$dependentProvider', function($rootProvider) {
if ($rootProvider.dependentMode === "A") {
this.$get = function() {
// Special mode!
}
} else {
this.$get = function() {
// something else
}
}
});
</code></pre>
<p>would have "worked", meaning behaviour of the config block between the registration of "$rootProvider"
and "$dependentProvider" would have actually accomplished something and changed the behaviour of the
app. This is no longer possible within a single module.</p>
<h2 id="animation-nganimate-">Animation (<code>ngAnimate</code>)</h2>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/1cb8584e8490ecdb1b410a8846c4478c6c2c0e53">1cb8584e</a>,
<code>$animate</code> will no longer default the after parameter to the last element of the parent
container. Instead, when after is not specified, the new element will be inserted as the
first child of the parent container.</li>
</ul>
<p>To update existing code, change all instances of <code>$animate.enter()</code> or <code>$animate.move()</code> from:</p>
<p><code>$animate.enter(element, parent);</code></p>
<p>to:</p>
<p><code>$animate.enter(element, parent, angular.element(parent[0].lastChild));</code></p>
<ul>
<li><p>due to <a href="https://github.com/angular/angular.js/commit/1bebe36aa938890d61188762ed618b1b5e193634">1bebe36a</a>,</p>
<p>Any class-based animation code that makes use of transitions
and uses the setup CSS classes (such as class-add and class-remove) must now
provide a empty transition value to ensure that its styling is applied right
away. In other words if your animation code is expecting any styling to be
applied that is defined in the setup class then it will not be applied
"instantly" unless a <code>transition:0s none</code> value is present in the styling
for that CSS class. This situation is only the case if a transition is already
present on the base CSS class once the animation kicks off.</p>
</li>
</ul>
<p>Before:</p>
<pre><code>.animated.my-class-add {
opacity:0;
transition:0.5s linear all;
}
.animated.my-class-add.my-class-add-active {
opacity:1;
}
</code></pre>
<p>After:</p>
<pre><code>.animated.my-class-add {
transition:0s linear all;
opacity:0;
}
.animated.my-class-add.my-class-add-active {
transition:0.5s linear all;
opacity:1;
}
</code></pre>
<p>Please view the documentation for ngAnimate for more info.</p>
<h2 id="testing">Testing</h2>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/85880a64900fa22a61feb926bf52de0965332ca5">85880a64</a>, some deprecated features of
Protractor tests no longer work.</li>
</ul>
<p><code>by.binding(descriptor)</code> no longer allows using the surrounding interpolation
markers in the descriptor (the default interpolation markers are <code>{{}}</code>).
Previously, these were optional.</p>
<p>Before:</p>
<pre><code>var el = element(by.binding('{{foo}}'));
</code></pre>
<p>After:</p>
<pre><code>var el = element(by.binding('foo'));
</code></pre>
<p>Prefixes <code>ng_</code> and <code>x-ng-</code> are no longer allowed for models. Use <code>ng-model</code>.</p>
<p><code>by.repeater</code> cannot find elements by row and column which are not children of
the row. For example, if your template is</p>
<pre><code><div ng-repeat="foo in foos">{{foo.name}}</div>
</code></pre>
<p>Before:</p>
<pre><code>var el = element(by.repeater('foo in foos').row(2).column('foo.name'))
</code></pre>
<p>After:</p>
<p>You may either enclose <code>{{foo.name}}</code> in a child element</p>
<pre><code><div ng-repeat="foo in foos"><span>{{foo.name}}</span></div>
</code></pre>
<p>or simply use:</p>
<pre><code>var el = element(by.repeater('foo in foos').row(2))
</code></pre>
<h2 id="internet-explorer-8">Internet Explorer 8</h2>
<ul>
<li>due to <a href="https://github.com/angular/angular.js/commit/eaa1d00b24008f590b95ad099241b4003688cdda">eaa1d00b</a>,
As communicated before, IE8 is no longer supported.</li>
</ul>
<h1 id="migrating-from-1-0-to-1-2">Migrating from 1.0 to 1.2</h1>
<div class="alert alert-warning">
<p><strong>Note:</strong> AngularJS versions 1.1.x are considered "experimental" with breaking changes between minor releases.
Version 1.2 is the result of several versions on the 1.1 branch, and has a stable API.</p>
<p>If you have an application on 1.1 and want to migrate it to 1.2, everything in the guide
below should still apply, but you may want to consult the
<a href="https://github.com/angular/angular.js/blob/master/CHANGELOG.md">changelog</a> as well.</p>
</div>
<ul class="nav nav-list">
<li class="nav-header">Summary of Breaking Changes</li>
<li><a href="guide/migration#ngroute-has-been-moved-into-its-own-module">ngRoute has been moved into its own module</a></li>
<li><a href="guide/migration#templates-no-longer-automatically-unwrap-promises">Templates no longer automatically unwrap promises</a></li>
<li><a href="guide/migration#syntax-for-named-wildcard-parameters-changed-in-route-">Syntax for named wildcard parameters changed in <code>$route</code></a></li>
<li><a href="guide/migration#you-can-only-bind-one-expression-to-src-ng-src-or-action-">You can only bind one expression to <code><em>[src]</code>, <code></em>[ng-src]</code> or <code>action</code></a></li>
<li><a href="guide/migration#interpolations-inside-dom-event-handlers-are-now-disallowed">Interpolations inside DOM event handlers are now disallowed</a></li>
<li><a href="guide/migration#directives-cannot-end-with-start-or-end">Directives cannot end with -start or -end</a></li>
<li><a href="guide/migration#in-q-promise-always-has-been-renamed-promise-finally">In $q, promise.always has been renamed promise.finally</a></li>
<li><a href="guide/migration#ngmobile-is-now-ngtouch">ngMobile is now ngTouch</a></li>
<li><a href="guide/migration#resource-then-has-been-removed">resource.$then has been removed</a></li>
<li><a href="guide/migration#resource-methods-return-the-promise">Resource methods return the promise</a></li>
<li><a href="guide/migration#resource-promises-are-resolved-with-the-resource-instance">Resource promises are resolved with the resource instance</a></li>
<li><a href="guide/migration#-location-search-supports-multiple-keys">$location.search supports multiple keys</a></li>
<li><a href="guide/migration#ngbindhtmlunsafe-has-been-removed-and-replaced-by-ngbindhtml">ngBindHtmlUnsafe has been removed and replaced by ngBindHtml</a></li>
<li><a href="guide/migration#form-names-that-are-expressions-are-evaluated">Form names that are expressions are evaluated</a></li>
<li><a href="guide/migration#hasownproperty-disallowed-as-an-input-name">hasOwnProperty disallowed as an input name</a></li>
<li><a href="guide/migration#directives-order-of-postlink-functions-reversed">Directives: Order of postLink functions reversed</a></li>
<li><a href="guide/migration#directive-priority">Directive priority</a></li>
<li><a href="guide/migration#ngscenario">ngScenario</a></li>
<li><a href="guide/migration#nginclude-and-ngview-replace-its-entire-element-on-update">ngInclude and ngView replace its entire element on update</a></li>
<li><a href="guide/migration#urls-are-now-sanitized-against-a-whitelist">URLs are now sanitized against a whitelist</a></li>
<li><a href="guide/migration#isolate-scope-only-exposed-to-directives-with-scope-property">Isolate scope only exposed to directives with <code>scope</code> property</a></li>
<li><a href="guide/migration#change-to-interpolation-priority">Change to interpolation priority</a></li>
<li><a href="guide/migration#underscore-prefixed-suffixed-properties-are-non-bindable">Underscore-prefixed/suffixed properties are non-bindable</a></li>
<li><a href="guide/migration#you-cannot-bind-to-select-multiple-">You cannot bind to select[multiple]</a></li>
<li><a href="guide/migration#uncommon-region-specific-local-files-were-removed-from-i18n">Uncommon region-specific local files were removed from i18n</a></li>
<li><a href="guide/migration#services-can-now-return-functions">Services can now return functions</a></li>
</ul>
<h2 id="ngroute-has-been-moved-into-its-own-module">ngRoute has been moved into its own module</h2>
<p>Just like <code>ngResource</code>, <code>ngRoute</code> is now its own module.</p>
<p>Applications that use <code>$route</code>, <code>ngView</code>, and/or <code>$routeParams</code> will now need to load an
<code>angular-route.js</code> file and have their application's module dependency on the <code>ngRoute</code> module.</p>
<p>Before:</p>
<pre><code class="lang-html"><script src="angular.js"></script>
</code></pre>
<pre><code class="lang-javascript">var myApp = angular.module('myApp', ['someOtherModule']);
</code></pre>
<p>After:</p>
<pre><code class="lang-html"><script src="angular.js"></script>
<script src="angular-route.js"></script>
</code></pre>
<pre><code class="lang-javascript">var myApp = angular.module('myApp', ['ngRoute', 'someOtherModule']);
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/5599b55b04788c2e327d7551a4a699d75516dd21">5599b55b</a>.</p>
<h2 id="templates-no-longer-automatically-unwrap-promises">Templates no longer automatically unwrap promises</h2>
<p><code>$parse</code> and templates in general will no longer automatically unwrap promises.</p>
<p>Before:</p>
<pre><code class="lang-javascript">$scope.foo = $http({method: 'GET', url: '/someUrl'});
</code></pre>
<pre><code class="lang-html"><p>{{foo}}</p>
</code></pre>
<p>After:</p>
<pre><code class="lang-javascript">$http({method: 'GET', url: '/someUrl'})
.success(function(data) {
$scope.foo = data;
});
</code></pre>
<pre><code class="lang-html"><p>{{foo}}</p>
</code></pre>
<p>This feature has been deprecated. If absolutely needed, it can be reenabled for now via the
<code>$parseProvider.unwrapPromises(true)</code> API.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/5dc35b527b3c99f6544b8cb52e93c6510d3ac577">5dc35b52</a>,
<a href="https://github.com/angular/angular.js/commit/b6a37d112b3e1478f4d14a5f82faabf700443748">b6a37d11</a>.</p>
<h2 id="syntax-for-named-wildcard-parameters-changed-in-route-">Syntax for named wildcard parameters changed in <code>$route</code></h2>
<p>To migrate the code, follow the example below. Here, <code>*highlight</code> becomes <code>:highlight*</code></p>
<p>Before:</p>
<pre><code class="lang-javascript">$routeProvider.when('/Book1/:book/Chapter/:chapter/*highlight/edit',
{controller: noop, templateUrl: 'Chapter.html'});
</code></pre>
<p>After:</p>
<pre><code class="lang-javascript">$routeProvider.when('/Book1/:book/Chapter/:chapter/:highlight*/edit',
{controller: noop, templateUrl: 'Chapter.html'});
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/04cebcc133c8b433a3ac5f72ed19f3631778142b">04cebcc1</a>.</p>
<h2 id="you-can-only-bind-one-expression-to-src-ng-src-or-action-">You can only bind one expression to <code>*[src]</code>, <code>*[ng-src]</code> or <code>action</code></h2>
<p>With the exception of <code><a></code> and <code><img></code> elements, you cannot bind more than one expression to the
<code>src</code> or <code>action</code> attribute of elements.</p>
<p>This is one of several improvements to security introduces by Angular 1.2.</p>
<p>Concatenating expressions makes it hard to understand whether some combination of concatenated
values are unsafe to use and potentially subject to XSS vulnerabilities. To simplify the task of
auditing for XSS issues, we now require that a single expression be used for <code>*[src/ng-src]</code>
bindings such as bindings for <code>iframe[src]</code>, <code>object[src]</code>, etc. In addition, this requirement is
enforced for <code>form</code> tags with <code>action</code> attributes.</p>
<table class="table table-bordered code-table">
<thead>
<tr>
<th>Examples</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><img src="{{a}}/{{b}}"></code></td>
<td class="success">ok</td>
</tr>
<tr>
<td><code><iframe src="{{a}}/{{b}}"></iframe></code></td>
<td class="error">bad</td>
</tr>
<tr>
<td><code><iframe src="{{a}}"></iframe></code></td>
<td class="success">ok</td>
</tr>
</tbody>
</table>
<p>To migrate your code, you can combine multiple expressions using a method attached to your scope.</p>
<p>Before:</p>
<pre><code class="lang-javascript">scope.baseUrl = 'page';
scope.a = 1;
scope.b = 2;
</code></pre>
<pre><code class="lang-html"><!-- Are a and b properly escaped here? Is baseUrl controlled by user? -->
<iframe src="{{baseUrl}}?a={{a}&b={{b}}">
</code></pre>
<p>After:</p>
<pre><code class="lang-javascript">var baseUrl = "page";
scope.getIframeSrc = function() {
// One should think about their particular case and sanitize accordingly
var qs = ["a", "b"].map(function(value, name) {
return encodeURIComponent(name) + "=" +
encodeURIComponent(value);
}).join("&");
// `baseUrl` isn't exposed to a user's control, so we don't have to worry about escaping it.
return baseUrl + "?" + qs;
};
</code></pre>
<pre><code class="lang-html"><iframe src="{{getIframeSrc()}}">
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/38deedd6e3d806eb8262bb43f26d47245f6c2739">38deedd6</a>.</p>
<h2 id="interpolations-inside-dom-event-handlers-are-now-disallowed">Interpolations inside DOM event handlers are now disallowed</h2>
<p>DOM event handlers execute arbitrary Javascript code. Using an interpolation for such handlers
means that the interpolated value is a JS string that is evaluated. Storing or generating such
strings is error prone and leads to XSS vulnerabilities. On the other hand, <code>ngClick</code> and other
Angular specific event handlers evaluate Angular expressions in non-window (Scope) context which
makes them much safer.</p>
<p>To migrate the code follow the example below:</p>
<p>Before:</p>
<pre><code>JS: scope.foo = 'alert(1)';
HTML: <div onclick="{{foo}}">
</code></pre>
<p>After:</p>
<pre><code>JS: scope.foo = function() { alert(1); }
HTML: <div ng-click="foo()">
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/39841f2ec9b17b3b2920fd1eb548d444251f4f56">39841f2e</a>.</p>
<h2 id="directives-cannot-end-with-start-or-end">Directives cannot end with -start or -end</h2>
<p>This change was necessary to enable multi-element directives. The best fix is to rename existing
directives so that they don't end with these suffixes.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/e46100f7097d9a8f174bdb9e15d4c6098395c3f2">e46100f7</a>.</p>
<h2 id="in-q-promise-always-has-been-renamed-promise-finally">In $q, promise.always has been renamed promise.finally</h2>
<p>The reason for this change is to align <code>$q</code> with the <a href="https://github.com/kriskowal/q">Q promise
library</a>, despite the fact that this makes it a bit more difficult
to use with non-ES5 browsers, like IE8.</p>
<p><code>finally</code> also goes well together with the <code>catch</code> API that was added to <code>$q</code> recently and is part
of the <a href="http://dom.spec.whatwg.org/">DOM promises standard</a>.</p>
<p>To migrate the code follow the example below.</p>
<p>Before:</p>
<pre><code class="lang-javascript">$http.get('/foo').always(doSomething);
</code></pre>
<p>After:</p>
<pre><code class="lang-javascript">$http.get('/foo').finally(doSomething);
</code></pre>
<p>Or for IE8-compatible code:</p>
<pre><code class="lang-javascript">$http.get('/foo')['finally'](doSomething);
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/f078762d48d0d5d9796dcdf2cb0241198677582c">f078762d</a>.</p>
<h2 id="ngmobile-is-now-ngtouch">ngMobile is now ngTouch</h2>
<p>Many touch-enabled devices are not mobile devices, so we decided to rename this module to better
reflect its concerns.</p>
<p>To migrate, replace all references to <code>ngMobile</code> with <code>ngTouch</code> and <code>angular-mobile.js</code> with
<code>angular-touch.js</code>.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/94ec84e7b9c89358dc00e4039009af9e287bbd05">94ec84e7</a>.</p>
<h2 id="resource-then-has-been-removed">resource.$then has been removed</h2>
<p>Resource instances do not have a <code>$then</code> function anymore. Use the <code>$promise.then</code> instead.</p>
<p>Before:</p>
<pre><code class="lang-javascript">Resource.query().$then(callback);
</code></pre>
<p>After:</p>
<pre><code class="lang-javascript">Resource.query().$promise.then(callback);
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/05772e15fbecfdc63d4977e2e8839d8b95d6a92d">05772e15</a>.</p>
<h2 id="resource-methods-return-the-promise">Resource methods return the promise</h2>
<p>Methods of a resource instance return the promise rather than the instance itself.</p>
<p>Before:</p>
<pre><code class="lang-javascript">resource.$save().chaining = true;
</code></pre>
<p>After:</p>
<pre><code class="lang-javascript">resource.$save();
resource.chaining = true;
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/05772e15fbecfdc63d4977e2e8839d8b95d6a92d">05772e15</a>.</p>
<h2 id="resource-promises-are-resolved-with-the-resource-instance">Resource promises are resolved with the resource instance</h2>
<p>On success, the resource promise is resolved with the resource instance rather than HTTP response object.</p>
<p>Use interceptor API to access the HTTP response object.</p>
<p>Before:</p>
<pre><code class="lang-javascript">Resource.query().$then(function(response) {...});
</code></pre>
<p>After:</p>
<pre><code class="lang-javascript">var Resource = $resource('/url', {}, {
get: {
method: 'get',
interceptor: {
response: function(response) {
// expose response
return response;
}
}
}
});
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/05772e15fbecfdc63d4977e2e8839d8b95d6a92d">05772e15</a>.</p>
<h2 id="-location-search-supports-multiple-keys">$location.search supports multiple keys</h2>
<p><a href="api/ng/service/$location#search"><code>$location.search</code></a> now supports multiple keys with the
same value provided that the values are stored in an array.</p>
<p>Before this change:</p>
<ul>
<li><code>parseKeyValue</code> only took the last key overwriting all the previous keys.</li>
<li><code>toKeyValue</code> joined the keys together in a comma delimited string.</li>
</ul>
<p>This was deemed buggy behavior. If your server relied on this behavior then either the server
should be fixed, or a simple serialization of the array should be done on the client before
passing it to <code>$location</code>.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/807394095b991357225a03d5fed81fea5c9a1abe">80739409</a>.</p>
<h2 id="ngbindhtmlunsafe-has-been-removed-and-replaced-by-ngbindhtml">ngBindHtmlUnsafe has been removed and replaced by ngBindHtml</h2>
<p><code>ngBindHtml</code> provides <code>ngBindHtmlUnsafe</code> like
behavior (evaluate an expression and innerHTML the result into the DOM) when bound to the result
of <code>$sce.trustAsHtml(string)</code>. When bound to a plain string, the string is sanitized via
<code>$sanitize</code> before being innerHTML'd. If the <code>$sanitize</code> service isn't available (<code>ngSanitize</code>
module is not loaded) and the bound expression evaluates to a value that is not trusted an
exception is thrown.</p>
<p>When using this directive you can either include <code>ngSanitize</code> in your module's dependencies (See the
example at the <a href="api/ng/directive/ngBindHtml"><code>ngBindHtml</code></a> reference) or use the <a href="api/ng/service/$sce"><code>$sce</code></a> service to set the value as
trusted.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/dae694739b9581bea5dbc53522ec00d87b26ae55">dae69473</a>.</p>
<h2 id="form-names-that-are-expressions-are-evaluated">Form names that are expressions are evaluated</h2>
<p>If you have form names that will evaluate as an expression:</p>
<pre><code><form name="ctrl.form">
</code></pre>
<p>And if you are accessing the form from your controller:</p>
<p>Before:</p>
<pre><code class="lang-javascript">function($scope) {
$scope['ctrl.form'] // form controller instance
}
</code></pre>
<p>After:</p>
<pre><code class="lang-javascript">function($scope) {
$scope.ctrl.form // form controller instance
}
</code></pre>
<p>This makes it possible to access a form from a controller using the new "controller as" syntax.
Supporting the previous behavior offers no benefit.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/8ea802a1d23ad8ecacab892a3a451a308d9c39d7">8ea802a1</a>.</p>
<h2 id="hasownproperty-disallowed-as-an-input-name">hasOwnProperty disallowed as an input name</h2>
<p>Inputs with name equal to <code>hasOwnProperty</code> are not allowed inside form or ngForm directives.</p>
<p>Before, inputs whose name was "hasOwnProperty" were quietly ignored and not added to the scope.
Now a badname exception is thrown. Using "hasOwnProperty" for an input name would be very unusual
and bad practice. To migrate, change your input name.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/7a586e5c19f3d1ecc3fefef084ce992072ee7f60">7a586e5c</a>.</p>
<h2 id="directives-order-of-postlink-functions-reversed">Directives: Order of postLink functions reversed</h2>
<p>The order of postLink fn is now mirror opposite of the order in which corresponding preLinking and compile functions execute.</p>
<p>Previously the compile/link fns executed in order, sorted by priority:</p>
<table class="table table-bordered table-striped code-table">
<thead>
<tr>
<th>#</th>
<th>Step</th>
<th align="center">Old Sort Order</th>
<th align="center">New Sort Order</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Compile Fns</td>
<td align="center" colspan="2">High → Low</td>
</tr>
<tr>
<td>2</td>
<td colspan="3">Compile child nodes</td>
</tr>
<tr>
<td>3</td>
<td>PreLink Fns</td>
<td align="center" colspan="2">High → Low</td>
</tr>
<tr>
<td>4</td>
<td colspan="3">Link child nodes</td>
</tr>
<tr>
<td>5</td>
<td>PostLink Fns</td>
<td align="center">High → Low</td>
<td align="center"><strong>Low → High</strong></td>
</tr>
</tbody>
</table>
<p><small>"High → Low" here refers to the <code>priority</code> option of a directive.</small></p>
<p>Very few directives in practice rely on the order of postLinking functions (unlike on the order
of compile functions), so in the rare case of this change affecting an existing directive, it might
be necessary to convert it to a preLinking function or give it negative priority.</p>
<p>You can look at <a href="https://github.com/angular/angular.js/commit/31f190d4d53921d32253ba80d9ebe57d6c1de82b">the diff of this
commit</a> to see how an internal
attribute interpolation directive was adjusted.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/31f190d4d53921d32253ba80d9ebe57d6c1de82b">31f190d4</a>.</p>
<h2 id="directive-priority">Directive priority</h2>
<p>the priority of ngRepeat, ngSwitchWhen, ngIf, ngInclude and ngView has changed. This could affect directives that explicitly specify their priority.</p>
<p>In order to make ngRepeat, ngSwitchWhen, ngIf, ngInclude and ngView work together in all common scenarios their directives are being adjusted to achieve the following precedence:</p>
<table>
<thead>
<tr>
<th>Directive</th>
<th>Old Priority</th>
<th>New Priority</th>
</tr>
</thead>
<tbody>
<tr>
<td>ngRepeat</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>ngSwitchWhen</td>
<td>500</td>
<td>800</td>
</tr>
<tr>
<td>ngIf</td>
<td>1000</td>
<td>600</td>
</tr>
<tr>
<td>ngInclude</td>
<td>1000</td>
<td>400</td>
</tr>
<tr>
<td>ngView</td>
<td>1000</td>
<td>400</td>
</tr>
</tbody>
</table>
<p>See <a href="https://github.com/angular/angular.js/commit/b7af76b4c5aa77648cc1bfd49935b48583419023">b7af76b4</a>.</p>
<h2 id="ngscenario">ngScenario</h2>
<p>browserTrigger now uses an eventData object instead of direct parameters for mouse events.
To migrate, place the <code>keys</code>,<code>x</code> and <code>y</code> parameters inside of an object and place that as the
third parameter for the browserTrigger function.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/28f56a383e9d1ff378e3568a3039e941c7ffb1d8">28f56a38</a>.</p>
<h2 id="nginclude-and-ngview-replace-its-entire-element-on-update">ngInclude and ngView replace its entire element on update</h2>
<p>Previously <code>ngInclude</code> and <code>ngView</code> only updated its element's content. Now these directives will
recreate the element every time a new content is included.</p>
<p>This ensures that a single rootElement for all the included contents always exists, which makes
definition of css styles for animations much easier.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/7d69d52acff8578e0f7d6fe57a6c45561a05b182">7d69d52a</a>,
<a href="https://github.com/angular/angular.js/commit/aa2133ad818d2e5c27cbd3933061797096356c8a">aa2133ad</a>.</p>
<h2 id="urls-are-now-sanitized-against-a-whitelist">URLs are now sanitized against a whitelist</h2>
<p>A whitelist configured via <code>$compileProvider</code> can be used to configure what URLs are considered safe.
By default all common protocol prefixes are whitelisted including <code>data:</code> URIs with mime types <code>image/*</code>.
This change shouldn't impact apps that don't contain malicious image links.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/1adf29af13890d61286840177607edd552a9df97">1adf29af</a>,
<a href="https://github.com/angular/angular.js/commit/3e39ac7e1b10d4812a44dad2f959a93361cd823b">3e39ac7e</a>.</p>
<h2 id="isolate-scope-only-exposed-to-directives-with-scope-property">Isolate scope only exposed to directives with <code>scope</code> property</h2>
<p>If you declare a scope option on a directive, that directive will have an
<a href="https://github.com/angular/angular.js/wiki/Understanding-Scopes">isolate scope</a>. In Angular 1.0, if a
directive with an isolate scope is used on an element, all directives on that same element have access
to the same isolate scope. For example, say we have the following directives:</p>
<pre><code>// This directive declares an isolate scope.
.directive('isolateScope', function() {
return {
scope: {},
link: function($scope) {
console.log('one = ' + $scope.$id);
}
};
})
// This directive does not.
.directive('nonIsolateScope', function() {
return {
link: function($scope) {
console.log('two = ' + $scope.$id);
}
};
});
</code></pre>
<p>Now what happens if we use both directives on the same element?</p>
<pre><code><div isolate-scope non-isolate-scope></div>
</code></pre>
<p>In Angular 1.0, the nonIsolateScope directive will have access to the isolateScope directive’s scope. The
log statements will print the same id, because the scope is the same. But in Angular 1.2, the nonIsolateScope
will not use the same scope as isolateScope. Instead, it will inherit the parent scope. The log statements
will print different id’s.</p>
<p>If your code depends on the Angular 1.0 behavior (non-isolate directive needs to access state
from within the isolate scope), change the isolate directive to use scope locals to pass these explicitly:</p>
<p><strong>Before</strong></p>
<pre><code><input ng-model="$parent.value" ng-isolate>
.directive('ngIsolate', function() {
return {
scope: {},
template: '{{value}}'
};
});
</code></pre>
<p><strong>After</strong></p>
<pre><code><input ng-model="value" ng-isolate>
.directive('ngIsolate', function() {
return {
scope: {value: '=ngModel'},
template: '{{value}}
};
});
</code></pre>
<p>See <a href="https://github.com/angular/angular.js/commit/909cabd36d779598763cc358979ecd85bb40d4d7">909cabd3</a>,
<a href="https://github.com/angular/angular.js/issues/1924">#1924</a> and
<a href="https://github.com/angular/angular.js/issues/2500">#2500</a>.</p>
<h2 id="change-to-interpolation-priority">Change to interpolation priority</h2>
<p>Previously, the interpolation priority was <code>-100</code> in 1.2.0-rc.2, and <code>100</code> before 1.2.0-rc.2.
Before this change the binding was setup in the post-linking phase.</p>
<p>Now the attribute interpolation (binding) executes as a directive with priority 100 and the
binding is set up in the pre-linking phase.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/79223eae5022838893342c42dacad5eca83fabe8">79223eae</a>,
<a href="https://github.com/angular/angular.js/issues/4525">#4525</a>,
<a href="https://github.com/angular/angular.js/issues/4528">#4528</a>, and
<a href="https://github.com/angular/angular.js/issues/4649">#4649</a></p>
<h2 id="underscore-prefixed-suffixed-properties-are-non-bindable">Underscore-prefixed/suffixed properties are non-bindable</h2>
<div class="alert alert-info">
<p><strong>Reverted</strong>: This breaking change has been reverted in 1.2.1, and so can be ignored if you're using <strong>version 1.2.1 or higher</strong></p>
</div>
<p>This change introduces the notion of "private" properties (properties
whose names begin and/or end with an underscore) on the scope chain.
These properties will not be available to Angular expressions (i.e. {{
}} interpolation in templates and strings passed to <code>$parse</code>) They are
freely available to JavaScript code (as before).</p>
<p><strong>Motivation</strong></p>
<p>Angular expressions execute in a limited context. They do not have
direct access to the global scope, <code>window</code>, <code>document</code> or the Function
constructor. However, they have direct access to names/properties on
the scope chain. It has been a long standing best practice to keep
sensitive APIs outside of the scope chain (in a closure or your
controller.) That's easier said than done for two reasons:</p>
<ol>
<li>JavaScript does not have a notion of private properties so if you need
someone on the scope chain for JavaScript use, you also expose it to
Angular expressions</li>
<li>The new <code>controller as</code> syntax that's now in increased usage exposes the
entire controller on the scope chain greatly increasing the exposed surface.</li>
</ol>
<p>Though Angular expressions are written and controlled by the developer, they:</p>
<ol>
<li>Typically deal with user input</li>
<li>Don't get the kind of test coverage that JavaScript code would</li>
</ol>
<p>This commit provides a way, via a naming convention, to allow restricting properties from
controllers/scopes. This means Angular expressions can access only those properties that
are actually needed by the expressions.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/3d6a89e8888b14ae5cb5640464e12b7811853c7e">3d6a89e8</a>.</p>
<h2 id="you-cannot-bind-to-select-multiple-">You cannot bind to select[multiple]</h2>
<p>Switching between <code>select[single]</code> and <code>select[multiple]</code> has always been odd due to browser quirks.
This feature never worked with two-way data-binding so it's not expected that anyone is using it.</p>
<p>If you are interested in properly adding this feature, please submit a pull request on Github.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/d87fa0042375b025b98c40bff05e5f42c00af114">d87fa004</a>.</p>
<h2 id="uncommon-region-specific-local-files-were-removed-from-i18n">Uncommon region-specific local files were removed from i18n</h2>
<p>AngularJS uses the Google Closure library's locale files. The following locales were removed from
Closure, so Angular is not able to continue to support them:</p>
<p><code>chr</code>, <code>cy</code>, <code>el-polyton</code>, <code>en-zz</code>, <code>fr-rw</code>, <code>fr-sn</code>, <code>fr-td</code>, <code>fr-tg</code>, <code>haw</code>, <code>it-ch</code>, <code>ln-cg</code>,
<code>mo</code>, <code>ms-bn</code>, <code>nl-aw</code>, <code>nl-be</code>, <code>pt-ao</code>, <code>pt-gw</code>, <code>pt-mz</code>, <code>pt-st</code>, <code>ro-md</code>, <code>ru-md</code>, <code>ru-ua</code>,
<code>sr-cyrl-ba</code>, <code>sr-cyrl-me</code>, <code>sr-cyrl</code>, <code>sr-latn-ba</code>, <code>sr-latn-me</code>, <code>sr-latn</code>, <code>sr-rs</code>, <code>sv-fi</code>,
<code>sw-ke</code>, <code>ta-lk</code>, <code>tl-ph</code>, <code>ur-in</code>, <code>zh-hans-hk</code>, <code>zh-hans-mo</code>, <code>zh-hans-sg</code>, <code>zh-hans</code>,
<code>zh-hant-hk</code>, <code>zh-hant-mo</code>, <code>zh-hant-tw</code>, <code>zh-hant</code></p>
<p>Although these locales were removed from the official AngularJS repository, you can continue to
load and use your copy of the locale file provided that you maintain it yourself.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/6382e21fb28541a2484ac1a241d41cf9fbbe9d2c">6382e21f</a>.</p>
<h2 id="services-can-now-return-functions">Services can now return functions</h2>
<p>Previously, the service constructor only returned objects regardless of whether a function was returned.</p>
<p>Now, <code>$injector.instantiate</code> (and thus <code>$provide.service</code>) behaves the same as the native
<code>new</code> operator and allows functions to be returned as a service.</p>
<p>If using a JavaScript preprocessor it's quite possible when upgrading that services could start behaving incorrectly.
Make sure your services return the correct type wanted.</p>
<p><strong>Coffeescript example</strong></p>
<pre><code>myApp.service 'applicationSrvc', ->
@something = "value"
@someFunct = ->
"something else"
</code></pre>
<p>pre 1.2 this service would return the whole object as the service.</p>
<p>post 1.2 this service returns <code>someFunct</code> as the value of the service</p>
<p>you would need to change this services to</p>
<pre><code>myApp.service 'applicationSrvc', ->
@something = "value"
@someFunct = ->
"something else"
return
</code></pre>
<p>to continue to return the complete instance.</p>
<p>See <a href="https://github.com/angular/angular.js/commit/c22adbf160f32c1839fbb35382b7a8c6bcec2927">c22adbf1</a>.</p>
| Zex/ntlminv | extern/angular/docs/partials/guide/migration.html | HTML | mit | 51,654 |
const path = require('path');
const env = require('yargs').argv.mode;
const webpack = require('webpack');
const projectRoot = path.resolve(__dirname, '/');
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
const libraryName = '<%= libraryName %>';
const plugins = [];
let outputFile;
if (env === 'build') {
plugins.push(new UglifyJsPlugin({ minimize: true }));
outputFile = `${libraryName}.min.js`;
} else {
outputFile = `${libraryName}.js`;
}
const config = {
entry: `${__dirname}/src/index.js`,
devtool: 'source-map',
output: {
path: `${__dirname}/dist`,
filename: outputFile,
library: libraryName,
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
preLoaders: [
{
test: /(\.jsx|\.js)$/,
loader: 'eslint',
include: projectRoot,
exclude: /(node_modules|bower_components)/
}
],
loaders: [
{
test: /(\.jsx|\.js)$/,
loader: 'babel',
include: projectRoot,
exclude: /(node_modules|bower_components)/
}
]
},
resolve: {
root: path.resolve('./src'),
extensions: ['', '.js']
},
plugins
};
module.exports = config;
| ianaya89/generator-bwk | generators/app/templates/webpack.config.js | JavaScript | mit | 1,188 |
<?php
namespace JMS\JobQueueBundle\Entity\Listener;
use Doctrine\ORM\Event\LifecycleEventArgs;
use JMS\JobQueueBundle\Entity\Job;
/**
* Provides many-to-any association support for jobs.
*
* This listener only implements the minimal support for this feature. For
* example, currently we do not support any modification of a collection after
* its initial creation.
*
* @see http://docs.jboss.org/hibernate/orm/4.1/javadocs/org/hibernate/annotations/ManyToAny.html
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class ManyToAnyListener
{
private $registry;
private $ref;
public function __construct(\Symfony\Bridge\Doctrine\RegistryInterface $registry)
{
$this->registry = $registry;
$this->ref = new \ReflectionProperty('JMS\JobQueueBundle\Entity\Job', 'relatedEntities');
$this->ref->setAccessible(true);
}
public function postLoad(\Doctrine\ORM\Event\LifecycleEventArgs $event)
{
$entity = $event->getEntity();
if ( ! $entity instanceof \JMS\JobQueueBundle\Entity\Job) {
return;
}
$this->ref->setValue($entity, new PersistentRelatedEntitiesCollection($this->registry, $entity));
}
public function preRemove(LifecycleEventArgs $event)
{
$entity = $event->getEntity();
if ( ! $entity instanceof Job) {
return;
}
$con = $event->getEntityManager()->getConnection();
$con->executeUpdate("DELETE FROM jms_job_related_entities WHERE job_id = :id", array(
'id' => $entity->getId(),
));
}
public function postPersist(\Doctrine\ORM\Event\LifecycleEventArgs $event)
{
$entity = $event->getEntity();
if ( ! $entity instanceof \JMS\JobQueueBundle\Entity\Job) {
return;
}
$con = $event->getEntityManager()->getConnection();
foreach ($this->ref->getValue($entity) as $relatedEntity) {
$relClass = \Doctrine\Common\Util\ClassUtils::getClass($relatedEntity);
$relId = $this->registry->getManagerForClass($relClass)->getMetadataFactory()->getMetadataFor($relClass)->getIdentifierValues($relatedEntity);
asort($relId);
if ( ! $relId) {
throw new \RuntimeException('The identifier for the related entity "'.$relClass.'" was empty.');
}
$con->executeUpdate("INSERT INTO jms_job_related_entities (job_id, related_class, related_id) VALUES (:jobId, :relClass, :relId)", array(
'jobId' => $entity->getId(),
'relClass' => $relClass,
'relId' => json_encode($relId),
));
}
}
public function postGenerateSchema(\Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs $event)
{
$schema = $event->getSchema();
// When using multiple entity managers ignore events that are triggered by other entity managers.
if ($event->getEntityManager()->getMetadataFactory()->isTransient('JMS\JobQueueBundle\Entity\Job')) {
return;
}
$table = $schema->createTable('jms_job_related_entities');
$table->addColumn('job_id', 'bigint', array('nullable' => false, 'unsigned' => true));
$table->addColumn('related_class', 'string', array('nullable' => false, 'length' => '150'));
$table->addColumn('related_id', 'string', array('nullable' => false, 'length' => '100'));
$table->setPrimaryKey(array('job_id', 'related_class', 'related_id'));
$table->addForeignKeyConstraint('jms_jobs', array('job_id'), array('id'));
}
} | minhnguyen-balance/oro_platform | vendor/jms/job-queue-bundle/JMS/JobQueueBundle/Entity/Listener/ManyToAnyListener.php | PHP | mit | 3,604 |
/*
* (C) Copyright Nick Thompson 2018.
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
*/
#include "multiprecision_config.hpp"
#ifndef DISABLE_MP_TESTS
#include <boost/integer/mod_inverse.hpp>
#include <boost/cstdint.hpp>
#include <boost/optional/optional.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/integer/common_factor.hpp>
using boost::multiprecision::int128_t;
using boost::multiprecision::int256_t;
using boost::integer::mod_inverse;
using boost::integer::gcd;
template<class Z>
void test_mod_inverse()
{
//Z max_arg = std::numeric_limits<Z>::max();
Z max_arg = 500;
for (Z modulus = 2; modulus < max_arg; ++modulus)
{
if (modulus % 1000 == 0)
{
std::cout << "Testing all inverses modulo " << modulus << std::endl;
}
for (Z a = 1; a < modulus; ++a)
{
Z gcdam = gcd(a, modulus);
Z inv_a = mod_inverse(a, modulus);
// Should fail if gcd(a, mod) != 1:
if (gcdam > 1)
{
BOOST_TEST(inv_a == 0);
}
else
{
BOOST_TEST(inv_a > 0);
// Cast to a bigger type so the multiplication won't overflow.
int256_t a_inv = inv_a;
int256_t big_a = a;
int256_t m = modulus;
int256_t outta_be_one = (a_inv*big_a) % m;
BOOST_TEST_EQ(outta_be_one, 1);
}
}
}
}
int main()
{
test_mod_inverse<boost::int16_t>();
test_mod_inverse<boost::int32_t>();
test_mod_inverse<boost::int64_t>();
test_mod_inverse<int128_t>();
return boost::report_errors();
}
#else
int main()
{
return 0;
}
#endif
| davehorton/drachtio-server | deps/boost_1_77_0/libs/integer/test/mod_inverse_test.cpp | C++ | mit | 1,917 |
<?php
/**
* This class defines the structure of the 'movie' table.
*
*
* This class was autogenerated by Propel 1.4.2 on:
*
* Thu Mar 8 15:14:38 2012
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package lib.model.map
*/
class MovieTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'lib.model.map.MovieTableMap';
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('movie');
$this->setPhpName('Movie');
$this->setClassname('Movie');
$this->setPackage('lib.model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('DIRECTOR', 'Director', 'VARCHAR', false, 255, null);
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('MovieI18n', 'MovieI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null);
} // buildRelations()
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'symfony' => array('form' => 'true', 'filter' => 'true', ),
'symfony_behaviors' => array(),
'symfony_i18n' => array('i18n_table' => 'movie_i18n', ),
);
} // getBehaviors()
} // MovieTableMap
| zlood/pbbonline-symfony | lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/MovieTableMap.php | PHP | mit | 1,887 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="app"></div>
</body>
</html>
| Radivarig/react-infinite-any-height | src/index.html | HTML | mit | 131 |
var searchData=
[
['makeexternal',['MakeExternal',['../classv8_1_1String.html#a5efd1eba40c1fa8a6aae2c4a175a63be',1,'v8::String::MakeExternal(ExternalStringResource *resource)'],['../classv8_1_1String.html#a19db11c97e2ce01244e06f5cbcd094f2',1,'v8::String::MakeExternal(ExternalAsciiStringResource *resource)']]],
['markasundetectable',['MarkAsUndetectable',['../classv8_1_1ObjectTemplate.html#a7e40ef313b44c2ad336c73051523b4f8',1,'v8::ObjectTemplate']]],
['markindependent',['MarkIndependent',['../classv8_1_1PersistentBase.html#aed12b0a54bc5ade1fb44e3bdb3a1fe74',1,'v8::PersistentBase']]],
['markpartiallydependent',['MarkPartiallyDependent',['../classv8_1_1PersistentBase.html#a4a876d30dda0dfb812e82bb240e4686e',1,'v8::PersistentBase']]],
['maybe',['Maybe',['../structv8_1_1Maybe.html',1,'v8']]],
['message',['Message',['../classv8_1_1Message.html',1,'v8']]],
['message',['Message',['../classv8_1_1Debug_1_1Message.html',1,'v8::Debug']]],
['message',['Message',['../classv8_1_1TryCatch.html#a2811e500fbb906ee505895a3d94fc66f',1,'v8::TryCatch']]],
['messagehandler',['MessageHandler',['../classv8_1_1Debug.html#a526826b857bd3e3efa184e12bcebc694',1,'v8::Debug']]]
];
| v8-dox/v8-dox.github.io | 9d3288c/html/search/all_c.js | JavaScript | mit | 1,184 |
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary server in each group
# is considered to be the first unless any hosts have the primary
# property set. Don't declare `role :all`, it's a meta role.
set :branch, 'production'
set :rails_env, 'production'
role :app, %w{root@dashboard.wikiedu.org}
role :web, %w{root@dashboard.wikiedu.org}
role :db, %w{root@dashboard.wikiedu.org}
set :deploy_to, '/var/www/dashboard'
# Extended Server Syntax
# ======================
# This can be used to drop a more detailed server definition into the
# server list. The second argument is a, or duck-types, Hash and is
# used to set extended properties on the server.
# server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a
# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
#
# Global options
# --------------
# set :ssh_options, {
# keys: %w(/home/rlisowski/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(password)
# }
#
# And/or per server (overrides global)
# ------------------------------------
# server 'example.com',
# user: 'user_name',
# roles: %w{web app},
# ssh_options: {
# user: 'user_name', # overrides user setting above
# keys: %w(/home/user_name/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(publickey password)
# # password: 'please use keys'
# }
| wikimedia/wikimedia-education-WikiEduDashboard | config/deploy/production.rb | Ruby | mit | 1,578 |
<?php
/**
* URL rewrite collection
*
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\UrlRewrite\Model\ResourceModel;
class UrlRewriteCollection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
/**
* Store Manager Model
*
* @var \Magento\Store\Model\StoreManagerInterface
*/
protected $storeManager;
/**
* @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory
* @param \Psr\Log\LoggerInterface $logger
* @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
* @param \Magento\Framework\Event\ManagerInterface $eventManager
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param mixed $connection
* @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
*/
public function __construct(
\Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
) {
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
$this->storeManager = $storeManager;
}
/**
* Define resource model
*
* @return void
*/
protected function _construct()
{
$this->_init('Magento\UrlRewrite\Model\UrlRewrite', 'Magento\UrlRewrite\Model\ResourceModel\UrlRewrite');
}
/**
* Filter collections by stores
*
* @param mixed $store
* @param bool $withAdmin
* @return $this
* @api
*/
public function addStoreFilter($store, $withAdmin = true)
{
if (!is_array($store)) {
$store = [$this->storeManager->getStore($store)->getId()];
}
if ($withAdmin) {
$store[] = 0;
}
$this->addFieldToFilter('store_id', ['in' => $store]);
return $this;
}
}
| j-froehlich/magento2_wk | vendor/magento/module-url-rewrite/Model/ResourceModel/UrlRewriteCollection.php | PHP | mit | 2,347 |
AUTOBAHN_DEBUG = true;
var autobahn = require('autobahn');
var program = require('commander');
program
.option('-p, --port <port>', 'Server IP port', parseInt,9000)
.option('-i, --ip <ip>', 'Server IP address','127.0.0.1')
.parse(process.argv);
var connection = new autobahn.Connection({
url: 'ws://' + program.ip + ':' + program.port,
realm: 'realm1'}
);
connection.onopen = function (session) {
// Define an event handler
function onEvent(publishArgs, kwargs) {
console.log('Event received args', publishArgs, 'kwargs ',kwargs);
}
// Subscribe to a topic
session.subscribe('com.myapp.topic1', onEvent).then(
function(subscription) {
console.log("subscription successfull", subscription);
currentSubscription = subscription;
},
function(error) {
console.log("subscription failed", error);
}
);
// Exit after 5 minutes
setTimeout(
function() {
console.log("Terminating subscriber");
session.unsubscribe(currentSubscription).then(
function(gone) {
console.log("unsubscribe successfull");
connection.close();
},
function(error) {
console.log("unsubscribe failed", error);
connection.close();
}
);
},
300000
);
};
connection.open();
| cantidio/wamp.rt | test/pubsub/subscriber.js | JavaScript | mit | 1,473 |
# -*- coding: utf-8 -*-
from .base import _Base, Base
from .base_collection import BaseCollection
from .habit_groups import HabitGroups
from .habit_groups_collection import HabitGroupsCollection
from .habits import Habits
from .habits_collection import HabitsCollection
from .users import Users
from .users_collection import UsersCollection
from .attempts import Attempts
from .attempts_collection import AttemptsCollection
from .routines import Routines
from .routines_collection import RoutinesCollection
from .attempts_logs import AttemptsLogs
from .attempts_logs_collection import AttemptsLogsCollection
from .root import Root
__all__ = ['Attempts',
'AttemptsCollection',
'AttemptsLogs',
'AttemptsLogsCollection',
'Base',
'BaseCollection',
'HabitGroups',
'HabitGroupsCollection',
'Habits',
'HabitsCollection',
'Root',
'Routines',
'RoutinesCollection',
'Users',
'UsersCollection']
| dnguyen0304/mfit_service | mfit/mfit/resources/__init__.py | Python | mit | 1,041 |
'use strict';
((window, document) => {
})(window, document);
| Pier1/rocketbelt | src/rocketbelt/base/rocketbelt.legacy.js | JavaScript | mit | 62 |
#include "lpg_parse_expression.h"
#include "lpg_allocate.h"
#include "lpg_assert.h"
#include "lpg_for.h"
#include <string.h>
bool is_end_of_file(rich_token const *token)
{
return (token->status == tokenize_success) && (token->content.length == 0);
}
typedef enum comparison_result { equal, greater, less } comparison_result;
static comparison_result check_indentation_level(rich_token const found, size_t const expected)
{
if (expected == 0 && found.token != token_indentation)
{
return equal;
}
if (found.token != token_indentation)
{
return less;
}
size_t found_indentation_spaces = 0;
for (size_t i = 0; i < found.content.length; i++)
{
char const currentCharacter = found.content.begin[i];
found_indentation_spaces += ((currentCharacter == ' ') ? 1 : spaces_for_indentation);
}
size_t const actual_indentation = (found_indentation_spaces / spaces_for_indentation);
if (actual_indentation > expected)
{
return greater;
}
if (actual_indentation < expected)
{
return less;
}
return equal;
}
static bool is_same_indentation_level(rich_token const found, size_t const expected)
{
if (expected == 0 && found.token != token_indentation)
{
return true;
}
size_t indentation_level = 0;
for (size_t i = 0; i < found.content.length; i++)
{
char currentCharacter = *(found.content.begin + i);
indentation_level += ((currentCharacter == ' ') ? 1 : spaces_for_indentation);
}
return (found.token == token_indentation) && ((indentation_level / spaces_for_indentation) == expected);
}
static bool skip_line_break(expression_parser *parser)
{
rich_token head;
size_t whitespace_token_count = 0;
for (;;)
{
head = peek_at(parser, whitespace_token_count);
if (head.status == tokenize_invalid)
{
return false;
}
if (head.content.length > 0 && (head.token == token_space || head.token == token_indentation))
{
whitespace_token_count++;
}
else
{
break;
}
}
if (head.token == token_newline || head.content.length == 0)
{
pop_n(parser, whitespace_token_count + 1);
return true;
}
return false;
}
static bool parse_space(expression_parser *const parser)
{
rich_token maybe_space = peek(parser);
if (maybe_space.token != token_space || maybe_space.content.length == 0)
{
parser->on_error(parse_error_create(parse_error_expected_space, maybe_space.where), parser->on_error_user);
return false;
}
pop(parser);
return true;
}
static void parse_optional_space(expression_parser *const parser)
{
rich_token maybe_space = peek(parser);
if (maybe_space.token == token_space && maybe_space.content.length > 0)
{
pop(parser);
}
}
static sequence parse_sequence(expression_parser *parser, size_t indentation)
{
source_location const begin = peek(parser).where;
expression *elements = NULL;
size_t element_count = 0;
size_t element_allocated = 0;
for (;;)
{
rich_token const indentation_token = peek(parser);
if (is_end_of_file(&indentation_token))
{
break;
}
if (skip_line_break(parser))
{
continue;
}
switch (check_indentation_level(indentation_token, indentation))
{
case greater:
parser->on_error(
parse_error_create(parse_error_unexpected_indentation, indentation_token.where), parser->on_error_user);
/*fall through*/
case equal:
{
if (indentation > 0)
{
pop(parser);
}
expression_parser_result const element = parse_expression(parser, indentation, 1);
if (element.is_success)
{
elements = reallocate_array_exponentially(
elements, (element_count + 1), sizeof(*elements), element_count, &element_allocated);
elements[element_count] = element.success;
++element_count;
}
break;
}
case less:
return sequence_create(elements, element_count, begin);
}
}
return sequence_create(elements, element_count, begin);
}
static expression_parser_result const expression_parser_result_failure = {
0, {expression_type_lambda, {{{NULL, 0}, {NULL, 0, NULL}, NULL, {0, 0}}}}};
static tuple parse_tuple(expression_parser *parser, size_t indentation, source_location const opening_brace);
static expression_parser_result parse_returnable(expression_parser *const parser, size_t const indentation,
bool const may_be_binary);
static expression_parser_result parse_loop(expression_parser *parser, size_t indentation)
{
rich_token const maybe_newline = peek(parser);
pop(parser);
if (maybe_newline.token != token_newline)
{
parser->on_error(parse_error_create(parse_error_expected_newline, maybe_newline.where), parser->on_error_user);
return expression_parser_result_failure;
}
expression_parser_result const result = {1, expression_from_loop(parse_sequence(parser, (indentation + 1)))};
return result;
}
static bool parse_match_cases(expression_parser *parser, size_t const indentation, match_case **cases,
size_t *case_count)
{
for (;;)
{
rich_token const indentation_token = peek(parser);
if (!is_same_indentation_level(indentation_token, indentation))
{
return true;
}
pop(parser);
rich_token const expected_case = peek(parser);
bool is_default = false;
if ((expected_case.token == token_identifier) && (unicode_view_equals_c_str(expected_case.content, "default")))
{
is_default = true;
pop(parser);
}
else if (expected_case.token == token_case)
{
pop(parser);
if (!parse_space(parser))
{
return false;
}
}
expression_parser_result key
#ifdef _MSC_VER
// avoid false positive warning about uninitialized variable
= expression_parser_result_failure
#endif
;
if (!is_default)
{
key = parse_expression(parser, indentation, 0);
if (!key.is_success)
{
return false;
}
}
{
parse_optional_space(parser);
rich_token const colon = peek(parser);
pop(parser);
if (colon.token != token_colon)
{
parser->on_error(parse_error_create(parse_error_expected_colon, colon.where), parser->on_error_user);
if (!is_default)
{
expression_free(key.success);
}
return false;
}
}
rich_token const space = peek(parser);
if (space.token == token_newline)
{
pop(parser);
sequence const value = parse_sequence(parser, (indentation + 1));
if (value.length < 1)
{
parser->on_error(
parse_error_create(parse_error_expected_expression, peek(parser).where), parser->on_error_user);
if (!is_default)
{
expression_free(key.success);
}
return false;
}
*cases = reallocate_array(*cases, (*case_count + 1), sizeof(**cases));
(*cases)[*case_count] =
match_case_create(is_default ? NULL : expression_allocate(key.success, parser->pool),
expression_allocate(expression_from_sequence(value), parser->pool));
}
else
{
parse_optional_space(parser);
expression_parser_result const value = parse_expression(parser, indentation, 0);
if (!value.is_success)
{
if (!is_default)
{
expression_free(key.success);
}
return false;
}
{
rich_token const newline = peek(parser);
pop(parser);
if (newline.token != token_newline)
{
parser->on_error(
parse_error_create(parse_error_expected_newline, newline.where), parser->on_error_user);
if (!is_default)
{
expression_free(key.success);
}
expression_free(value.success);
return false;
}
}
*cases = reallocate_array(*cases, (*case_count + 1), sizeof(**cases));
(*cases)[*case_count] =
match_case_create(is_default ? NULL : expression_allocate(key.success, parser->pool),
expression_allocate(value.success, parser->pool));
}
++(*case_count);
}
}
static expression_parser_result parse_match(expression_parser *parser, size_t const indentation,
source_location const begin)
{
if (!parse_space(parser))
{
return expression_parser_result_failure;
}
expression_parser_result const input = parse_expression(parser, indentation, 0);
if (!input.is_success)
{
return input;
}
{
rich_token const newline = peek(parser);
pop(parser);
if (newline.token != token_newline)
{
parser->on_error(parse_error_create(parse_error_expected_newline, newline.where), parser->on_error_user);
expression_free(input.success);
return expression_parser_result_failure;
}
}
match_case *cases = NULL;
size_t case_count = 0;
if (parse_match_cases(parser, (indentation + 1), &cases, &case_count))
{
expression_parser_result const result = {
1, expression_from_match(
match_create(begin, expression_allocate(input.success, parser->pool), cases, case_count))};
return result;
}
expression_free(input.success);
LPG_FOR(size_t, i, case_count)
{
match_case_free(cases + i);
}
if (cases)
{
deallocate(cases);
}
return expression_parser_result_failure;
}
static void clean_up_parameters(parameter *const parameters, size_t parameter_count)
{
if (parameters)
{
for (size_t i = 0; i < parameter_count; ++i)
{
parameter_free(parameters + i);
}
deallocate(parameters);
}
}
static expression_parser_result parse_lambda_body(expression_parser *const parser, size_t const indentation,
generic_parameter_list generic_parameters,
function_header_tree const header, source_location const lambda_begin)
{
rich_token const next_token = peek(parser);
if (next_token.token == token_space && !header.return_type)
{
pop(parser);
expression_parser_result const body = parse_expression(parser, indentation, false);
if (!body.is_success)
{
generic_parameter_list_free(generic_parameters);
function_header_tree_free(header);
return expression_parser_result_failure;
}
expression_parser_result const result = {
1, expression_from_lambda(lambda_create(
generic_parameters, header, expression_allocate(body.success, parser->pool), lambda_begin))};
return result;
}
if (next_token.token == token_newline)
{
pop(parser);
sequence const body = parse_sequence(parser, (indentation + 1));
expression_parser_result const result = {
1, expression_from_lambda(lambda_create(generic_parameters, header,
expression_allocate(expression_from_sequence(body), parser->pool),
lambda_begin))};
return result;
}
pop(parser);
parser->on_error(parse_error_create(parse_error_expected_lambda_body, next_token.where), parser->on_error_user);
generic_parameter_list_free(generic_parameters);
function_header_tree_free(header);
return expression_parser_result_failure;
}
typedef struct function_header_parse_result
{
bool is_success;
function_header_tree header;
} function_header_parse_result;
static function_header_parse_result const function_header_parse_result_failure = {false, {NULL, 0, NULL}};
static function_header_parse_result parse_function_header(expression_parser *const parser, size_t const indentation)
{
parameter *parameters = NULL;
size_t parameter_count = 0;
expression *result_type = NULL;
for (;;)
{
rich_token const head = peek(parser);
if (head.token == token_right_parenthesis)
{
pop(parser);
if ((peek(parser).token == token_colon))
{
pop(parser);
/*space is optional here*/
if (peek(parser).token == token_space)
{
pop(parser);
}
expression_parser_result const type = parse_returnable(parser, indentation, false);
if (!type.is_success)
{
clean_up_parameters(parameters, parameter_count);
return function_header_parse_result_failure;
}
result_type = expression_allocate(type.success, parser->pool);
}
break;
}
if (parameter_count >= 1)
{
if (head.token == token_comma)
{
pop(parser);
parse_optional_space(parser);
}
else
{
pop(parser);
parser->on_error(parse_error_create(parse_error_expected_comma, head.where), parser->on_error_user);
clean_up_parameters(parameters, parameter_count);
return function_header_parse_result_failure;
}
}
rich_token const name = peek(parser);
pop(parser);
if (name.token != token_identifier)
{
parser->on_error(parse_error_create(parse_error_expected_identifier, name.where), parser->on_error_user);
clean_up_parameters(parameters, parameter_count);
return function_header_parse_result_failure;
}
{
rich_token const colon = peek(parser);
pop(parser);
if (colon.token != token_colon)
{
parser->on_error(parse_error_create(parse_error_expected_colon, colon.where), parser->on_error_user);
clean_up_parameters(parameters, parameter_count);
return function_header_parse_result_failure;
}
}
if (!parse_space(parser))
{
clean_up_parameters(parameters, parameter_count);
return function_header_parse_result_failure;
}
expression_parser_result const parsed_type = parse_expression(parser, indentation, false);
if (!parsed_type.is_success)
{
clean_up_parameters(parameters, parameter_count);
return function_header_parse_result_failure;
}
parameters = reallocate_array(parameters, (parameter_count + 1), sizeof(*parameters));
parameters[parameter_count] = parameter_create(identifier_expression_create(name.content, name.where),
expression_allocate(parsed_type.success, parser->pool));
++parameter_count;
}
function_header_parse_result const result = {
true, function_header_tree_create(parameters, parameter_count, result_type)};
return result;
}
static expression_parser_result parse_lambda(expression_parser *const parser, size_t const indentation,
generic_parameter_list generic_parameters,
source_location const lambda_begin)
{
function_header_parse_result const parsed_header = parse_function_header(parser, indentation);
if (!parsed_header.is_success)
{
generic_parameter_list_free(generic_parameters);
return expression_parser_result_failure;
}
return parse_lambda_body(parser, indentation, generic_parameters, parsed_header.header, lambda_begin);
}
static generic_parameter_list parse_generic_parameters(expression_parser *const parser)
{
rich_token const maybe_bracket = peek(parser);
if (maybe_bracket.token != token_left_bracket)
{
generic_parameter_list const result = {NULL, 0};
return result;
}
pop(parser);
unicode_view *generic_parameters = NULL;
size_t generic_parameter_count = 0;
for (;;)
{
rich_token const next = peek(parser);
if (next.token == token_identifier)
{
generic_parameters =
reallocate_array(generic_parameters, generic_parameter_count + 1, sizeof(*generic_parameters));
generic_parameters[generic_parameter_count] = next.content;
++generic_parameter_count;
pop(parser);
rich_token const after_parameter = peek(parser);
if (after_parameter.token == token_comma)
{
pop(parser);
parse_optional_space(parser);
}
else if (after_parameter.token != token_right_bracket)
{
parser->on_error(parse_error_create(parse_error_expected_right_bracket, after_parameter.where),
parser->on_error_user);
break;
}
}
else if (next.token == token_right_bracket)
{
pop(parser);
break;
}
else
{
parser->on_error(parse_error_create(parse_error_expected_right_bracket, next.where), parser->on_error_user);
break;
}
}
generic_parameter_list const result = {generic_parameters, generic_parameter_count};
return result;
}
static expression_parser_result parse_interface(expression_parser *const parser, size_t const indentation,
source_location const begin)
{
generic_parameter_list const parameters = parse_generic_parameters(parser);
interface_expression_method *methods = NULL;
size_t method_count = 0;
bool is_success = true;
for (;;)
{
{
rich_token const newline = peek_at(parser, 0);
if (newline.token != token_newline)
{
break;
}
}
{
rich_token const indent = peek_at(parser, 1);
if (!is_same_indentation_level(indent, indentation))
{
break;
}
}
pop_n(parser, 2);
rich_token const name = peek(parser);
if (name.token != token_identifier)
{
parser->on_error(parse_error_create(parse_error_expected_identifier, name.where), parser->on_error_user);
is_success = false;
break;
}
pop(parser);
{
rich_token const left_parenthesis = peek(parser);
if (left_parenthesis.token != token_left_parenthesis)
{
parser->on_error(parse_error_create(parse_error_expected_parameter_list, left_parenthesis.where),
parser->on_error_user);
is_success = false;
break;
}
pop(parser);
}
function_header_parse_result const header_parsed = parse_function_header(parser, indentation);
if (!header_parsed.is_success)
{
is_success = false;
break;
}
methods = reallocate_array(methods, (method_count + 1), sizeof(*methods));
methods[method_count] = interface_expression_method_create(
identifier_expression_create(name.content, name.where), header_parsed.header);
++method_count;
}
interface_expression const parsed = interface_expression_create(parameters, begin, methods, method_count);
if (is_success)
{
expression_parser_result const result = {true, expression_from_interface(parsed)};
return result;
}
interface_expression_free(parsed);
return expression_parser_result_failure;
}
static expression_parser_result parse_struct(expression_parser *const parser, size_t const indentation,
source_location const begin)
{
generic_parameter_list const generic_parameters = parse_generic_parameters(parser);
struct_expression_element *elements = NULL;
size_t element_count = 0;
bool is_success = true;
for (;;)
{
{
rich_token const newline = peek_at(parser, 0);
if (newline.token != token_newline)
{
break;
}
}
{
rich_token const indent = peek_at(parser, 1);
if (!is_same_indentation_level(indent, indentation))
{
break;
}
}
pop_n(parser, 2);
rich_token const name = peek(parser);
if (name.token != token_identifier)
{
parser->on_error(parse_error_create(parse_error_expected_identifier, name.where), parser->on_error_user);
is_success = false;
break;
}
pop(parser);
{
rich_token const colon = peek(parser);
if (colon.token != token_colon)
{
parser->on_error(parse_error_create(parse_error_expected_colon, colon.where), parser->on_error_user);
is_success = false;
break;
}
pop(parser);
}
if (!parse_space(parser))
{
is_success = false;
break;
}
expression_parser_result const type_parsed = parse_expression(parser, indentation, false);
if (!type_parsed.is_success)
{
is_success = false;
break;
}
elements = reallocate_array(elements, (element_count + 1), sizeof(*elements));
elements[element_count] = struct_expression_element_create(
identifier_expression_create(name.content, name.where), type_parsed.success);
++element_count;
}
struct_expression const parsed = struct_expression_create(generic_parameters, begin, elements, element_count);
if (is_success)
{
expression_parser_result const result = {true, expression_from_struct(parsed)};
return result;
}
struct_expression_free(&parsed);
return expression_parser_result_failure;
}
static expression_parser_result parse_enum(expression_parser *const parser, size_t const indentation,
source_location const begin)
{
generic_parameter_list const parameters = parse_generic_parameters(parser);
enum_expression_element *elements = NULL;
enum_element_id element_count = 0;
bool is_success = true;
for (;;)
{
{
rich_token const newline = peek_at(parser, 0);
if (newline.token != token_newline)
{
break;
}
}
{
rich_token const indent = peek_at(parser, 1);
if (!is_same_indentation_level(indent, indentation))
{
break;
}
}
pop_n(parser, 2);
rich_token const name = peek(parser);
if (name.token != token_identifier)
{
parser->on_error(parse_error_create(parse_error_expected_identifier, name.where), parser->on_error_user);
is_success = false;
break;
}
pop(parser);
expression *state = NULL;
rich_token const left_parenthesis = peek(parser);
if (left_parenthesis.token == token_left_parenthesis)
{
pop(parser);
expression_parser_result const maybe_state = parse_expression(parser, indentation, false);
if (!maybe_state.is_success)
{
is_success = false;
break;
}
rich_token const right_parenthesis = peek(parser);
if (right_parenthesis.token == token_right_parenthesis)
{
pop(parser);
}
else
{
parser->on_error(
parse_error_create(parse_error_expected_right_parenthesis, name.where), parser->on_error_user);
is_success = false;
expression_free(maybe_state.success);
break;
}
state = expression_allocate(maybe_state.success, parser->pool);
}
elements = reallocate_array(elements, (element_count + 1), sizeof(*elements));
elements[element_count] = enum_expression_element_create(unicode_view_copy(name.content), state);
++element_count;
}
enum_expression const parsed = enum_expression_create(begin, parameters, elements, element_count);
if (is_success)
{
expression_parser_result const result = {true, expression_from_enum(parsed)};
return result;
}
enum_expression_free(parsed);
return expression_parser_result_failure;
}
static expression_parser_result parse_type_of(expression_parser *const parser, size_t const indentation,
source_location const begin)
{
{
rich_token const left_parenthesis = peek(parser);
if (left_parenthesis.token != token_left_parenthesis)
{
parser->on_error(parse_error_create(parse_error_expected_left_parenthesis, left_parenthesis.where),
parser->on_error_user);
return expression_parser_result_failure;
}
}
pop(parser);
expression_parser_result const target_parsed = parse_expression(parser, indentation, false);
if (!target_parsed.is_success)
{
return expression_parser_result_failure;
}
{
rich_token const right_parenthesis = peek(parser);
if (right_parenthesis.token != token_right_parenthesis)
{
parser->on_error(parse_error_create(parse_error_expected_right_parenthesis, right_parenthesis.where),
parser->on_error_user);
expression_free(target_parsed.success);
return expression_parser_result_failure;
}
}
pop(parser);
expression_parser_result const result = {
true, expression_from_type_of(
type_of_expression_create(begin, expression_allocate(target_parsed.success, parser->pool)))};
return result;
}
static expression_parser_result parse_import(expression_parser *const parser, source_location const begin)
{
if (!parse_space(parser))
{
return expression_parser_result_failure;
}
rich_token const name = peek(parser);
if (name.token != token_identifier)
{
parser->on_error(parse_error_create(parse_error_expected_identifier, name.where), parser->on_error_user);
return expression_parser_result_failure;
}
pop(parser);
expression_parser_result const result = {true, expression_from_import(import_expression_create(
begin, identifier_expression_create(name.content, name.where)))};
return result;
}
static expression_parser_result parse_new_array(expression_parser *const parser, size_t indentation)
{
parse_optional_space(parser);
{
rich_token const left_parenthesis = peek(parser);
if (left_parenthesis.token != token_left_parenthesis)
{
parser->on_error(parse_error_create(parse_error_expected_left_parenthesis, left_parenthesis.where),
parser->on_error_user);
return expression_parser_result_failure;
}
pop(parser);
}
expression_parser_result const argument = parse_expression(parser, indentation, false);
if (!argument.is_success)
{
return expression_parser_result_failure;
}
parse_optional_space(parser);
{
rich_token const right_parenthesis = peek(parser);
if (right_parenthesis.token != token_right_parenthesis)
{
expression_free(argument.success);
parser->on_error(parse_error_create(parse_error_expected_right_parenthesis, right_parenthesis.where),
parser->on_error_user);
return expression_parser_result_failure;
}
pop(parser);
}
expression_parser_result const result = {
1, expression_from_new_array(new_array_expression_create(expression_allocate(argument.success, parser->pool)))};
return result;
}
typedef struct parse_callable_result
{
expression_parser_result content;
bool can_be_continued;
} parse_callable_result;
static parse_callable_result parse_callable_result_create(expression_parser_result content, bool can_be_continued)
{
parse_callable_result const result = {content, can_be_continued};
return result;
}
static parse_callable_result parse_identifier(expression_parser *parser, rich_token const head)
{
pop(parser);
expression_parser_result const result = {
1, expression_from_identifier(identifier_expression_create(head.content, head.where))};
return parse_callable_result_create(result, true);
}
static parse_callable_result parse_break(expression_parser *parser, rich_token const head, size_t const indentation)
{
pop(parser);
rich_token const space = peek(parser);
if ((space.token == token_space) && (space.content.length >= 1))
{
pop(parser);
expression_parser_result const returned_value = parse_expression(parser, indentation, false);
if (returned_value.is_success)
{
expression *const allocated = expression_allocate(returned_value.success, parser->pool);
expression_parser_result const result = {
true, expression_from_break(break_expression_create(head.where, allocated))};
return parse_callable_result_create(result, true);
}
expression_parser_result const result = {
false, expression_from_break(break_expression_create(head.where, NULL))};
return parse_callable_result_create(result, true);
}
expression_parser_result const result = {true, expression_from_break(break_expression_create(head.where, NULL))};
return parse_callable_result_create(result, true);
}
static parse_callable_result parse_generic_lambda(expression_parser *parser, size_t indentation)
{
generic_parameter_list const generic_parameters = parse_generic_parameters(parser);
parse_optional_space(parser);
rich_token const left_parenthesis = peek(parser);
if (left_parenthesis.token != token_left_parenthesis)
{
generic_parameter_list_free(generic_parameters);
parser->on_error(
parse_error_create(parse_error_expected_left_parenthesis, left_parenthesis.where), parser->on_error_user);
return parse_callable_result_create(expression_parser_result_failure, false);
}
pop(parser);
return parse_callable_result_create(
parse_lambda(parser, indentation, generic_parameters, left_parenthesis.where), false);
}
static parse_callable_result parse_integer(expression_parser *parser, rich_token const head)
{
pop(parser);
integer value;
if (integer_parse(&value, head.content))
{
expression_parser_result const result = {
1, expression_from_integer_literal(integer_literal_expression_create(value, head.where))};
return parse_callable_result_create(result, true);
}
parser->on_error(parse_error_create(parse_error_integer_literal_out_of_range, head.where), parser->on_error_user);
return parse_callable_result_create(expression_parser_result_failure, false);
}
static parse_callable_result parse_comment(expression_parser *parser, rich_token const head)
{
pop(parser);
char const multi_line_comment_start[2] = {'/', '*'};
ASSUME(multi_line_comment_start[0] == head.content.begin[0]);
ASSUME(head.content.length >= LPG_ARRAY_SIZE(multi_line_comment_start));
unicode_view content = unicode_view_create(head.content.begin + LPG_ARRAY_SIZE(multi_line_comment_start),
head.content.length - LPG_ARRAY_SIZE(multi_line_comment_start));
if (head.content.begin[1] == multi_line_comment_start[1])
{
char const multi_line_comment_end[2] = {'*', '/'};
if ((content.length >= LPG_ARRAY_SIZE(multi_line_comment_end)) &&
!memcmp((content.begin + content.length - LPG_ARRAY_SIZE(multi_line_comment_end)), multi_line_comment_end,
LPG_ARRAY_SIZE(multi_line_comment_end)))
{
content.length -= LPG_ARRAY_SIZE(multi_line_comment_end);
}
}
comment_expression const comment = comment_expression_create(unicode_view_copy(content), head.where);
expression_parser_result const result = {1, expression_from_comment(comment)};
return parse_callable_result_create(result, false);
}
static parse_callable_result parse_not(expression_parser *parser, size_t indentation)
{
pop(parser);
expression_parser_result const result = parse_expression(parser, indentation, false);
if (!result.is_success)
{
return parse_callable_result_create(expression_parser_result_failure, false);
}
expression *const success = expression_pool_allocate(parser->pool);
*success = result.success;
expression const expr = expression_from_not(not_expression_create(success));
expression_parser_result const result1 = {1, expr};
return parse_callable_result_create(result1, true);
}
static parse_callable_result handle_end_of_file(expression_parser *const parser, rich_token const head)
{
pop(parser);
parser->on_error(parse_error_create(parse_error_expected_expression, head.where), parser->on_error_user);
return parse_callable_result_create(expression_parser_result_failure, false);
}
static parse_callable_result parse_callable(expression_parser *parser, size_t indentation)
{
for (;;)
{
rich_token const head = peek(parser);
if (is_end_of_file(&head))
{
return handle_end_of_file(parser, head);
}
switch (head.token)
{
case token_identifier:
return parse_identifier(parser, head);
case token_break:
return parse_break(parser, head, indentation);
case token_loop:
pop(parser);
return parse_callable_result_create(parse_loop(parser, indentation), false);
case token_match:
pop(parser);
return parse_callable_result_create(parse_match(parser, indentation, head.where), false);
case token_left_parenthesis:
pop(parser);
return parse_callable_result_create(
parse_lambda(parser, indentation, generic_parameter_list_create(NULL, 0), head.where), true);
case token_left_bracket:
return parse_generic_lambda(parser, indentation);
case token_right_bracket:
case token_right_curly_brace:
case token_right_parenthesis:
case token_newline:
case token_space:
case token_indentation:
case token_colon:
case token_comma:
case token_assign:
case token_fat_arrow:
case token_return:
case token_case:
case token_dot:
case token_let:
case token_equals:
case token_not_equals:
case token_less_than:
case token_less_than_or_equals:
case token_greater_than:
case token_greater_than_or_equals:
case token_left_curly_brace:
pop(parser);
parser->on_error(parse_error_create(parse_error_expected_expression, head.where), parser->on_error_user);
break;
case token_integer:
return parse_integer(parser, head);
case token_comment:
return parse_comment(parser, head);
case token_string:
{
pop(parser);
expression_parser_result const result = {
1, expression_from_string(string_expression_create(head.content, head.where))};
return parse_callable_result_create(result, true);
}
case token_raw_string:
{
pop(parser);
expression_parser_result const result = {
1, expression_from_string(string_expression_create(head.content, head.where))};
return parse_callable_result_create(result, true);
}
case token_not:
return parse_not(parser, indentation);
case token_interface:
pop(parser);
return parse_callable_result_create(parse_interface(parser, indentation + 1, head.where), false);
case token_struct:
pop(parser);
return parse_callable_result_create(parse_struct(parser, indentation + 1, head.where), false);
case token_enum:
pop(parser);
return parse_callable_result_create(parse_enum(parser, indentation + 1, head.where), false);
case token_impl:
pop(parser);
parser->on_error(parse_error_create(parse_error_expected_expression, head.where), parser->on_error_user);
return parse_callable_result_create(expression_parser_result_failure, false);
case token_type_of:
pop(parser);
return parse_callable_result_create(parse_type_of(parser, indentation, head.where), true);
case token_import:
pop(parser);
return parse_callable_result_create(parse_import(parser, head.where), true);
case token_new_array:
pop(parser);
return parse_callable_result_create(parse_new_array(parser, indentation), true);
}
}
}
static tuple parse_tuple(expression_parser *parser, size_t indentation, source_location const opening_brace)
{
rich_token next = peek(parser);
if (next.token == token_right_curly_brace)
{
pop(parser);
return tuple_create(NULL, 0, opening_brace);
}
size_t element_count = 0;
bool more_elements = true;
expression *tuple_elements = allocate_array(0, sizeof(*tuple_elements));
while (next.token != token_right_curly_brace)
{
if (next.token == token_comma)
{
more_elements = true;
pop(parser);
parse_optional_space(parser);
}
expression_parser_result const parser_result = parse_expression(parser, indentation, false);
if (parser_result.is_success && more_elements)
{
/*TODO: avoid O(N^2)*/
tuple_elements = reallocate_array(tuple_elements, element_count + 1, sizeof(*tuple_elements));
tuple_elements[element_count] = parser_result.success;
element_count++;
more_elements = false;
}
else
{
if (parser_result.is_success)
{
expression_free(parser_result.success);
}
for (size_t i = 0; i < element_count; ++i)
{
expression_free(tuple_elements[i]);
}
if (tuple_elements)
{
deallocate(tuple_elements);
}
return tuple_create(NULL, 0, opening_brace);
}
next = peek(parser);
}
pop(parser);
return tuple_create(tuple_elements, element_count, opening_brace);
}
static int parse_call(expression_parser *parser, size_t indentation, expression *result,
source_location const opening_parenthesis)
{
expression *arguments = NULL;
size_t argument_count = 0;
size_t argument_capacity = 0;
int expect_another_argument = 0;
for (;;)
{
{
rich_token const maybe_close = peek(parser);
if (is_end_of_file(&maybe_close))
{
pop(parser);
parser->on_error(
parse_error_create(parse_error_expected_arguments, maybe_close.where), parser->on_error_user);
for (size_t i = 0; i < argument_count; ++i)
{
expression_free(arguments[i]);
}
if (arguments)
{
deallocate(arguments);
}
return 0;
}
if (maybe_close.token == token_right_parenthesis)
{
pop(parser);
if (expect_another_argument)
{
parser->on_error(
parse_error_create(parse_error_expected_expression, maybe_close.where), parser->on_error_user);
}
*result = expression_from_call(call_create(expression_allocate(*result, parser->pool),
tuple_create(arguments, argument_count, opening_parenthesis),
maybe_close.where));
return 1;
}
}
expression_parser_result const argument = parse_expression(parser, indentation, 1);
if (argument.is_success)
{
arguments = reallocate_array_exponentially(
arguments, argument_count + 1, sizeof(*arguments), argument_count, &argument_capacity);
arguments[argument_count] = argument.success;
argument_count++;
}
rich_token const maybe_comma = peek(parser);
if (is_end_of_file(&maybe_comma))
{
pop(parser);
parser->on_error(
parse_error_create(parse_error_expected_arguments, maybe_comma.where), parser->on_error_user);
for (size_t i = 0; i < argument_count; ++i)
{
expression_free(arguments[i]);
}
if (arguments)
{
deallocate(arguments);
}
return 0;
}
if (maybe_comma.token == token_comma)
{
expect_another_argument = 1;
pop(parser);
rich_token const expected_space = peek(parser);
if (expected_space.token == token_space)
{
pop(parser);
}
else
{
parser->on_error(
parse_error_create(parse_error_expected_space, expected_space.where), parser->on_error_user);
}
}
else
{
expect_another_argument = 0;
}
}
}
static expression parse_instantiate_struct(expression_parser *parser, size_t indentation, expression structure,
source_location const opening_brace)
{
tuple const arguments = parse_tuple(parser, indentation, opening_brace);
return expression_from_instantiate_struct(
instantiate_struct_expression_create(expression_allocate(structure, parser->pool), arguments));
}
static bool parse_generic_instantiation(expression_parser *const parser, size_t const indentation,
expression *const result)
{
rich_token next = peek(parser);
size_t argument_count = 0;
bool more_elements = true;
expression *arguments = allocate_array(0, sizeof(*arguments));
while (next.token != token_right_bracket)
{
if (next.token == token_comma)
{
more_elements = true;
pop(parser);
next = peek(parser);
if (next.token == token_space)
{
pop(parser);
}
}
expression_parser_result const parser_result = parse_expression(parser, indentation, false);
if (parser_result.is_success && more_elements)
{
/*TODO: avoid O(N^2)*/
arguments = reallocate_array(arguments, argument_count + 1, sizeof(*arguments));
arguments[argument_count] = parser_result.success;
argument_count++;
more_elements = false;
}
else
{
if (parser_result.is_success)
{
expression_free(parser_result.success);
}
for (size_t i = 0; i < argument_count; ++i)
{
expression_free(arguments[i]);
}
if (arguments)
{
deallocate(arguments);
}
return false;
}
next = peek(parser);
}
pop(parser);
*result = expression_from_generic_instantiation(
generic_instantiation_expression_create(expression_allocate(*result, parser->pool), arguments, argument_count));
return true;
}
static expression_parser_result parse_binary_operator(expression_parser *const parser, const size_t indentation,
expression left_side, binary_operator operator)
{
// Checking the whitespaces
rich_token const token = peek(parser);
if (token.token != token_space)
{
parser->on_error(parse_error_create(parse_error_expected_space, peek(parser).where), parser->on_error_user);
}
else
{
pop(parser);
}
expression_parser_result const right = parse_expression(parser, indentation, true);
if (!right.is_success)
{
expression_parser_result const result = {true, left_side};
return result;
}
binary_operator_expression binary_operator_expression1;
binary_operator_expression1.left = expression_pool_allocate(parser->pool);
*binary_operator_expression1.left = left_side;
binary_operator_expression1.right = expression_pool_allocate(parser->pool);
*binary_operator_expression1.right = right.success;
binary_operator_expression1.comparator = operator;
expression_parser_result const result = {true, expression_from_binary_operator(binary_operator_expression1)};
return result;
}
static expression_parser_result parse_returnable_suffixes(expression_parser *const parser, size_t const indentation,
bool const may_be_binary, expression const left_most)
{
expression_parser_result result = {true, left_most};
for (;;)
{
rich_token const maybe_operator = peek(parser);
if (maybe_operator.token == token_left_parenthesis)
{
pop(parser);
if (parse_call(parser, indentation, &result.success, maybe_operator.where))
{
continue;
}
}
if (maybe_operator.token == token_left_curly_brace)
{
pop(parser);
result.success = parse_instantiate_struct(parser, indentation, result.success, maybe_operator.where);
continue;
}
if (maybe_operator.token == token_left_bracket)
{
pop(parser);
if (parse_generic_instantiation(parser, indentation, &result.success))
{
continue;
}
else
{
expression_free(result.success);
return expression_parser_result_failure;
}
}
if (may_be_binary)
{
size_t peeking = 0;
if ((maybe_operator.token == token_space) && (maybe_operator.content.length == 1))
{
peeking += 1;
}
rich_token const next_operator = peek_at(parser, peeking);
if (next_operator.token == token_not_equals)
{
if (peeking == 0)
{
parser->on_error(
parse_error_create(parse_error_expected_space, next_operator.where), parser->on_error_user);
}
pop_n(parser, peeking + 1);
return parse_binary_operator(parser, indentation, result.success, not_equals);
}
if (next_operator.token == token_greater_than)
{
if (peeking == 0)
{
parser->on_error(
parse_error_create(parse_error_expected_space, next_operator.where), parser->on_error_user);
}
pop_n(parser, peeking + 1);
return parse_binary_operator(parser, indentation, result.success, greater_than);
}
if (next_operator.token == token_greater_than_or_equals)
{
if (peeking == 0)
{
parser->on_error(
parse_error_create(parse_error_expected_space, next_operator.where), parser->on_error_user);
}
pop_n(parser, peeking + 1);
return parse_binary_operator(parser, indentation, result.success, greater_than_or_equals);
}
if (next_operator.token == token_less_than)
{
if (peeking == 0)
{
parser->on_error(
parse_error_create(parse_error_expected_space, next_operator.where), parser->on_error_user);
}
pop_n(parser, peeking + 1);
return parse_binary_operator(parser, indentation, result.success, less_than);
}
if (next_operator.token == token_less_than_or_equals)
{
if (peeking == 0)
{
parser->on_error(
parse_error_create(parse_error_expected_space, next_operator.where), parser->on_error_user);
}
pop_n(parser, peeking + 1);
return parse_binary_operator(parser, indentation, result.success, less_than_or_equals);
}
if (next_operator.token == token_equals)
{
if (peeking == 0)
{
parser->on_error(
parse_error_create(parse_error_expected_space, next_operator.where), parser->on_error_user);
}
pop_n(parser, peeking + 1);
return parse_binary_operator(parser, indentation, result.success, equals);
}
}
if (maybe_operator.token == token_dot)
{
pop(parser);
rich_token const element_name = peek(parser);
pop(parser);
if ((element_name.token == token_identifier) || (element_name.token == token_integer))
{
expression const access = expression_from_access_structure(
access_structure_create(expression_allocate(result.success, parser->pool),
identifier_expression_create(element_name.content, element_name.where)));
result.success = access;
continue;
}
parser->on_error(
parse_error_create(parse_error_expected_element_name, element_name.where), parser->on_error_user);
ASSUME(result.is_success);
expression_free(result.success);
return expression_parser_result_failure;
}
return result;
}
}
static expression_parser_result parse_returnable(expression_parser *const parser, size_t const indentation,
bool const may_be_binary)
{
parse_callable_result const callee = parse_callable(parser, indentation);
if (!callee.content.is_success)
{
return callee.content;
}
if (!callee.can_be_continued)
{
return callee.content;
}
return parse_returnable_suffixes(parser, indentation, may_be_binary, callee.content.success);
}
static expression_parser_result parse_impl(expression_parser *const parser, size_t const indentation,
source_location const impl_keyword)
{
generic_parameter_list const generic_parameters = parse_generic_parameters(parser);
{
rich_token const space = peek(parser);
pop(parser);
if (space.token != token_space)
{
parser->on_error(parse_error_create(parse_error_expected_space, space.where), parser->on_error_user);
}
}
expression_parser_result const implemented_interface = parse_expression(parser, indentation, false);
if (!implemented_interface.is_success)
{
generic_parameter_list_free(generic_parameters);
return expression_parser_result_failure;
}
{
rich_token const space = peek(parser);
pop(parser);
if (space.token != token_space || space.content.length != 1)
{
parser->on_error(parse_error_create(parse_error_expected_space, space.where), parser->on_error_user);
expression_free(implemented_interface.success);
generic_parameter_list_free(generic_parameters);
return expression_parser_result_failure;
}
}
{
rich_token const for_ = peek(parser);
pop(parser);
if ((for_.token != token_identifier) || !unicode_view_equals_c_str(for_.content, "for"))
{
parser->on_error(parse_error_create(parse_error_expected_for, for_.where), parser->on_error_user);
expression_free(implemented_interface.success);
generic_parameter_list_free(generic_parameters);
return expression_parser_result_failure;
}
}
{
rich_token const space = peek(parser);
pop(parser);
if (space.token != token_space)
{
parser->on_error(parse_error_create(parse_error_expected_space, space.where), parser->on_error_user);
expression_free(implemented_interface.success);
generic_parameter_list_free(generic_parameters);
return expression_parser_result_failure;
}
}
expression_parser_result const self = parse_expression(parser, indentation, false);
if (!self.is_success)
{
expression_free(implemented_interface.success);
generic_parameter_list_free(generic_parameters);
return expression_parser_result_failure;
}
{
rich_token const newline = peek_at(parser, 0);
pop(parser);
if (newline.token != token_newline)
{
parser->on_error(parse_error_create(parse_error_expected_newline, newline.where), parser->on_error_user);
expression_free(implemented_interface.success);
expression_free(self.success);
generic_parameter_list_free(generic_parameters);
return expression_parser_result_failure;
}
}
impl_expression_method *methods = NULL;
size_t method_count = 0;
bool is_success = true;
for (;;)
{
size_t const method_indentation = (indentation + 1);
{
rich_token const indent = peek_at(parser, 0);
if (!is_same_indentation_level(indent, method_indentation))
{
break;
}
}
pop_n(parser, 1);
rich_token const name = peek(parser);
if (name.token != token_identifier)
{
parser->on_error(parse_error_create(parse_error_expected_identifier, name.where), parser->on_error_user);
is_success = false;
break;
}
pop(parser);
{
rich_token const left_parenthesis = peek(parser);
if (left_parenthesis.token != token_left_parenthesis)
{
parser->on_error(parse_error_create(parse_error_expected_parameter_list, left_parenthesis.where),
parser->on_error_user);
is_success = false;
break;
}
pop(parser);
}
function_header_parse_result const header_parsed = parse_function_header(parser, method_indentation);
if (!header_parsed.is_success)
{
is_success = false;
break;
}
{
rich_token const new_line = peek(parser);
if (new_line.token != token_newline)
{
parser->on_error(
parse_error_create(parse_error_expected_newline, new_line.where), parser->on_error_user);
is_success = false;
function_header_tree_free(header_parsed.header);
break;
}
pop(parser);
}
sequence const body = parse_sequence(parser, method_indentation + 1);
methods = reallocate_array(methods, (method_count + 1), sizeof(*methods));
methods[method_count] = impl_expression_method_create(
identifier_expression_create(name.content, name.where), header_parsed.header, body);
++method_count;
}
impl_expression const impl = impl_expression_create(
impl_keyword, generic_parameters, expression_allocate(implemented_interface.success, parser->pool),
expression_allocate(self.success, parser->pool), methods, method_count);
if (is_success)
{
expression_parser_result const result = {true, expression_from_impl(impl)};
return result;
}
impl_expression_free(impl);
return expression_parser_result_failure;
}
expression_parser_result parse_let_expression(expression_parser *const parser, size_t const indentation)
{
if (!parse_space(parser))
{
return expression_parser_result_failure;
}
rich_token const name = peek(parser);
pop(parser);
if (name.token != token_identifier)
{
parser->on_error(parse_error_create(parse_error_expected_identifier, name.where), parser->on_error_user);
return expression_parser_result_failure;
}
if (peek(parser).token == token_right_parenthesis)
{
expression_parser_result const result = {
true, expression_from_placeholder(placeholder_expression_create(name.where, name.content))};
return result;
}
parse_optional_space(parser);
expression_parser_result declared_variable_type = {
false, expression_from_break(break_expression_create(source_location_create(0, 0), NULL))};
rich_token colon_or_assign = peek(parser);
if (colon_or_assign.token == token_colon)
{
pop(parser);
parse_optional_space(parser);
declared_variable_type = parse_returnable(parser, indentation, false);
if (!declared_variable_type.is_success)
{
return expression_parser_result_failure;
}
parse_optional_space(parser);
colon_or_assign = peek(parser);
}
if (colon_or_assign.token != token_assign)
{
if (declared_variable_type.is_success)
{
expression_free(declared_variable_type.success);
}
parser->on_error(parse_error_create(parse_error_expected_declaration_or_assignment, colon_or_assign.where),
parser->on_error_user);
return expression_parser_result_failure;
}
pop(parser);
parse_optional_space(parser);
expression_parser_result const initial_value = parse_returnable(parser, indentation, true);
if (!initial_value.is_success)
{
if (declared_variable_type.is_success)
{
expression_free(declared_variable_type.success);
}
return expression_parser_result_failure;
}
expression_parser_result const result = {
true, expression_from_declare(declare_create(
identifier_expression_create(name.content, name.where),
(declared_variable_type.is_success ? expression_allocate(declared_variable_type.success, parser->pool)
: NULL),
expression_allocate(initial_value.success, parser->pool)))};
return result;
}
expression_parser_result parse_expression(expression_parser *const parser, size_t const indentation,
bool const may_be_statement)
{
size_t const maximum_nesting_depth = 20;
if (parser->current_nesting_depth >= maximum_nesting_depth)
{
rich_token const head = peek(parser);
pop(parser);
parser->on_error(parse_error_create(parse_error_nesting_too_deep, head.where), parser->on_error_user);
return expression_parser_result_failure;
}
parser->current_nesting_depth += 1;
if (may_be_statement)
{
rich_token const head = peek(parser);
if (head.token == token_return)
{
pop(parser);
rich_token const space = peek(parser);
pop(parser);
if ((space.token == token_space) && (space.content.length == 1))
{
expression_parser_result result = parse_returnable(parser, indentation, true);
if (result.is_success)
{
result.success = expression_from_return(expression_allocate(result.success, parser->pool));
}
parser->current_nesting_depth -= 1;
return result;
}
parser->on_error(parse_error_create(parse_error_expected_space, space.where), parser->on_error_user);
parser->current_nesting_depth -= 1;
return expression_parser_result_failure;
}
if (head.token == token_let)
{
pop(parser);
expression_parser_result const result = parse_let_expression(parser, indentation);
parser->current_nesting_depth -= 1;
return result;
}
if (head.token == token_impl)
{
pop(parser);
expression_parser_result const result = parse_impl(parser, indentation, head.where);
parser->current_nesting_depth -= 1;
return result;
}
}
expression_parser_result const result = parse_returnable(parser, indentation, true);
parser->current_nesting_depth -= 1;
return result;
}
sequence parse_program(expression_parser *parser)
{
return parse_sequence(parser, 0);
}
| TyRoXx/Lpg | syntax/lpg_parse_expression.c | C | mit | 63,102 |
package org.robolectric.internal;
import org.robolectric.annotation.Config;
import org.robolectric.manifest.AndroidManifest;
import org.robolectric.res.Fs;
import org.robolectric.res.FsFile;
import org.robolectric.util.Logger;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
public class MavenManifestFactory implements ManifestFactory {
@Override
public ManifestIdentifier identify(Config config) {
if (config.manifest().equals(Config.NONE)) {
return new ManifestIdentifier(null, null, null, null, null);
}
FsFile manifestFile = getBaseDir().join(config.manifest());
FsFile baseDir = manifestFile.getParent();
FsFile resDir = baseDir.join(config.resourceDir());
FsFile assetDir = baseDir.join(config.assetDir());
List<FsFile> libraryDirs = null;
if (config.libraries().length > 0) {
libraryDirs = new ArrayList<>();
for (String libraryDirName : config.libraries()) {
libraryDirs.add(baseDir.join(libraryDirName));
}
}
return new ManifestIdentifier(manifestFile, resDir, assetDir, config.packageName(), libraryDirs);
}
@Override
public AndroidManifest create(ManifestIdentifier manifestIdentifier) {
AndroidManifest appManifest;
FsFile manifestFile = manifestIdentifier.getManifestFile();
if (manifestFile == null) {
appManifest = createDummyManifest(manifestIdentifier.getPackageName());
} else if (!manifestFile.exists()) {
System.out.println("WARNING: No manifest file found at " + manifestFile.getPath() + ".");
System.out.println("Falling back to the Android OS resources only.");
System.out.println("To remove this warning, annotate your test class with @Config(manifest=Config.NONE).");
appManifest = createDummyManifest(manifestIdentifier.getPackageName());
} else {
FsFile resDir = manifestIdentifier.getResDir();
FsFile assetDir = manifestIdentifier.getAssetDir();
String packageName = manifestIdentifier.getPackageName();
Logger.debug("Robolectric assets directory: " + assetDir.getPath());
Logger.debug(" Robolectric res directory: " + resDir.getPath());
Logger.debug(" Robolectric manifest path: " + manifestFile.getPath());
Logger.debug(" Robolectric package name: " + packageName);
appManifest = new AndroidManifest(manifestFile, resDir, assetDir, packageName);
}
List<FsFile> libraryDirs = manifestIdentifier.getLibraryDirs();
appManifest.setLibraryManifests(createLibraryManifests(appManifest, libraryDirs));
return appManifest;
}
private AndroidManifest createDummyManifest(String packageName) {
if (packageName == null || packageName.equals("")) {
packageName = "org.robolectric.default";
}
return new AndroidManifest(null, null, null, packageName) {
@Override
public int getTargetSdkVersion() {
return SdkConfig.FALLBACK_SDK_VERSION;
}
};
}
FsFile getBaseDir() {
return Fs.currentDirectory();
}
/**
* Search through an AndroidManifest's library directories to load library AppManifest files.
* For testing, allow a parameter override of the library directories.
* @param androidManifest The main AppManifest which may have library resources.
* @param libraryDirectories If not null, override the libraries in androidManifest.
* @return A list of AndroidManifest objects, one for each library found.
*/
private static List<AndroidManifest> createLibraryManifests(
AndroidManifest androidManifest,
List<FsFile> libraryDirectories) {
List<AndroidManifest> libraryManifests = new ArrayList<>();
if (androidManifest != null) {
// If there is no library override, look through subdirectories.
if (libraryDirectories == null) {
libraryDirectories = findLibraries(androidManifest);
}
for (FsFile libraryBaseDir : libraryDirectories) {
AndroidManifest libraryManifest = createLibraryAndroidManifest(libraryBaseDir);
libraryManifest.setLibraryManifests(
createLibraryManifests(libraryManifest, null));
libraryManifests.add(libraryManifest);
}
}
return libraryManifests;
}
private static AndroidManifest createLibraryAndroidManifest(FsFile libraryBaseDir) {
return new AndroidManifest(libraryBaseDir.join(Config.DEFAULT_MANIFEST_NAME), libraryBaseDir.join(Config.DEFAULT_RES_FOLDER), libraryBaseDir.join(Config.DEFAULT_ASSET_FOLDER));
}
private static Properties getProperties(FsFile propertiesFile) {
Properties properties = new Properties();
// return an empty Properties object if the propertiesFile does not exist
if (!propertiesFile.exists()) return properties;
InputStream stream;
try {
stream = propertiesFile.getInputStream();
} catch (IOException e) {
throw new RuntimeException(e);
}
try {
try {
properties.load(stream);
} finally {
stream.close();
}
} catch (IOException e) {
throw new RuntimeException(e);
}
return properties;
}
/**
* Find valid library AndroidManifest files referenced from an already loaded AndroidManifest's
* "project.properties" file.
* @param androidManifest
*/
private static List<FsFile> findLibraries(AndroidManifest androidManifest) {
List<FsFile> libraryBaseDirs = new ArrayList<>();
if (androidManifest.getResDirectory() != null) {
FsFile baseDir = androidManifest.getResDirectory().getParent();
final Properties properties = getProperties(baseDir.join("project.properties"));
Properties overrideProperties = getProperties(baseDir.join("test-project.properties"));
properties.putAll(overrideProperties);
int libRef = 1;
String lib;
while ((lib = properties.getProperty("android.library.reference." + libRef)) != null) {
FsFile libraryBaseDir = baseDir.join(lib);
if (libraryBaseDir.isDirectory()) {
// Ignore directories without any files
FsFile[] libraryBaseDirFiles = libraryBaseDir.listFiles();
if (libraryBaseDirFiles != null && libraryBaseDirFiles.length > 0) {
libraryBaseDirs.add(libraryBaseDir);
}
}
libRef++;
}
}
return libraryBaseDirs;
}
}
| ocadotechnology/robolectric | robolectric/src/main/java/org/robolectric/internal/MavenManifestFactory.java | Java | mit | 6,318 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\CssSelector\Node;
use Symfony\Component\CssSelector\XPathExpr;
/**
* HashNode represents a "selector#id" node.
*
* This component is a port of the Python lxml library,
* which is copyright Infrae and distributed under the BSD license.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class HashNode implements NodeInterface
{
protected $selector;
protected $id;
/**
* Constructor.
*
* @param NodeInterface $selector The NodeInterface object
* @param string $id The ID
*/
public function __construct($selector, $id)
{
$this->selector = $selector;
$this->id = $id;
}
/**
* {@inheritDoc}
*/
public function __toString()
{
return sprintf('%s[%s#%s]', __CLASS__, $this->selector, $this->id);
}
/**
* {@inheritDoc}
*/
public function toXpath()
{
$path = $this->selector->toXpath();
$path->addCondition(sprintf('@id = %s', XPathExpr::xpathLiteral($this->id)));
return $path;
}
}
| lrt/lrt | vendor/symfony/symfony/src/Symfony/Component/CssSelector/Node/HashNode.php | PHP | mit | 1,376 |
package info.aea.rss;
import java.io.IOException;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.jsoup.Jsoup;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import android.util.Log;
public class RSSParser {
// RSS XML document CHANNEL tag
private static String TAG_CHANNEL = "channel";
private static String TAG_TITLE = "title";
private static String TAG_LINK = "link";
private static String TAG_DESRIPTION = "description";
private static String TAG_LANGUAGE = "language";
private static String TAG_ITEM = "item";
private static String TAG_PUB_DATE = "pubDate";
private static String TAG_GUID = "guid";
// constructor
public RSSParser() {
}
/***
* Get RSS feed from url
*
* @param url - is url of the website
* @return RSSFeed class object
*/
public RSSFeed getRSSFeed(String url) {
RSSFeed rssFeed = null;
String rss_feed_xml = null;
// getting rss link from html source code
String rss_url = this.getRSSLinkFromURL(url);
// check if rss_link is found or not
if (rss_url != null) {
// RSS url found
// get RSS XML from rss ulr
rss_feed_xml = this.getXmlFromUrl(rss_url);
// check if RSS XML fetched or not
if (rss_feed_xml != null) {
// successfully fetched rss xml
// parse the xml
try {
Document doc = this.getDomElement(rss_feed_xml);
NodeList nodeList = doc.getElementsByTagName(TAG_CHANNEL);
Element e = (Element) nodeList.item(0);
// RSS nodes
String title = this.getValue(e, TAG_TITLE);
String link = this.getValue(e, TAG_LINK);
String description = this.getValue(e, TAG_DESRIPTION);
String language = this.getValue(e, TAG_LANGUAGE);
// Creating new RSS Feed
rssFeed = new RSSFeed(title, description, link, rss_url, language);
} catch (Exception e) {
// Check log for errors
e.printStackTrace();
}
} else {
// failed to fetch rss xml
}
} else {
// no RSS url found
}
return rssFeed;
}
/**
* Getting RSS feed items <item>
*
* @param - rss link url of the website
* @return - List of RSSItem class objects
* */
public List<RSSItem> getRSSFeedItems(String rss_url){
List<RSSItem> itemsList = new ArrayList<RSSItem>();
String rss_feed_xml;
// get RSS XML from rss url
rss_feed_xml = this.getXmlFromUrl(rss_url);
// check if RSS XML fetched or not
if(rss_feed_xml != null){
// successfully fetched rss xml
// parse the xml
try{
Document doc = this.getDomElement(rss_feed_xml);
NodeList nodeList = doc.getElementsByTagName(TAG_CHANNEL);
Element e = (Element) nodeList.item(0);
// Getting items array
NodeList items = e.getElementsByTagName(TAG_ITEM);
// looping through each item
for(int i = 0; i < items.getLength(); i++){
Element e1 = (Element) items.item(i);
String title = this.getValue(e1, TAG_TITLE);
String link = this.getValue(e1, TAG_LINK);
String description = this.getValue(e1, TAG_DESRIPTION);
String pubdate = this.getValue(e1, TAG_PUB_DATE);
String guid = this.getValue(e1, TAG_GUID);
RSSItem rssItem = new RSSItem(title, link, description, pubdate, guid);
// adding item to list
itemsList.add(rssItem);
}
}catch(Exception e){
// Check log for errors
e.printStackTrace();
}
}
// return item list
return itemsList;
}
/**
* Getting RSS feed link from HTML source code
*
* @param ulr is url of the website
* @returns url of rss link of website
* */
public String getRSSLinkFromURL(String url) {
// RSS url
String rss_url = null;
try {
// Using JSoup library to parse the html source code
org.jsoup.nodes.Document doc = Jsoup.connect(url).get();
// finding rss links which are having link[type=application/rss+xml]
org.jsoup.select.Elements links = doc
.select("link[type=application/rss+xml]");
Log.d("No of RSS links found", " " + links.size());
// check if urls found or not
if (links.size() > 0) {
rss_url = links.get(0).attr("href").toString();
} else {
// finding rss links which are having link[type=application/rss+xml]
org.jsoup.select.Elements links1 = doc
.select("link[type=application/atom+xml]");
if(links1.size() > 0){
rss_url = links1.get(0).attr("href").toString();
}
}
} catch (IOException e) {
e.printStackTrace();
}
// returing RSS url
return rss_url;
}
/**
* Method to get xml content from url HTTP Get request
* */
public String getXmlFromUrl(String url) {
String xml = null;
try {
// request method is GET
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
HttpResponse httpResponse = httpClient.execute(httpGet);
HttpEntity httpEntity = httpResponse.getEntity();
xml = EntityUtils.toString(httpEntity);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// return XML
return xml;
}
/**
* Getting XML DOM element
*
* @param XML string
* */
public Document getDomElement(String xml) {
Document doc = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(xml));
doc = (Document) db.parse(is);
} catch (ParserConfigurationException e) {
Log.e("Error: ", e.getMessage());
return null;
} catch (SAXException e) {
Log.e("Error: ", e.getMessage());
return null;
} catch (IOException e) {
Log.e("Error: ", e.getMessage());
return null;
}
return doc;
}
/**
* Getting node value
*
* @param elem element
*/
public final String getElementValue(Node elem) {
Node child;
if (elem != null) {
if (elem.hasChildNodes()) {
for (child = elem.getFirstChild(); child != null; child = child
.getNextSibling()) {
if (child.getNodeType() == Node.TEXT_NODE || ( child.getNodeType() == Node.CDATA_SECTION_NODE)) {
return child.getNodeValue();
}
}
}
}
return "";
}
/**
* Getting node value
*
* @param Element node
* @param key string
* */
public String getValue(Element item, String str) {
NodeList n = item.getElementsByTagName(str);
return this.getElementValue(n.item(0));
}
}
| aman-devy/snippets | Snippets/src/info/aea/rss/RSSParser.java | Java | mit | 7,349 |
/*
Time Count
TimeCount class, useful for incremental games
By Luke Nickerson, 2015
*/
(function(){
var TimeCount = function(){
this.lastTime = null;
}
TimeCount.prototype.setLastTime = function(){
}
// Install into RocketBoots if it exists, otherwise make global
if (typeof RocketBoots == "object") {
RocketBoots.installComponent(
"time_count", // file name
"TimeCount", // class name
TimeCount // class
);
} else window["TimeCount"] = TimeCount;
})(); | Lukenickerson/reptilian-president | scripts/rocketboots/time_count.js | JavaScript | mit | 486 |
<?php
namespace Oro\Bundle\ReportBundle\Tests\Unit\DependencyInjection;
use Oro\Bundle\ReportBundle\DependencyInjection\Compiler\DbalConnectionCompilerPass;
use Oro\Bundle\ReportBundle\DependencyInjection\OroReportExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class OroReportExtensionTest extends \PHPUnit\Framework\TestCase
{
public function testLoadEmptyConfig()
{
$configs = [];
$container = new ContainerBuilder();
$extension = new OroReportExtension();
$extension->load($configs, $container);
self::assertFalse($container->hasParameter(DbalConnectionCompilerPass::CONNECTION_PARAM_NAME));
self::assertFalse($container->hasParameter(DbalConnectionCompilerPass::DATAGRID_PREFIXES_PARAM_NAME));
self::assertEquals(
[
[
'settings' => [
'resolved' => true,
'display_sql_query' => ['value' => false, 'scope' => 'app']
]
]
],
$container->getExtensionConfig('oro_report')
);
}
public function testLoadConfigWithReportDbalConnection()
{
$configs = [
[
'dbal' => [
'connection' => 'reports'
]
]
];
$container = new ContainerBuilder();
$extension = new OroReportExtension();
$extension->load($configs, $container);
self::assertEquals(
$configs[0]['dbal']['connection'],
$container->getParameter(DbalConnectionCompilerPass::CONNECTION_PARAM_NAME)
);
self::assertEquals(
[],
$container->getParameter(DbalConnectionCompilerPass::DATAGRID_PREFIXES_PARAM_NAME)
);
}
public function testLoadConfigWithReportDbalConnectionAndDatagridPrefixes()
{
$configs = [
[
'dbal' => [
'connection' => 'reports',
'datagrid_prefixes' => ['prefix1']
]
]
];
$container = new ContainerBuilder();
$extension = new OroReportExtension();
$extension->load($configs, $container);
self::assertEquals(
$configs[0]['dbal']['connection'],
$container->getParameter(DbalConnectionCompilerPass::CONNECTION_PARAM_NAME)
);
self::assertEquals(
$configs[0]['dbal']['datagrid_prefixes'],
$container->getParameter(DbalConnectionCompilerPass::DATAGRID_PREFIXES_PARAM_NAME)
);
}
public function testLoadConfigWithReportDbalDatagridPrefixesButWithoutConnection()
{
$configs = [
[
'dbal' => [
'datagrid_prefixes' => ['prefix1']
]
]
];
$container = new ContainerBuilder();
$extension = new OroReportExtension();
$extension->load($configs, $container);
self::assertFalse($container->hasParameter(DbalConnectionCompilerPass::CONNECTION_PARAM_NAME));
self::assertFalse($container->hasParameter(DbalConnectionCompilerPass::DATAGRID_PREFIXES_PARAM_NAME));
}
}
| orocrm/platform | src/Oro/Bundle/ReportBundle/Tests/Unit/DependencyInjection/OroReportExtensionTest.php | PHP | mit | 3,270 |
;§ £®«®¢®ª ¯à¨«®¦¥¨ï
use32 ; âà á«ïâ®à, ¨á¯®«ì§ãî騩 32 à §àï¤ëå ª®¬ ¤ë
org 0x0 ; ¡ §®¢ë© ¤à¥á ª®¤ , ¢á¥£¤ 0x0
db 'MENUET01' ; ¨¤¥â¨ä¨ª â®à ¨á¯®«ï¥¬®£® ä ©« (8 ¡ ©â)
dd 0x1 ; ¢¥àá¨ï ä®à¬ â § £®«®¢ª ¨á¯®«ï¥¬®£® ä ©«
dd start ; ¤à¥á, ª®â®àë© á¨á⥬ ¯¥à¥¤ ñâ ã¯à ¢«¥¨¥
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥¨ï ¢ ¯ ¬ïâì
dd i_end ; à §¬¥à ¯à¨«®¦¥¨ï
dd mem ; ¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪ ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢¨¬ £à¨æã 4 ¡ ©â
dd mem ; à ᯮ«®¦¨¬ ¯®§¨æ¨î á⥪ ¢ ®¡« á⨠¯ ¬ïâ¨, áà §ã § ⥫®¬ ¯à®£à ¬¬ë. ¥àè¨ á⥪ ¢ ¤¨ ¯ §®¥ ¯ ¬ïâ¨, 㪠§ ®¬ ¢ëè¥
dd 0x0 ; 㪠§ ⥫ì áâபã á ¯ à ¬¥âà ¬¨.
dd cur_dir_path ; 㪠§ â¥«ì ¤à¥á, ªã¤ ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥â § ¯ã᪠.
include '../../../../../macros.inc'
include '../../trunk/box_lib.mac'
include '../../load_lib.mac'
@use_library ;use load lib macros
start:
;universal load library/librarys
sys_load_library library_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
;if return code =-1 then exit, else nornary work
cmp eax,-1
jz exit
mcall 40,0x27 ;ãáâ ®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
push dword check1 ;¯®¤áçñâ ¤¨ë ⥪áâ ¤«ï Checkbox'®¢
call [init_checkbox]
push dword check2
call [init_checkbox]
red_win:
call draw_window ;¯¥à¢® ç «ì® ¥®¡å®¤¨¬® à¨á®¢ âì ®ª®
align 4
still: ;®á®¢®© ®¡à ¡®â稪
mcall 10 ;¦¨¤ âì ᮡëâ¨ï
dec eax
jz red_win
dec eax
jz key
dec eax
jz button
push dword edit1
call [edit_box_mouse]
push dword edit2
call [edit_box_mouse]
push dword check1
call [check_box_mouse]
push dword check2
call [check_box_mouse]
push dword Option_boxs
call [option_box_mouse]
push dword Option_boxs2
call [option_box_mouse]
jmp still ;¥á«¨ ¨ç¥£® ¨§ ¯¥à¥ç¨á«¥®£® ⮠ᮢ ¢ 横«
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
button:
mcall 17 ;¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª« ¢¨è¨
test ah,ah ;¥á«¨ ¢ ah 0, â® ¯¥à¥©â¨ ®¡à ¡®â稪 ᮡë⨩ still
jz still
exit:
mcall -1
key:
mcall 2 ;§ £à㧨¬ § 票¥ 2 ¢ ॣ¨áâ®à eax ¨ ¯®«ã稬 ª®¤ ¦ ⮩ ª« ¢¨è¨
push dword edit1
call [edit_box_key]
push dword edit2
call [edit_box_key]
jmp still
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
align 4
draw_window: ;à¨á®¢ ¨¥ ®ª ¯à¨«®¦¥¨ï
mcall 12,1
mcall 0,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword check1
call [check_box_draw]
push dword check2
call [check_box_draw]
push dword Option_boxs
call [option_box_draw]
push dword Option_boxs2
call [option_box_draw]
mcall 12,2
ret
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA ¤ ë¥
;ᥣ¤ ᮡ«î¤ âì ¯®á«¥¤®¢ ⥫ì®áâì ¢ ¨¬¥¨.
system_path db '/sys/lib/'
library_name db 'box_lib.obj',0
;
᫨ ¥áâì ¦¥« ¨¥ à §ê¥¤¨¨âì, ⮠㦮 ¨á¯®«ì§®¢ âì á«¥¤ãîé¨î ª®áâàãªæ¨î
;system_path db '/sys/lib/box_lib.obj',0
;... «î¡ ï ¯®á«¥¤®¢ ⥫ì®áâì ¤àã£¨å ª®¬ ¤ ¨ ®¯à¥¤¥«¥¨©.
;library_name db 'box_lib.obj',0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library box_lib.obj',0
myimport:
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
version_ed dd aVersion_ed
init_checkbox dd aInit_checkbox
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
version_ch dd aVersion_ch
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
version_op dd aVersion_op
dd 0
dd 0
aEdit_box_draw db 'edit_box',0
aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0
aVersion_ed db 'version_ed',0
aInit_checkbox db 'init_checkbox2',0
aCheck_box_draw db 'check_box_draw2',0
aCheck_box_mouse db 'check_box_mouse2',0
aVersion_ch db 'version_ch2',0
aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0
aVersion_op db 'version_op',0
check1 check_box2 (10 shl 16 + 12),(45 shl 16 + 12),5,0x80AABBCC,0,0,check_text1,ch_flag_en
check2 check_box2 (10 shl 16 + 12),(60 shl 16 + 12),6,0x80AABBCC,0,0,check_text2
edit1 edit_box 350,3,5,0xffffff,0x6f9480,0,0xAABBCC,0,308,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
edit2 edit_box 350,3,25,0xffffff,0x6a9480,0,0,0,99,ed_buffer,mouse_dd,ed_figure_only
op1 option_box option_group1,10,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
op2 option_box option_group1,10,105,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
op3 option_box option_group1,10,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
op11 option_box option_group2,120,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
op12 option_box option_group2,120,105,6,12,0xffffff,0,0,op_text.2,op_text.e2-op_text.2
op13 option_box option_group2,120,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
option_group1 dd op1 ;㪠§ ⥫¨, ®¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ¨î, ª®£¤ ¢ë¢®¤¨âáï
option_group2 dd op12 ;¯à¨«®¦¥¨¥
Option_boxs dd op1,op2,op3,0
Option_boxs2 dd op11,op12,op13,0
hed db 'BOXs load from lib <Lrz> date 27.04.2009',0
hed_end:
rb 256
check_text1 db 'First checkbox',0
check_text2 db 'Second checkbox',0
op_text: ; ®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï Optionbox'
.1 db 'Option_Box #1'
.e1:
.2 db 'Option_Box #2'
.e2:
.3 db 'Option_Box #3'
.e3:
ed_buffer rb 100
;-----------------------
;sc system_colors
mouse_dd rd 1
p_info process_information
cur_dir_path rb 4096
library_path rb 4096
i_end:
rb 1024
mem: | devlato/kolibrios-llvm | programs/develop/libraries/box_lib/asm/trunk/editbox_ex.asm | Assembly | mit | 6,288 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <stdio.h>
#include <libc/file.h>
#include <libc/stdiohk.h>
FILE __dj_stdout = {
0, 0, 0, 0,
_IOWRT | _IOFBF,
1
};
| devlato/kolibrios-llvm | programs/develop/libraries/menuetlibc/src/libc/ansi/stdio/stdout.c | C | mit | 194 |
//-----------------------------------------------------------------------
// <copyright file="EventSource.cs">(c) http://www.codeplex.com/MSBuildExtensionPack. This source is subject to the Microsoft Permissive License. See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. All other rights reserved.</copyright>
//-----------------------------------------------------------------------
namespace MSBuild.ExtensionPack.Computer
{
using System;
using System.Diagnostics;
using System.Globalization;
using Microsoft.Build.Framework;
/// <summary>
/// <b>Valid TaskActions are:</b>
/// <para><i>CheckExists</i> (<b>Required: </b>Source <b>Optional: </b>MachineName <b>Output: </b>Exists)</para>
/// <para><i>Create</i> (<b>Required: </b>Source, LogName <b>Optional: </b>Force, MachineName, CategoryCount, MessageResourceFile, CategoryResourceFile, ParameterResourceFile)</para>
/// <para><i>Delete</i> (<b>Required: </b>Source <b>Optional: </b>MachineName)</para>
/// <para><i>Log</i> (<b>Required: </b> Source, Description, LogType, EventId, LogName<b>Optional: </b>MachineName)</para>
/// <para><b>Remote Execution Support:</b> Yes</para>
/// </summary>
/// <example>
/// <code lang="xml"><![CDATA[
/// <Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
/// <PropertyGroup>
/// <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
/// <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
/// </PropertyGroup>
/// <Import Project="$(TPath)"/>
/// <Target Name="Default">
/// <!-- Delete an event source -->
/// <MSBuild.ExtensionPack.Computer.EventSource TaskAction="Delete" Source="MyEventSource" LogName="Application"/>
/// <!-- Check an event source exists -->
/// <MSBuild.ExtensionPack.Computer.EventSource TaskAction="CheckExists" Source="MyEventSource" LogName="Application">
/// <Output TaskParameter="Exists" PropertyName="DoesExist"/>
/// </MSBuild.ExtensionPack.Computer.EventSource>
/// <Message Text="Exists: $(DoesExist)"/>
/// <!-- Create an event source -->
/// <MSBuild.ExtensionPack.Computer.EventSource TaskAction="Create" Source="MyEventSource" LogName="Application"/>
/// <MSBuild.ExtensionPack.Computer.EventSource TaskAction="CheckExists" Source="MyEventSource" LogName="Application">
/// <Output TaskParameter="Exists" PropertyName="DoesExist"/>
/// </MSBuild.ExtensionPack.Computer.EventSource>
/// <Message Text="Exists: $(DoesExist)"/>
/// <!-- Log an event -->
/// <MSBuild.ExtensionPack.Computer.EventSource TaskAction="Log" Source="MyEventSource" Description="Hello" LogType="Information" EventId="222"/>
/// </Target>
/// </Project>
/// ]]></code>
/// </example>
[HelpUrl("http://www.msbuildextensionpack.com/help/3.5.12.0/html/072b0fa3-2739-f3aa-124c-71955299d206.htm")]
public class EventSource : BaseTask
{
private const string CheckExistsTaskAction = "CheckExists";
private const string CreateTaskAction = "Create";
private const string DeleteTaskAction = "Delete";
private const string LogTaskAction = "Log";
private System.Diagnostics.EventLogEntryType logType = System.Diagnostics.EventLogEntryType.Error;
[DropdownValue(CheckExistsTaskAction)]
[DropdownValue(CreateTaskAction)]
[DropdownValue(DeleteTaskAction)]
[DropdownValue(LogTaskAction)]
public override string TaskAction
{
get { return base.TaskAction; }
set { base.TaskAction = value; }
}
/// <summary>
/// Sets the event id.
/// </summary>
[TaskAction(LogTaskAction, true)]
public string EventId { get; set; }
/// <summary>
/// Sets the Event Log Entry Type. Possible values are: Error, FailureAudit, Information, SuccessAudit, Warning.
/// </summary>
[TaskAction(LogTaskAction, true)]
public string LogType
{
get { return this.logType.ToString(); }
set { this.logType = (System.Diagnostics.EventLogEntryType)Enum.Parse(typeof(System.Diagnostics.EventLogEntryType), value); }
}
/// <summary>
/// Sets the description for the logentry
/// </summary>
[TaskAction(LogTaskAction, true)]
public string Description { get; set; }
/// <summary>
/// Sets the source name
/// </summary>
[Required]
[TaskAction(CheckExistsTaskAction, true)]
[TaskAction(CreateTaskAction, true)]
[TaskAction(DeleteTaskAction, true)]
[TaskAction(LogTaskAction, true)]
public string Source { get; set; }
/// <summary>
/// Sets the name of the log the source's entries are written to, e.g Application, Security, System, YOUREVENTLOG.
/// </summary>
[TaskAction(CreateTaskAction, true)]
[TaskAction(LogTaskAction, false)]
public string LogName { get; set; }
/// <summary>
/// Set to true to delete any existing matching eventsource when creating
/// </summary>
[TaskAction(CreateTaskAction, false)]
public bool Force { get; set; }
/// <summary>
/// Sets the number of categories in the category resource file
/// </summary>
[TaskAction(CreateTaskAction, false)]
public int CategoryCount { get; set; }
/// <summary>
/// Sets the path of the message resource file to configure an event log source to write localized event messages
/// </summary>
[TaskAction(CreateTaskAction, false)]
public string MessageResourceFile { get; set; }
/// <summary>
/// Sets the path of the category resource file to write events with localized category strings
/// </summary>
[TaskAction(CreateTaskAction, false)]
public string CategoryResourceFile { get; set; }
/// <summary>
/// Sets the path of the parameter resource file to configure an event log source to write localized event messages with inserted parameter strings
/// </summary>
[TaskAction(CreateTaskAction, false)]
public string ParameterResourceFile { get; set; }
/// <summary>
/// Gets a value indicating whether the EventSource exists.
/// </summary>
[Output]
[TaskAction(CheckExistsTaskAction, false)]
public bool Exists { get; set; }
[TaskAction(CheckExistsTaskAction, false)]
[TaskAction(CreateTaskAction, false)]
[TaskAction(DeleteTaskAction, false)]
[TaskAction(LogTaskAction, false)]
public override string MachineName
{
get { return base.MachineName; }
set { base.MachineName = value; }
}
/// <summary>
/// Performs the action of this task.
/// </summary>
protected override void InternalExecute()
{
switch (this.TaskAction)
{
case "Create":
this.Create();
break;
case "CheckExists":
this.CheckExists();
break;
case "Delete":
this.Delete();
break;
case "Log":
this.LogEvent();
break;
default:
this.Log.LogError(string.Format(CultureInfo.CurrentCulture, "Invalid TaskAction passed: {0}", this.TaskAction));
return;
}
}
private void Delete()
{
this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "Deleting EventSource: {0}", this.Source));
if (System.Diagnostics.EventLog.SourceExists(this.Source, this.MachineName))
{
System.Diagnostics.EventLog.DeleteEventSource(this.Source, this.MachineName);
}
}
private void LogEvent()
{
// Validation
if (string.IsNullOrEmpty(this.EventId))
{
this.Log.LogError("EventId must be specified");
return;
}
this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "Logging to EventSource: {0}", this.Source));
if (!System.Diagnostics.EventLog.SourceExists(this.Source, this.MachineName))
{
this.Log.LogError(string.Format(CultureInfo.CurrentCulture, "The EventSource does not exist: {0} on {1}", this.Source, this.MachineName));
}
else
{
string logName = this.LogName ?? "Application";
using (System.Diagnostics.EventLog log = new System.Diagnostics.EventLog(logName, this.MachineName, this.Source))
{
log.WriteEntry(this.Description, this.logType, int.Parse(this.EventId, CultureInfo.CurrentCulture));
}
}
}
private void CheckExists()
{
this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "Checking EventSource exists: {0}", this.Source));
this.Exists = System.Diagnostics.EventLog.SourceExists(this.Source, this.MachineName);
}
private void Create()
{
this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "Creating EventSource: {0}", this.Source));
EventSourceCreationData data = new EventSourceCreationData(this.Source, this.LogName)
{
MachineName = this.MachineName,
CategoryCount = this.CategoryCount,
MessageResourceFile = this.MessageResourceFile ?? string.Empty,
CategoryResourceFile = this.CategoryResourceFile ?? string.Empty,
ParameterResourceFile = this.ParameterResourceFile ?? string.Empty
};
if (!System.Diagnostics.EventLog.SourceExists(this.Source, this.MachineName))
{
System.Diagnostics.EventLog.CreateEventSource(data);
}
else
{
if (this.Force)
{
this.LogTaskMessage(MessageImportance.Low, string.Format(CultureInfo.CurrentCulture, "The event source already exists. Force is true, attempting to delete: {0}", this.Source));
System.Diagnostics.EventLog.DeleteEventSource(this.Source, this.MachineName);
this.LogTaskMessage(MessageImportance.Low, string.Format(CultureInfo.CurrentCulture, "Creating EventSource: {0}", this.Source));
System.Diagnostics.EventLog.CreateEventSource(data);
}
else
{
this.Log.LogError("The event source already exists. Use Force to delete and create.");
}
}
}
}
} | mikefourie/MSBuildExtensionPack | Releases/Archive/Main3.5/Framework/Computer/EventSource.cs | C# | mit | 11,618 |
<?php
/*
* This file is part of the PHPExifTool package.
*
* (c) Alchemy <support@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPExiftool\Driver\Tag\Canon;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class ColorTempCustom2 extends AbstractTag
{
protected $Id = 74;
protected $Name = 'ColorTempCustom2';
protected $FullName = 'Canon::ColorData1';
protected $GroupName = 'Canon';
protected $g0 = 'MakerNotes';
protected $g1 = 'Canon';
protected $g2 = 'Camera';
protected $Type = 'int16s';
protected $Writable = true;
protected $Description = 'Color Temp Custom 2';
protected $flag_Permanent = true;
}
| bburnichon/PHPExiftool | lib/PHPExiftool/Driver/Tag/Canon/ColorTempCustom2.php | PHP | mit | 848 |
/* iCheck plugin Line skin, red
----------------------------------- */
.icheckbox_line-red,
.iradio_line-red {
position: relative;
display: block;
margin: 0;
padding: 5px 15px 5px 38px;
font-size: 13px;
line-height: 17px;
color: #fff;
background: #e56c69;
border: none;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
cursor: pointer;
}
.icheckbox_line-red .icheck_line-icon,
.iradio_line-red .icheck_line-icon {
position: absolute;
top: 50%;
left: 13px;
width: 13px;
height: 11px;
margin: -5px 0 0 0;
padding: 0;
overflow: hidden;
background: url(line.png) no-repeat;
border: none;
}
.icheckbox_line-red.hover,
.icheckbox_line-red.checked.hover,
.iradio_line-red.hover {
background: #E98582;
}
.icheckbox_line-red.checked,
.iradio_line-red.checked {
background: #e56c69;
}
.icheckbox_line-red.checked .icheck_line-icon,
.iradio_line-red.checked .icheck_line-icon {
background-position: -15px 0;
}
.icheckbox_line-red.disabled,
.iradio_line-red.disabled {
background: #F7D3D2;
cursor: default;
}
.icheckbox_line-red.disabled .icheck_line-icon,
.iradio_line-red.disabled .icheck_line-icon {
background-position: -30px 0;
}
.icheckbox_line-red.checked.disabled,
.iradio_line-red.checked.disabled {
background: #F7D3D2;
}
.icheckbox_line-red.checked.disabled .icheck_line-icon,
.iradio_line-red.checked.disabled .icheck_line-icon {
background-position: -45px 0;
}
/* HiDPI support */
@media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) {
.icheckbox_line-red .icheck_line-icon,
.iradio_line-red .icheck_line-icon {
background-image: url(line@2x.png);
-webkit-background-size: 60px 13px;
background-size: 60px 13px;
}
} | ViraxDev/centrale_referencement | src/BackendBundle/Resources/public/css/iCheck/line/red.css | CSS | mit | 1,862 |
import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";
export default createSvgIcon( /*#__PURE__*/_jsx("path", {
d: "M19 3h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm1 14H8c-.55 0-1-.45-1-1s.45-1 1-1h5c.55 0 1 .45 1 1s-.45 1-1 1zm3-4H8c-.55 0-1-.45-1-1s.45-1 1-1h8c.55 0 1 .45 1 1s-.45 1-1 1zm0-4H8c-.55 0-1-.45-1-1s.45-1 1-1h8c.55 0 1 .45 1 1s-.45 1-1 1z"
}), 'AssignmentRounded'); | oliviertassinari/material-ui | packages/mui-icons-material/lib/esm/AssignmentRounded.js | JavaScript | mit | 553 |
//>>built
define({descTemplate:"${2} - ${3}/${1} ${0}",firstTip:"\uccab \ud398\uc774\uc9c0",lastTip:"\ub9c8\uc9c0\ub9c9 \ud398\uc774\uc9c0",nextTip:"\ub2e4\uc74c \ud398\uc774\uc9c0",prevTip:"\uc774\uc804 \ud398\uc774\uc9c0",itemTitle:"\ud56d\ubaa9",singularItemTitle:"\ud56d\ubaa9",pageStepLabelTemplate:"${0} \ud398\uc774\uc9c0",pageSizeLabelTemplate:"\ud398\uc774\uc9c0\ub2f9 ${0}\uac1c \ud56d\ubaa9",allItemsLabelTemplate:"\ubaa8\ub4e0 \ud56d\ubaa9",gotoButtonTitle:"\ud2b9\uc815 \ud398\uc774\uc9c0\ub85c \uc774\ub3d9",
dialogTitle:"\ud398\uc774\uc9c0 \uc774\ub3d9",dialogIndication:"\ud398\uc774\uc9c0 \ubc88\ud638 \uc9c0\uc815",pageCountIndication:" (${0}\ud398\uc774\uc9c0)",dialogConfirm:"\uc774\ub3d9",dialogCancel:"\ucde8\uc18c",all:"\ubaa8\ub450"}); | ycabon/presentations | 2020-devsummit/arcgis-js-api-road-ahead/js-api/dojox/grid/enhanced/nls/ko/Pagination.js | JavaScript | mit | 759 |
PORT=8887
while `true` ; do
echo "about to start jetty on port $PORT"
mvn -Djetty.port=$PORT jetty:run
SLEEPTIME=$?
echo "jetty stopped. Going to sleep for $SLEEPTIME seconds"
sleep $SLEEPTIME
done
| hotlib/http-rpc-client | resttest-app/run7.sh | Shell | mit | 204 |
/*
* Copyright (c) 2015, 2016, 2017 Adrian Siekierka
*
* This file is part of Charset.
*
* Charset 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.
*
* Charset 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 Charset. If not, see <http://www.gnu.org/licenses/>.
*/
package betterwithmods.client.baking;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraftforge.common.model.TRSRTransformation;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import javax.vecmath.Matrix4f;
import javax.vecmath.Vector3f;
import java.util.EnumMap;
public abstract class BaseBakedModel implements IBakedModel {
private final EnumMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap = new EnumMap(ItemCameraTransforms.TransformType.class);
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
return ImmutablePair.of(this,
transformMap.containsKey(cameraTransformType) ? transformMap.get(cameraTransformType).getMatrix() : null);
}
@Override
public boolean isAmbientOcclusion() {
return true;
}
@Override
public boolean isGui3d() {
return true;
}
@Override
public boolean isBuiltInRenderer() {
return false;
}
@Override
public ItemOverrideList getOverrides() {
return ItemOverrideList.NONE;
}
public void addTransformation(ItemCameraTransforms.TransformType type, TRSRTransformation transformation) {
transformMap.put(type, TRSRTransformation.blockCornerToCenter(transformation));
}
public void addThirdPersonTransformation(TRSRTransformation transformation) {
addTransformation(ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, transformation);
addTransformation(ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, toLeftHand(transformation));
}
// ForgeBlockStateV1 transforms
private static final TRSRTransformation flipX = new TRSRTransformation(null, null, new Vector3f(-1, 1, 1), null);
protected static TRSRTransformation toLeftHand(TRSRTransformation transform) {
return TRSRTransformation.blockCenterToCorner(flipX.compose(TRSRTransformation.blockCornerToCenter(transform)).compose(flipX));
}
protected static TRSRTransformation getTransformation(float tx, float ty, float tz, float ax, float ay, float az, float s) {
return TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
new Vector3f(tx / 16, ty / 16, tz / 16),
TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)),
new Vector3f(s, s, s),
null));
}
public BaseBakedModel addDefaultBlockTransforms() {
//All transformations are forge default block transformations with y angle +180
TRSRTransformation thirdperson = getTransformation(0, 2.5f, 0, 75, 225, 0, 0.375f);
addTransformation(ItemCameraTransforms.TransformType.GUI, getTransformation(0, 0, 0, 30, 45, 0, 0.625f));
addTransformation(ItemCameraTransforms.TransformType.GROUND, getTransformation(0, 0, 0, 0, 180, 0, 0.25f)); //Note: this is different from the default block transform oddly enough
addTransformation(ItemCameraTransforms.TransformType.FIXED, getTransformation(0, 0, 0, 0, 180, 0, 0.5f));
addThirdPersonTransformation(thirdperson);
addTransformation(ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND, getTransformation(0, 0, 0, 0, 225, 0, 0.4f));
addTransformation(ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND, getTransformation(0, 0, 0, 0, 75, 0, 0.4f));
return this;
}
}
| BetterWithMods/BetterWithMods | src/main/java/betterwithmods/client/baking/BaseBakedModel.java | Java | mit | 4,407 |
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.actionbarsherlock;
public final class R {
public static final class attr {
public static final int absForceOverflow = 0x7f010039;
public static final int actionBarDivider = 0x7f01000e;
public static final int actionBarItemBackground = 0x7f01000f;
public static final int actionBarSize = 0x7f01000d;
public static final int actionBarSplitStyle = 0x7f01000b;
public static final int actionBarStyle = 0x7f01000a;
public static final int actionBarTabBarStyle = 0x7f010007;
public static final int actionBarTabStyle = 0x7f010006;
public static final int actionBarTabTextStyle = 0x7f010008;
public static final int actionBarWidgetTheme = 0x7f01000c;
public static final int actionButtonStyle = 0x7f01002b;
public static final int actionDropDownStyle = 0x7f01002a;
public static final int actionMenuTextAppearance = 0x7f010010;
public static final int actionMenuTextColor = 0x7f010011;
public static final int actionModeBackground = 0x7f010014;
public static final int actionModeCloseButtonStyle = 0x7f010013;
public static final int actionModeCloseDrawable = 0x7f010016;
public static final int actionModePopupWindowStyle = 0x7f010018;
public static final int actionModeShareDrawable = 0x7f010017;
public static final int actionModeSplitBackground = 0x7f010015;
public static final int actionModeStyle = 0x7f010012;
public static final int actionOverflowButtonStyle = 0x7f010009;
public static final int actionSpinnerItemStyle = 0x7f010030;
public static final int activatedBackgroundIndicator = 0x7f010038;
public static final int activityChooserViewStyle = 0x7f010037;
public static final int background = 0x7f010002;
public static final int backgroundSplit = 0x7f010003;
public static final int backgroundStacked = 0x7f010040;
public static final int buttonStyleSmall = 0x7f010019;
public static final int customNavigationLayout = 0x7f010041;
public static final int displayOptions = 0x7f01003b;
public static final int divider = 0x7f010005;
public static final int dividerVertical = 0x7f010029;
public static final int dropDownListViewStyle = 0x7f01002d;
public static final int dropdownListPreferredItemHeight = 0x7f01002f;
public static final int expandActivityOverflowButtonDrawable = 0x7f010050;
public static final int headerBackground = 0x7f01004a;
public static final int height = 0x7f010004;
public static final int homeAsUpIndicator = 0x7f01002c;
public static final int homeLayout = 0x7f010042;
public static final int horizontalDivider = 0x7f010048;
public static final int icon = 0x7f01003e;
public static final int indeterminateProgressStyle = 0x7f010044;
public static final int initialActivityCount = 0x7f01004f;
public static final int itemBackground = 0x7f01004b;
public static final int itemIconDisabledAlpha = 0x7f01004d;
public static final int itemPadding = 0x7f010046;
public static final int itemTextAppearance = 0x7f010047;
public static final int listPopupWindowStyle = 0x7f010036;
public static final int listPreferredItemHeightSmall = 0x7f010023;
public static final int listPreferredItemPaddingLeft = 0x7f010024;
public static final int listPreferredItemPaddingRight = 0x7f010025;
public static final int logo = 0x7f01003f;
public static final int navigationMode = 0x7f01003a;
public static final int popupMenuStyle = 0x7f01002e;
public static final int preserveIconSpacing = 0x7f01004e;
public static final int progressBarPadding = 0x7f010045;
public static final int progressBarStyle = 0x7f010043;
public static final int spinnerDropDownItemStyle = 0x7f010022;
public static final int spinnerItemStyle = 0x7f010021;
public static final int subtitle = 0x7f01003d;
public static final int subtitleTextStyle = 0x7f010001;
public static final int textAppearanceLargePopupMenu = 0x7f01001b;
public static final int textAppearanceListItemSmall = 0x7f010026;
public static final int textAppearanceSmall = 0x7f01001d;
public static final int textAppearanceSmallPopupMenu = 0x7f01001c;
public static final int textColorPrimary = 0x7f01001e;
public static final int textColorPrimaryDisableOnly = 0x7f01001f;
public static final int textColorPrimaryInverse = 0x7f010020;
public static final int title = 0x7f01003c;
public static final int titleTextStyle = 0x7f010000;
public static final int verticalDivider = 0x7f010049;
public static final int windowActionBar = 0x7f010032;
public static final int windowActionBarOverlay = 0x7f010033;
public static final int windowActionModeOverlay = 0x7f010034;
public static final int windowAnimationStyle = 0x7f01004c;
public static final int windowContentOverlay = 0x7f01001a;
public static final int windowMinWidthMajor = 0x7f010027;
public static final int windowMinWidthMinor = 0x7f010028;
public static final int windowNoTitle = 0x7f010031;
public static final int windowSplitActionBar = 0x7f010035;
}
public static final class bool {
public static final int abs__action_bar_embed_tabs = 0x7f060000;
public static final int abs__action_bar_expanded_action_views_exclusive = 0x7f060002;
public static final int abs__config_actionMenuItemAllCaps = 0x7f060004;
public static final int abs__config_allowActionMenuItemTextWithIcon = 0x7f060005;
public static final int abs__config_showMenuShortcutsWhenKeyboardPresent = 0x7f060003;
public static final int abs__split_action_bar_is_narrow = 0x7f060001;
}
public static final class color {
public static final int abs__background_holo_dark = 0x7f070000;
public static final int abs__background_holo_light = 0x7f070001;
public static final int abs__bright_foreground_disabled_holo_dark = 0x7f070004;
public static final int abs__bright_foreground_disabled_holo_light = 0x7f070005;
public static final int abs__bright_foreground_holo_dark = 0x7f070002;
public static final int abs__bright_foreground_holo_light = 0x7f070003;
public static final int abs__bright_foreground_inverse_holo_dark = 0x7f070006;
public static final int abs__bright_foreground_inverse_holo_light = 0x7f070007;
public static final int abs__holo_blue_light = 0x7f070008;
public static final int abs__primary_text_disable_only_holo_dark = 0x7f07000d;
public static final int abs__primary_text_disable_only_holo_light = 0x7f07000e;
public static final int abs__primary_text_holo_dark = 0x7f07000f;
public static final int abs__primary_text_holo_light = 0x7f070010;
}
public static final class dimen {
public static final int abs__action_bar_default_height = 0x7f080001;
public static final int abs__action_bar_icon_vertical_padding = 0x7f080002;
public static final int abs__action_bar_subtitle_bottom_margin = 0x7f080006;
public static final int abs__action_bar_subtitle_text_size = 0x7f080004;
public static final int abs__action_bar_subtitle_top_margin = 0x7f080005;
public static final int abs__action_bar_title_text_size = 0x7f080003;
public static final int abs__action_button_min_width = 0x7f080007;
public static final int abs__alert_dialog_title_height = 0x7f080008;
public static final int abs__config_prefDialogWidth = 0x7f080000;
public static final int abs__dialog_min_width_major = 0x7f080009;
public static final int abs__dialog_min_width_minor = 0x7f08000a;
public static final int action_button_min_width = 0x7f08000b;
}
public static final class drawable {
public static final int abs__ab_bottom_solid_dark_holo = 0x7f020000;
public static final int abs__ab_bottom_solid_inverse_holo = 0x7f020001;
public static final int abs__ab_bottom_solid_light_holo = 0x7f020002;
public static final int abs__ab_bottom_transparent_dark_holo = 0x7f020003;
public static final int abs__ab_bottom_transparent_light_holo = 0x7f020004;
public static final int abs__ab_share_pack_holo_dark = 0x7f020005;
public static final int abs__ab_share_pack_holo_light = 0x7f020006;
public static final int abs__ab_solid_dark_holo = 0x7f020007;
public static final int abs__ab_solid_light_holo = 0x7f020008;
public static final int abs__ab_solid_shadow_holo = 0x7f020009;
public static final int abs__ab_stacked_solid_dark_holo = 0x7f02000a;
public static final int abs__ab_stacked_solid_light_holo = 0x7f02000b;
public static final int abs__ab_stacked_transparent_dark_holo = 0x7f02000c;
public static final int abs__ab_stacked_transparent_light_holo = 0x7f02000d;
public static final int abs__ab_transparent_dark_holo = 0x7f02000e;
public static final int abs__ab_transparent_light_holo = 0x7f02000f;
public static final int abs__activated_background_holo_dark = 0x7f020010;
public static final int abs__activated_background_holo_light = 0x7f020011;
public static final int abs__btn_cab_done_default_holo_dark = 0x7f020012;
public static final int abs__btn_cab_done_default_holo_light = 0x7f020013;
public static final int abs__btn_cab_done_focused_holo_dark = 0x7f020014;
public static final int abs__btn_cab_done_focused_holo_light = 0x7f020015;
public static final int abs__btn_cab_done_holo_dark = 0x7f020016;
public static final int abs__btn_cab_done_holo_light = 0x7f020017;
public static final int abs__btn_cab_done_pressed_holo_dark = 0x7f020018;
public static final int abs__btn_cab_done_pressed_holo_light = 0x7f020019;
public static final int abs__cab_background_bottom_holo_dark = 0x7f02001a;
public static final int abs__cab_background_bottom_holo_light = 0x7f02001b;
public static final int abs__cab_background_top_holo_dark = 0x7f02001c;
public static final int abs__cab_background_top_holo_light = 0x7f02001d;
public static final int abs__dialog_full_holo_dark = 0x7f02001e;
public static final int abs__dialog_full_holo_light = 0x7f02001f;
public static final int abs__ic_ab_back_holo_dark = 0x7f020020;
public static final int abs__ic_ab_back_holo_light = 0x7f020021;
public static final int abs__ic_cab_done_holo_dark = 0x7f020022;
public static final int abs__ic_cab_done_holo_light = 0x7f020023;
public static final int abs__ic_menu_moreoverflow_holo_dark = 0x7f020024;
public static final int abs__ic_menu_moreoverflow_holo_light = 0x7f020025;
public static final int abs__ic_menu_moreoverflow_normal_holo_dark = 0x7f020026;
public static final int abs__ic_menu_moreoverflow_normal_holo_light = 0x7f020027;
public static final int abs__ic_menu_share_holo_dark = 0x7f020028;
public static final int abs__ic_menu_share_holo_light = 0x7f020029;
public static final int abs__item_background_holo_dark = 0x7f02002a;
public static final int abs__item_background_holo_light = 0x7f02002b;
public static final int abs__list_activated_holo = 0x7f02002c;
public static final int abs__list_divider_holo_dark = 0x7f02002d;
public static final int abs__list_divider_holo_light = 0x7f02002e;
public static final int abs__list_focused_holo = 0x7f02002f;
public static final int abs__list_longpressed_holo = 0x7f020030;
public static final int abs__list_pressed_holo_dark = 0x7f020031;
public static final int abs__list_pressed_holo_light = 0x7f020032;
public static final int abs__list_selector_background_transition_holo_dark = 0x7f020033;
public static final int abs__list_selector_background_transition_holo_light = 0x7f020034;
public static final int abs__list_selector_disabled_holo_dark = 0x7f020035;
public static final int abs__list_selector_disabled_holo_light = 0x7f020036;
public static final int abs__list_selector_holo_dark = 0x7f020037;
public static final int abs__list_selector_holo_light = 0x7f020038;
public static final int abs__menu_dropdown_panel_holo_dark = 0x7f020039;
public static final int abs__menu_dropdown_panel_holo_light = 0x7f02003a;
public static final int abs__progress_bg_holo_dark = 0x7f02003b;
public static final int abs__progress_bg_holo_light = 0x7f02003c;
public static final int abs__progress_horizontal_holo_dark = 0x7f02003d;
public static final int abs__progress_horizontal_holo_light = 0x7f02003e;
public static final int abs__progress_medium_holo = 0x7f02003f;
public static final int abs__progress_primary_holo_dark = 0x7f020040;
public static final int abs__progress_primary_holo_light = 0x7f020041;
public static final int abs__progress_secondary_holo_dark = 0x7f020042;
public static final int abs__progress_secondary_holo_light = 0x7f020043;
public static final int abs__spinner_48_inner_holo = 0x7f020044;
public static final int abs__spinner_48_outer_holo = 0x7f020045;
public static final int abs__spinner_ab_default_holo_dark = 0x7f020046;
public static final int abs__spinner_ab_default_holo_light = 0x7f020047;
public static final int abs__spinner_ab_disabled_holo_dark = 0x7f020048;
public static final int abs__spinner_ab_disabled_holo_light = 0x7f020049;
public static final int abs__spinner_ab_focused_holo_dark = 0x7f02004a;
public static final int abs__spinner_ab_focused_holo_light = 0x7f02004b;
public static final int abs__spinner_ab_holo_dark = 0x7f02004c;
public static final int abs__spinner_ab_holo_light = 0x7f02004d;
public static final int abs__spinner_ab_pressed_holo_dark = 0x7f02004e;
public static final int abs__spinner_ab_pressed_holo_light = 0x7f02004f;
public static final int abs__tab_indicator_ab_holo = 0x7f020050;
public static final int abs__tab_selected_focused_holo = 0x7f020051;
public static final int abs__tab_selected_holo = 0x7f020052;
public static final int abs__tab_selected_pressed_holo = 0x7f020053;
public static final int abs__tab_unselected_pressed_holo = 0x7f020054;
}
public static final class id {
public static final int abs__action_bar = 0x7f050022;
public static final int abs__action_bar_container = 0x7f050021;
public static final int abs__action_bar_subtitle = 0x7f050011;
public static final int abs__action_bar_title = 0x7f050010;
public static final int abs__action_context_bar = 0x7f050023;
public static final int abs__action_menu_divider = 0x7f05000c;
public static final int abs__action_menu_presenter = 0x7f05000d;
public static final int abs__action_mode_bar = 0x7f050026;
public static final int abs__action_mode_bar_stub = 0x7f050025;
public static final int abs__action_mode_close_button = 0x7f050014;
public static final int abs__activity_chooser_view_content = 0x7f050015;
public static final int abs__checkbox = 0x7f05001e;
public static final int abs__content = 0x7f05001d;
public static final int abs__default_activity_button = 0x7f050018;
public static final int abs__expand_activities_button = 0x7f050016;
public static final int abs__home = 0x7f05000a;
public static final int abs__icon = 0x7f05001a;
public static final int abs__image = 0x7f050017;
public static final int abs__imageButton = 0x7f050012;
public static final int abs__list_item = 0x7f050019;
public static final int abs__progress_circular = 0x7f05000e;
public static final int abs__progress_horizontal = 0x7f05000f;
public static final int abs__radio = 0x7f050020;
public static final int abs__shortcut = 0x7f05001f;
public static final int abs__split_action_bar = 0x7f050024;
public static final int abs__textButton = 0x7f050013;
public static final int abs__title = 0x7f05001b;
public static final int abs__titleDivider = 0x7f05001c;
public static final int abs__up = 0x7f05000b;
public static final int disableHome = 0x7f050009;
public static final int homeAsUp = 0x7f050006;
public static final int listMode = 0x7f050002;
public static final int normal = 0x7f050001;
public static final int showCustom = 0x7f050008;
public static final int showHome = 0x7f050005;
public static final int showTitle = 0x7f050007;
public static final int tabMode = 0x7f050003;
public static final int useLogo = 0x7f050004;
public static final int wrap_content = 0x7f050000;
}
public static final class integer {
public static final int abs__max_action_buttons = 0x7f090000;
}
public static final class layout {
public static final int abs__action_bar_home = 0x7f030000;
public static final int abs__action_bar_tab = 0x7f030001;
public static final int abs__action_bar_tab_bar_view = 0x7f030002;
public static final int abs__action_bar_title_item = 0x7f030003;
public static final int abs__action_menu_item_layout = 0x7f030004;
public static final int abs__action_menu_layout = 0x7f030005;
public static final int abs__action_mode_bar = 0x7f030006;
public static final int abs__action_mode_close_item = 0x7f030007;
public static final int abs__activity_chooser_view = 0x7f030008;
public static final int abs__activity_chooser_view_list_item = 0x7f030009;
public static final int abs__dialog_title_holo = 0x7f03000a;
public static final int abs__list_menu_item_checkbox = 0x7f03000b;
public static final int abs__list_menu_item_icon = 0x7f03000c;
public static final int abs__list_menu_item_layout = 0x7f03000d;
public static final int abs__list_menu_item_radio = 0x7f03000e;
public static final int abs__popup_menu_item_layout = 0x7f03000f;
public static final int abs__screen_action_bar = 0x7f030010;
public static final int abs__screen_action_bar_overlay = 0x7f030011;
public static final int abs__screen_simple = 0x7f030012;
public static final int abs__screen_simple_overlay_action_mode = 0x7f030013;
public static final int sherlock_spinner_dropdown_item = 0x7f03003e;
public static final int sherlock_spinner_item = 0x7f03003f;
}
public static final class string {
public static final int abs__action_bar_home_description = 0x7f0a0000;
public static final int abs__action_bar_up_description = 0x7f0a0001;
public static final int abs__action_menu_overflow_description = 0x7f0a0002;
public static final int abs__action_mode_done = 0x7f0a0003;
public static final int abs__activity_chooser_view_dialog_title_default = 0x7f0a0005;
public static final int abs__activity_chooser_view_see_all = 0x7f0a0004;
public static final int abs__activitychooserview_choose_application = 0x7f0a0007;
public static final int abs__share_action_provider_share_with = 0x7f0a0006;
public static final int abs__shareactionprovider_share_with = 0x7f0a0008;
public static final int abs__shareactionprovider_share_with_application = 0x7f0a0009;
}
public static final class style {
public static final int DialogWindowTitle_Sherlock = 0x7f0b0033;
public static final int DialogWindowTitle_Sherlock_Light = 0x7f0b0034;
public static final int Sherlock___TextAppearance_Small = 0x7f0b0047;
public static final int Sherlock___Theme = 0x7f0b004a;
public static final int Sherlock___Theme_DarkActionBar = 0x7f0b004c;
public static final int Sherlock___Theme_Dialog = 0x7f0b004d;
public static final int Sherlock___Theme_Light = 0x7f0b004b;
public static final int Sherlock___Widget_ActionBar = 0x7f0b0001;
public static final int Sherlock___Widget_ActionMode = 0x7f0b0016;
public static final int Sherlock___Widget_ActivityChooserView = 0x7f0b001e;
public static final int Sherlock___Widget_Holo_DropDownItem = 0x7f0b0029;
public static final int Sherlock___Widget_Holo_ListView = 0x7f0b0026;
public static final int Sherlock___Widget_Holo_Spinner = 0x7f0b0023;
public static final int TextAppearance_Sherlock_DialogWindowTitle = 0x7f0b0045;
public static final int TextAppearance_Sherlock_Light_DialogWindowTitle = 0x7f0b0046;
public static final int TextAppearance_Sherlock_Light_Small = 0x7f0b0049;
public static final int TextAppearance_Sherlock_Light_Widget_PopupMenu_Large = 0x7f0b0040;
public static final int TextAppearance_Sherlock_Light_Widget_PopupMenu_Small = 0x7f0b0042;
public static final int TextAppearance_Sherlock_Small = 0x7f0b0048;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Menu = 0x7f0b0035;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Subtitle = 0x7f0b0038;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Subtitle_Inverse = 0x7f0b0039;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Title = 0x7f0b0036;
public static final int TextAppearance_Sherlock_Widget_ActionBar_Title_Inverse = 0x7f0b0037;
public static final int TextAppearance_Sherlock_Widget_ActionMode_Subtitle = 0x7f0b003c;
public static final int TextAppearance_Sherlock_Widget_ActionMode_Subtitle_Inverse = 0x7f0b003d;
public static final int TextAppearance_Sherlock_Widget_ActionMode_Title = 0x7f0b003a;
public static final int TextAppearance_Sherlock_Widget_ActionMode_Title_Inverse = 0x7f0b003b;
public static final int TextAppearance_Sherlock_Widget_DropDownItem = 0x7f0b0044;
public static final int TextAppearance_Sherlock_Widget_PopupMenu = 0x7f0b003e;
public static final int TextAppearance_Sherlock_Widget_PopupMenu_Large = 0x7f0b003f;
public static final int TextAppearance_Sherlock_Widget_PopupMenu_Small = 0x7f0b0041;
public static final int TextAppearance_Sherlock_Widget_TextView_SpinnerItem = 0x7f0b0043;
public static final int Theme_Sherlock = 0x7f0b004e;
public static final int Theme_Sherlock_Dialog = 0x7f0b0056;
public static final int Theme_Sherlock_ForceOverflow = 0x7f0b0053;
public static final int Theme_Sherlock_Light = 0x7f0b004f;
public static final int Theme_Sherlock_Light_DarkActionBar = 0x7f0b0050;
public static final int Theme_Sherlock_Light_DarkActionBar_ForceOverflow = 0x7f0b0055;
public static final int Theme_Sherlock_Light_Dialog = 0x7f0b0057;
public static final int Theme_Sherlock_Light_ForceOverflow = 0x7f0b0054;
public static final int Theme_Sherlock_Light_NoActionBar = 0x7f0b0052;
public static final int Theme_Sherlock_NoActionBar = 0x7f0b0051;
public static final int Widget = 0x7f0b0000;
public static final int Widget_Sherlock_ActionBar = 0x7f0b0002;
public static final int Widget_Sherlock_ActionBar_Solid = 0x7f0b0003;
public static final int Widget_Sherlock_ActionBar_TabBar = 0x7f0b000a;
public static final int Widget_Sherlock_ActionBar_TabText = 0x7f0b000d;
public static final int Widget_Sherlock_ActionBar_TabView = 0x7f0b0007;
public static final int Widget_Sherlock_ActionButton = 0x7f0b0010;
public static final int Widget_Sherlock_ActionButton_CloseMode = 0x7f0b0012;
public static final int Widget_Sherlock_ActionButton_Overflow = 0x7f0b0014;
public static final int Widget_Sherlock_ActionMode = 0x7f0b0017;
public static final int Widget_Sherlock_ActivityChooserView = 0x7f0b001f;
public static final int Widget_Sherlock_Button_Small = 0x7f0b0021;
public static final int Widget_Sherlock_DropDownItem_Spinner = 0x7f0b002a;
public static final int Widget_Sherlock_Light_ActionBar = 0x7f0b0004;
public static final int Widget_Sherlock_Light_ActionBar_Solid = 0x7f0b0005;
public static final int Widget_Sherlock_Light_ActionBar_Solid_Inverse = 0x7f0b0006;
public static final int Widget_Sherlock_Light_ActionBar_TabBar = 0x7f0b000b;
public static final int Widget_Sherlock_Light_ActionBar_TabBar_Inverse = 0x7f0b000c;
public static final int Widget_Sherlock_Light_ActionBar_TabText = 0x7f0b000e;
public static final int Widget_Sherlock_Light_ActionBar_TabText_Inverse = 0x7f0b000f;
public static final int Widget_Sherlock_Light_ActionBar_TabView = 0x7f0b0008;
public static final int Widget_Sherlock_Light_ActionBar_TabView_Inverse = 0x7f0b0009;
public static final int Widget_Sherlock_Light_ActionButton = 0x7f0b0011;
public static final int Widget_Sherlock_Light_ActionButton_CloseMode = 0x7f0b0013;
public static final int Widget_Sherlock_Light_ActionButton_Overflow = 0x7f0b0015;
public static final int Widget_Sherlock_Light_ActionMode = 0x7f0b0018;
public static final int Widget_Sherlock_Light_ActionMode_Inverse = 0x7f0b0019;
public static final int Widget_Sherlock_Light_ActivityChooserView = 0x7f0b0020;
public static final int Widget_Sherlock_Light_Button_Small = 0x7f0b0022;
public static final int Widget_Sherlock_Light_DropDownItem_Spinner = 0x7f0b002b;
public static final int Widget_Sherlock_Light_ListPopupWindow = 0x7f0b001b;
public static final int Widget_Sherlock_Light_ListView_DropDown = 0x7f0b0028;
public static final int Widget_Sherlock_Light_PopupMenu = 0x7f0b001d;
public static final int Widget_Sherlock_Light_PopupWindow_ActionMode = 0x7f0b002d;
public static final int Widget_Sherlock_Light_ProgressBar = 0x7f0b002f;
public static final int Widget_Sherlock_Light_ProgressBar_Horizontal = 0x7f0b0031;
public static final int Widget_Sherlock_Light_Spinner_DropDown_ActionBar = 0x7f0b0025;
public static final int Widget_Sherlock_ListPopupWindow = 0x7f0b001a;
public static final int Widget_Sherlock_ListView_DropDown = 0x7f0b0027;
public static final int Widget_Sherlock_PopupMenu = 0x7f0b001c;
public static final int Widget_Sherlock_PopupWindow_ActionMode = 0x7f0b002c;
public static final int Widget_Sherlock_ProgressBar = 0x7f0b002e;
public static final int Widget_Sherlock_ProgressBar_Horizontal = 0x7f0b0030;
public static final int Widget_Sherlock_Spinner_DropDown_ActionBar = 0x7f0b0024;
public static final int Widget_Sherlock_TextView_SpinnerItem = 0x7f0b0032;
}
public static final class styleable {
public static final int[] SherlockActionBar = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f01003a, 0x7f01003b, 0x7f01003c, 0x7f01003d, 0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010041, 0x7f010042, 0x7f010043, 0x7f010044, 0x7f010045, 0x7f010046 };
public static final int SherlockActionBar_background = 2;
public static final int SherlockActionBar_backgroundSplit = 3;
public static final int SherlockActionBar_backgroundStacked = 12;
public static final int SherlockActionBar_customNavigationLayout = 13;
public static final int SherlockActionBar_displayOptions = 7;
public static final int SherlockActionBar_divider = 5;
public static final int SherlockActionBar_height = 4;
public static final int SherlockActionBar_homeLayout = 14;
public static final int SherlockActionBar_icon = 10;
public static final int SherlockActionBar_indeterminateProgressStyle = 16;
public static final int SherlockActionBar_itemPadding = 18;
public static final int SherlockActionBar_logo = 11;
public static final int SherlockActionBar_navigationMode = 6;
public static final int SherlockActionBar_progressBarPadding = 17;
public static final int SherlockActionBar_progressBarStyle = 15;
public static final int SherlockActionBar_subtitle = 9;
public static final int SherlockActionBar_subtitleTextStyle = 1;
public static final int SherlockActionBar_title = 8;
public static final int SherlockActionBar_titleTextStyle = 0;
public static final int[] SherlockActionMenuItemView = { 0x0101013f };
public static final int SherlockActionMenuItemView_android_minWidth = 0;
public static final int[] SherlockActionMode = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004 };
public static final int SherlockActionMode_background = 2;
public static final int SherlockActionMode_backgroundSplit = 3;
public static final int SherlockActionMode_height = 4;
public static final int SherlockActionMode_subtitleTextStyle = 1;
public static final int SherlockActionMode_titleTextStyle = 0;
public static final int[] SherlockActivityChooserView = { 0x010100d4, 0x7f01004f, 0x7f010050 };
public static final int SherlockActivityChooserView_android_background = 0;
public static final int SherlockActivityChooserView_expandActivityOverflowButtonDrawable = 2;
public static final int SherlockActivityChooserView_initialActivityCount = 1;
public static final int[] SherlockMenuGroup = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 };
public static final int SherlockMenuGroup_android_checkableBehavior = 5;
public static final int SherlockMenuGroup_android_enabled = 0;
public static final int SherlockMenuGroup_android_id = 1;
public static final int SherlockMenuGroup_android_menuCategory = 3;
public static final int SherlockMenuGroup_android_orderInCategory = 4;
public static final int SherlockMenuGroup_android_visible = 2;
public static final int[] SherlockMenuItem = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x010102d9, 0x010102fb, 0x010102fc, 0x01010389 };
public static final int SherlockMenuItem_android_actionLayout = 14;
public static final int SherlockMenuItem_android_actionProviderClass = 16;
public static final int SherlockMenuItem_android_actionViewClass = 15;
public static final int SherlockMenuItem_android_alphabeticShortcut = 9;
public static final int SherlockMenuItem_android_checkable = 11;
public static final int SherlockMenuItem_android_checked = 3;
public static final int SherlockMenuItem_android_enabled = 1;
public static final int SherlockMenuItem_android_icon = 0;
public static final int SherlockMenuItem_android_id = 2;
public static final int SherlockMenuItem_android_menuCategory = 5;
public static final int SherlockMenuItem_android_numericShortcut = 10;
public static final int SherlockMenuItem_android_onClick = 12;
public static final int SherlockMenuItem_android_orderInCategory = 6;
public static final int SherlockMenuItem_android_showAsAction = 13;
public static final int SherlockMenuItem_android_title = 7;
public static final int SherlockMenuItem_android_titleCondensed = 8;
public static final int SherlockMenuItem_android_visible = 4;
public static final int[] SherlockMenuView = { 0x7f010047, 0x7f010048, 0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d, 0x7f01004e };
public static final int SherlockMenuView_headerBackground = 3;
public static final int SherlockMenuView_horizontalDivider = 1;
public static final int SherlockMenuView_itemBackground = 4;
public static final int SherlockMenuView_itemIconDisabledAlpha = 6;
public static final int SherlockMenuView_itemTextAppearance = 0;
public static final int SherlockMenuView_preserveIconSpacing = 7;
public static final int SherlockMenuView_verticalDivider = 2;
public static final int SherlockMenuView_windowAnimationStyle = 5;
public static final int[] SherlockSpinner = { 0x010100af, 0x01010175, 0x01010176, 0x0101017b, 0x01010262, 0x010102ac, 0x010102ad, 0x01010411 };
public static final int SherlockSpinner_android_dropDownHorizontalOffset = 5;
public static final int SherlockSpinner_android_dropDownSelector = 1;
public static final int SherlockSpinner_android_dropDownVerticalOffset = 6;
public static final int SherlockSpinner_android_dropDownWidth = 4;
public static final int SherlockSpinner_android_gravity = 0;
public static final int SherlockSpinner_android_popupBackground = 2;
public static final int SherlockSpinner_android_popupPromptView = 7;
public static final int SherlockSpinner_android_prompt = 3;
public static final int[] SherlockTheme = { 0x01010057, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020, 0x7f010021, 0x7f010022, 0x7f010023, 0x7f010024, 0x7f010025, 0x7f010026, 0x7f010027, 0x7f010028, 0x7f010029, 0x7f01002a, 0x7f01002b, 0x7f01002c, 0x7f01002d, 0x7f01002e, 0x7f01002f, 0x7f010030, 0x7f010031, 0x7f010032, 0x7f010033, 0x7f010034, 0x7f010035, 0x7f010036, 0x7f010037, 0x7f010038, 0x7f010039 };
public static final int SherlockTheme_absForceOverflow = 52;
public static final int SherlockTheme_actionBarDivider = 9;
public static final int SherlockTheme_actionBarItemBackground = 10;
public static final int SherlockTheme_actionBarSize = 8;
public static final int SherlockTheme_actionBarSplitStyle = 6;
public static final int SherlockTheme_actionBarStyle = 5;
public static final int SherlockTheme_actionBarTabBarStyle = 2;
public static final int SherlockTheme_actionBarTabStyle = 1;
public static final int SherlockTheme_actionBarTabTextStyle = 3;
public static final int SherlockTheme_actionBarWidgetTheme = 7;
public static final int SherlockTheme_actionButtonStyle = 38;
public static final int SherlockTheme_actionDropDownStyle = 37;
public static final int SherlockTheme_actionMenuTextAppearance = 11;
public static final int SherlockTheme_actionMenuTextColor = 12;
public static final int SherlockTheme_actionModeBackground = 15;
public static final int SherlockTheme_actionModeCloseButtonStyle = 14;
public static final int SherlockTheme_actionModeCloseDrawable = 17;
public static final int SherlockTheme_actionModePopupWindowStyle = 19;
public static final int SherlockTheme_actionModeShareDrawable = 18;
public static final int SherlockTheme_actionModeSplitBackground = 16;
public static final int SherlockTheme_actionModeStyle = 13;
public static final int SherlockTheme_actionOverflowButtonStyle = 4;
public static final int SherlockTheme_actionSpinnerItemStyle = 43;
public static final int SherlockTheme_activatedBackgroundIndicator = 51;
public static final int SherlockTheme_activityChooserViewStyle = 50;
public static final int SherlockTheme_android_windowIsFloating = 0;
public static final int SherlockTheme_buttonStyleSmall = 20;
public static final int SherlockTheme_dividerVertical = 36;
public static final int SherlockTheme_dropDownListViewStyle = 40;
public static final int SherlockTheme_dropdownListPreferredItemHeight = 42;
public static final int SherlockTheme_homeAsUpIndicator = 39;
public static final int SherlockTheme_listPopupWindowStyle = 49;
public static final int SherlockTheme_listPreferredItemHeightSmall = 30;
public static final int SherlockTheme_listPreferredItemPaddingLeft = 31;
public static final int SherlockTheme_listPreferredItemPaddingRight = 32;
public static final int SherlockTheme_popupMenuStyle = 41;
public static final int SherlockTheme_spinnerDropDownItemStyle = 29;
public static final int SherlockTheme_spinnerItemStyle = 28;
public static final int SherlockTheme_textAppearanceLargePopupMenu = 22;
public static final int SherlockTheme_textAppearanceListItemSmall = 33;
public static final int SherlockTheme_textAppearanceSmall = 24;
public static final int SherlockTheme_textAppearanceSmallPopupMenu = 23;
public static final int SherlockTheme_textColorPrimary = 25;
public static final int SherlockTheme_textColorPrimaryDisableOnly = 26;
public static final int SherlockTheme_textColorPrimaryInverse = 27;
public static final int SherlockTheme_windowActionBar = 45;
public static final int SherlockTheme_windowActionBarOverlay = 46;
public static final int SherlockTheme_windowActionModeOverlay = 47;
public static final int SherlockTheme_windowContentOverlay = 21;
public static final int SherlockTheme_windowMinWidthMajor = 34;
public static final int SherlockTheme_windowMinWidthMinor = 35;
public static final int SherlockTheme_windowNoTitle = 44;
public static final int SherlockTheme_windowSplitActionBar = 48;
}
}
| dougreside/MOVER | Releases/January2014/src/gen/com/actionbarsherlock/R.java | Java | mit | 35,346 |
gvim(){ /usr/bin/gvim -f "$@" & true;disown }
| waysidekoi/dotfiles | home/zsh/gvim.zsh | Shell | mit | 46 |
package com.flextrade.jfixture.builders;
import com.flextrade.jfixture.NoSpecimen;
import com.flextrade.jfixture.SpecimenBuilder;
import com.flextrade.jfixture.SpecimenContext;
import com.flextrade.jfixture.requests.RangeRequest;
import com.flextrade.jfixture.utility.SpecimenType;
import java.util.Calendar;
class CalendarRangeRelay implements SpecimenBuilder {
@Override
public Object create(Object request, SpecimenContext context) {
if (!(request instanceof RangeRequest)) {
return new NoSpecimen();
}
RangeRequest rangeRequest = (RangeRequest) request;
if (!requestIsAMatch(rangeRequest)) {
return new NoSpecimen();
}
return create(rangeRequest, context);
}
private Object create(RangeRequest request, SpecimenContext context) {
NumberInRangeGenerator numberInRangeGenerator = getNumberInRangeGenerator(request);
Long value = (Long)numberInRangeGenerator.create(Long.class, context);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(value);
return calendar;
}
private boolean requestIsAMatch(RangeRequest request) {
boolean isType = request.getRequest() instanceof SpecimenType;
if (!isType) return false;
SpecimenType type = (SpecimenType) request.getRequest();
return type.getRawType().equals(Calendar.class) &&
request.getMin() instanceof Calendar &&
request.getMax() instanceof Calendar;
}
private NumberInRangeGenerator getNumberInRangeGenerator(RangeRequest request) {
Long min = ((Calendar) request.getMin()).getTimeInMillis();
Long max = ((Calendar) request.getMax()).getTimeInMillis();
return new NumberInRangeGenerator(min, max);
}
}
| FlexTradeUKLtd/jfixture | jfixture/src/main/java/com/flextrade/jfixture/builders/CalendarRangeRelay.java | Java | mit | 1,813 |
@charset "UTF-8";
body.ltr {
direction: ltr;
}
body.rtl div {
direction: rtl;
}
/* Form Layout Styles */
form label {
cursor: pointer;
}
p.legend {
margin-bottom: 1em;
}
p.legend em {
color: #c00;
font-style: normal;
}
.form-container {
width: 100%;
overflow: auto;
margin-top: 5px;
margin-bottom: 15px;
}
.form-container form {
padding: 5px;
background-color: #fff;
border: #eee 1px solid;
background-color: #fbfbfb;
}
.form-container p {
margin: 0.5em 0 0 0;
}
.form-container form p {
margin: 0;
}
.form-container form p.note {
font-style: italic;
margin-left: 18em;
font-size: 80%;
color: #666;
}
.form-container form input,
.form-container form button,
.form-container form select,
.form-container form textarea {
padding: 2px;
margin: 2px 0 2px 0;
}
.form-container form input.string,
.form-container form textarea {
width: 500px;
}
.form-container form input.date {
width: auto;
}
#login_form form table,
#register_form form table {
width: 95%;
}
#login_form input.string,
#register_form input.string {
width: 95%;
}
.form-container form input[type="checkbox"],
.form-container form input[type="radio"] {
margin: 2px 5px;
}
.form-container form fieldset {
margin: 0 0 10px 0;
padding: 10px;
border: #ddd 1px solid;
background-color: #fff;
}
.form-container form legend {
font-weight: bold;
color: #666;
}
.form-container form td.w2p_fl,
.item-container form td.w2p_fl {
font-weight: bold;
/* background-color: #ffc; */
}
.form-container form tr td,
.item-container form tr td {
padding: 3px 0 0 3px;
}
.form-container .controlset label,
.form-container .controlset input {
display: inline;
float: none;
}
.form-container .controlset div {
margin-left: 15em;
}
.form-container .buttonrow {
margin-left: 180px;
}
/* Form field hints
http://remysharp.com/2007/03/19/a-few-more-jquery-plugins-crop-labelover-and-pluck/#labelOver
*/
div.hint {
position: relative;
/* Breaks Map Save Panel
float: left;*/
}
label.over {
color: #ccc;
font-style: italic;
position: absolute;
/* Wrong on Save Map */
/*top: 5px;*/
left: 5px;
}
/* Styling for Inline Components */
table.embeddedComponent {
border: 1px solid #b3b3b3;
}
form table.embeddedComponent td {
padding: 0 5px;
border: solid #b3b3b3;
border-width: 0 0 1px 0;
text-align: left;
}
table.embeddedComponent tr.label-row td {
color: #b3b3b3;
}
.form-container form .embeddedComponent input.string,
.form-container form .embeddedComponent textarea {
width: auto;
}
.inline-throbber {
background-image: url(../../img/indicator.gif);
background-repeat: no-repeat;
height: 16px;
width: 16px;
}
.inline-add {
background-image: url(../../img/crud/add.png);
background-repeat: no-repeat;
height: 23px;
width: 23px;
}
.inline-cnc {
background-image: url(../../img/crud/cancel.png);
background-repeat: no-repeat;
height: 16px;
width: 16px;
}
.inline-edt {
background-image: url(../../img/crud/edit.png);
background-repeat: no-repeat;
height: 22px;
width: 22px;
}
.inline-rdy {
background-image: url(../../img/crud/apply.png);
background-repeat: no-repeat;
height: 16px;
width: 16px;
}
.inline-rmv {
background-image: url(../../img/crud/remove.png);
background-repeat: no-repeat;
height: 23px;
width: 23px;
}
.s3_inline_add_resource_link a {
margin-left: 2px;
padding-left: 2px;
}
/* Filter Forms */
#filter-form {
margin: 0;
}
/* Summary Page */
#summary-tabs {
/* Hide while loading */
visibility: hidden;
}
#summary-filter-form {
margin: 0;
}
#summary-sections #map{
margin-top: 0;
padding: 0;
}
.ui-tabs .ui-tabs-panel {
padding: 2px 5px;
}
/* ========================================================================= */
textarea.comments {
height: 50px;
}
textarea.richtext {
height: 100px;
}
/* Used to diplay the list-add with the list-add-btn */
#list-btn-add,
.list-btn-add {
margin-bottom: 10px;
/* float: left; */
}
/*#list-btn-add + h3 {
clear: both;
}*/
#list-add {
display: none;
}
/* Tabular data view */
#table-container {
display: block;
width: 100%;
/* We want the scroll in the table not the wrapper
overflow: auto; */
/* Bring in line with export formats */
margin-top: -1px;
/* min-width: 640px; */
}
#table-container .empty {
margin-left: 10px;
}
.dataTable thead th {
/* datatables fixed headers must not be transparent, however those aren't used currently & this removes the Sorting Icons
background: no-repeat scroll right center #F0F3F4;*/
border: 1px solid #ccc;
border-bottom: 1px solid black;
}
.dataTable th,
.fixedHeader th {
text-align: center;
border: 1px solid #ccc;
}
.dataTable tr.even td,
.dataTable tr.odd td {
border: 1px solid #ccc;
padding: 4px 10px;
}
.dt-export-options {
float: right;
padding-top: 5px;
}
.list_formats div {
padding: 1px;
cursor: pointer;
height: 16px;
width: 16px;
float: right;
background-repeat: no-repeat;
}
.export_cap_large {
background-image: url(../../img/icon-cap.jpg);
height: 36px;
width: 99px;
}
.export_cap {
background-image: url(../../img/cap_16.png);
}
.export_have {
background-image: url(../../img/have_16.png);
}
.export_kml {
background-image: url(../../img/kml_icon.png);
}
.export_map {
background-image: url(../../img/map_icon.png);
}
.export_pdf {
background-image: url(../../img/pdficon_small.gif);
}
.export_rss {
background-image: url(../../img/RSS_16.png);
}
.export_xls {
background-image: url(../../img/icon-xls.png);
}
.export_xml {
background-image: url(../../img/icon-xml.png);
}
/* msg_list_empty */
.empty {
margin-top: 30px;
}
/* dataTables Styling
@ToDo: Move colours out of widgets.css
*/
div .dataTable_table {
/* Scroll the table not the wrapper */
overflow: auto;
clear: both;
}
.dataTable {
width: 100%;
}
.dataTable tr td {
vertical-align: top;
}
.dataTable.group {
background-color: #ddd;
border: 1px solid #aaa;
}
.dataTable tr.level_1{
background-color: #999;
color: #def;
}
.dataTable tr.level_1 a{
color: #def;
}
.dataTable tr.activeRow.level_1 {
background-color: #1d70cf;
}
.dataTable tr.level_2{
background-color: #ddd;
color: #248;
}
.dataTable tr.level_2 a{
color: #248;
}
.dataTable tr.activeRow.level_2{
background-color: #528dd1;
}
.dataTables_filter {
width: auto;
float: left !important;
margin-bottom: 4px;
}
.dataTables_processing {
float: left;
margin-left: 10px;
}
.dataTables_info {
width: auto;
float: right !important;
clear: none !important;
margin: 7px 0 4px 10px;
}
.dataTables_length {
float: right !important;
margin-bottom:4px;
}
.dataTables_paginate {
float: left;
margin: 4px 0 4px 0;
}
.paging_full_numbers {
width: auto;
}
a.paginate_button,
a.paginate_active {
text-decoration: none;
}
.sorting_disabled {
background: no-repeat scroll right center transparent;
}
.dataTable .row_selected td {
background-color: #ddd;
border: 1px solid #aaa;
}
.dataTable tr.dtalert .action-btn,
.dataTable tr.dtalert .delete-btn {
background-color: #d0d004;
color: #444420;
}
.dataTable tr.dtalert .action-btn:hover,
.dataTable tr.dtalert .delete-btn:hover {
text-decoration: none;
color: #222;
background-color: #eeed04;
border-right: 1px solid #4589ce;
border-bottom: 1px solid #4589ce;
border-left: 1px solid #000;
border-top: 1px solid #000;
padding: 2px 4px 2px 4px;
}
.dataTable tr.dtdisable {
text-shadow: #ccc 1px 1px 1px;
color: #888;
}
.dataTable tr.even.row_selected td { background-color: #60f6ad; }
.dataTable tr.even.row_selected td.sorting_1 { background-color: #40fa8d; }
table.display tr.odd.row_selected td { background-color: #40fa8d; }
table.display tr.odd.row_selected td.sorting_1 { background-color: #20f0ad; }
.dataTable tr.odd.dtalert { background-color: #ffffc0; }
.dataTable tr.odd.dtalert td.sorting_1 { background-color: #ffffb0; }
.dataTable tr.odd.dtalert td.sorting_2 { background-color: #ffffa0; }
.dataTable tr.odd.dtalert td.sorting_3 { background-color: #ffff90; }
.dataTable tr.even.dtalert { background-color: #ffffa0; }
.dataTable tr.even.dtalert td.sorting_1 { background-color: #ffff0; }
.dataTable tr.even.dtalert td.sorting_2 { background-color: #ffff80; }
.dataTable tr.even.dtalert td.sorting_3 { background-color: #ffff70; }
.dataTable tr.odd.dtwarning { background-color: #ffd9d9; }
.dataTable tr.odd.dtwarning td.sorting_1 { background-color: #ffb6b6; }
.dataTable tr.odd.dtwarning td.sorting_2 { background-color: #ffa6a6; }
.dataTable tr.odd.dtwarning td.sorting_3 { background-color: #ff9696; }
.dataTable tr.even.dtwarning { background-color: #ffa6a6; }
.dataTable tr.even.dtwarning td.sorting_1 { background-color: #ff8383; }
.dataTable tr.even.dtwarning td.sorting_2 { background-color: #ff7373; }
.dataTable tr.even.dtwarning td.sorting_3 { background-color: #ff6363; }
.dataTable tr.dtwarning .action-btn,
.dataTable tr.dtwarning .delete-btn{
background-color: #d07060;
color: #431;
text-shadow: #fff 0 0 0;
}
.dataTable tr.dtwarning .action-btn:hover,
.dataTable tr.dtwarning .delete-btn:hover {
text-decoration: none;
color: #fff;
background-color: #b37;
border-right: 1px solid #4589ce;
border-bottom: 1px solid #4589ce;
border-left: 1px solid #000;
border-top: 1px solid #000;
padding: 2px 4px 2px 4px;
}
.dataTable-btn {
background-color: #ddd;
border: 1px solid #aaa;
border-radius: 5px;
padding: 2px 5px;
margin: 0 3px;
cursor: pointer;
*cursor: hand;
}
.dataTable-btn:hover {
background-color: #efefef;
}
table.importItem {
display: none;
}
/* Pivot Tables */
.pivot-table-contents {
overflow: auto;
}
/* Data Lists */
#dl-container {
clear: left;
}
div.dl {
border-bottom: 1px solid #aaa;
}
.dl-header {
float: right;
padding: 3px;
}
.dl-row {
clear: both;
padding: 0;
border-top: 1px solid #aaa;
}
.dl-item {
float: left;
padding: 3px 5px 3px 5px;
width: 98.7%;
}
.dl-row.even,
.dl-row.even .dl-item {
background-color: white;
}
.dl-row.odd,
.dl-row.odd .dl-item {
background-color: #e2e4ff;
}
.dl-1-cols {
/* Wide as possible for display on small screens */
width: 98%;
}
.dl-2-cols {
width: 48%;
}
.dl-3-cols {
width: 31%;
}
.dl-field {
clear: left;
}
.dl-field-label {
margin-right: 10px;
font-weight: bold;
}
.dl-field-value {
}
.infscr-loading {
float: left;
clear: left;
}
/* Cards */
.card_1_line,
.card_manylines {
font-size: 12px;
padding-top: 4px;
color: #666;
padding-bottom: 2px;
}
.card_1_line {
height: 16px; /* Height needs to be same with or without contents */
line-height: normal;
margin-bottom: 0;
text-overflow: none;
overflow: hidden;
}
.card_1_line i {
margin-right: 5px;
}
/* Display view */
.item-container {
width: 100%;
overflow: auto;
margin: 5px 0 5px 0;
}
/* Default text for INPUT fields */
.default-text {
color: #a1a1a1;
font-style: italic;
}
ul.ui-autocomplete {
z-index: 9999 !important;
}
/* Embedded Map */
#map {
width: 100%;
overflow: auto;
}
/* Red indicators */
.error,
.expired,
.req,
.req_key {
color: red;
font-weight: bold;
}
/* Help Popup */
.tooltip,
.tooltipbody,
.stickytip,
.ajaxtip {
position: static;
text-transform: uppercase;
height: 20px;
width: 50px;
background: none;
background: url(../../img/help_off.gif) no-repeat;
}
.tooltip span,
.tooltipbody span,
.stickytip span,
.ajaxtip span {
display:none;
}
.tooltip:hover,
.tooltipbody:hover,
.stickytip:hover,
.ajaxtip:hover {
background-color: transparent;
height: 20px;
width: 50px;
background: url(../../img/help_on.gif) no-repeat;
}
/* Form Popup */
body.popup {
background-color: #fbfbfb;
min-width: auto;
height: auto;
}
#popup {
max-width: 750px;
width: 100%;
}
.loading {
background: url(../../img/ajax-loader.gif) center no-repeat !important;
}
#popup form {
/* Form initially hidden until resized to fit modal */
display: none;
}
#popup .form-container {
/* Ensure scrollbars are all on the Modal, not inside */
overflow: inherit;
}
#popup .control-group {
padding-right: 20px;
}
/* Message Flash styles */
.alert-success {
color: #070;
font-weight: bold;
text-align: center;
border: #070 1px solid;
background: url(../../img/dialog-confirmation.png) #e5ffe5 no-repeat 5px 5px;
margin-top: 0.0em;
margin-bottom: 0.5em;
padding-left: 30px;
padding-right: 20px;
padding-top: 1.0em;
padding-bottom: 1.0em;
cursor: pointer;
clear: left; /* Added to avoid merging with breadcrumbs */
}
.alert-success p em {
color: #070;
}
.alert-error {
color: #c00;
font-weight: bold;
text-align: center;
border: #c00 1px solid;
background: url(../../img/dialog-error.png) #ffe5e5 no-repeat 5px 5px;
margin-top: 0.0em;
margin-bottom: 0.5em;
padding-left: 30px;
padding-right: 20px;
padding-top: 1.0em;
padding-bottom: 1.0em;
cursor: pointer;
clear: left; /* Added to avoid merging with breadcrumbs */
}
.alert-error p em {
color: #c00;
}
.alert-info {
color: #748d8e;
font-weight: bold;
text-align: center;
border: #9ed8d7 1px solid;
background: url(../../img/dialog-information.png) #ecfdff no-repeat 5px 5px;
margin-top: 0.0em;
margin-bottom: 0.5em;
padding-left: 30px;
padding-right: 20px;
padding-top: 1.0em;
padding-bottom: 1.0em;
cursor: pointer;
clear: left; /* Added to avoid merging with breadcrumbs */
}
.alert-info p em {
color: #748d8e;
}
.alert-warning {
color: #c00;
font-weight: bold;
text-align: center;
border: #fc6 1px solid;
background: url(../../img/dialog-warning.png) #ffc no-repeat 5px 5px;
margin-top: 0.0em;
margin-bottom: 0.5em;
padding-left: 30px;
padding-right: 20px;
padding-top: 1.0em;
padding-bottom: 1.0em;
cursor: pointer;
clear: left; /* Added to avoid merging with breadcrumbs */
}
.alert-warning p em {
color: #c00;
}
/* Copy of BootStrap Styling */
button.close {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
border: 0 none;
cursor: pointer;
padding: 0;
}
/* Throbber */
/* Used by Autocompletes, map popups, map toolbar, dropdown widgets , tweets */
.throbber,
.layer_throbber,
.s3-twitter-throbber,
.map_loader {
background-image: url(../../img/ajax-loader.gif);
background-repeat: no-repeat;
height: 32px;
width: 32px;
}
.throbber {
margin-bottom: -16px;
padding: 0 0 0 10px;
}
.input_throbber {
background-size: 60% !important;
height: 24px;
width: 24px;
display: inline-block;
margin: 0 0 -11px -24px;
}
.s3-twitter-throbber {
height: 0px;
margin: 66px 0 0 42px;
padding: 20px;
width: 0px;
}
/* Resource Header */
#rheader {
margin-bottom: 0.75em;
}
#rheader th,
#rheader td {
text-align: left;
padding: 1px 5px 1px 5px;
white-space: pre-line;
}
#rheader th {
font-weight: bold;
}
/* Tabs */
div.tabs {
width: 100%;
clear: left;
height: 1.5em;
padding: 8px 0 2px 0;
margin: 5px 0 0 0;
text-align: left;
border-bottom: 1px solid #3286e2;
}
div.tabs span {
float: left;
border-radius: 3px 3px 0 0;
}
span.tab_last,
span.tab_other {
background: #3286e2;
border-color: #3286e2;
border-width: 2px 1px 0 3px;
border-style: solid;
margin-right: 3px;
padding-right: 3px;
}
div.tabs span a {
color: #fff;
text-decoration: none;
}
/* To overlap component border */
div.tabs span.tab_here {
display: inline;
position: relative;
bottom: 0;
background: #f0f3f4;
border-width: 2px 2px 0 3px;
border-style: solid;
border-color: #69c;
padding: 1px 6px 0 5px;
margin-right: 5px;
font-weight: bold;
}
form div.tabs span.tab_here {
background: #fff;
border-bottom: 2px solid #fff;
}
div.tabs span.tab_here a {
color: #069;
}
span.tab_last a:hover,
span.tab_other a:hover {
color: #fff;
background: transparent;
}
span.tab_last:hover,
span.tab_other:hover {
background: #164b8b;
border-color: #164b8b;
}
span.tab_prev_active {
border: 1px solid #69c;
color: #069;
border-bottom: 0;
}
span.tab_next_active {
border: 1px solid #69c;
color: #069;
border-bottom: 0;
}
span.tab_prev_inactive {
border: 1px solid #bbb;
color: #bbb;
border-bottom: 0;
}
span.tab_next_inactive {
border: 1px solid #bbb;
color: #bbb;
border-bottom: 0;
}
span.tab_prev_active a,
span.tab_next_active a {
color: #069;
text-decoration: None;
}
span.tab_prev_inactive a,
span.tab_next_inactive a {
color: #bbb;
text-decoration: None;
}
/* Component */
#component {
float: left;
width: 100%;
/* overflow: auto; */
}
/* Resource Footer */
#rfooter {
padding: 15px 0;
clear: both;
}
/* Last Update Meta-data */
#last_update {
text-align: right;
font-style: italic;
font-size: 80%;
color: #666;
float: right;
clear: right;
}
.authorinfo {
font-style: italic;
font-size: 80%;
color: #666;
}
/* Action Buttons */
.action-btn,
.delete-btn-ajax,
.delete-btn {
cursor: pointer;
line-height: 1.5;
text-decoration: none;
color: #fff;
background-color: #3286e2;
border: 1px solid #4c95e6;
border-bottom: 2px solid #164b8b;
border-top: 1px solid #5f9eeb;
padding: 2px 4px 2px 4px;
margin: 2px;
z-index: 500;
white-space: nowrap;
border-radius: 2px;
}
.action-btn:hover,
.delete-btn-ajax:hover,
.delete-btn:hover,
.action-btn:focus,
.delete-btn-ajax:focus,
.delete-btn:focus {
text-decoration: none;
color: #fff;
background-color: #164b8b;
}
#delete-btn {
margin-bottom: 8px;
}
#markDuplicate {
float: right;
clear: right;
padding-bottom: 8px;
}
.cancel-btn {
padding-left: 10px;
}
.action-lnk {
font-size: 85%;
margin-left: 15px;
cursor: pointer;
}
.action-lnk:first-child {
margin-left: 0;
}
.form-toggle,
.form-toggle:hover {
text-decoration: none;
}
.form-toggle i {
margin-left: 3px;
}
.sublabels {
font-size: 85%;
}
/* Expand section button */
.plus {
position: static;
height: 16px;
width: 16px;
background-image: url(../../img/icon_blue_plus15px.png);
}
.minus {
position: static;
height: 16px;
width: 16px;
background-image: url(../../img/icon_blue_minus15px.png);
}
.expand {
/*position: static;*/
height: 16px;
width: 16px;
float: left;
background-image: url(../../img/jquery-ui/ui-icons_222222_256x240.png);
background-position: -64px -16px;
white-space: nowrap;
}
.expanded {
height: 16px;
width: 16px;
float: left;
background-image: url(../../img/jquery-ui/ui-icons_222222_256x240.png);
background-position: -32px -16px;
white-space: nowrap;
}
/* Embed Widget */
#select_from_registry_row td {
padding: 8px;
}
/* This should be in style.css where-required
.box_top,
.box_middle,
.box_bottom {
border-left: #bbb 1px solid;
border-right: #bbb 1px solid;
background: #F0F3F4;
}*/
.box_top,
.box_top_inner {
border-top: #bbb 1px solid;
}
.box_top {
padding-top: 8px;
}
.box_top_inner {
padding-top: 0.2rem;
padding-bottom: 0.5rem;
}
form table td.box_top_td {
padding-top: 8px;
}
.box_top label,
.box_top_inner label {
display: inline-block;
}
.box_bottom { /* For Bootstrap */
border-bottom: #bbb 1px solid;
padding-bottom: 8px;
}
form table tr.box_bottom td { /* For regular themes */
border-bottom: #bbb 1px solid;
padding-bottom: 8px;
}
.form-horizontal .control-group.box_top {
margin: 15px 0 0;
max-width: 680px;
}
.form-horizontal .control-group.box_bottom {
margin-bottom: 8px;
max-width: 680px;
}
/* Add Person 2 */
.add_person_edit_bar {
cursor: pointer;
display: inline-block;
padding-left: 1.2rem;
}
.add_person_edit_bar a {
text-decoration: none;
}
/* Subheadings */
td.subheading {
padding-top: 10px !important;
padding-bottom: 5px;
border-bottom: thin solid #bbb;
font-weight: bold;
}
tr.after_subheading td {
padding-top: 10px !important;
}
select[disabled='disabled'],
input[disabled='disabled'] {
/* A lighter background so the text is more readable */
background: #eee;
color: #333;
/* Make the cursor not change to editable */
cursor: default;
}
/* Grow Input */
li input + a {
text-decoration: none;
}
.rfilter {
float: left;
padding: 10px 20px 10px 10px;
/*margin-bottom: 20px;*/
}
/* Comments */
#comments {
margin: 0;
padding: 0;
list-style: none outside none;
}
#comments ul, ol {
padding-left: 20px;
list-style: none outside none;
}
#comments li {
padding: 10px 0 0;
}
#comments li a.jcollapsible:hover {
background: none;
}
#comments div.comment-text ul {
list-style: disc outside none;
}
#comments div.comment-text ol {
list-style: decimal outside none;
}
#comments div.comment-text li {
padding: 0;
}
#comments div.comment-body {
white-space: pre-line;
}
#comments div.comment-body p {
margin-left: 25px;
}
/* Over-ride Ext! */
#comments em {
font-style: italic;
}
#comments strong {
font-weight: bold;
}
#comment-form {
width: 390px;
border: 1px #9c9c9c dashed;
padding: 5px;
margin-top: 5px;
}
.avatar {
background: none repeat scroll 0 0 #fff;
border-bottom: 1px solid #d7d7d7;
border-left: 1px solid #f2f2f2;
border-right: 1px solid #f2f2f2;
float: left;
height: 55px;
padding: 4px;
width: 55px;
}
.rheader-avatar {
float: left;
clear: right;
padding-bottom: 5px;
padding-right: 10px;
}
/* HRM RHeader */
.comment-box {
overflow: hidden;
padding: 15px 0;
background: none repeat scroll 0 0 #fff;
display: block;
overflow: hidden;
padding: 10px;
margin-left: 15px;
}
.comment-text {
padding: 0 0 0 20px;
float: left;
}
.comment-text div {
white-space: pre-line;
}
.comment-header {
margin: 0 0 10px 0;
}
.comment-footer {
clear: left;
}
.comment-date {
font-size: 11px;
margin: 0 0 10px 0;
}
/* Popup text for represents of Long text fields */
.showall {
display: none;
position: absolute;
border-style: solid;
background-color: #ffc;
padding: 5px;
margin: 0 20px 0 -50px;
}
/* Drag and Drop */
#template_sections {
margin-right: 10px;
}
#template_sections li,
#master_sections li {
list-style: none;
}
.ui-droppable {
padding-bottom: 25px;
}
li.ui-draggable:hover,
li.ui-draggable-dragging {
cursor: pointer;
list-style: none;
padding: 3px;
border: solid 1px #bbb;
background: none repeat scroll 0 0 #cfdde7;
}
.imagecrop-drag {
font-weight: bold;
text-align: center;
padding: 3em 0;
margin: 1em 0;
color: #555;
border: 2px dashed #555;
border-radius: 7px;
cursor: default;
}
.imagecrop-drag.hover {
border-style: solid;
background-color: #F7F8F9;
}
.imagecrop-btn {
display: none;
cursor: pointer;
}
/* Ext button (e.g. on Bulk Upload form */
#show-dialog-btn {
border: 1px solid #efefef;
margin: 10px;
padding: 10px;
}
/* Request (req) Application */
.req_status_none {
color: red;
font-weight: bold;
}
.req_status_partial {
color: darkorange;
font-weight: bold;
}
.req_status_complete {
color: green;
font-weight: bold;
}
/* Contacts */
.contacts-wrapper {
width: 500px;
}
.contacts-wrapper p {
margin-bottom: 0.8em;
}
.contacts-wrapper div.margin {
margin-bottom: 10px;
}
.contacts-wrapper .contact.saving .editBtn,
.contacts-wrapper .contact.edit .editBtn {
display: none;
}
/* GIS */
/* Except here */
ul.x-tab-strip,
ul.x-tree-node-ct,
ul.x-tree-root-ct {
list-style: none outside none;
}
/* LocationSelector 2 */
.geocode_success {
color: #0a0;
}
.geocode_fail {
color: #f00;
}
/* Search Form */
.s3-grouped-checkboxes-widget-label,
.s3-groupedopts-label {
margin: 10px 0 0 7px;
padding-left: 20px;
height: 16px;
background: url(../../img/icon_blue_plus15px.png) no-repeat;
cursor: pointer;
}
.s3-grouped-checkboxes-widget-label.expanded,
.s3-groupedopts-label.expanded {
height: 16px;
width: 16px;
background: url(../../img/icon_blue_minus15px.png) no-repeat;
}
.s3-grouped-checkboxes-widget .s3-checkboxes-widget,
.s3-groupedopts-widget table {
margin-left: 2em;
}
.form-container form fieldset .s3-checkboxes-widget label,
.form-container form fieldset .s3-groupedopts-widget label {
white-space: nowrap;
text-align: left;
}
.s3-groupedopts-widget label {
display: inline;
margin-left: 5px;
}
.s3-groupedopts-widget tr > td {
padding-top: 5px;
padding-right: 10px;
}
/* Checkboxes with title attributes */
/*
.checkbox-tooltip {
border-bottom: 1px dotted black;
}
.checkbox-tooltip:after {
content: " ?";
}
*/
/* when S3SearchOptionsWidget has nothing to show */
.no-options-available {
color: #aaa;
font-style: italic;
}
.checkboxes-widget-s3 input,
.s3-checkboxes-widget input,
.s3-groupedopts-widget input
{
display: inline-block;
vertical-align: middle;
}
.s3-checkboxes-widget-filter input {
vertical-align: middle;
}
.range-filter-label {
font-size: 85%;
}
.range-filter-field {
float: left;
padding-right: 10px;
}
.filter-form td,
#filter_options td {
border-top: 1px solid #d9d9d9;
}
.filter-form tr:first-child > td,
#filter_options tr:first-child > td {
border-top: 0;
}
.filter-form table.s3-checkboxes-widget td,
.filter-form table.s3-groupedopts-widget td,
#filter_options table.s3-checkboxes-widget td,
#filter_options table.s3searchminmaxwidget td {
border-top: 0;
}
/* Vertical arrangement of multi-button multi-select filter widgets such as S3LocationFilter */
.filter-form .ui-multiselect.ui-widget.ui-state-default.ui-corner-all,
.form-container .ui-multiselect.ui-widget.ui-state-default.ui-corner-all {
display: block;
min-width: 220px;
}
.filter-form .ui-multiselect.ui-widget.ui-state-default.ui-corner-all:first-of-type,
.form-container .ui-multiselect.ui-widget.ui-state-default.ui-corner-all:first-of-type {
clear: none;
}
.ui-selectmenu-button,
.ui-multiselect-menu {
min-width: 220px;
}
/* Don't display the default widget, only the multiselect generated widget is displayed */
select.multiselect-filter-widget {
display: none;
}
.filter-advanced {
text-decoration: none;
cursor: pointer;
}
.filter-advanced-label {
padding-right: 4px;
}
/* End */
.widget-org-hierarchy-menu {
overflow: auto;
height: 10em;
width: 36em;
position: relative;
}
.widget-org-hierarchy-menu .ui-menu {
position: absolute;
top: 0;
bottom: 0;
overflow: auto;
width: 32em;
}
.widget-org-hierarchy-menu .ui-menu a {
cursor: pointer;
}
.widget-org-hierarchy-crumbs {
list-style: none;
}
.widget-org-hierarchy-crumbs li {
display: inline;
cursor: pointer;
}
.widget-org-hierarchy-crumbs li:after {
content: " > ";
}
.widget-org-hierarchy-crumbs li a {
text-decoration: none;
}
.widget-org-hierarchy-crumbs li.selected a {
text-decoration: none;
border-bottom: 1px dashed black;
}
/* Short form for Modals */
.ui-datepicker-trigger {
background-image: url(../../img/calendar.gif);
background-repeat: no-repeat;
height: 15px;
width: 16px;
margin-left: 3px;
/* Make it not like a button */
border: 0;
/*padding: 0;*/
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
/* Long form to override normal button margin */
.form-container form button.ui-datepicker-trigger {
margin-left: 3px;
}
td .icon {
/* Override profile.css */
margin-top: 0;
}
/* S3LocationSelector */
option.missing {
background-color: yellow;
}
.dms-label {
padding: 4px;
font-weight: bold;
}
.dms-input.invalidinput {
border: solid thin red;
}
.resizable-textarea .grippie {
/*-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;*/
background: url(../../img/grippie.png) no-repeat scroll center 2px #eee;
border-color: #ddd;
border-right: 1px solid #ddd;
border-style: solid;
border-width: 0 1px 1px;
cursor: s-resize;
height: 9px;
overflow: hidden;
}
/* Translation Functionality */
.translation_module_table {
width: 55%;
}
/* Project Task */
textarea#project_task_description {
height: 200px;
}
/* Project Task Time Inline Form */
select#sub_defaulttime_defaulttime_person_id_edit_none {
width: 150px;
}
input#sub_defaulttime_defaulttime_hours_edit_none {
width: 60px;
}
/* Filter Manager */
.filter-manager-widget {
float: left;
}
.fm-load,
.fm-save,
.fm-delete,
.fm-create,
.fm-accept,
.fm-cancel {
float: left;
margin-left: 5px;
}
div.fm-load,
div.fm-save,
div.fm-delete,
div.fm-create,
div.fm-accept,
div.fm-cancel {
margin-top: 7px;
width: 16px;
height: 16px;
}
div.fm-load {
background: url(../../img/filter/load.png) no-repeat;
}
div.fm-save {
background: url(../../img/filter/save.png) no-repeat;
}
div.fm-delete {
background: url(../../img/filter/delete.png) no-repeat;
}
div.fm-create {
background: url(../../img/filter/create.png) no-repeat;
}
div.fm-accept {
background: url(../../img/crud/apply.png) no-repeat;
}
div.fm-cancel {
background: url(../../img/crud/cancel.png) no-repeat;
}
.cms-edit {
display: table;
}
/* Date Picker Widget */
.datetimepicker {
width: 110px;
}
.datetimepicker.hide-time {
width: 75px;
}
/* UI Dialog */
.ui-dialog .ui-dialog-content {
/* Ensure maximal space for iframe within Dialog */
padding: 0 !important;
}
.ui-dialog {
padding: 0;
width: 750px !important;
}
/* UI Multiselect */
body.ltr label.ui-corner-all span {
left: 10px;
}
body.rtl label.ui-corner-all span {
right: 10px;
}
/* Hierarchy Widget */
.s3-hierarchy-tree.jstree,
.s3-hierarchy-header {
border: 1px solid #ccc;
padding: 2px 3px 4px 3px;
background: white;
/* @todo: make this work - currently overflow:auto conflicts with
bootstrap popovers (because they are inside the box and
become inaccessible when overflowing)
*/
/* max-height: 360px;
overflow-y: auto;*/
}
.jstree-contextmenu {
z-index: 9999;
}
.s3-hierarchy-wrapper {
z-index: 9998;
}
.s3-hierarchy-header {
font-size: 0.8rem;
display: none;
}
.s3-hierarchy-action-node,
.s3-hierarchy-none {
font-style: italic;
}
/* Saved Filters Page - Inline Editor for Filter Titles */
form.jeditable-input input {
max-width: 400px !important;
}
.pt-form legend {
font-size: 14px;
margin-bottom: 0;
border: 0 !important;
}
button.toggle-text {
font-size: 10px !important;
margin-left: 12px !important;
line-height: 1.0;
}
/* Action Toolbar */
.action-bar {
color: #8a8989;
font-size: 14px;
position: relative;
top: 4px;
}
.action-bar.fleft {
margin-right: 8px;
}
.action-bar a:hover,
.action-bar a:visited:hover {
color: #ffa500;
text-decoration: none;
}
.maxLength {
background-color: #ffcdcd;
border: 3px solid #d55b5b;
}
/* S3SelectWidget() icons */
.ui-selectmenu-menu .ui-menu.customicons {
/* @ToDo: This should be responsive */
height: 400px;
}
.ui-selectmenu-menu .ui-menu.customicons .ui-menu-item {
/* @ToDo: This is suitabel for GIS Markers, but may be too big for other usecases */
padding: 1em 0 1em 4em;
}
.ui-selectmenu-menu .ui-menu.customicons .ui-menu-item .ui-icon {
background-repeat: no-repeat !important;
background-position: left top;
top: 0.1em;
}
/* AddPersonWidget2 duplicate results */
.card > .fleft {
margin-right: 10px;
}
.media-object {
display: block;
}
/* Req quantity */
.ajax_more {
float: right;
width: 16px;
height: 16px;
margin: 0 2px 2px 0;
}
.ajax_more.collapsed {
background: url(../../img/icon_blue_plus15px.png) no-repeat left top;
}
.ajax_more.expanded {
background: url(../../img/icon_blue_minus15px.png) no-repeat left top;
}
/* Simile Timeline */
.s3-timeline {
height: 400px;
border: 1px solid #aaa;
font-family: Trebuchet MS,sans-serif;
font-size: 85%;
}
/* Videos Page */
#video-toc {
clear: left;
}
.video-header {
padding-top: 50px;
}
/* Password Widget-Unmask */
.s3-unmask {
margin-left: 10px;
cursor: pointer;
}
.s3-password-widget {
display: inline-block;
}
/* Tweet Display */
.s3-twitter-container {
width: 350px;
height: 130px;
}
| sahana/Turkey | static/themes/default/widgets.css | CSS | mit | 33,066 |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Global try_to_lock</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/acknowledgements_notes.html#header.boost.interprocess.sync.lock_options_hpp" title="Header <boost/interprocess/sync/lock_options.hpp>">
<link rel="prev" href="defer_lock.html" title="Global defer_lock">
<link rel="next" href="accept_ownership.html" title="Global accept_ownership">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="defer_lock.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/acknowledgements_notes.html#header.boost.interprocess.sync.lock_options_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="accept_ownership.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.interprocess.try_to_lock"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Global try_to_lock</span></h2>
<p>boost::interprocess::try_to_lock</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../interprocess/acknowledgements_notes.html#header.boost.interprocess.sync.lock_options_hpp" title="Header <boost/interprocess/sync/lock_options.hpp>">boost/interprocess/sync/lock_options.hpp</a>>
</span><span class="keyword">static</span> <span class="keyword">const</span> <a class="link" href="try_to_lock_type.html" title="Struct try_to_lock_type">try_to_lock_type</a> try_to_lock<span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp255380992"></a><h2>Description</h2>
<p>An object indicating that a try_lock() operation must be executed. </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2005-2012 Ion Gaztanaga<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="defer_lock.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/acknowledgements_notes.html#header.boost.interprocess.sync.lock_options_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="accept_ownership.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| rkq/cxxexp | third-party/src/boost_1_56_0/doc/html/boost/interprocess/try_to_lock.html | HTML | mit | 3,998 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// Copyright 2009 Aurora Feint, 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.
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "OFSmartObject.h"
class OFViewDataMap;
class OFViewDataSetter : public OFSmartObject
{
public:
OFViewDataSetter(UIView* targetView, OFViewDataMap* fieldMap);
void setField(NSString* fieldName, NSString* value);
bool isValidField(NSString* fieldName) const;
private:
typedef void (OFViewDataSetter::*UIViewValueSetter)(UIView* targetView, NSString* value) const;
struct UITypeAndSetter
{
Class uiClassType;
UIViewValueSetter setter;
};
#if defined(_UNITTEST)
static const unsigned int sNumSetters = 2;
#else
static const unsigned int sNumSetters = 1;
#endif
static const UITypeAndSetter sAvailableSetters[sNumSetters];
void setValueUILabel(UIView* targetView, NSString* value) const;
#if defined(_UNITTEST)
void setValueUIMockLabel(UIView* targetView, NSString* value) const;
#endif
OFRetainedPtr<UIView> mTargetView;
OFPointer<OFViewDataMap> mFieldMap;
}; | VaultHeadGames/WhackABoss | OpenFeint/api/internal/Systems/ViewSerializers/OFViewDataSetter.h | C | mit | 1,782 |
include "./masterpage/template-MP/header.html"
<div class="band">
<div class="row">
include "./modals/megan.html"
</div>
</div>
include "./masterpage/template-MP/footer.html"
| WhatsNewSaes/Sherpa | _input/templates/modals.html | HTML | mit | 194 |
<?php
/*
* This file is part of the PHPExifTool package.
*
* (c) Alchemy <support@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPExiftool\Driver\Tag\Canon;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class CroppedImageHeight extends AbstractTag
{
protected $Id = 2;
protected $Name = 'CroppedImageHeight';
protected $FullName = 'Canon::AspectInfo';
protected $GroupName = 'Canon';
protected $g0 = 'MakerNotes';
protected $g1 = 'Canon';
protected $g2 = 'Camera';
protected $Type = 'int32u';
protected $Writable = true;
protected $Description = 'Cropped Image Height';
protected $flag_Permanent = true;
}
| bburnichon/PHPExiftool | lib/PHPExiftool/Driver/Tag/Canon/CroppedImageHeight.php | PHP | mit | 852 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Fixtures.PetstoreV2AllSync.Models
{
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
/// <summary>
/// Defines headers for loginUser operation.
/// </summary>
public partial class LoginUserHeaders
{
/// <summary>
/// Initializes a new instance of the LoginUserHeaders class.
/// </summary>
public LoginUserHeaders() { }
/// <summary>
/// Initializes a new instance of the LoginUserHeaders class.
/// </summary>
public LoginUserHeaders(int? xRateLimit = default(int?), DateTime? xExpiresAfter = default(DateTime?))
{
XRateLimit = xRateLimit;
XExpiresAfter = xExpiresAfter;
}
/// <summary>
/// Gets or sets calls per hour allowed by the user
/// </summary>
[JsonProperty(PropertyName = "X-Rate-Limit")]
public int? XRateLimit { get; set; }
/// <summary>
/// Gets or sets date in UTC when toekn expires
/// </summary>
[JsonProperty(PropertyName = "X-Expires-After")]
public DateTime? XExpiresAfter { get; set; }
}
}
| sharadagarwal/autorest | AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/Models/LoginUserHeaders.cs | C# | mit | 1,572 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/inventory/shared_creature_inventory_6.iff"
result.attribute_template_id = -1
result.stfName("item_n","inventory")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | anhstudios/swganh | data/scripts/templates/object/tangible/inventory/shared_creature_inventory_6.py | Python | mit | 450 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="iso-8859-1">
<title>Uses of Interface org.apache.commons.configuration.tree.ConfigurationNodeVisitor (Apache Commons Configuration 1.10 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface org.apache.commons.configuration.tree.ConfigurationNodeVisitor (Apache Commons Configuration 1.10 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/commons/configuration/tree/class-use/ConfigurationNodeVisitor.html" target="_top">Frames</a></li>
<li><a href="ConfigurationNodeVisitor.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface org.apache.commons.configuration.tree.ConfigurationNodeVisitor" class="title">Uses of Interface<br>org.apache.commons.configuration.tree.ConfigurationNodeVisitor</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">ConfigurationNodeVisitor</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.commons.configuration.tree">org.apache.commons.configuration.tree</a></td>
<td class="colLast">
<div class="block">
A package with helper and utility classes used by hierarchical configurations.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.commons.configuration.tree">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">ConfigurationNodeVisitor</a> in <a href="../../../../../../org/apache/commons/configuration/tree/package-summary.html">org.apache.commons.configuration.tree</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../org/apache/commons/configuration/tree/package-summary.html">org.apache.commons.configuration.tree</a> that implement <a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">ConfigurationNodeVisitor</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitorAdapter.html" title="class in org.apache.commons.configuration.tree">ConfigurationNodeVisitorAdapter</a></strong></code>
<div class="block">
A simple adapter class that simplifies writing custom node visitor
implementations.</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/commons/configuration/tree/package-summary.html">org.apache.commons.configuration.tree</a> with parameters of type <a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">ConfigurationNodeVisitor</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">DefaultConfigurationNode.</span><code><strong><a href="../../../../../../org/apache/commons/configuration/tree/DefaultConfigurationNode.html#visit(org.apache.commons.configuration.tree.ConfigurationNodeVisitor)">visit</a></strong>(<a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">ConfigurationNodeVisitor</a> visitor)</code>
<div class="block">Visits this node and all its sub nodes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">DefaultConfigurationNode.SubNodes.</span><code><strong><a href="../../../../../../org/apache/commons/configuration/tree/DefaultConfigurationNode.SubNodes.html#visit(org.apache.commons.configuration.tree.ConfigurationNodeVisitor)">visit</a></strong>(<a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">ConfigurationNodeVisitor</a> visitor)</code>
<div class="block">Let the passed in visitor visit all sub nodes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">ConfigurationNode.</span><code><strong><a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNode.html#visit(org.apache.commons.configuration.tree.ConfigurationNodeVisitor)">visit</a></strong>(<a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">ConfigurationNodeVisitor</a> visitor)</code>
<div class="block">Visits this node and all its sub nodes.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/commons/configuration/tree/ConfigurationNodeVisitor.html" title="interface in org.apache.commons.configuration.tree">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/commons/configuration/tree/class-use/ConfigurationNodeVisitor.html" target="_top">Frames</a></li>
<li><a href="ConfigurationNodeVisitor.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2001–2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
| JPAT-ROSEMARY/SCUBA | org.jpat.scuba.external.apache.commons/apache.commons.libs/configuration/apidocs/org/apache/commons/configuration/tree/class-use/ConfigurationNodeVisitor.html | HTML | mit | 9,580 |
/******************************************************************************/
/* Copyright (c) 2013-2022 VectorChief (at github, bitbucket, sourceforge) */
/* Distributed under the MIT software license, see the accompanying */
/* file COPYING or http://www.opensource.org/licenses/mit-license.php */
/******************************************************************************/
#ifndef RT_RTARCH_XHB_512X2V2_H
#define RT_RTARCH_XHB_512X2V2_H
/******************************************************************************/
/********************************* LEGEND *********************************/
/******************************************************************************/
/*
* rtarch_xHB_512x2v2.h: Implementation of x86_64 half+byte AVX512F/BW pairs.
*
* This file is a part of the unified SIMD assembler framework (rtarch.h)
* designed to be compatible with different processor architectures,
* while maintaining strictly defined common API.
*
* Recommended naming scheme for instructions:
*
* cmdm*_rx - applies [cmd] to var-len packed SIMD: [r]egister (one operand)
* cmdm*_rr - applies [cmd] to var-len packed SIMD: [r]egister from [r]egister
*
* cmdm*_rm - applies [cmd] to var-len packed SIMD: [r]egister from [m]emory
* cmdm*_ld - applies [cmd] to var-len packed SIMD: as above (friendly alias)
*
* cmdg*_** - applies [cmd] to 16-bit elements SIMD args, packed-128-bit
* cmdgb_** - applies [cmd] to u-char elements SIMD args, packed-128-bit
* cmdgc_** - applies [cmd] to s-char elements SIMD args, packed-128-bit
*
* cmda*_** - applies [cmd] to 16-bit elements SIMD args, packed-256-bit
* cmdab_** - applies [cmd] to u-char elements SIMD args, packed-256-bit
* cmdac_** - applies [cmd] to s-char elements SIMD args, packed-256-bit
*
* cmdn*_** - applies [cmd] to 16-bit elements ELEM args, scalar-fp-only
* cmdh*_** - applies [cmd] to 16-bit elements BASE args, BASE-regs-only
* cmdb*_** - applies [cmd] to 8-bit elements BASE args, BASE-regs-only
*
* cmd*x_** - applies [cmd] to SIMD/BASE unsigned integer args, [x] - default
* cmd*n_** - applies [cmd] to SIMD/BASE signed integer args, [n] - negatable
* cmd*s_** - applies [cmd] to SIMD/ELEM floating point args, [s] - scalable
*
* The cmdm*_** (rtconf.h) instructions are intended for SPMD programming model
* and simultaneously support 16/8-bit data elements (int, fp16 on ARM and x86).
* In this model data paths are fixed-width, BASE and SIMD data elements are
* width-compatible, code path divergence is handled via mkj**_** pseudo-ops.
* Matching 16/8-bit BASE subsets cmdh* / cmdb* are defined in rtarch_*HB.h.
*
* Note, when using fixed-data-size 128/256-bit SIMD subsets simultaneously
* upper 128-bit halves of full 256-bit SIMD registers may end up undefined.
* On RISC targets they remain unchanged, while on x86-AVX they are zeroed.
* This happens when registers written in 128-bit subset are then used/read
* from within 256-bit subset. The same rule applies to mixing with 512-bit
* and wider vectors. Use of scalars may leave respective vector registers
* undefined, as seen from the perspective of any particular vector subset.
*
* 256-bit vectors used with wider subsets may not be compatible with regards
* to memory loads/stores when mixed in the code. It means that data loaded
* with wider vector and stored within 256-bit subset at the same address may
* result in changing the initial representation in memory. The same can be
* said about mixing vector and scalar subsets. Scalars can be completely
* detached on some architectures. Use elm*x_st to store 1st vector element.
* 128-bit vectors should be memory-compatible with any wider vector subset.
*
* Handling of NaNs in the floating point pipeline may not be consistent
* across different architectures. Avoid NaNs entering the data flow by using
* masking or control flow instructions. Apply special care when dealing with
* floating point compare and min/max input/output. The result of floating point
* compare instructions can be considered a -QNaN, though it is also interpreted
* as integer -1 and is often treated as a mask. Most arithmetic instructions
* should propagate QNaNs unchanged, however this behavior hasn't been tested.
*
* Note, that instruction subsets operating on vectors of different length
* may support different number of SIMD registers, therefore mixing them
* in the same code needs to be done with register awareness in mind.
* For example, AVX-512 supports 32 SIMD registers, while AVX2 only has 16,
* as does 256-bit paired subset on ARMv8, while 128-bit and SVE have 32.
* These numbers should be consistent across architectures if properly
* mapped to SIMD target mask presented in rtzero.h (compatibility layer).
*
* Interpretation of instruction parameters:
*
* upper-case params have triplet structure and require W to pass-forward
* lower-case params are singular and can be used/passed as such directly
*
* XD - SIMD register serving as destination only, if present
* XG - SIMD register serving as destination and first source
* XS - SIMD register serving as second source (first if any)
* XT - SIMD register serving as third source (second if any)
*
* RD - BASE register serving as destination only, if present
* RG - BASE register serving as destination and first source
* RS - BASE register serving as second source (first if any)
* RT - BASE register serving as third source (second if any)
*
* MD - BASE addressing mode (Oeax, M***, I***) (memory-dest)
* MG - BASE addressing mode (Oeax, M***, I***) (memory-dsrc)
* MS - BASE addressing mode (Oeax, M***, I***) (memory-src2)
* MT - BASE addressing mode (Oeax, M***, I***) (memory-src3)
*
* DD - displacement value (DP, DF, DG, DH, DV) (memory-dest)
* DG - displacement value (DP, DF, DG, DH, DV) (memory-dsrc)
* DS - displacement value (DP, DF, DG, DH, DV) (memory-src2)
* DT - displacement value (DP, DF, DG, DH, DV) (memory-src3)
*
* IS - immediate value (is used as a second or first source)
* IT - immediate value (is used as a third or second source)
*/
/******************************************************************************/
/******************************** INTERNAL ********************************/
/******************************************************************************/
#if (defined RT_SIMD_CODE)
#if (RT_512X2 >= 1 && RT_512X2 <= 2)
#if (RT_512X2 == 1) /* instructions below require AVX512BW (not in AVX512F) */
#define ck1mx_rm(XS, MT, DT) /* not portable, do not use outside */ \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 1) EMITB(0x75) \
MRM(0x01, MOD(MT), REG(MT)) \
AUX(SIB(MT), CMD(DT), EMPTY)
#define ck1mb_rm(XS, MT, DT) /* not portable, do not use outside */ \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 1) EMITB(0x74) \
MRM(0x01, MOD(MT), REG(MT)) \
AUX(SIB(MT), CMD(DT), EMPTY)
#define mz1mx_ld(XD, MS, DS) /* not portable, do not use outside */ \
ADR EZW(RXB(XD), RXB(MS), REN(XD), K, 1, 2) EMITB(0x66) \
MRM(REG(XD), MOD(MS), REG(MS)) \
AUX(SIB(MS), CMD(DS), EMPTY)
#define mz1mb_ld(XD, MS, DS) /* not portable, do not use outside */ \
ADR EZX(RXB(XD), RXB(MS), REN(XD), K, 1, 2) EMITB(0x66) \
MRM(REG(XD), MOD(MS), REG(MS)) \
AUX(SIB(MS), CMD(DS), EMPTY)
#else /* (RT_512X2 == 2) */
#define ck1mx_rm(XS, MT, DT) /* not portable, do not use outside */ \
EVW(0, RXB(XS), 0x00, K, 2, 2) EMITB(0x29) \
MRM(0x01, MOD(XS), REG(XS))
#define ck1mb_rm(XS, MT, DT) /* not portable, do not use outside */ \
EVX(0, RXB(XS), 0x00, K, 2, 2) EMITB(0x29) \
MRM(0x01, MOD(XS), REG(XS))
#define mz1mx_ld(XD, MS, DS) /* not portable, do not use outside */ \
EVW(RXB(XD), 0, 0x00, K, 2, 2) EMITB(0x28) \
MRM(REG(XD), 0x03, 0x01)
#define mz1mb_ld(XD, MS, DS) /* not portable, do not use outside */ \
EVX(RXB(XD), 0, 0x00, K, 2, 2) EMITB(0x28) \
MRM(REG(XD), 0x03, 0x01)
#endif /* (RT_512X2 == 2) */
/******************************************************************************/
/******************************** EXTERNAL ********************************/
/******************************************************************************/
/******************************************************************************/
/********************************** SIMD **********************************/
/******************************************************************************/
/**************** packed half-precision generic move/logic ****************/
/* mov (D = S) */
#define movmx_rr(XD, XS) \
EVX(RXB(XD), RXB(XS), 0x00, K, 0, 1) EMITB(0x28) \
MRM(REG(XD), MOD(XS), REG(XS)) \
EVX(RMB(XD), RMB(XS), 0x00, K, 0, 1) EMITB(0x28) \
MRM(REG(XD), MOD(XS), REG(XS))
#define movmx_ld(XD, MS, DS) \
ADR EVX(RXB(XD), RXB(MS), 0x00, K, 0, 1) EMITB(0x28) \
MRM(REG(XD), 0x02, REG(MS)) \
AUX(SIB(MS), EMITW(VAL(DS)), EMPTY) \
ADR EVX(RMB(XD), RXB(MS), 0x00, K, 0, 1) EMITB(0x28) \
MRM(REG(XD), 0x02, REG(MS)) \
AUX(SIB(MS), EMITW(VZL(DS)), EMPTY)
#define movmx_st(XS, MD, DD) \
ADR EVX(RXB(XS), RXB(MD), 0x00, K, 0, 1) EMITB(0x29) \
MRM(REG(XS), 0x02, REG(MD)) \
AUX(SIB(MD), EMITW(VAL(DD)), EMPTY) \
ADR EVX(RMB(XS), RXB(MD), 0x00, K, 0, 1) EMITB(0x29) \
MRM(REG(XS), 0x02, REG(MD)) \
AUX(SIB(MD), EMITW(VZL(DD)), EMPTY)
/* mmv (G = G mask-merge S) where (mask-elem: 0 keeps G, -1 picks S)
* uses Xmm0 implicitly as a mask register, destroys Xmm0, 0-masked XS elems */
#if (RT_512X2 == 1)
#define mmvmx_rr(XG, XS) \
andmx_rr(W(XS), Xmm0) \
annmx_rr(Xmm0, W(XG)) \
orrmx_rr(Xmm0, W(XS)) \
movmx_rr(W(XG), Xmm0)
#define mmvmx_ld(XG, MS, DS) \
notmx_rx(Xmm0) \
andmx_rr(W(XG), Xmm0) \
annmx_ld(Xmm0, W(MS), W(DS)) \
orrmx_rr(W(XG), Xmm0)
#define mmvmx_st(XS, MG, DG) \
andmx_rr(W(XS), Xmm0) \
annmx_ld(Xmm0, W(MG), W(DG)) \
orrmx_rr(Xmm0, W(XS)) \
movmx_st(Xmm0, W(MG), W(DG))
#else /* RT_512X2 == 2 */
#define mmvmx_rr(XG, XS) \
ck1mx_rm(Xmm0, Mebp, inf_GPC07) \
EKW(RXB(XG), RXB(XS), 0x00, K, 3, 1) EMITB(0x6F) \
MRM(REG(XG), MOD(XS), REG(XS)) \
ck1mx_rm(XmmG, Mebp, inf_GPC07) \
EKW(RMB(XG), RMB(XS), 0x00, K, 3, 1) EMITB(0x6F) \
MRM(REG(XG), MOD(XS), REG(XS))
#define mmvmx_ld(XG, MS, DS) \
ck1mx_rm(Xmm0, Mebp, inf_GPC07) \
ADR EKW(RXB(XG), RXB(MS), 0x00, K, 3, 1) EMITB(0x6F) \
MRM(REG(XG), 0x02, REG(MS)) \
AUX(SIB(MS), EMITW(VAL(DS)), EMPTY) \
ck1mx_rm(XmmG, Mebp, inf_GPC07) \
ADR EKW(RMB(XG), RXB(MS), 0x00, K, 3, 1) EMITB(0x6F) \
MRM(REG(XG), 0x02, REG(MS)) \
AUX(SIB(MS), EMITW(VZL(DS)), EMPTY)
#define mmvmx_st(XS, MG, DG) \
ck1mx_rm(Xmm0, Mebp, inf_GPC07) \
ADR EKW(RXB(XS), RXB(MG), 0x00, K, 3, 1) EMITB(0x7F) \
MRM(REG(XS), 0x02, REG(MG)) \
AUX(SIB(MG), EMITW(VAL(DG)), EMPTY) \
ck1mx_rm(XmmG, Mebp, inf_GPC07) \
ADR EKW(RMB(XS), RXB(MG), 0x00, K, 3, 1) EMITB(0x7F) \
MRM(REG(XS), 0x02, REG(MG)) \
AUX(SIB(MG), EMITW(VZL(DG)), EMPTY)
#endif /* RT_512X2 == 2 */
/* and (G = G & S), (D = S & T) if (#D != #T) */
#define andmx_rr(XG, XS) \
andmx3rr(W(XG), W(XG), W(XS))
#define andmx_ld(XG, MS, DS) \
andmx3ld(W(XG), W(XG), W(MS), W(DS))
#define andmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xDB) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xDB) \
MRM(REG(XD), MOD(XT), REG(XT))
#define andmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xDB) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xDB) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* ann (G = ~G & S), (D = ~S & T) if (#D != #T) */
#define annmx_rr(XG, XS) \
annmx3rr(W(XG), W(XG), W(XS))
#define annmx_ld(XG, MS, DS) \
annmx3ld(W(XG), W(XG), W(MS), W(DS))
#define annmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xDF) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xDF) \
MRM(REG(XD), MOD(XT), REG(XT))
#define annmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xDF) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xDF) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* orr (G = G | S), (D = S | T) if (#D != #T) */
#define orrmx_rr(XG, XS) \
orrmx3rr(W(XG), W(XG), W(XS))
#define orrmx_ld(XG, MS, DS) \
orrmx3ld(W(XG), W(XG), W(MS), W(DS))
#define orrmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xEB) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xEB) \
MRM(REG(XD), MOD(XT), REG(XT))
#define orrmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xEB) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xEB) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* orn (G = ~G | S), (D = ~S | T) if (#D != #T) */
#define ornmx_rr(XG, XS) \
notmx_rx(W(XG)) \
orrmx_rr(W(XG), W(XS))
#define ornmx_ld(XG, MS, DS) \
notmx_rx(W(XG)) \
orrmx_ld(W(XG), W(MS), W(DS))
#define ornmx3rr(XD, XS, XT) \
notmx_rr(W(XD), W(XS)) \
orrmx_rr(W(XD), W(XT))
#define ornmx3ld(XD, XS, MT, DT) \
notmx_rr(W(XD), W(XS)) \
orrmx_ld(W(XD), W(MT), W(DT))
/* xor (G = G ^ S), (D = S ^ T) if (#D != #T) */
#define xormx_rr(XG, XS) \
xormx3rr(W(XG), W(XG), W(XS))
#define xormx_ld(XG, MS, DS) \
xormx3ld(W(XG), W(XG), W(MS), W(DS))
#define xormx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xEF) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xEF) \
MRM(REG(XD), MOD(XT), REG(XT))
#define xormx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xEF) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xEF) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* not (G = ~G), (D = ~S) */
#define notmx_rx(XG) \
notmx_rr(W(XG), W(XG))
#define notmx_rr(XD, XS) \
annmx3ld(W(XD), W(XS), Mebp, inf_GPC07)
/************* packed half-precision integer arithmetic/shifts ************/
#if (RT_512X2 < 2)
/* add (G = G + S), (D = S + T) if (#D != #T) */
#define addmx_rr(XG, XS) \
addmx3rr(W(XG), W(XG), W(XS))
#define addmx_ld(XG, MS, DS) \
addmx3ld(W(XG), W(XG), W(MS), W(DS))
#define addmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
addmx_rx(W(XD))
#define addmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
addmx_rx(W(XD))
#define addmx_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
addax_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
addax_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
addax_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
addax_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* ads (G = G + S), (D = S + T) if (#D != #T) - saturate, unsigned */
#define adsmx_rr(XG, XS) \
adsmx3rr(W(XG), W(XG), W(XS))
#define adsmx_ld(XG, MS, DS) \
adsmx3ld(W(XG), W(XG), W(MS), W(DS))
#define adsmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
adsmx_rx(W(XD))
#define adsmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
adsmx_rx(W(XD))
#define adsmx_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
adsax_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
adsax_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
adsax_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
adsax_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* ads (G = G + S), (D = S + T) if (#D != #T) - saturate, signed */
#define adsmn_rr(XG, XS) \
adsmn3rr(W(XG), W(XG), W(XS))
#define adsmn_ld(XG, MS, DS) \
adsmn3ld(W(XG), W(XG), W(MS), W(DS))
#define adsmn3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
adsmn_rx(W(XD))
#define adsmn3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
adsmn_rx(W(XD))
#define adsmn_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
adsan_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
adsan_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
adsan_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
adsan_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* sub (G = G - S), (D = S - T) if (#D != #T) */
#define submx_rr(XG, XS) \
submx3rr(W(XG), W(XG), W(XS))
#define submx_ld(XG, MS, DS) \
submx3ld(W(XG), W(XG), W(MS), W(DS))
#define submx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
submx_rx(W(XD))
#define submx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
submx_rx(W(XD))
#define submx_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
subax_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
subax_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
subax_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
subax_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* sbs (G = G - S), (D = S - T) if (#D != #T) - saturate, unsigned */
#define sbsmx_rr(XG, XS) \
sbsmx3rr(W(XG), W(XG), W(XS))
#define sbsmx_ld(XG, MS, DS) \
sbsmx3ld(W(XG), W(XG), W(MS), W(DS))
#define sbsmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
sbsmx_rx(W(XD))
#define sbsmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
sbsmx_rx(W(XD))
#define sbsmx_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
sbsax_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
sbsax_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
sbsax_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
sbsax_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* sbs (G = G - S), (D = S - T) if (#D != #T) - saturate, signed */
#define sbsmn_rr(XG, XS) \
sbsmn3rr(W(XG), W(XG), W(XS))
#define sbsmn_ld(XG, MS, DS) \
sbsmn3ld(W(XG), W(XG), W(MS), W(DS))
#define sbsmn3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
sbsmn_rx(W(XD))
#define sbsmn3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
sbsmn_rx(W(XD))
#define sbsmn_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
sbsan_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
sbsan_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
sbsan_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
sbsan_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* mul (G = G * S), (D = S * T) if (#D != #T) */
#define mulmx_rr(XG, XS) \
mulmx3rr(W(XG), W(XG), W(XS))
#define mulmx_ld(XG, MS, DS) \
mulmx3ld(W(XG), W(XG), W(MS), W(DS))
#define mulmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
mulmx_rx(W(XD))
#define mulmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
mulmx_rx(W(XD))
#define mulmx_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
mulax_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
mulax_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
mulax_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
mulax_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* shl (G = G << S), (D = S << T) if (#D != #T) - plain, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define shlmx_ri(XG, IS) \
shlmx3ri(W(XG), W(XG), W(IS))
#define shlmx_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shlmx3ld(W(XG), W(XG), W(MS), W(DS))
#define shlmx3ri(XD, XS, IT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
shlax3ri(W(XD), W(XS), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
shlax_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
shlax_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
shlax_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shlmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
shlax3ld(W(XD), W(XS), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
shlax_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
shlax_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
shlax_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* shr (G = G >> S), (D = S >> T) if (#D != #T) - plain, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define shrmx_ri(XG, IS) \
shrmx3ri(W(XG), W(XG), W(IS))
#define shrmx_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shrmx3ld(W(XG), W(XG), W(MS), W(DS))
#define shrmx3ri(XD, XS, IT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
shrax3ri(W(XD), W(XS), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
shrax_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
shrax_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
shrax_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shrmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
shrax3ld(W(XD), W(XS), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
shrax_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
shrax_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
shrax_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* shr (G = G >> S), (D = S >> T) if (#D != #T) - plain, signed
* for maximum compatibility: shift count must be modulo elem-size */
#define shrmn_ri(XG, IS) \
shrmn3ri(W(XG), W(XG), W(IS))
#define shrmn_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shrmn3ld(W(XG), W(XG), W(MS), W(DS))
#define shrmn3ri(XD, XS, IT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
shran3ri(W(XD), W(XS), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
shran_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
shran_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
shran_ri(W(XD), W(IT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shrmn3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
shran3ld(W(XD), W(XS), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
shran_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
shran_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
shran_ld(W(XD), W(MT), W(DT)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* svl (G = G << S), (D = S << T) if (#D != #T) - variable, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define svlmx_rr(XG, XS) /* variable shift with per-elem count */ \
svlmx3rr(W(XG), W(XG), W(XS))
#define svlmx_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svlmx3ld(W(XG), W(XG), W(MS), W(DS))
#define svlmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
svlmx_rx(W(XD))
#define svlmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
svlmx_rx(W(XD))
#define svlmx_rx(XD) /* not portable, do not use outside */ \
stack_st(Recx) \
movhx_ld(Recx, Mebp, inf_SCR02(0x00)) \
shlhx_mx(Mebp, inf_SCR01(0x00)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x02)) \
shlhx_mx(Mebp, inf_SCR01(0x02)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x04)) \
shlhx_mx(Mebp, inf_SCR01(0x04)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x06)) \
shlhx_mx(Mebp, inf_SCR01(0x06)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x08)) \
shlhx_mx(Mebp, inf_SCR01(0x08)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0A)) \
shlhx_mx(Mebp, inf_SCR01(0x0A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0C)) \
shlhx_mx(Mebp, inf_SCR01(0x0C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0E)) \
shlhx_mx(Mebp, inf_SCR01(0x0E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x10)) \
shlhx_mx(Mebp, inf_SCR01(0x10)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x12)) \
shlhx_mx(Mebp, inf_SCR01(0x12)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x14)) \
shlhx_mx(Mebp, inf_SCR01(0x14)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x16)) \
shlhx_mx(Mebp, inf_SCR01(0x16)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x18)) \
shlhx_mx(Mebp, inf_SCR01(0x18)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1A)) \
shlhx_mx(Mebp, inf_SCR01(0x1A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1C)) \
shlhx_mx(Mebp, inf_SCR01(0x1C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1E)) \
shlhx_mx(Mebp, inf_SCR01(0x1E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x20)) \
shlhx_mx(Mebp, inf_SCR01(0x20)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x22)) \
shlhx_mx(Mebp, inf_SCR01(0x22)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x24)) \
shlhx_mx(Mebp, inf_SCR01(0x24)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x26)) \
shlhx_mx(Mebp, inf_SCR01(0x26)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x28)) \
shlhx_mx(Mebp, inf_SCR01(0x28)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2A)) \
shlhx_mx(Mebp, inf_SCR01(0x2A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2C)) \
shlhx_mx(Mebp, inf_SCR01(0x2C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2E)) \
shlhx_mx(Mebp, inf_SCR01(0x2E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x30)) \
shlhx_mx(Mebp, inf_SCR01(0x30)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x32)) \
shlhx_mx(Mebp, inf_SCR01(0x32)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x34)) \
shlhx_mx(Mebp, inf_SCR01(0x34)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x36)) \
shlhx_mx(Mebp, inf_SCR01(0x36)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x38)) \
shlhx_mx(Mebp, inf_SCR01(0x38)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3A)) \
shlhx_mx(Mebp, inf_SCR01(0x3A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3C)) \
shlhx_mx(Mebp, inf_SCR01(0x3C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3E)) \
shlhx_mx(Mebp, inf_SCR01(0x3E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x40)) \
shlhx_mx(Mebp, inf_SCR01(0x40)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x42)) \
shlhx_mx(Mebp, inf_SCR01(0x42)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x44)) \
shlhx_mx(Mebp, inf_SCR01(0x44)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x46)) \
shlhx_mx(Mebp, inf_SCR01(0x46)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x48)) \
shlhx_mx(Mebp, inf_SCR01(0x48)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4A)) \
shlhx_mx(Mebp, inf_SCR01(0x4A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4C)) \
shlhx_mx(Mebp, inf_SCR01(0x4C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4E)) \
shlhx_mx(Mebp, inf_SCR01(0x4E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x50)) \
shlhx_mx(Mebp, inf_SCR01(0x50)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x52)) \
shlhx_mx(Mebp, inf_SCR01(0x52)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x54)) \
shlhx_mx(Mebp, inf_SCR01(0x54)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x56)) \
shlhx_mx(Mebp, inf_SCR01(0x56)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x58)) \
shlhx_mx(Mebp, inf_SCR01(0x58)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5A)) \
shlhx_mx(Mebp, inf_SCR01(0x5A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5C)) \
shlhx_mx(Mebp, inf_SCR01(0x5C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5E)) \
shlhx_mx(Mebp, inf_SCR01(0x5E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x60)) \
shlhx_mx(Mebp, inf_SCR01(0x60)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x62)) \
shlhx_mx(Mebp, inf_SCR01(0x62)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x64)) \
shlhx_mx(Mebp, inf_SCR01(0x64)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x66)) \
shlhx_mx(Mebp, inf_SCR01(0x66)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x68)) \
shlhx_mx(Mebp, inf_SCR01(0x68)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6A)) \
shlhx_mx(Mebp, inf_SCR01(0x6A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6C)) \
shlhx_mx(Mebp, inf_SCR01(0x6C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6E)) \
shlhx_mx(Mebp, inf_SCR01(0x6E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x70)) \
shlhx_mx(Mebp, inf_SCR01(0x70)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x72)) \
shlhx_mx(Mebp, inf_SCR01(0x72)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x74)) \
shlhx_mx(Mebp, inf_SCR01(0x74)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x76)) \
shlhx_mx(Mebp, inf_SCR01(0x76)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x78)) \
shlhx_mx(Mebp, inf_SCR01(0x78)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7A)) \
shlhx_mx(Mebp, inf_SCR01(0x7A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7C)) \
shlhx_mx(Mebp, inf_SCR01(0x7C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7E)) \
shlhx_mx(Mebp, inf_SCR01(0x7E)) \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* svr (G = G >> S), (D = S >> T) if (#D != #T) - variable, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define svrmx_rr(XG, XS) /* variable shift with per-elem count */ \
svrmx3rr(W(XG), W(XG), W(XS))
#define svrmx_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svrmx3ld(W(XG), W(XG), W(MS), W(DS))
#define svrmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
svrmx_rx(W(XD))
#define svrmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
svrmx_rx(W(XD))
#define svrmx_rx(XD) /* not portable, do not use outside */ \
stack_st(Recx) \
movhx_ld(Recx, Mebp, inf_SCR02(0x00)) \
shrhx_mx(Mebp, inf_SCR01(0x00)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x02)) \
shrhx_mx(Mebp, inf_SCR01(0x02)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x04)) \
shrhx_mx(Mebp, inf_SCR01(0x04)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x06)) \
shrhx_mx(Mebp, inf_SCR01(0x06)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x08)) \
shrhx_mx(Mebp, inf_SCR01(0x08)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0A)) \
shrhx_mx(Mebp, inf_SCR01(0x0A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0C)) \
shrhx_mx(Mebp, inf_SCR01(0x0C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0E)) \
shrhx_mx(Mebp, inf_SCR01(0x0E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x10)) \
shrhx_mx(Mebp, inf_SCR01(0x10)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x12)) \
shrhx_mx(Mebp, inf_SCR01(0x12)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x14)) \
shrhx_mx(Mebp, inf_SCR01(0x14)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x16)) \
shrhx_mx(Mebp, inf_SCR01(0x16)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x18)) \
shrhx_mx(Mebp, inf_SCR01(0x18)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1A)) \
shrhx_mx(Mebp, inf_SCR01(0x1A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1C)) \
shrhx_mx(Mebp, inf_SCR01(0x1C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1E)) \
shrhx_mx(Mebp, inf_SCR01(0x1E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x20)) \
shrhx_mx(Mebp, inf_SCR01(0x20)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x22)) \
shrhx_mx(Mebp, inf_SCR01(0x22)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x24)) \
shrhx_mx(Mebp, inf_SCR01(0x24)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x26)) \
shrhx_mx(Mebp, inf_SCR01(0x26)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x28)) \
shrhx_mx(Mebp, inf_SCR01(0x28)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2A)) \
shrhx_mx(Mebp, inf_SCR01(0x2A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2C)) \
shrhx_mx(Mebp, inf_SCR01(0x2C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2E)) \
shrhx_mx(Mebp, inf_SCR01(0x2E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x30)) \
shrhx_mx(Mebp, inf_SCR01(0x30)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x32)) \
shrhx_mx(Mebp, inf_SCR01(0x32)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x34)) \
shrhx_mx(Mebp, inf_SCR01(0x34)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x36)) \
shrhx_mx(Mebp, inf_SCR01(0x36)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x38)) \
shrhx_mx(Mebp, inf_SCR01(0x38)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3A)) \
shrhx_mx(Mebp, inf_SCR01(0x3A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3C)) \
shrhx_mx(Mebp, inf_SCR01(0x3C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3E)) \
shrhx_mx(Mebp, inf_SCR01(0x3E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x40)) \
shrhx_mx(Mebp, inf_SCR01(0x40)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x42)) \
shrhx_mx(Mebp, inf_SCR01(0x42)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x44)) \
shrhx_mx(Mebp, inf_SCR01(0x44)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x46)) \
shrhx_mx(Mebp, inf_SCR01(0x46)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x48)) \
shrhx_mx(Mebp, inf_SCR01(0x48)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4A)) \
shrhx_mx(Mebp, inf_SCR01(0x4A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4C)) \
shrhx_mx(Mebp, inf_SCR01(0x4C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4E)) \
shrhx_mx(Mebp, inf_SCR01(0x4E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x50)) \
shrhx_mx(Mebp, inf_SCR01(0x50)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x52)) \
shrhx_mx(Mebp, inf_SCR01(0x52)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x54)) \
shrhx_mx(Mebp, inf_SCR01(0x54)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x56)) \
shrhx_mx(Mebp, inf_SCR01(0x56)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x58)) \
shrhx_mx(Mebp, inf_SCR01(0x58)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5A)) \
shrhx_mx(Mebp, inf_SCR01(0x5A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5C)) \
shrhx_mx(Mebp, inf_SCR01(0x5C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5E)) \
shrhx_mx(Mebp, inf_SCR01(0x5E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x60)) \
shrhx_mx(Mebp, inf_SCR01(0x60)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x62)) \
shrhx_mx(Mebp, inf_SCR01(0x62)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x64)) \
shrhx_mx(Mebp, inf_SCR01(0x64)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x66)) \
shrhx_mx(Mebp, inf_SCR01(0x66)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x68)) \
shrhx_mx(Mebp, inf_SCR01(0x68)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6A)) \
shrhx_mx(Mebp, inf_SCR01(0x6A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6C)) \
shrhx_mx(Mebp, inf_SCR01(0x6C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6E)) \
shrhx_mx(Mebp, inf_SCR01(0x6E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x70)) \
shrhx_mx(Mebp, inf_SCR01(0x70)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x72)) \
shrhx_mx(Mebp, inf_SCR01(0x72)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x74)) \
shrhx_mx(Mebp, inf_SCR01(0x74)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x76)) \
shrhx_mx(Mebp, inf_SCR01(0x76)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x78)) \
shrhx_mx(Mebp, inf_SCR01(0x78)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7A)) \
shrhx_mx(Mebp, inf_SCR01(0x7A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7C)) \
shrhx_mx(Mebp, inf_SCR01(0x7C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7E)) \
shrhx_mx(Mebp, inf_SCR01(0x7E)) \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* svr (G = G >> S), (D = S >> T) if (#D != #T) - variable, signed
* for maximum compatibility: shift count must be modulo elem-size */
#define svrmn_rr(XG, XS) /* variable shift with per-elem count */ \
svrmn3rr(W(XG), W(XG), W(XS))
#define svrmn_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svrmn3ld(W(XG), W(XG), W(MS), W(DS))
#define svrmn3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
svrmn_rx(W(XD))
#define svrmn3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
svrmn_rx(W(XD))
#define svrmn_rx(XD) /* not portable, do not use outside */ \
stack_st(Recx) \
movhx_ld(Recx, Mebp, inf_SCR02(0x00)) \
shrhn_mx(Mebp, inf_SCR01(0x00)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x02)) \
shrhn_mx(Mebp, inf_SCR01(0x02)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x04)) \
shrhn_mx(Mebp, inf_SCR01(0x04)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x06)) \
shrhn_mx(Mebp, inf_SCR01(0x06)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x08)) \
shrhn_mx(Mebp, inf_SCR01(0x08)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0A)) \
shrhn_mx(Mebp, inf_SCR01(0x0A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0C)) \
shrhn_mx(Mebp, inf_SCR01(0x0C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x0E)) \
shrhn_mx(Mebp, inf_SCR01(0x0E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x10)) \
shrhn_mx(Mebp, inf_SCR01(0x10)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x12)) \
shrhn_mx(Mebp, inf_SCR01(0x12)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x14)) \
shrhn_mx(Mebp, inf_SCR01(0x14)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x16)) \
shrhn_mx(Mebp, inf_SCR01(0x16)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x18)) \
shrhn_mx(Mebp, inf_SCR01(0x18)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1A)) \
shrhn_mx(Mebp, inf_SCR01(0x1A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1C)) \
shrhn_mx(Mebp, inf_SCR01(0x1C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x1E)) \
shrhn_mx(Mebp, inf_SCR01(0x1E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x20)) \
shrhn_mx(Mebp, inf_SCR01(0x20)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x22)) \
shrhn_mx(Mebp, inf_SCR01(0x22)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x24)) \
shrhn_mx(Mebp, inf_SCR01(0x24)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x26)) \
shrhn_mx(Mebp, inf_SCR01(0x26)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x28)) \
shrhn_mx(Mebp, inf_SCR01(0x28)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2A)) \
shrhn_mx(Mebp, inf_SCR01(0x2A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2C)) \
shrhn_mx(Mebp, inf_SCR01(0x2C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x2E)) \
shrhn_mx(Mebp, inf_SCR01(0x2E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x30)) \
shrhn_mx(Mebp, inf_SCR01(0x30)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x32)) \
shrhn_mx(Mebp, inf_SCR01(0x32)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x34)) \
shrhn_mx(Mebp, inf_SCR01(0x34)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x36)) \
shrhn_mx(Mebp, inf_SCR01(0x36)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x38)) \
shrhn_mx(Mebp, inf_SCR01(0x38)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3A)) \
shrhn_mx(Mebp, inf_SCR01(0x3A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3C)) \
shrhn_mx(Mebp, inf_SCR01(0x3C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x3E)) \
shrhn_mx(Mebp, inf_SCR01(0x3E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x40)) \
shrhn_mx(Mebp, inf_SCR01(0x40)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x42)) \
shrhn_mx(Mebp, inf_SCR01(0x42)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x44)) \
shrhn_mx(Mebp, inf_SCR01(0x44)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x46)) \
shrhn_mx(Mebp, inf_SCR01(0x46)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x48)) \
shrhn_mx(Mebp, inf_SCR01(0x48)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4A)) \
shrhn_mx(Mebp, inf_SCR01(0x4A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4C)) \
shrhn_mx(Mebp, inf_SCR01(0x4C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x4E)) \
shrhn_mx(Mebp, inf_SCR01(0x4E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x50)) \
shrhn_mx(Mebp, inf_SCR01(0x50)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x52)) \
shrhn_mx(Mebp, inf_SCR01(0x52)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x54)) \
shrhn_mx(Mebp, inf_SCR01(0x54)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x56)) \
shrhn_mx(Mebp, inf_SCR01(0x56)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x58)) \
shrhn_mx(Mebp, inf_SCR01(0x58)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5A)) \
shrhn_mx(Mebp, inf_SCR01(0x5A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5C)) \
shrhn_mx(Mebp, inf_SCR01(0x5C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x5E)) \
shrhn_mx(Mebp, inf_SCR01(0x5E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x60)) \
shrhn_mx(Mebp, inf_SCR01(0x60)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x62)) \
shrhn_mx(Mebp, inf_SCR01(0x62)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x64)) \
shrhn_mx(Mebp, inf_SCR01(0x64)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x66)) \
shrhn_mx(Mebp, inf_SCR01(0x66)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x68)) \
shrhn_mx(Mebp, inf_SCR01(0x68)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6A)) \
shrhn_mx(Mebp, inf_SCR01(0x6A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6C)) \
shrhn_mx(Mebp, inf_SCR01(0x6C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x6E)) \
shrhn_mx(Mebp, inf_SCR01(0x6E)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x70)) \
shrhn_mx(Mebp, inf_SCR01(0x70)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x72)) \
shrhn_mx(Mebp, inf_SCR01(0x72)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x74)) \
shrhn_mx(Mebp, inf_SCR01(0x74)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x76)) \
shrhn_mx(Mebp, inf_SCR01(0x76)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x78)) \
shrhn_mx(Mebp, inf_SCR01(0x78)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7A)) \
shrhn_mx(Mebp, inf_SCR01(0x7A)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7C)) \
shrhn_mx(Mebp, inf_SCR01(0x7C)) \
movhx_ld(Recx, Mebp, inf_SCR02(0x7E)) \
shrhn_mx(Mebp, inf_SCR01(0x7E)) \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#else /* RT_512X2 >= 2 */
/* add (G = G + S), (D = S + T) if (#D != #T) */
#define addmx_rr(XG, XS) \
addmx3rr(W(XG), W(XG), W(XS))
#define addmx_ld(XG, MS, DS) \
addmx3ld(W(XG), W(XG), W(MS), W(DS))
#define addmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xFD) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xFD) \
MRM(REG(XD), MOD(XT), REG(XT))
#define addmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xFD) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xFD) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* ads (G = G + S), (D = S + T) if (#D != #T) - saturate, unsigned */
#define adsmx_rr(XG, XS) \
adsmx3rr(W(XG), W(XG), W(XS))
#define adsmx_ld(XG, MS, DS) \
adsmx3ld(W(XG), W(XG), W(MS), W(DS))
#define adsmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xDD) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xDD) \
MRM(REG(XD), MOD(XT), REG(XT))
#define adsmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xDD) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xDD) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* ads (G = G + S), (D = S + T) if (#D != #T) - saturate, signed */
#define adsmn_rr(XG, XS) \
adsmn3rr(W(XG), W(XG), W(XS))
#define adsmn_ld(XG, MS, DS) \
adsmn3ld(W(XG), W(XG), W(MS), W(DS))
#define adsmn3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xED) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xED) \
MRM(REG(XD), MOD(XT), REG(XT))
#define adsmn3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xED) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xED) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* sub (G = G - S), (D = S - T) if (#D != #T) */
#define submx_rr(XG, XS) \
submx3rr(W(XG), W(XG), W(XS))
#define submx_ld(XG, MS, DS) \
submx3ld(W(XG), W(XG), W(MS), W(DS))
#define submx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xF9) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xF9) \
MRM(REG(XD), MOD(XT), REG(XT))
#define submx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xF9) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xF9) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* sbs (G = G - S), (D = S - T) if (#D != #T) - saturate, unsigned */
#define sbsmx_rr(XG, XS) \
sbsmx3rr(W(XG), W(XG), W(XS))
#define sbsmx_ld(XG, MS, DS) \
sbsmx3ld(W(XG), W(XG), W(MS), W(DS))
#define sbsmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xD9) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xD9) \
MRM(REG(XD), MOD(XT), REG(XT))
#define sbsmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xD9) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xD9) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* sbs (G = G - S), (D = S - T) if (#D != #T) - saturate, signed */
#define sbsmn_rr(XG, XS) \
sbsmn3rr(W(XG), W(XG), W(XS))
#define sbsmn_ld(XG, MS, DS) \
sbsmn3ld(W(XG), W(XG), W(MS), W(DS))
#define sbsmn3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xE9) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xE9) \
MRM(REG(XD), MOD(XT), REG(XT))
#define sbsmn3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xE9) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xE9) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* mul (G = G * S), (D = S * T) if (#D != #T) */
#define mulmx_rr(XG, XS) \
mulmx3rr(W(XG), W(XG), W(XS))
#define mulmx_ld(XG, MS, DS) \
mulmx3ld(W(XG), W(XG), W(MS), W(DS))
#define mulmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xD5) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xD5) \
MRM(REG(XD), MOD(XT), REG(XT))
#define mulmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xD5) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xD5) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* shl (G = G << S), (D = S << T) if (#D != #T) - plain, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define shlmx_ri(XG, IS) \
shlmx3ri(W(XG), W(XG), W(IS))
#define shlmx_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shlmx3ld(W(XG), W(XG), W(MS), W(DS))
#define shlmx3ri(XD, XS, IT) \
EVX(0, RXB(XS), REN(XD), K, 1, 1) EMITB(0x71) \
MRM(0x06, MOD(XS), REG(XS)) \
AUX(EMPTY, EMPTY, EMITB(VAL(IT))) \
EVX(0, RMB(XS), REM(XD), K, 1, 1) EMITB(0x71) \
MRM(0x06, MOD(XS), REG(XS)) \
AUX(EMPTY, EMPTY, EMITB(VAL(IT)))
#define shlmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xF1) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xF1) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY)
/* shr (G = G >> S), (D = S >> T) if (#D != #T) - plain, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define shrmx_ri(XG, IS) \
shrmx3ri(W(XG), W(XG), W(IS))
#define shrmx_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shrmx3ld(W(XG), W(XG), W(MS), W(DS))
#define shrmx3ri(XD, XS, IT) \
EVX(0, RXB(XS), REN(XD), K, 1, 1) EMITB(0x71) \
MRM(0x02, MOD(XS), REG(XS)) \
AUX(EMPTY, EMPTY, EMITB(VAL(IT))) \
EVX(0, RMB(XS), REM(XD), K, 1, 1) EMITB(0x71) \
MRM(0x02, MOD(XS), REG(XS)) \
AUX(EMPTY, EMPTY, EMITB(VAL(IT)))
#define shrmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xD1) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xD1) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY)
/* shr (G = G >> S), (D = S >> T) if (#D != #T) - plain, signed
* for maximum compatibility: shift count must be modulo elem-size */
#define shrmn_ri(XG, IS) \
shrmn3ri(W(XG), W(XG), W(IS))
#define shrmn_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shrmn3ld(W(XG), W(XG), W(MS), W(DS))
#define shrmn3ri(XD, XS, IT) \
EVX(0, RXB(XS), REN(XD), K, 1, 1) EMITB(0x71) \
MRM(0x04, MOD(XS), REG(XS)) \
AUX(EMPTY, EMPTY, EMITB(VAL(IT))) \
EVX(0, RMB(XS), REM(XD), K, 1, 1) EMITB(0x71) \
MRM(0x04, MOD(XS), REG(XS)) \
AUX(EMPTY, EMPTY, EMITB(VAL(IT)))
#define shrmn3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xE1) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xE1) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY)
/* svl (G = G << S), (D = S << T) if (#D != #T) - variable, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define svlmx_rr(XG, XS) /* variable shift with per-elem count */ \
svlmx3rr(W(XG), W(XG), W(XS))
#define svlmx_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svlmx3ld(W(XG), W(XG), W(MS), W(DS))
#define svlmx3rr(XD, XS, XT) \
EVW(RXB(XD), RXB(XT), REN(XS), K, 1, 2) EMITB(0x12) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVW(RMB(XD), RMB(XT), REM(XS), K, 1, 2) EMITB(0x12) \
MRM(REG(XD), MOD(XT), REG(XT))
#define svlmx3ld(XD, XS, MT, DT) \
ADR EVW(RXB(XD), RXB(MT), REN(XS), K, 1, 2) EMITB(0x12) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVW(RMB(XD), RXB(MT), REM(XS), K, 1, 2) EMITB(0x12) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* svr (G = G >> S), (D = S >> T) if (#D != #T) - variable, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define svrmx_rr(XG, XS) /* variable shift with per-elem count */ \
svrmx3rr(W(XG), W(XG), W(XS))
#define svrmx_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svrmx3ld(W(XG), W(XG), W(MS), W(DS))
#define svrmx3rr(XD, XS, XT) \
EVW(RXB(XD), RXB(XT), REN(XS), K, 1, 2) EMITB(0x10) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVW(RMB(XD), RMB(XT), REM(XS), K, 1, 2) EMITB(0x10) \
MRM(REG(XD), MOD(XT), REG(XT))
#define svrmx3ld(XD, XS, MT, DT) \
ADR EVW(RXB(XD), RXB(MT), REN(XS), K, 1, 2) EMITB(0x10) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVW(RMB(XD), RXB(MT), REM(XS), K, 1, 2) EMITB(0x10) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* svr (G = G >> S), (D = S >> T) if (#D != #T) - variable, signed
* for maximum compatibility: shift count must be modulo elem-size */
#define svrmn_rr(XG, XS) /* variable shift with per-elem count */ \
svrmn3rr(W(XG), W(XG), W(XS))
#define svrmn_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svrmn3ld(W(XG), W(XG), W(MS), W(DS))
#define svrmn3rr(XD, XS, XT) \
EVW(RXB(XD), RXB(XT), REN(XS), K, 1, 2) EMITB(0x11) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVW(RMB(XD), RMB(XT), REM(XS), K, 1, 2) EMITB(0x11) \
MRM(REG(XD), MOD(XT), REG(XT))
#define svrmn3ld(XD, XS, MT, DT) \
ADR EVW(RXB(XD), RXB(MT), REN(XS), K, 1, 2) EMITB(0x11) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVW(RMB(XD), RXB(MT), REM(XS), K, 1, 2) EMITB(0x11) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
#endif /* RT_512X2 >= 2 */
/***************** packed half-precision integer compare ******************/
#if (RT_512X2 < 2)
/* min (G = G < S ? G : S), (D = S < T ? S : T) if (#D != #T), unsigned */
#define minmx_rr(XG, XS) \
minmx3rr(W(XG), W(XG), W(XS))
#define minmx_ld(XG, MS, DS) \
minmx3ld(W(XG), W(XG), W(MS), W(DS))
#define minmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
minmx_rx(W(XD))
#define minmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
minmx_rx(W(XD))
#define minmx_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
minax_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
minax_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
minax_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
minax_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* min (G = G < S ? G : S), (D = S < T ? S : T) if (#D != #T), signed */
#define minmn_rr(XG, XS) \
minmn3rr(W(XG), W(XG), W(XS))
#define minmn_ld(XG, MS, DS) \
minmn3ld(W(XG), W(XG), W(MS), W(DS))
#define minmn3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
minmn_rx(W(XD))
#define minmn3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
minmn_rx(W(XD))
#define minmn_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
minan_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
minan_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
minan_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
minan_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* max (G = G > S ? G : S), (D = S > T ? S : T) if (#D != #T), unsigned */
#define maxmx_rr(XG, XS) \
maxmx3rr(W(XG), W(XG), W(XS))
#define maxmx_ld(XG, MS, DS) \
maxmx3ld(W(XG), W(XG), W(MS), W(DS))
#define maxmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
maxmx_rx(W(XD))
#define maxmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
maxmx_rx(W(XD))
#define maxmx_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
maxax_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
maxax_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
maxax_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
maxax_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* max (G = G > S ? G : S), (D = S > T ? S : T) if (#D != #T), signed */
#define maxmn_rr(XG, XS) \
maxmn3rr(W(XG), W(XG), W(XS))
#define maxmn_ld(XG, MS, DS) \
maxmn3ld(W(XG), W(XG), W(MS), W(DS))
#define maxmn3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
maxmn_rx(W(XD))
#define maxmn3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
maxmn_rx(W(XD))
#define maxmn_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
maxan_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
maxan_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
maxan_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
maxan_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* ceq (G = G == S ? -1 : 0), (D = S == T ? -1 : 0) if (#D != #T) */
#define ceqmx_rr(XG, XS) \
ceqmx3rr(W(XG), W(XG), W(XS))
#define ceqmx_ld(XG, MS, DS) \
ceqmx3ld(W(XG), W(XG), W(MS), W(DS))
#define ceqmx3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
ceqmx_rx(W(XD))
#define ceqmx3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
ceqmx_rx(W(XD))
#define ceqmx_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
ceqax_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
ceqax_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
ceqax_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
ceqax_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* cgt (G = G > S ? -1 : 0), (D = S > T ? -1 : 0) if (#D != #T), signed */
#define cgtmn_rr(XG, XS) \
cgtmn3rr(W(XG), W(XG), W(XS))
#define cgtmn_ld(XG, MS, DS) \
cgtmn3ld(W(XG), W(XG), W(MS), W(DS))
#define cgtmn3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
cgtmn_rx(W(XD))
#define cgtmn3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
cgtmn_rx(W(XD))
#define cgtmn_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
cgtan_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
cgtan_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
cgtan_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
cgtan_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* cne (G = G != S ? -1 : 0), (D = S != T ? -1 : 0) if (#D != #T) */
#define cnemx_rr(XG, XS) \
cnemx3rr(W(XG), W(XG), W(XS))
#define cnemx_ld(XG, MS, DS) \
cnemx3ld(W(XG), W(XG), W(MS), W(DS))
#define cnemx3rr(XD, XS, XT) \
ceqmx3rr(W(XD), W(XS), W(XT)) \
notmx_rx(W(XD))
#define cnemx3ld(XD, XS, MT, DT) \
ceqmx3ld(W(XD), W(XS), W(MT), W(DT)) \
notmx_rx(W(XD))
/* clt (G = G < S ? -1 : 0), (D = S < T ? -1 : 0) if (#D != #T), unsigned */
#define cltmx_rr(XG, XS) \
cltmx3rr(W(XG), W(XG), W(XS))
#define cltmx_ld(XG, MS, DS) \
cltmx3ld(W(XG), W(XG), W(MS), W(DS))
#define cltmx3rr(XD, XS, XT) \
minmx3rr(W(XD), W(XS), W(XT)) \
cnemx_rr(W(XD), W(XT))
#define cltmx3ld(XD, XS, MT, DT) \
minmx3ld(W(XD), W(XS), W(MT), W(DT)) \
cnemx_ld(W(XD), W(MT), W(DT))
/* clt (G = G < S ? -1 : 0), (D = S < T ? -1 : 0) if (#D != #T), signed */
#define cltmn_rr(XG, XS) \
cltmn3rr(W(XG), W(XG), W(XS))
#define cltmn_ld(XG, MS, DS) \
cltmn3ld(W(XG), W(XG), W(MS), W(DS))
#define cltmn3rr(XD, XS, XT) \
cgtmn3rr(W(XD), W(XT), W(XS))
#define cltmn3ld(XD, XS, MT, DT) \
minmn3ld(W(XD), W(XS), W(MT), W(DT)) \
cnemx_ld(W(XD), W(MT), W(DT))
/* cle (G = G <= S ? -1 : 0), (D = S <= T ? -1 : 0) if (#D != #T), unsigned */
#define clemx_rr(XG, XS) \
clemx3rr(W(XG), W(XG), W(XS))
#define clemx_ld(XG, MS, DS) \
clemx3ld(W(XG), W(XG), W(MS), W(DS))
#define clemx3rr(XD, XS, XT) \
maxmx3rr(W(XD), W(XS), W(XT)) \
ceqmx_rr(W(XD), W(XT))
#define clemx3ld(XD, XS, MT, DT) \
maxmx3ld(W(XD), W(XS), W(MT), W(DT)) \
ceqmx_ld(W(XD), W(MT), W(DT))
/* cle (G = G <= S ? -1 : 0), (D = S <= T ? -1 : 0) if (#D != #T), signed */
#define clemn_rr(XG, XS) \
clemn3rr(W(XG), W(XG), W(XS))
#define clemn_ld(XG, MS, DS) \
clemn3ld(W(XG), W(XG), W(MS), W(DS))
#define clemn3rr(XD, XS, XT) \
cgtmn3rr(W(XD), W(XS), W(XT)) \
notmx_rx(W(XD))
#define clemn3ld(XD, XS, MT, DT) \
cgtmn3ld(W(XD), W(XS), W(MT), W(DT)) \
notmx_rx(W(XD))
/* cgt (G = G > S ? -1 : 0), (D = S > T ? -1 : 0) if (#D != #T), unsigned */
#define cgtmx_rr(XG, XS) \
cgtmx3rr(W(XG), W(XG), W(XS))
#define cgtmx_ld(XG, MS, DS) \
cgtmx3ld(W(XG), W(XG), W(MS), W(DS))
#define cgtmx3rr(XD, XS, XT) \
maxmx3rr(W(XD), W(XS), W(XT)) \
cnemx_rr(W(XD), W(XT))
#define cgtmx3ld(XD, XS, MT, DT) \
maxmx3ld(W(XD), W(XS), W(MT), W(DT)) \
cnemx_ld(W(XD), W(MT), W(DT))
/* cge (G = G >= S ? -1 : 0), (D = S >= T ? -1 : 0) if (#D != #T), unsigned */
#define cgemx_rr(XG, XS) \
cgemx3rr(W(XG), W(XG), W(XS))
#define cgemx_ld(XG, MS, DS) \
cgemx3ld(W(XG), W(XG), W(MS), W(DS))
#define cgemx3rr(XD, XS, XT) \
minmx3rr(W(XD), W(XS), W(XT)) \
ceqmx_rr(W(XD), W(XT))
#define cgemx3ld(XD, XS, MT, DT) \
minmx3ld(W(XD), W(XS), W(MT), W(DT)) \
ceqmx_ld(W(XD), W(MT), W(DT))
/* cge (G = G >= S ? -1 : 0), (D = S >= T ? -1 : 0) if (#D != #T), signed */
#define cgemn_rr(XG, XS) \
cgemn3rr(W(XG), W(XG), W(XS))
#define cgemn_ld(XG, MS, DS) \
cgemn3ld(W(XG), W(XG), W(MS), W(DS))
#define cgemn3rr(XD, XS, XT) \
minmn3rr(W(XD), W(XS), W(XT)) \
ceqmx_rr(W(XD), W(XT))
#define cgemn3ld(XD, XS, MT, DT) \
minmn3ld(W(XD), W(XS), W(MT), W(DT)) \
ceqmx_ld(W(XD), W(MT), W(DT))
/* mkj (jump to lb) if (S satisfies mask condition) */
#define RT_SIMD_MASK_NONE16_1K4 0x00000000 /* none satisfy the condition */
#define RT_SIMD_MASK_FULL16_1K4 0xFFC0FFC0 /* all satisfy the condition */
#define adpax3rr(XD, XS, XT) /* not portable, do not use outside */ \
VEX(RXB(XD), RXB(XT), REN(XS), 1, 1, 2) EMITB(0x01) \
MRM(REG(XD), MOD(XT), REG(XT))
#define adpax3ld(XD, XS, MT, DT) /* not portable, do not use outside */ \
VEX(RXB(XD), RXB(MT), REN(XS), 1, 1, 2) EMITB(0x01) \
MRM(REG(XD), MOD(MT), REG(MT)) \
AUX(SIB(MT), CMD(DT), EMPTY)
#define mkjmx_rx(XS, mask, lb) /* destroys Reax, if S == mask jump lb */ \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
adpax3ld(W(XS), W(XS), Mebp, inf_SCR01(0x20)) \
movax_st(W(XS), Mebp, inf_SCR02(0x00)) \
movax_ld(W(XS), Mebp, inf_SCR01(0x40)) \
adpax3ld(W(XS), W(XS), Mebp, inf_SCR01(0x60)) \
adpax3ld(W(XS), W(XS), Mebp, inf_SCR02(0x00)) \
adpax3rr(W(XS), W(XS), W(XS)) \
adpax3rr(W(XS), W(XS), W(XS)) \
adpax3rr(W(XS), W(XS), W(XS)) \
movrs_st(W(XS), Mebp, inf_SCR02(0)) \
movmx_ld(W(XS), Mebp, inf_SCR01(0)) \
cmpwx_mi(Mebp, inf_SCR02(0), IW(RT_SIMD_MASK_##mask##16_1K4)) \
jeqxx_lb(lb)
#else /* RT_512X2 >= 2 */
/* min (G = G < S ? G : S), (D = S < T ? S : T) if (#D != #T), unsigned */
#define minmx_rr(XG, XS) \
minmx3rr(W(XG), W(XG), W(XS))
#define minmx_ld(XG, MS, DS) \
minmx3ld(W(XG), W(XG), W(MS), W(DS))
#define minmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 2) EMITB(0x3A) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 2) EMITB(0x3A) \
MRM(REG(XD), MOD(XT), REG(XT))
#define minmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 2) EMITB(0x3A) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 2) EMITB(0x3A) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* min (G = G < S ? G : S), (D = S < T ? S : T) if (#D != #T), signed */
#define minmn_rr(XG, XS) \
minmn3rr(W(XG), W(XG), W(XS))
#define minmn_ld(XG, MS, DS) \
minmn3ld(W(XG), W(XG), W(MS), W(DS))
#define minmn3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xEA) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xEA) \
MRM(REG(XD), MOD(XT), REG(XT))
#define minmn3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xEA) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xEA) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* max (G = G > S ? G : S), (D = S > T ? S : T) if (#D != #T), unsigned */
#define maxmx_rr(XG, XS) \
maxmx3rr(W(XG), W(XG), W(XS))
#define maxmx_ld(XG, MS, DS) \
maxmx3ld(W(XG), W(XG), W(MS), W(DS))
#define maxmx3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 2) EMITB(0x3E) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 2) EMITB(0x3E) \
MRM(REG(XD), MOD(XT), REG(XT))
#define maxmx3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 2) EMITB(0x3E) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 2) EMITB(0x3E) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* max (G = G > S ? G : S), (D = S > T ? S : T) if (#D != #T), signed */
#define maxmn_rr(XG, XS) \
maxmn3rr(W(XG), W(XG), W(XS))
#define maxmn_ld(XG, MS, DS) \
maxmn3ld(W(XG), W(XG), W(MS), W(DS))
#define maxmn3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xEE) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xEE) \
MRM(REG(XD), MOD(XT), REG(XT))
#define maxmn3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xEE) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xEE) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* ceq (G = G == S ? -1 : 0), (D = S == T ? -1 : 0) if (#D != #T) */
#define ceqmx_rr(XG, XS) \
ceqmx3rr(W(XG), W(XG), W(XS))
#define ceqmx_ld(XG, MS, DS) \
ceqmx3ld(W(XG), W(XG), W(MS), W(DS))
#define ceqmx3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x00)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x00)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define ceqmx3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x00)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x00)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* cne (G = G != S ? -1 : 0), (D = S != T ? -1 : 0) if (#D != #T) */
#define cnemx_rr(XG, XS) \
cnemx3rr(W(XG), W(XG), W(XS))
#define cnemx_ld(XG, MS, DS) \
cnemx3ld(W(XG), W(XG), W(MS), W(DS))
#define cnemx3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x04)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x04)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define cnemx3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x04)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x04)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* clt (G = G < S ? -1 : 0), (D = S < T ? -1 : 0) if (#D != #T), unsigned */
#define cltmx_rr(XG, XS) \
cltmx3rr(W(XG), W(XG), W(XS))
#define cltmx_ld(XG, MS, DS) \
cltmx3ld(W(XG), W(XG), W(MS), W(DS))
#define cltmx3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x01)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x01)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define cltmx3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x01)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x01)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* clt (G = G < S ? -1 : 0), (D = S < T ? -1 : 0) if (#D != #T), signed */
#define cltmn_rr(XG, XS) \
cltmn3rr(W(XG), W(XG), W(XS))
#define cltmn_ld(XG, MS, DS) \
cltmn3ld(W(XG), W(XG), W(MS), W(DS))
#define cltmn3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x01)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x01)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define cltmn3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x01)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x01)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* cle (G = G <= S ? -1 : 0), (D = S <= T ? -1 : 0) if (#D != #T), unsigned */
#define clemx_rr(XG, XS) \
clemx3rr(W(XG), W(XG), W(XS))
#define clemx_ld(XG, MS, DS) \
clemx3ld(W(XG), W(XG), W(MS), W(DS))
#define clemx3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x02)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x02)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define clemx3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x02)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x02)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* cle (G = G <= S ? -1 : 0), (D = S <= T ? -1 : 0) if (#D != #T), signed */
#define clemn_rr(XG, XS) \
clemn3rr(W(XG), W(XG), W(XS))
#define clemn_ld(XG, MS, DS) \
clemn3ld(W(XG), W(XG), W(MS), W(DS))
#define clemn3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x02)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x02)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define clemn3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x02)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x02)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* cgt (G = G > S ? -1 : 0), (D = S > T ? -1 : 0) if (#D != #T), unsigned */
#define cgtmx_rr(XG, XS) \
cgtmx3rr(W(XG), W(XG), W(XS))
#define cgtmx_ld(XG, MS, DS) \
cgtmx3ld(W(XG), W(XG), W(MS), W(DS))
#define cgtmx3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x06)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x06)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define cgtmx3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x06)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x06)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* cgt (G = G > S ? -1 : 0), (D = S > T ? -1 : 0) if (#D != #T), signed */
#define cgtmn_rr(XG, XS) \
cgtmn3rr(W(XG), W(XG), W(XS))
#define cgtmn_ld(XG, MS, DS) \
cgtmn3ld(W(XG), W(XG), W(MS), W(DS))
#define cgtmn3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x06)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x06)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define cgtmn3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x06)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x06)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* cge (G = G >= S ? -1 : 0), (D = S >= T ? -1 : 0) if (#D != #T), unsigned */
#define cgemx_rr(XG, XS) \
cgemx3rr(W(XG), W(XG), W(XS))
#define cgemx_ld(XG, MS, DS) \
cgemx3ld(W(XG), W(XG), W(MS), W(DS))
#define cgemx3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x05)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x05)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define cgemx3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x05)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x05)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* cge (G = G >= S ? -1 : 0), (D = S >= T ? -1 : 0) if (#D != #T), signed */
#define cgemn_rr(XG, XS) \
cgemn3rr(W(XG), W(XG), W(XS))
#define cgemn_ld(XG, MS, DS) \
cgemn3ld(W(XG), W(XG), W(MS), W(DS))
#define cgemn3rr(XD, XS, XT) \
EVW(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x05)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
EVW(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x05)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
#define cgemn3ld(XD, XS, MT, DT) \
ADR EVW(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x05)) \
mz1mx_ld(W(XD), Mebp, inf_GPC07) \
ADR EVW(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x05)) \
mz1mx_ld(X(XD), Mebp, inf_GPC07)
/* mkj (jump to lb) if (S satisfies mask condition) */
#define RT_SIMD_MASK_NONE16_1K4 0x00000000 /* none satisfy the condition */
#define RT_SIMD_MASK_FULL16_1K4 0xFFFFFFFF /* all satisfy the condition */
#define mk1hx_rx(RD) /* not portable, do not use outside */ \
VEX(RXB(RD), 0, 0x00, 0, 3, 1) EMITB(0x93) \
MRM(REG(RD), 0x03, 0x01)
#define mkjmx_rx(XS, mask, lb) /* destroys Reax, if S == mask jump lb */ \
ck1mx_rm(W(XS), Mebp, inf_GPC07) \
mk1hx_rx(Reax) \
REX(1, 0) EMITB(0x8B) \
MRM(0x07, 0x03, 0x00) \
ck1mx_rm(X(XS), Mebp, inf_GPC07) \
mk1hx_rx(Reax) \
REX(0, 1) \
EMITB(0x03 | (0x08 << ((RT_SIMD_MASK_##mask##16_1K4 & 0x1) << 1))) \
MRM(0x00, 0x03, 0x07) \
cmpwx_ri(Reax, IW(RT_SIMD_MASK_##mask##16_1K4)) \
jeqxx_lb(lb)
#endif /* RT_512X2 >= 2 */
/**************** packed byte-precision generic move/logic ****************/
/* mmv (G = G mask-merge S) where (mask-elem: 0 keeps G, -1 picks S)
* uses Xmm0 implicitly as a mask register, destroys Xmm0, 0-masked XS elems */
#if (RT_512X2 == 1)
#define mmvmb_rr(XG, XS) \
andmx_rr(W(XS), Xmm0) \
annmx_rr(Xmm0, W(XG)) \
orrmx_rr(Xmm0, W(XS)) \
movmx_rr(W(XG), Xmm0)
#define mmvmb_ld(XG, MS, DS) \
notmx_rx(Xmm0) \
andmx_rr(W(XG), Xmm0) \
annmx_ld(Xmm0, W(MS), W(DS)) \
orrmx_rr(W(XG), Xmm0)
#define mmvmb_st(XS, MG, DG) \
andmx_rr(W(XS), Xmm0) \
annmx_ld(Xmm0, W(MG), W(DG)) \
orrmx_rr(Xmm0, W(XS)) \
movmx_st(Xmm0, W(MG), W(DG))
#else /* RT_512X2 == 2 */
#define mmvmb_rr(XG, XS) \
ck1mb_rm(Xmm0, Mebp, inf_GPC07) \
EKX(RXB(XG), RXB(XS), 0x00, K, 3, 1) EMITB(0x6F) \
MRM(REG(XG), MOD(XS), REG(XS)) \
ck1mb_rm(XmmG, Mebp, inf_GPC07) \
EKX(RMB(XG), RMB(XS), 0x00, K, 3, 1) EMITB(0x6F) \
MRM(REG(XG), MOD(XS), REG(XS))
#define mmvmb_ld(XG, MS, DS) \
ck1mb_rm(Xmm0, Mebp, inf_GPC07) \
ADR EKX(RXB(XG), RXB(MS), 0x00, K, 3, 1) EMITB(0x6F) \
MRM(REG(XG), 0x02, REG(MS)) \
AUX(SIB(MS), EMITW(VAL(DS)), EMPTY) \
ck1mb_rm(XmmG, Mebp, inf_GPC07) \
ADR EKX(RMB(XG), RXB(MS), 0x00, K, 3, 1) EMITB(0x6F) \
MRM(REG(XG), 0x02, REG(MS)) \
AUX(SIB(MS), EMITW(VZL(DS)), EMPTY)
#define mmvmb_st(XS, MG, DG) \
ck1mb_rm(Xmm0, Mebp, inf_GPC07) \
ADR EKX(RXB(XS), RXB(MG), 0x00, K, 3, 1) EMITB(0x7F) \
MRM(REG(XS), 0x02, REG(MG)) \
AUX(SIB(MG), EMITW(VAL(DG)), EMPTY) \
ck1mb_rm(XmmG, Mebp, inf_GPC07) \
ADR EKX(RMB(XS), RXB(MG), 0x00, K, 3, 1) EMITB(0x7F) \
MRM(REG(XS), 0x02, REG(MG)) \
AUX(SIB(MG), EMITW(VZL(DG)), EMPTY)
#endif /* RT_512X2 == 2 */
/* move/logic instructions are sizeless and provided in 16-bit subset above */
/************* packed byte-precision integer arithmetic/shifts ************/
#if (RT_512X2 < 2)
/* add (G = G + S), (D = S + T) if (#D != #T) */
#define addmb_rr(XG, XS) \
addmb3rr(W(XG), W(XG), W(XS))
#define addmb_ld(XG, MS, DS) \
addmb3ld(W(XG), W(XG), W(MS), W(DS))
#define addmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
addmb_rx(W(XD))
#define addmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
addmb_rx(W(XD))
#define addmb_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
addab_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
addab_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
addab_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
addab_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* ads (G = G + S), (D = S + T) if (#D != #T) - saturate, unsigned */
#define adsmb_rr(XG, XS) \
adsmb3rr(W(XG), W(XG), W(XS))
#define adsmb_ld(XG, MS, DS) \
adsmb3ld(W(XG), W(XG), W(MS), W(DS))
#define adsmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
adsmb_rx(W(XD))
#define adsmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
adsmb_rx(W(XD))
#define adsmb_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
adsab_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
adsab_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
adsab_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
adsab_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* ads (G = G + S), (D = S + T) if (#D != #T) - saturate, signed */
#define adsmc_rr(XG, XS) \
adsmc3rr(W(XG), W(XG), W(XS))
#define adsmc_ld(XG, MS, DS) \
adsmc3ld(W(XG), W(XG), W(MS), W(DS))
#define adsmc3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
adsmc_rx(W(XD))
#define adsmc3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
adsmc_rx(W(XD))
#define adsmc_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
adsac_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
adsac_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
adsac_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
adsac_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* sub (G = G - S), (D = S - T) if (#D != #T) */
#define submb_rr(XG, XS) \
submb3rr(W(XG), W(XG), W(XS))
#define submb_ld(XG, MS, DS) \
submb3ld(W(XG), W(XG), W(MS), W(DS))
#define submb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
submb_rx(W(XD))
#define submb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
submb_rx(W(XD))
#define submb_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
subab_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
subab_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
subab_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
subab_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* sbs (G = G - S), (D = S - T) if (#D != #T) - saturate, unsigned */
#define sbsmb_rr(XG, XS) \
sbsmb3rr(W(XG), W(XG), W(XS))
#define sbsmb_ld(XG, MS, DS) \
sbsmb3ld(W(XG), W(XG), W(MS), W(DS))
#define sbsmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
sbsmb_rx(W(XD))
#define sbsmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
sbsmb_rx(W(XD))
#define sbsmb_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
sbsab_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
sbsab_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
sbsab_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
sbsab_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* sbs (G = G - S), (D = S - T) if (#D != #T) - saturate, signed */
#define sbsmc_rr(XG, XS) \
sbsmc3rr(W(XG), W(XG), W(XS))
#define sbsmc_ld(XG, MS, DS) \
sbsmc3ld(W(XG), W(XG), W(MS), W(DS))
#define sbsmc3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
sbsmc_rx(W(XD))
#define sbsmc3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
sbsmc_rx(W(XD))
#define sbsmc_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
sbsac_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
sbsac_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
sbsac_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
sbsac_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#else /* RT_512X2 >= 2 */
/* add (G = G + S), (D = S + T) if (#D != #T) */
#define addmb_rr(XG, XS) \
addmb3rr(W(XG), W(XG), W(XS))
#define addmb_ld(XG, MS, DS) \
addmb3ld(W(XG), W(XG), W(MS), W(DS))
#define addmb3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xFC) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xFC) \
MRM(REG(XD), MOD(XT), REG(XT))
#define addmb3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xFC) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xFC) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* ads (G = G + S), (D = S + T) if (#D != #T) - saturate, unsigned */
#define adsmb_rr(XG, XS) \
adsmb3rr(W(XG), W(XG), W(XS))
#define adsmb_ld(XG, MS, DS) \
adsmb3ld(W(XG), W(XG), W(MS), W(DS))
#define adsmb3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xDC) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xDC) \
MRM(REG(XD), MOD(XT), REG(XT))
#define adsmb3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xDC) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xDC) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* ads (G = G + S), (D = S + T) if (#D != #T) - saturate, signed */
#define adsmc_rr(XG, XS) \
adsmc3rr(W(XG), W(XG), W(XS))
#define adsmc_ld(XG, MS, DS) \
adsmc3ld(W(XG), W(XG), W(MS), W(DS))
#define adsmc3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xEC) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xEC) \
MRM(REG(XD), MOD(XT), REG(XT))
#define adsmc3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xEC) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xEC) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* sub (G = G - S), (D = S - T) if (#D != #T) */
#define submb_rr(XG, XS) \
submb3rr(W(XG), W(XG), W(XS))
#define submb_ld(XG, MS, DS) \
submb3ld(W(XG), W(XG), W(MS), W(DS))
#define submb3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xF8) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xF8) \
MRM(REG(XD), MOD(XT), REG(XT))
#define submb3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xF8) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xF8) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* sbs (G = G - S), (D = S - T) if (#D != #T) - saturate, unsigned */
#define sbsmb_rr(XG, XS) \
sbsmb3rr(W(XG), W(XG), W(XS))
#define sbsmb_ld(XG, MS, DS) \
sbsmb3ld(W(XG), W(XG), W(MS), W(DS))
#define sbsmb3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xD8) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xD8) \
MRM(REG(XD), MOD(XT), REG(XT))
#define sbsmb3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xD8) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xD8) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* sbs (G = G - S), (D = S - T) if (#D != #T) - saturate, signed */
#define sbsmc_rr(XG, XS) \
sbsmc3rr(W(XG), W(XG), W(XS))
#define sbsmc_ld(XG, MS, DS) \
sbsmc3ld(W(XG), W(XG), W(MS), W(DS))
#define sbsmc3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xE8) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xE8) \
MRM(REG(XD), MOD(XT), REG(XT))
#define sbsmc3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xE8) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xE8) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
#endif /* RT_512X2 >= 2 */
/* mul (G = G * S), (D = S * T) if (#D != #T) */
#define mulmb_rr(XG, XS) \
mulmb3rr(W(XG), W(XG), W(XS))
#define mulmb_ld(XG, MS, DS) \
mulmb3ld(W(XG), W(XG), W(MS), W(DS))
#define mulmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
mulmb_rx(W(XD))
#define mulmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
mulmb_rx(W(XD))
#define mulmb_rx(XD) /* not portable, do not use outside */ \
stack_st(Recx) \
movbx_ld(Recx, Mebp, inf_SCR01(0x00)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x00)) \
movbx_st(Recx, Mebp, inf_SCR01(0x00)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x01)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x01)) \
movbx_st(Recx, Mebp, inf_SCR01(0x01)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x02)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x02)) \
movbx_st(Recx, Mebp, inf_SCR01(0x02)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x03)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x03)) \
movbx_st(Recx, Mebp, inf_SCR01(0x03)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x04)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x04)) \
movbx_st(Recx, Mebp, inf_SCR01(0x04)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x05)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x05)) \
movbx_st(Recx, Mebp, inf_SCR01(0x05)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x06)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x06)) \
movbx_st(Recx, Mebp, inf_SCR01(0x06)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x07)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x07)) \
movbx_st(Recx, Mebp, inf_SCR01(0x07)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x08)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x08)) \
movbx_st(Recx, Mebp, inf_SCR01(0x08)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x09)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x09)) \
movbx_st(Recx, Mebp, inf_SCR01(0x09)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x0A)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x0A)) \
movbx_st(Recx, Mebp, inf_SCR01(0x0A)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x0B)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x0B)) \
movbx_st(Recx, Mebp, inf_SCR01(0x0B)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x0C)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x0C)) \
movbx_st(Recx, Mebp, inf_SCR01(0x0C)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x0D)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x0D)) \
movbx_st(Recx, Mebp, inf_SCR01(0x0D)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x0E)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x0E)) \
movbx_st(Recx, Mebp, inf_SCR01(0x0E)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x0F)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x0F)) \
movbx_st(Recx, Mebp, inf_SCR01(0x0F)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x10)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x10)) \
movbx_st(Recx, Mebp, inf_SCR01(0x10)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x11)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x11)) \
movbx_st(Recx, Mebp, inf_SCR01(0x11)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x12)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x12)) \
movbx_st(Recx, Mebp, inf_SCR01(0x12)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x13)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x13)) \
movbx_st(Recx, Mebp, inf_SCR01(0x13)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x14)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x14)) \
movbx_st(Recx, Mebp, inf_SCR01(0x14)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x15)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x15)) \
movbx_st(Recx, Mebp, inf_SCR01(0x15)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x16)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x16)) \
movbx_st(Recx, Mebp, inf_SCR01(0x16)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x17)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x17)) \
movbx_st(Recx, Mebp, inf_SCR01(0x17)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x18)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x18)) \
movbx_st(Recx, Mebp, inf_SCR01(0x18)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x19)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x19)) \
movbx_st(Recx, Mebp, inf_SCR01(0x19)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x1A)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x1A)) \
movbx_st(Recx, Mebp, inf_SCR01(0x1A)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x1B)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x1B)) \
movbx_st(Recx, Mebp, inf_SCR01(0x1B)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x1C)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x1C)) \
movbx_st(Recx, Mebp, inf_SCR01(0x1C)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x1D)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x1D)) \
movbx_st(Recx, Mebp, inf_SCR01(0x1D)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x1E)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x1E)) \
movbx_st(Recx, Mebp, inf_SCR01(0x1E)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x1F)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x1F)) \
movbx_st(Recx, Mebp, inf_SCR01(0x1F)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x20)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x20)) \
movbx_st(Recx, Mebp, inf_SCR01(0x20)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x21)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x21)) \
movbx_st(Recx, Mebp, inf_SCR01(0x21)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x22)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x22)) \
movbx_st(Recx, Mebp, inf_SCR01(0x22)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x23)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x23)) \
movbx_st(Recx, Mebp, inf_SCR01(0x23)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x24)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x24)) \
movbx_st(Recx, Mebp, inf_SCR01(0x24)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x25)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x25)) \
movbx_st(Recx, Mebp, inf_SCR01(0x25)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x26)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x26)) \
movbx_st(Recx, Mebp, inf_SCR01(0x26)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x27)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x27)) \
movbx_st(Recx, Mebp, inf_SCR01(0x27)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x28)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x28)) \
movbx_st(Recx, Mebp, inf_SCR01(0x28)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x29)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x29)) \
movbx_st(Recx, Mebp, inf_SCR01(0x29)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x2A)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x2A)) \
movbx_st(Recx, Mebp, inf_SCR01(0x2A)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x2B)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x2B)) \
movbx_st(Recx, Mebp, inf_SCR01(0x2B)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x2C)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x2C)) \
movbx_st(Recx, Mebp, inf_SCR01(0x2C)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x2D)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x2D)) \
movbx_st(Recx, Mebp, inf_SCR01(0x2D)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x2E)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x2E)) \
movbx_st(Recx, Mebp, inf_SCR01(0x2E)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x2F)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x2F)) \
movbx_st(Recx, Mebp, inf_SCR01(0x2F)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x30)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x30)) \
movbx_st(Recx, Mebp, inf_SCR01(0x30)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x31)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x31)) \
movbx_st(Recx, Mebp, inf_SCR01(0x31)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x32)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x32)) \
movbx_st(Recx, Mebp, inf_SCR01(0x32)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x33)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x33)) \
movbx_st(Recx, Mebp, inf_SCR01(0x33)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x34)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x34)) \
movbx_st(Recx, Mebp, inf_SCR01(0x34)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x35)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x35)) \
movbx_st(Recx, Mebp, inf_SCR01(0x35)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x36)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x36)) \
movbx_st(Recx, Mebp, inf_SCR01(0x36)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x37)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x37)) \
movbx_st(Recx, Mebp, inf_SCR01(0x37)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x38)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x38)) \
movbx_st(Recx, Mebp, inf_SCR01(0x38)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x39)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x39)) \
movbx_st(Recx, Mebp, inf_SCR01(0x39)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x3A)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x3A)) \
movbx_st(Recx, Mebp, inf_SCR01(0x3A)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x3B)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x3B)) \
movbx_st(Recx, Mebp, inf_SCR01(0x3B)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x3C)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x3C)) \
movbx_st(Recx, Mebp, inf_SCR01(0x3C)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x3D)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x3D)) \
movbx_st(Recx, Mebp, inf_SCR01(0x3D)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x3E)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x3E)) \
movbx_st(Recx, Mebp, inf_SCR01(0x3E)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x3F)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x3F)) \
movbx_st(Recx, Mebp, inf_SCR01(0x3F)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x40)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x40)) \
movbx_st(Recx, Mebp, inf_SCR01(0x40)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x41)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x41)) \
movbx_st(Recx, Mebp, inf_SCR01(0x41)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x42)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x42)) \
movbx_st(Recx, Mebp, inf_SCR01(0x42)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x43)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x43)) \
movbx_st(Recx, Mebp, inf_SCR01(0x43)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x44)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x44)) \
movbx_st(Recx, Mebp, inf_SCR01(0x44)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x45)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x45)) \
movbx_st(Recx, Mebp, inf_SCR01(0x45)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x46)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x46)) \
movbx_st(Recx, Mebp, inf_SCR01(0x46)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x47)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x47)) \
movbx_st(Recx, Mebp, inf_SCR01(0x47)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x48)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x48)) \
movbx_st(Recx, Mebp, inf_SCR01(0x48)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x49)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x49)) \
movbx_st(Recx, Mebp, inf_SCR01(0x49)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x4A)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x4A)) \
movbx_st(Recx, Mebp, inf_SCR01(0x4A)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x4B)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x4B)) \
movbx_st(Recx, Mebp, inf_SCR01(0x4B)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x4C)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x4C)) \
movbx_st(Recx, Mebp, inf_SCR01(0x4C)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x4D)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x4D)) \
movbx_st(Recx, Mebp, inf_SCR01(0x4D)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x4E)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x4E)) \
movbx_st(Recx, Mebp, inf_SCR01(0x4E)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x4F)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x4F)) \
movbx_st(Recx, Mebp, inf_SCR01(0x4F)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x50)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x50)) \
movbx_st(Recx, Mebp, inf_SCR01(0x50)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x51)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x51)) \
movbx_st(Recx, Mebp, inf_SCR01(0x51)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x52)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x52)) \
movbx_st(Recx, Mebp, inf_SCR01(0x52)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x53)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x53)) \
movbx_st(Recx, Mebp, inf_SCR01(0x53)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x54)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x54)) \
movbx_st(Recx, Mebp, inf_SCR01(0x54)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x55)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x55)) \
movbx_st(Recx, Mebp, inf_SCR01(0x55)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x56)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x56)) \
movbx_st(Recx, Mebp, inf_SCR01(0x56)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x57)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x57)) \
movbx_st(Recx, Mebp, inf_SCR01(0x57)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x58)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x58)) \
movbx_st(Recx, Mebp, inf_SCR01(0x58)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x59)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x59)) \
movbx_st(Recx, Mebp, inf_SCR01(0x59)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x5A)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x5A)) \
movbx_st(Recx, Mebp, inf_SCR01(0x5A)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x5B)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x5B)) \
movbx_st(Recx, Mebp, inf_SCR01(0x5B)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x5C)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x5C)) \
movbx_st(Recx, Mebp, inf_SCR01(0x5C)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x5D)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x5D)) \
movbx_st(Recx, Mebp, inf_SCR01(0x5D)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x5E)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x5E)) \
movbx_st(Recx, Mebp, inf_SCR01(0x5E)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x5F)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x5F)) \
movbx_st(Recx, Mebp, inf_SCR01(0x5F)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x60)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x60)) \
movbx_st(Recx, Mebp, inf_SCR01(0x60)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x61)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x61)) \
movbx_st(Recx, Mebp, inf_SCR01(0x61)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x62)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x62)) \
movbx_st(Recx, Mebp, inf_SCR01(0x62)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x63)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x63)) \
movbx_st(Recx, Mebp, inf_SCR01(0x63)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x64)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x64)) \
movbx_st(Recx, Mebp, inf_SCR01(0x64)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x65)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x65)) \
movbx_st(Recx, Mebp, inf_SCR01(0x65)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x66)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x66)) \
movbx_st(Recx, Mebp, inf_SCR01(0x66)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x67)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x67)) \
movbx_st(Recx, Mebp, inf_SCR01(0x67)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x68)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x68)) \
movbx_st(Recx, Mebp, inf_SCR01(0x68)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x69)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x69)) \
movbx_st(Recx, Mebp, inf_SCR01(0x69)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x6A)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x6A)) \
movbx_st(Recx, Mebp, inf_SCR01(0x6A)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x6B)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x6B)) \
movbx_st(Recx, Mebp, inf_SCR01(0x6B)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x6C)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x6C)) \
movbx_st(Recx, Mebp, inf_SCR01(0x6C)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x6D)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x6D)) \
movbx_st(Recx, Mebp, inf_SCR01(0x6D)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x6E)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x6E)) \
movbx_st(Recx, Mebp, inf_SCR01(0x6E)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x6F)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x6F)) \
movbx_st(Recx, Mebp, inf_SCR01(0x6F)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x70)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x70)) \
movbx_st(Recx, Mebp, inf_SCR01(0x70)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x71)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x71)) \
movbx_st(Recx, Mebp, inf_SCR01(0x71)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x72)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x72)) \
movbx_st(Recx, Mebp, inf_SCR01(0x72)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x73)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x73)) \
movbx_st(Recx, Mebp, inf_SCR01(0x73)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x74)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x74)) \
movbx_st(Recx, Mebp, inf_SCR01(0x74)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x75)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x75)) \
movbx_st(Recx, Mebp, inf_SCR01(0x75)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x76)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x76)) \
movbx_st(Recx, Mebp, inf_SCR01(0x76)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x77)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x77)) \
movbx_st(Recx, Mebp, inf_SCR01(0x77)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x78)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x78)) \
movbx_st(Recx, Mebp, inf_SCR01(0x78)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x79)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x79)) \
movbx_st(Recx, Mebp, inf_SCR01(0x79)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x7A)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x7A)) \
movbx_st(Recx, Mebp, inf_SCR01(0x7A)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x7B)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x7B)) \
movbx_st(Recx, Mebp, inf_SCR01(0x7B)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x7C)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x7C)) \
movbx_st(Recx, Mebp, inf_SCR01(0x7C)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x7D)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x7D)) \
movbx_st(Recx, Mebp, inf_SCR01(0x7D)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x7E)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x7E)) \
movbx_st(Recx, Mebp, inf_SCR01(0x7E)) \
movbx_ld(Recx, Mebp, inf_SCR01(0x7F)) \
mulbx_ld(Recx, Mebp, inf_SCR02(0x7F)) \
movbx_st(Recx, Mebp, inf_SCR01(0x7F)) \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* shl (G = G << S), (D = S << T) if (#D != #T) - plain, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define shlmb_ri(XG, IS) \
shlmb3ri(W(XG), W(XG), W(IS))
#define shlmb_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shlmb3ld(W(XG), W(XG), W(MS), W(DS))
#define shlmb3ri(XD, XS, IT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
stack_st(Recx) \
movbx_ri(Recx, W(IT)) \
shlmb_xx() \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shlmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
stack_st(Recx) \
movbx_ld(Recx, W(MT), W(DT)) \
shlmb_xx() \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shlmb_xx() /* not portable, do not use outside */ \
shlbx_mx(Mebp, inf_SCR01(0x00)) \
shlbx_mx(Mebp, inf_SCR01(0x01)) \
shlbx_mx(Mebp, inf_SCR01(0x02)) \
shlbx_mx(Mebp, inf_SCR01(0x03)) \
shlbx_mx(Mebp, inf_SCR01(0x04)) \
shlbx_mx(Mebp, inf_SCR01(0x05)) \
shlbx_mx(Mebp, inf_SCR01(0x06)) \
shlbx_mx(Mebp, inf_SCR01(0x07)) \
shlbx_mx(Mebp, inf_SCR01(0x08)) \
shlbx_mx(Mebp, inf_SCR01(0x09)) \
shlbx_mx(Mebp, inf_SCR01(0x0A)) \
shlbx_mx(Mebp, inf_SCR01(0x0B)) \
shlbx_mx(Mebp, inf_SCR01(0x0C)) \
shlbx_mx(Mebp, inf_SCR01(0x0D)) \
shlbx_mx(Mebp, inf_SCR01(0x0E)) \
shlbx_mx(Mebp, inf_SCR01(0x0F)) \
shlbx_mx(Mebp, inf_SCR01(0x10)) \
shlbx_mx(Mebp, inf_SCR01(0x11)) \
shlbx_mx(Mebp, inf_SCR01(0x12)) \
shlbx_mx(Mebp, inf_SCR01(0x13)) \
shlbx_mx(Mebp, inf_SCR01(0x14)) \
shlbx_mx(Mebp, inf_SCR01(0x15)) \
shlbx_mx(Mebp, inf_SCR01(0x16)) \
shlbx_mx(Mebp, inf_SCR01(0x17)) \
shlbx_mx(Mebp, inf_SCR01(0x18)) \
shlbx_mx(Mebp, inf_SCR01(0x19)) \
shlbx_mx(Mebp, inf_SCR01(0x1A)) \
shlbx_mx(Mebp, inf_SCR01(0x1B)) \
shlbx_mx(Mebp, inf_SCR01(0x1C)) \
shlbx_mx(Mebp, inf_SCR01(0x1D)) \
shlbx_mx(Mebp, inf_SCR01(0x1E)) \
shlbx_mx(Mebp, inf_SCR01(0x1F)) \
shlbx_mx(Mebp, inf_SCR01(0x20)) \
shlbx_mx(Mebp, inf_SCR01(0x21)) \
shlbx_mx(Mebp, inf_SCR01(0x22)) \
shlbx_mx(Mebp, inf_SCR01(0x23)) \
shlbx_mx(Mebp, inf_SCR01(0x24)) \
shlbx_mx(Mebp, inf_SCR01(0x25)) \
shlbx_mx(Mebp, inf_SCR01(0x26)) \
shlbx_mx(Mebp, inf_SCR01(0x27)) \
shlbx_mx(Mebp, inf_SCR01(0x28)) \
shlbx_mx(Mebp, inf_SCR01(0x29)) \
shlbx_mx(Mebp, inf_SCR01(0x2A)) \
shlbx_mx(Mebp, inf_SCR01(0x2B)) \
shlbx_mx(Mebp, inf_SCR01(0x2C)) \
shlbx_mx(Mebp, inf_SCR01(0x2D)) \
shlbx_mx(Mebp, inf_SCR01(0x2E)) \
shlbx_mx(Mebp, inf_SCR01(0x2F)) \
shlbx_mx(Mebp, inf_SCR01(0x30)) \
shlbx_mx(Mebp, inf_SCR01(0x31)) \
shlbx_mx(Mebp, inf_SCR01(0x32)) \
shlbx_mx(Mebp, inf_SCR01(0x33)) \
shlbx_mx(Mebp, inf_SCR01(0x34)) \
shlbx_mx(Mebp, inf_SCR01(0x35)) \
shlbx_mx(Mebp, inf_SCR01(0x36)) \
shlbx_mx(Mebp, inf_SCR01(0x37)) \
shlbx_mx(Mebp, inf_SCR01(0x38)) \
shlbx_mx(Mebp, inf_SCR01(0x39)) \
shlbx_mx(Mebp, inf_SCR01(0x3A)) \
shlbx_mx(Mebp, inf_SCR01(0x3B)) \
shlbx_mx(Mebp, inf_SCR01(0x3C)) \
shlbx_mx(Mebp, inf_SCR01(0x3D)) \
shlbx_mx(Mebp, inf_SCR01(0x3E)) \
shlbx_mx(Mebp, inf_SCR01(0x3F)) \
shlbx_mx(Mebp, inf_SCR01(0x40)) \
shlbx_mx(Mebp, inf_SCR01(0x41)) \
shlbx_mx(Mebp, inf_SCR01(0x42)) \
shlbx_mx(Mebp, inf_SCR01(0x43)) \
shlbx_mx(Mebp, inf_SCR01(0x44)) \
shlbx_mx(Mebp, inf_SCR01(0x45)) \
shlbx_mx(Mebp, inf_SCR01(0x46)) \
shlbx_mx(Mebp, inf_SCR01(0x47)) \
shlbx_mx(Mebp, inf_SCR01(0x48)) \
shlbx_mx(Mebp, inf_SCR01(0x49)) \
shlbx_mx(Mebp, inf_SCR01(0x4A)) \
shlbx_mx(Mebp, inf_SCR01(0x4B)) \
shlbx_mx(Mebp, inf_SCR01(0x4C)) \
shlbx_mx(Mebp, inf_SCR01(0x4D)) \
shlbx_mx(Mebp, inf_SCR01(0x4E)) \
shlbx_mx(Mebp, inf_SCR01(0x4F)) \
shlbx_mx(Mebp, inf_SCR01(0x50)) \
shlbx_mx(Mebp, inf_SCR01(0x51)) \
shlbx_mx(Mebp, inf_SCR01(0x52)) \
shlbx_mx(Mebp, inf_SCR01(0x53)) \
shlbx_mx(Mebp, inf_SCR01(0x54)) \
shlbx_mx(Mebp, inf_SCR01(0x55)) \
shlbx_mx(Mebp, inf_SCR01(0x56)) \
shlbx_mx(Mebp, inf_SCR01(0x57)) \
shlbx_mx(Mebp, inf_SCR01(0x58)) \
shlbx_mx(Mebp, inf_SCR01(0x59)) \
shlbx_mx(Mebp, inf_SCR01(0x5A)) \
shlbx_mx(Mebp, inf_SCR01(0x5B)) \
shlbx_mx(Mebp, inf_SCR01(0x5C)) \
shlbx_mx(Mebp, inf_SCR01(0x5D)) \
shlbx_mx(Mebp, inf_SCR01(0x5E)) \
shlbx_mx(Mebp, inf_SCR01(0x5F)) \
shlbx_mx(Mebp, inf_SCR01(0x60)) \
shlbx_mx(Mebp, inf_SCR01(0x61)) \
shlbx_mx(Mebp, inf_SCR01(0x62)) \
shlbx_mx(Mebp, inf_SCR01(0x63)) \
shlbx_mx(Mebp, inf_SCR01(0x64)) \
shlbx_mx(Mebp, inf_SCR01(0x65)) \
shlbx_mx(Mebp, inf_SCR01(0x66)) \
shlbx_mx(Mebp, inf_SCR01(0x67)) \
shlbx_mx(Mebp, inf_SCR01(0x68)) \
shlbx_mx(Mebp, inf_SCR01(0x69)) \
shlbx_mx(Mebp, inf_SCR01(0x6A)) \
shlbx_mx(Mebp, inf_SCR01(0x6B)) \
shlbx_mx(Mebp, inf_SCR01(0x6C)) \
shlbx_mx(Mebp, inf_SCR01(0x6D)) \
shlbx_mx(Mebp, inf_SCR01(0x6E)) \
shlbx_mx(Mebp, inf_SCR01(0x6F)) \
shlbx_mx(Mebp, inf_SCR01(0x70)) \
shlbx_mx(Mebp, inf_SCR01(0x71)) \
shlbx_mx(Mebp, inf_SCR01(0x72)) \
shlbx_mx(Mebp, inf_SCR01(0x73)) \
shlbx_mx(Mebp, inf_SCR01(0x74)) \
shlbx_mx(Mebp, inf_SCR01(0x75)) \
shlbx_mx(Mebp, inf_SCR01(0x76)) \
shlbx_mx(Mebp, inf_SCR01(0x77)) \
shlbx_mx(Mebp, inf_SCR01(0x78)) \
shlbx_mx(Mebp, inf_SCR01(0x79)) \
shlbx_mx(Mebp, inf_SCR01(0x7A)) \
shlbx_mx(Mebp, inf_SCR01(0x7B)) \
shlbx_mx(Mebp, inf_SCR01(0x7C)) \
shlbx_mx(Mebp, inf_SCR01(0x7D)) \
shlbx_mx(Mebp, inf_SCR01(0x7E)) \
shlbx_mx(Mebp, inf_SCR01(0x7F))
/* shr (G = G >> S), (D = S >> T) if (#D != #T) - plain, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define shrmb_ri(XG, IS) \
shrmb3ri(W(XG), W(XG), W(IS))
#define shrmb_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shrmb3ld(W(XG), W(XG), W(MS), W(DS))
#define shrmb3ri(XD, XS, IT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
stack_st(Recx) \
movbx_ri(Recx, W(IT)) \
shrmb_xx() \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shrmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
stack_st(Recx) \
movbx_ld(Recx, W(MT), W(DT)) \
shrmb_xx() \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shrmb_xx() /* not portable, do not use outside */ \
shrbx_mx(Mebp, inf_SCR01(0x00)) \
shrbx_mx(Mebp, inf_SCR01(0x01)) \
shrbx_mx(Mebp, inf_SCR01(0x02)) \
shrbx_mx(Mebp, inf_SCR01(0x03)) \
shrbx_mx(Mebp, inf_SCR01(0x04)) \
shrbx_mx(Mebp, inf_SCR01(0x05)) \
shrbx_mx(Mebp, inf_SCR01(0x06)) \
shrbx_mx(Mebp, inf_SCR01(0x07)) \
shrbx_mx(Mebp, inf_SCR01(0x08)) \
shrbx_mx(Mebp, inf_SCR01(0x09)) \
shrbx_mx(Mebp, inf_SCR01(0x0A)) \
shrbx_mx(Mebp, inf_SCR01(0x0B)) \
shrbx_mx(Mebp, inf_SCR01(0x0C)) \
shrbx_mx(Mebp, inf_SCR01(0x0D)) \
shrbx_mx(Mebp, inf_SCR01(0x0E)) \
shrbx_mx(Mebp, inf_SCR01(0x0F)) \
shrbx_mx(Mebp, inf_SCR01(0x10)) \
shrbx_mx(Mebp, inf_SCR01(0x11)) \
shrbx_mx(Mebp, inf_SCR01(0x12)) \
shrbx_mx(Mebp, inf_SCR01(0x13)) \
shrbx_mx(Mebp, inf_SCR01(0x14)) \
shrbx_mx(Mebp, inf_SCR01(0x15)) \
shrbx_mx(Mebp, inf_SCR01(0x16)) \
shrbx_mx(Mebp, inf_SCR01(0x17)) \
shrbx_mx(Mebp, inf_SCR01(0x18)) \
shrbx_mx(Mebp, inf_SCR01(0x19)) \
shrbx_mx(Mebp, inf_SCR01(0x1A)) \
shrbx_mx(Mebp, inf_SCR01(0x1B)) \
shrbx_mx(Mebp, inf_SCR01(0x1C)) \
shrbx_mx(Mebp, inf_SCR01(0x1D)) \
shrbx_mx(Mebp, inf_SCR01(0x1E)) \
shrbx_mx(Mebp, inf_SCR01(0x1F)) \
shrbx_mx(Mebp, inf_SCR01(0x20)) \
shrbx_mx(Mebp, inf_SCR01(0x21)) \
shrbx_mx(Mebp, inf_SCR01(0x22)) \
shrbx_mx(Mebp, inf_SCR01(0x23)) \
shrbx_mx(Mebp, inf_SCR01(0x24)) \
shrbx_mx(Mebp, inf_SCR01(0x25)) \
shrbx_mx(Mebp, inf_SCR01(0x26)) \
shrbx_mx(Mebp, inf_SCR01(0x27)) \
shrbx_mx(Mebp, inf_SCR01(0x28)) \
shrbx_mx(Mebp, inf_SCR01(0x29)) \
shrbx_mx(Mebp, inf_SCR01(0x2A)) \
shrbx_mx(Mebp, inf_SCR01(0x2B)) \
shrbx_mx(Mebp, inf_SCR01(0x2C)) \
shrbx_mx(Mebp, inf_SCR01(0x2D)) \
shrbx_mx(Mebp, inf_SCR01(0x2E)) \
shrbx_mx(Mebp, inf_SCR01(0x2F)) \
shrbx_mx(Mebp, inf_SCR01(0x30)) \
shrbx_mx(Mebp, inf_SCR01(0x31)) \
shrbx_mx(Mebp, inf_SCR01(0x32)) \
shrbx_mx(Mebp, inf_SCR01(0x33)) \
shrbx_mx(Mebp, inf_SCR01(0x34)) \
shrbx_mx(Mebp, inf_SCR01(0x35)) \
shrbx_mx(Mebp, inf_SCR01(0x36)) \
shrbx_mx(Mebp, inf_SCR01(0x37)) \
shrbx_mx(Mebp, inf_SCR01(0x38)) \
shrbx_mx(Mebp, inf_SCR01(0x39)) \
shrbx_mx(Mebp, inf_SCR01(0x3A)) \
shrbx_mx(Mebp, inf_SCR01(0x3B)) \
shrbx_mx(Mebp, inf_SCR01(0x3C)) \
shrbx_mx(Mebp, inf_SCR01(0x3D)) \
shrbx_mx(Mebp, inf_SCR01(0x3E)) \
shrbx_mx(Mebp, inf_SCR01(0x3F)) \
shrbx_mx(Mebp, inf_SCR01(0x40)) \
shrbx_mx(Mebp, inf_SCR01(0x41)) \
shrbx_mx(Mebp, inf_SCR01(0x42)) \
shrbx_mx(Mebp, inf_SCR01(0x43)) \
shrbx_mx(Mebp, inf_SCR01(0x44)) \
shrbx_mx(Mebp, inf_SCR01(0x45)) \
shrbx_mx(Mebp, inf_SCR01(0x46)) \
shrbx_mx(Mebp, inf_SCR01(0x47)) \
shrbx_mx(Mebp, inf_SCR01(0x48)) \
shrbx_mx(Mebp, inf_SCR01(0x49)) \
shrbx_mx(Mebp, inf_SCR01(0x4A)) \
shrbx_mx(Mebp, inf_SCR01(0x4B)) \
shrbx_mx(Mebp, inf_SCR01(0x4C)) \
shrbx_mx(Mebp, inf_SCR01(0x4D)) \
shrbx_mx(Mebp, inf_SCR01(0x4E)) \
shrbx_mx(Mebp, inf_SCR01(0x4F)) \
shrbx_mx(Mebp, inf_SCR01(0x50)) \
shrbx_mx(Mebp, inf_SCR01(0x51)) \
shrbx_mx(Mebp, inf_SCR01(0x52)) \
shrbx_mx(Mebp, inf_SCR01(0x53)) \
shrbx_mx(Mebp, inf_SCR01(0x54)) \
shrbx_mx(Mebp, inf_SCR01(0x55)) \
shrbx_mx(Mebp, inf_SCR01(0x56)) \
shrbx_mx(Mebp, inf_SCR01(0x57)) \
shrbx_mx(Mebp, inf_SCR01(0x58)) \
shrbx_mx(Mebp, inf_SCR01(0x59)) \
shrbx_mx(Mebp, inf_SCR01(0x5A)) \
shrbx_mx(Mebp, inf_SCR01(0x5B)) \
shrbx_mx(Mebp, inf_SCR01(0x5C)) \
shrbx_mx(Mebp, inf_SCR01(0x5D)) \
shrbx_mx(Mebp, inf_SCR01(0x5E)) \
shrbx_mx(Mebp, inf_SCR01(0x5F)) \
shrbx_mx(Mebp, inf_SCR01(0x60)) \
shrbx_mx(Mebp, inf_SCR01(0x61)) \
shrbx_mx(Mebp, inf_SCR01(0x62)) \
shrbx_mx(Mebp, inf_SCR01(0x63)) \
shrbx_mx(Mebp, inf_SCR01(0x64)) \
shrbx_mx(Mebp, inf_SCR01(0x65)) \
shrbx_mx(Mebp, inf_SCR01(0x66)) \
shrbx_mx(Mebp, inf_SCR01(0x67)) \
shrbx_mx(Mebp, inf_SCR01(0x68)) \
shrbx_mx(Mebp, inf_SCR01(0x69)) \
shrbx_mx(Mebp, inf_SCR01(0x6A)) \
shrbx_mx(Mebp, inf_SCR01(0x6B)) \
shrbx_mx(Mebp, inf_SCR01(0x6C)) \
shrbx_mx(Mebp, inf_SCR01(0x6D)) \
shrbx_mx(Mebp, inf_SCR01(0x6E)) \
shrbx_mx(Mebp, inf_SCR01(0x6F)) \
shrbx_mx(Mebp, inf_SCR01(0x70)) \
shrbx_mx(Mebp, inf_SCR01(0x71)) \
shrbx_mx(Mebp, inf_SCR01(0x72)) \
shrbx_mx(Mebp, inf_SCR01(0x73)) \
shrbx_mx(Mebp, inf_SCR01(0x74)) \
shrbx_mx(Mebp, inf_SCR01(0x75)) \
shrbx_mx(Mebp, inf_SCR01(0x76)) \
shrbx_mx(Mebp, inf_SCR01(0x77)) \
shrbx_mx(Mebp, inf_SCR01(0x78)) \
shrbx_mx(Mebp, inf_SCR01(0x79)) \
shrbx_mx(Mebp, inf_SCR01(0x7A)) \
shrbx_mx(Mebp, inf_SCR01(0x7B)) \
shrbx_mx(Mebp, inf_SCR01(0x7C)) \
shrbx_mx(Mebp, inf_SCR01(0x7D)) \
shrbx_mx(Mebp, inf_SCR01(0x7E)) \
shrbx_mx(Mebp, inf_SCR01(0x7F))
/* shr (G = G >> S), (D = S >> T) if (#D != #T) - plain, signed
* for maximum compatibility: shift count must be modulo elem-size */
#define shrmc_ri(XG, IS) \
shrmc3ri(W(XG), W(XG), W(IS))
#define shrmc_ld(XG, MS, DS) /* loads SIMD, uses first elem, rest zeroed */ \
shrmc3ld(W(XG), W(XG), W(MS), W(DS))
#define shrmc3ri(XD, XS, IT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
stack_st(Recx) \
movbx_ri(Recx, W(IT)) \
shrmc_xx() \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shrmc3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
stack_st(Recx) \
movbx_ld(Recx, W(MT), W(DT)) \
shrmc_xx() \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
#define shrmc_xx() /* not portable, do not use outside */ \
shrbn_mx(Mebp, inf_SCR01(0x00)) \
shrbn_mx(Mebp, inf_SCR01(0x01)) \
shrbn_mx(Mebp, inf_SCR01(0x02)) \
shrbn_mx(Mebp, inf_SCR01(0x03)) \
shrbn_mx(Mebp, inf_SCR01(0x04)) \
shrbn_mx(Mebp, inf_SCR01(0x05)) \
shrbn_mx(Mebp, inf_SCR01(0x06)) \
shrbn_mx(Mebp, inf_SCR01(0x07)) \
shrbn_mx(Mebp, inf_SCR01(0x08)) \
shrbn_mx(Mebp, inf_SCR01(0x09)) \
shrbn_mx(Mebp, inf_SCR01(0x0A)) \
shrbn_mx(Mebp, inf_SCR01(0x0B)) \
shrbn_mx(Mebp, inf_SCR01(0x0C)) \
shrbn_mx(Mebp, inf_SCR01(0x0D)) \
shrbn_mx(Mebp, inf_SCR01(0x0E)) \
shrbn_mx(Mebp, inf_SCR01(0x0F)) \
shrbn_mx(Mebp, inf_SCR01(0x10)) \
shrbn_mx(Mebp, inf_SCR01(0x11)) \
shrbn_mx(Mebp, inf_SCR01(0x12)) \
shrbn_mx(Mebp, inf_SCR01(0x13)) \
shrbn_mx(Mebp, inf_SCR01(0x14)) \
shrbn_mx(Mebp, inf_SCR01(0x15)) \
shrbn_mx(Mebp, inf_SCR01(0x16)) \
shrbn_mx(Mebp, inf_SCR01(0x17)) \
shrbn_mx(Mebp, inf_SCR01(0x18)) \
shrbn_mx(Mebp, inf_SCR01(0x19)) \
shrbn_mx(Mebp, inf_SCR01(0x1A)) \
shrbn_mx(Mebp, inf_SCR01(0x1B)) \
shrbn_mx(Mebp, inf_SCR01(0x1C)) \
shrbn_mx(Mebp, inf_SCR01(0x1D)) \
shrbn_mx(Mebp, inf_SCR01(0x1E)) \
shrbn_mx(Mebp, inf_SCR01(0x1F)) \
shrbn_mx(Mebp, inf_SCR01(0x20)) \
shrbn_mx(Mebp, inf_SCR01(0x21)) \
shrbn_mx(Mebp, inf_SCR01(0x22)) \
shrbn_mx(Mebp, inf_SCR01(0x23)) \
shrbn_mx(Mebp, inf_SCR01(0x24)) \
shrbn_mx(Mebp, inf_SCR01(0x25)) \
shrbn_mx(Mebp, inf_SCR01(0x26)) \
shrbn_mx(Mebp, inf_SCR01(0x27)) \
shrbn_mx(Mebp, inf_SCR01(0x28)) \
shrbn_mx(Mebp, inf_SCR01(0x29)) \
shrbn_mx(Mebp, inf_SCR01(0x2A)) \
shrbn_mx(Mebp, inf_SCR01(0x2B)) \
shrbn_mx(Mebp, inf_SCR01(0x2C)) \
shrbn_mx(Mebp, inf_SCR01(0x2D)) \
shrbn_mx(Mebp, inf_SCR01(0x2E)) \
shrbn_mx(Mebp, inf_SCR01(0x2F)) \
shrbn_mx(Mebp, inf_SCR01(0x30)) \
shrbn_mx(Mebp, inf_SCR01(0x31)) \
shrbn_mx(Mebp, inf_SCR01(0x32)) \
shrbn_mx(Mebp, inf_SCR01(0x33)) \
shrbn_mx(Mebp, inf_SCR01(0x34)) \
shrbn_mx(Mebp, inf_SCR01(0x35)) \
shrbn_mx(Mebp, inf_SCR01(0x36)) \
shrbn_mx(Mebp, inf_SCR01(0x37)) \
shrbn_mx(Mebp, inf_SCR01(0x38)) \
shrbn_mx(Mebp, inf_SCR01(0x39)) \
shrbn_mx(Mebp, inf_SCR01(0x3A)) \
shrbn_mx(Mebp, inf_SCR01(0x3B)) \
shrbn_mx(Mebp, inf_SCR01(0x3C)) \
shrbn_mx(Mebp, inf_SCR01(0x3D)) \
shrbn_mx(Mebp, inf_SCR01(0x3E)) \
shrbn_mx(Mebp, inf_SCR01(0x3F)) \
shrbn_mx(Mebp, inf_SCR01(0x40)) \
shrbn_mx(Mebp, inf_SCR01(0x41)) \
shrbn_mx(Mebp, inf_SCR01(0x42)) \
shrbn_mx(Mebp, inf_SCR01(0x43)) \
shrbn_mx(Mebp, inf_SCR01(0x44)) \
shrbn_mx(Mebp, inf_SCR01(0x45)) \
shrbn_mx(Mebp, inf_SCR01(0x46)) \
shrbn_mx(Mebp, inf_SCR01(0x47)) \
shrbn_mx(Mebp, inf_SCR01(0x48)) \
shrbn_mx(Mebp, inf_SCR01(0x49)) \
shrbn_mx(Mebp, inf_SCR01(0x4A)) \
shrbn_mx(Mebp, inf_SCR01(0x4B)) \
shrbn_mx(Mebp, inf_SCR01(0x4C)) \
shrbn_mx(Mebp, inf_SCR01(0x4D)) \
shrbn_mx(Mebp, inf_SCR01(0x4E)) \
shrbn_mx(Mebp, inf_SCR01(0x4F)) \
shrbn_mx(Mebp, inf_SCR01(0x50)) \
shrbn_mx(Mebp, inf_SCR01(0x51)) \
shrbn_mx(Mebp, inf_SCR01(0x52)) \
shrbn_mx(Mebp, inf_SCR01(0x53)) \
shrbn_mx(Mebp, inf_SCR01(0x54)) \
shrbn_mx(Mebp, inf_SCR01(0x55)) \
shrbn_mx(Mebp, inf_SCR01(0x56)) \
shrbn_mx(Mebp, inf_SCR01(0x57)) \
shrbn_mx(Mebp, inf_SCR01(0x58)) \
shrbn_mx(Mebp, inf_SCR01(0x59)) \
shrbn_mx(Mebp, inf_SCR01(0x5A)) \
shrbn_mx(Mebp, inf_SCR01(0x5B)) \
shrbn_mx(Mebp, inf_SCR01(0x5C)) \
shrbn_mx(Mebp, inf_SCR01(0x5D)) \
shrbn_mx(Mebp, inf_SCR01(0x5E)) \
shrbn_mx(Mebp, inf_SCR01(0x5F)) \
shrbn_mx(Mebp, inf_SCR01(0x60)) \
shrbn_mx(Mebp, inf_SCR01(0x61)) \
shrbn_mx(Mebp, inf_SCR01(0x62)) \
shrbn_mx(Mebp, inf_SCR01(0x63)) \
shrbn_mx(Mebp, inf_SCR01(0x64)) \
shrbn_mx(Mebp, inf_SCR01(0x65)) \
shrbn_mx(Mebp, inf_SCR01(0x66)) \
shrbn_mx(Mebp, inf_SCR01(0x67)) \
shrbn_mx(Mebp, inf_SCR01(0x68)) \
shrbn_mx(Mebp, inf_SCR01(0x69)) \
shrbn_mx(Mebp, inf_SCR01(0x6A)) \
shrbn_mx(Mebp, inf_SCR01(0x6B)) \
shrbn_mx(Mebp, inf_SCR01(0x6C)) \
shrbn_mx(Mebp, inf_SCR01(0x6D)) \
shrbn_mx(Mebp, inf_SCR01(0x6E)) \
shrbn_mx(Mebp, inf_SCR01(0x6F)) \
shrbn_mx(Mebp, inf_SCR01(0x70)) \
shrbn_mx(Mebp, inf_SCR01(0x71)) \
shrbn_mx(Mebp, inf_SCR01(0x72)) \
shrbn_mx(Mebp, inf_SCR01(0x73)) \
shrbn_mx(Mebp, inf_SCR01(0x74)) \
shrbn_mx(Mebp, inf_SCR01(0x75)) \
shrbn_mx(Mebp, inf_SCR01(0x76)) \
shrbn_mx(Mebp, inf_SCR01(0x77)) \
shrbn_mx(Mebp, inf_SCR01(0x78)) \
shrbn_mx(Mebp, inf_SCR01(0x79)) \
shrbn_mx(Mebp, inf_SCR01(0x7A)) \
shrbn_mx(Mebp, inf_SCR01(0x7B)) \
shrbn_mx(Mebp, inf_SCR01(0x7C)) \
shrbn_mx(Mebp, inf_SCR01(0x7D)) \
shrbn_mx(Mebp, inf_SCR01(0x7E)) \
shrbn_mx(Mebp, inf_SCR01(0x7F))
/* svl (G = G << S), (D = S << T) if (#D != #T) - variable, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define svlmb_rr(XG, XS) /* variable shift with per-elem count */ \
svlmb3rr(W(XG), W(XG), W(XS))
#define svlmb_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svlmb3ld(W(XG), W(XG), W(MS), W(DS))
#define svlmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
svlmb_rx(W(XD))
#define svlmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
svlmb_rx(W(XD))
#define svlmb_rx(XD) /* not portable, do not use outside */ \
stack_st(Recx) \
movbx_ld(Recx, Mebp, inf_SCR02(0x00)) \
shlbx_mx(Mebp, inf_SCR01(0x00)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x01)) \
shlbx_mx(Mebp, inf_SCR01(0x01)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x02)) \
shlbx_mx(Mebp, inf_SCR01(0x02)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x03)) \
shlbx_mx(Mebp, inf_SCR01(0x03)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x04)) \
shlbx_mx(Mebp, inf_SCR01(0x04)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x05)) \
shlbx_mx(Mebp, inf_SCR01(0x05)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x06)) \
shlbx_mx(Mebp, inf_SCR01(0x06)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x07)) \
shlbx_mx(Mebp, inf_SCR01(0x07)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x08)) \
shlbx_mx(Mebp, inf_SCR01(0x08)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x09)) \
shlbx_mx(Mebp, inf_SCR01(0x09)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0A)) \
shlbx_mx(Mebp, inf_SCR01(0x0A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0B)) \
shlbx_mx(Mebp, inf_SCR01(0x0B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0C)) \
shlbx_mx(Mebp, inf_SCR01(0x0C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0D)) \
shlbx_mx(Mebp, inf_SCR01(0x0D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0E)) \
shlbx_mx(Mebp, inf_SCR01(0x0E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0F)) \
shlbx_mx(Mebp, inf_SCR01(0x0F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x10)) \
shlbx_mx(Mebp, inf_SCR01(0x10)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x11)) \
shlbx_mx(Mebp, inf_SCR01(0x11)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x12)) \
shlbx_mx(Mebp, inf_SCR01(0x12)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x13)) \
shlbx_mx(Mebp, inf_SCR01(0x13)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x14)) \
shlbx_mx(Mebp, inf_SCR01(0x14)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x15)) \
shlbx_mx(Mebp, inf_SCR01(0x15)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x16)) \
shlbx_mx(Mebp, inf_SCR01(0x16)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x17)) \
shlbx_mx(Mebp, inf_SCR01(0x17)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x18)) \
shlbx_mx(Mebp, inf_SCR01(0x18)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x19)) \
shlbx_mx(Mebp, inf_SCR01(0x19)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1A)) \
shlbx_mx(Mebp, inf_SCR01(0x1A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1B)) \
shlbx_mx(Mebp, inf_SCR01(0x1B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1C)) \
shlbx_mx(Mebp, inf_SCR01(0x1C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1D)) \
shlbx_mx(Mebp, inf_SCR01(0x1D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1E)) \
shlbx_mx(Mebp, inf_SCR01(0x1E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1F)) \
shlbx_mx(Mebp, inf_SCR01(0x1F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x20)) \
shlbx_mx(Mebp, inf_SCR01(0x20)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x21)) \
shlbx_mx(Mebp, inf_SCR01(0x21)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x22)) \
shlbx_mx(Mebp, inf_SCR01(0x22)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x23)) \
shlbx_mx(Mebp, inf_SCR01(0x23)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x24)) \
shlbx_mx(Mebp, inf_SCR01(0x24)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x25)) \
shlbx_mx(Mebp, inf_SCR01(0x25)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x26)) \
shlbx_mx(Mebp, inf_SCR01(0x26)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x27)) \
shlbx_mx(Mebp, inf_SCR01(0x27)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x28)) \
shlbx_mx(Mebp, inf_SCR01(0x28)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x29)) \
shlbx_mx(Mebp, inf_SCR01(0x29)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2A)) \
shlbx_mx(Mebp, inf_SCR01(0x2A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2B)) \
shlbx_mx(Mebp, inf_SCR01(0x2B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2C)) \
shlbx_mx(Mebp, inf_SCR01(0x2C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2D)) \
shlbx_mx(Mebp, inf_SCR01(0x2D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2E)) \
shlbx_mx(Mebp, inf_SCR01(0x2E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2F)) \
shlbx_mx(Mebp, inf_SCR01(0x2F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x30)) \
shlbx_mx(Mebp, inf_SCR01(0x30)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x31)) \
shlbx_mx(Mebp, inf_SCR01(0x31)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x32)) \
shlbx_mx(Mebp, inf_SCR01(0x32)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x33)) \
shlbx_mx(Mebp, inf_SCR01(0x33)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x34)) \
shlbx_mx(Mebp, inf_SCR01(0x34)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x35)) \
shlbx_mx(Mebp, inf_SCR01(0x35)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x36)) \
shlbx_mx(Mebp, inf_SCR01(0x36)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x37)) \
shlbx_mx(Mebp, inf_SCR01(0x37)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x38)) \
shlbx_mx(Mebp, inf_SCR01(0x38)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x39)) \
shlbx_mx(Mebp, inf_SCR01(0x39)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3A)) \
shlbx_mx(Mebp, inf_SCR01(0x3A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3B)) \
shlbx_mx(Mebp, inf_SCR01(0x3B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3C)) \
shlbx_mx(Mebp, inf_SCR01(0x3C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3D)) \
shlbx_mx(Mebp, inf_SCR01(0x3D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3E)) \
shlbx_mx(Mebp, inf_SCR01(0x3E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3F)) \
shlbx_mx(Mebp, inf_SCR01(0x3F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x40)) \
shlbx_mx(Mebp, inf_SCR01(0x40)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x41)) \
shlbx_mx(Mebp, inf_SCR01(0x41)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x42)) \
shlbx_mx(Mebp, inf_SCR01(0x42)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x43)) \
shlbx_mx(Mebp, inf_SCR01(0x43)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x44)) \
shlbx_mx(Mebp, inf_SCR01(0x44)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x45)) \
shlbx_mx(Mebp, inf_SCR01(0x45)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x46)) \
shlbx_mx(Mebp, inf_SCR01(0x46)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x47)) \
shlbx_mx(Mebp, inf_SCR01(0x47)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x48)) \
shlbx_mx(Mebp, inf_SCR01(0x48)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x49)) \
shlbx_mx(Mebp, inf_SCR01(0x49)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4A)) \
shlbx_mx(Mebp, inf_SCR01(0x4A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4B)) \
shlbx_mx(Mebp, inf_SCR01(0x4B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4C)) \
shlbx_mx(Mebp, inf_SCR01(0x4C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4D)) \
shlbx_mx(Mebp, inf_SCR01(0x4D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4E)) \
shlbx_mx(Mebp, inf_SCR01(0x4E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4F)) \
shlbx_mx(Mebp, inf_SCR01(0x4F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x50)) \
shlbx_mx(Mebp, inf_SCR01(0x50)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x51)) \
shlbx_mx(Mebp, inf_SCR01(0x51)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x52)) \
shlbx_mx(Mebp, inf_SCR01(0x52)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x53)) \
shlbx_mx(Mebp, inf_SCR01(0x53)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x54)) \
shlbx_mx(Mebp, inf_SCR01(0x54)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x55)) \
shlbx_mx(Mebp, inf_SCR01(0x55)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x56)) \
shlbx_mx(Mebp, inf_SCR01(0x56)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x57)) \
shlbx_mx(Mebp, inf_SCR01(0x57)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x58)) \
shlbx_mx(Mebp, inf_SCR01(0x58)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x59)) \
shlbx_mx(Mebp, inf_SCR01(0x59)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5A)) \
shlbx_mx(Mebp, inf_SCR01(0x5A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5B)) \
shlbx_mx(Mebp, inf_SCR01(0x5B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5C)) \
shlbx_mx(Mebp, inf_SCR01(0x5C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5D)) \
shlbx_mx(Mebp, inf_SCR01(0x5D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5E)) \
shlbx_mx(Mebp, inf_SCR01(0x5E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5F)) \
shlbx_mx(Mebp, inf_SCR01(0x5F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x60)) \
shlbx_mx(Mebp, inf_SCR01(0x60)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x61)) \
shlbx_mx(Mebp, inf_SCR01(0x61)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x62)) \
shlbx_mx(Mebp, inf_SCR01(0x62)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x63)) \
shlbx_mx(Mebp, inf_SCR01(0x63)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x64)) \
shlbx_mx(Mebp, inf_SCR01(0x64)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x65)) \
shlbx_mx(Mebp, inf_SCR01(0x65)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x66)) \
shlbx_mx(Mebp, inf_SCR01(0x66)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x67)) \
shlbx_mx(Mebp, inf_SCR01(0x67)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x68)) \
shlbx_mx(Mebp, inf_SCR01(0x68)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x69)) \
shlbx_mx(Mebp, inf_SCR01(0x69)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6A)) \
shlbx_mx(Mebp, inf_SCR01(0x6A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6B)) \
shlbx_mx(Mebp, inf_SCR01(0x6B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6C)) \
shlbx_mx(Mebp, inf_SCR01(0x6C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6D)) \
shlbx_mx(Mebp, inf_SCR01(0x6D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6E)) \
shlbx_mx(Mebp, inf_SCR01(0x6E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6F)) \
shlbx_mx(Mebp, inf_SCR01(0x6F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x70)) \
shlbx_mx(Mebp, inf_SCR01(0x70)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x71)) \
shlbx_mx(Mebp, inf_SCR01(0x71)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x72)) \
shlbx_mx(Mebp, inf_SCR01(0x72)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x73)) \
shlbx_mx(Mebp, inf_SCR01(0x73)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x74)) \
shlbx_mx(Mebp, inf_SCR01(0x74)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x75)) \
shlbx_mx(Mebp, inf_SCR01(0x75)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x76)) \
shlbx_mx(Mebp, inf_SCR01(0x76)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x77)) \
shlbx_mx(Mebp, inf_SCR01(0x77)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x78)) \
shlbx_mx(Mebp, inf_SCR01(0x78)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x79)) \
shlbx_mx(Mebp, inf_SCR01(0x79)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7A)) \
shlbx_mx(Mebp, inf_SCR01(0x7A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7B)) \
shlbx_mx(Mebp, inf_SCR01(0x7B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7C)) \
shlbx_mx(Mebp, inf_SCR01(0x7C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7D)) \
shlbx_mx(Mebp, inf_SCR01(0x7D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7E)) \
shlbx_mx(Mebp, inf_SCR01(0x7E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7F)) \
shlbx_mx(Mebp, inf_SCR01(0x7F)) \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* svr (G = G >> S), (D = S >> T) if (#D != #T) - variable, unsigned
* for maximum compatibility: shift count must be modulo elem-size */
#define svrmb_rr(XG, XS) /* variable shift with per-elem count */ \
svrmb3rr(W(XG), W(XG), W(XS))
#define svrmb_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svrmb3ld(W(XG), W(XG), W(MS), W(DS))
#define svrmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
svrmb_rx(W(XD))
#define svrmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
svrmb_rx(W(XD))
#define svrmb_rx(XD) /* not portable, do not use outside */ \
stack_st(Recx) \
movbx_ld(Recx, Mebp, inf_SCR02(0x00)) \
shrbx_mx(Mebp, inf_SCR01(0x00)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x01)) \
shrbx_mx(Mebp, inf_SCR01(0x01)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x02)) \
shrbx_mx(Mebp, inf_SCR01(0x02)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x03)) \
shrbx_mx(Mebp, inf_SCR01(0x03)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x04)) \
shrbx_mx(Mebp, inf_SCR01(0x04)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x05)) \
shrbx_mx(Mebp, inf_SCR01(0x05)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x06)) \
shrbx_mx(Mebp, inf_SCR01(0x06)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x07)) \
shrbx_mx(Mebp, inf_SCR01(0x07)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x08)) \
shrbx_mx(Mebp, inf_SCR01(0x08)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x09)) \
shrbx_mx(Mebp, inf_SCR01(0x09)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0A)) \
shrbx_mx(Mebp, inf_SCR01(0x0A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0B)) \
shrbx_mx(Mebp, inf_SCR01(0x0B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0C)) \
shrbx_mx(Mebp, inf_SCR01(0x0C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0D)) \
shrbx_mx(Mebp, inf_SCR01(0x0D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0E)) \
shrbx_mx(Mebp, inf_SCR01(0x0E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0F)) \
shrbx_mx(Mebp, inf_SCR01(0x0F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x10)) \
shrbx_mx(Mebp, inf_SCR01(0x10)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x11)) \
shrbx_mx(Mebp, inf_SCR01(0x11)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x12)) \
shrbx_mx(Mebp, inf_SCR01(0x12)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x13)) \
shrbx_mx(Mebp, inf_SCR01(0x13)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x14)) \
shrbx_mx(Mebp, inf_SCR01(0x14)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x15)) \
shrbx_mx(Mebp, inf_SCR01(0x15)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x16)) \
shrbx_mx(Mebp, inf_SCR01(0x16)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x17)) \
shrbx_mx(Mebp, inf_SCR01(0x17)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x18)) \
shrbx_mx(Mebp, inf_SCR01(0x18)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x19)) \
shrbx_mx(Mebp, inf_SCR01(0x19)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1A)) \
shrbx_mx(Mebp, inf_SCR01(0x1A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1B)) \
shrbx_mx(Mebp, inf_SCR01(0x1B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1C)) \
shrbx_mx(Mebp, inf_SCR01(0x1C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1D)) \
shrbx_mx(Mebp, inf_SCR01(0x1D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1E)) \
shrbx_mx(Mebp, inf_SCR01(0x1E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1F)) \
shrbx_mx(Mebp, inf_SCR01(0x1F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x20)) \
shrbx_mx(Mebp, inf_SCR01(0x20)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x21)) \
shrbx_mx(Mebp, inf_SCR01(0x21)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x22)) \
shrbx_mx(Mebp, inf_SCR01(0x22)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x23)) \
shrbx_mx(Mebp, inf_SCR01(0x23)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x24)) \
shrbx_mx(Mebp, inf_SCR01(0x24)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x25)) \
shrbx_mx(Mebp, inf_SCR01(0x25)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x26)) \
shrbx_mx(Mebp, inf_SCR01(0x26)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x27)) \
shrbx_mx(Mebp, inf_SCR01(0x27)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x28)) \
shrbx_mx(Mebp, inf_SCR01(0x28)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x29)) \
shrbx_mx(Mebp, inf_SCR01(0x29)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2A)) \
shrbx_mx(Mebp, inf_SCR01(0x2A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2B)) \
shrbx_mx(Mebp, inf_SCR01(0x2B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2C)) \
shrbx_mx(Mebp, inf_SCR01(0x2C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2D)) \
shrbx_mx(Mebp, inf_SCR01(0x2D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2E)) \
shrbx_mx(Mebp, inf_SCR01(0x2E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2F)) \
shrbx_mx(Mebp, inf_SCR01(0x2F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x30)) \
shrbx_mx(Mebp, inf_SCR01(0x30)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x31)) \
shrbx_mx(Mebp, inf_SCR01(0x31)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x32)) \
shrbx_mx(Mebp, inf_SCR01(0x32)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x33)) \
shrbx_mx(Mebp, inf_SCR01(0x33)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x34)) \
shrbx_mx(Mebp, inf_SCR01(0x34)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x35)) \
shrbx_mx(Mebp, inf_SCR01(0x35)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x36)) \
shrbx_mx(Mebp, inf_SCR01(0x36)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x37)) \
shrbx_mx(Mebp, inf_SCR01(0x37)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x38)) \
shrbx_mx(Mebp, inf_SCR01(0x38)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x39)) \
shrbx_mx(Mebp, inf_SCR01(0x39)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3A)) \
shrbx_mx(Mebp, inf_SCR01(0x3A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3B)) \
shrbx_mx(Mebp, inf_SCR01(0x3B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3C)) \
shrbx_mx(Mebp, inf_SCR01(0x3C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3D)) \
shrbx_mx(Mebp, inf_SCR01(0x3D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3E)) \
shrbx_mx(Mebp, inf_SCR01(0x3E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3F)) \
shrbx_mx(Mebp, inf_SCR01(0x3F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x40)) \
shrbx_mx(Mebp, inf_SCR01(0x40)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x41)) \
shrbx_mx(Mebp, inf_SCR01(0x41)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x42)) \
shrbx_mx(Mebp, inf_SCR01(0x42)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x43)) \
shrbx_mx(Mebp, inf_SCR01(0x43)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x44)) \
shrbx_mx(Mebp, inf_SCR01(0x44)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x45)) \
shrbx_mx(Mebp, inf_SCR01(0x45)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x46)) \
shrbx_mx(Mebp, inf_SCR01(0x46)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x47)) \
shrbx_mx(Mebp, inf_SCR01(0x47)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x48)) \
shrbx_mx(Mebp, inf_SCR01(0x48)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x49)) \
shrbx_mx(Mebp, inf_SCR01(0x49)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4A)) \
shrbx_mx(Mebp, inf_SCR01(0x4A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4B)) \
shrbx_mx(Mebp, inf_SCR01(0x4B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4C)) \
shrbx_mx(Mebp, inf_SCR01(0x4C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4D)) \
shrbx_mx(Mebp, inf_SCR01(0x4D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4E)) \
shrbx_mx(Mebp, inf_SCR01(0x4E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4F)) \
shrbx_mx(Mebp, inf_SCR01(0x4F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x50)) \
shrbx_mx(Mebp, inf_SCR01(0x50)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x51)) \
shrbx_mx(Mebp, inf_SCR01(0x51)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x52)) \
shrbx_mx(Mebp, inf_SCR01(0x52)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x53)) \
shrbx_mx(Mebp, inf_SCR01(0x53)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x54)) \
shrbx_mx(Mebp, inf_SCR01(0x54)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x55)) \
shrbx_mx(Mebp, inf_SCR01(0x55)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x56)) \
shrbx_mx(Mebp, inf_SCR01(0x56)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x57)) \
shrbx_mx(Mebp, inf_SCR01(0x57)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x58)) \
shrbx_mx(Mebp, inf_SCR01(0x58)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x59)) \
shrbx_mx(Mebp, inf_SCR01(0x59)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5A)) \
shrbx_mx(Mebp, inf_SCR01(0x5A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5B)) \
shrbx_mx(Mebp, inf_SCR01(0x5B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5C)) \
shrbx_mx(Mebp, inf_SCR01(0x5C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5D)) \
shrbx_mx(Mebp, inf_SCR01(0x5D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5E)) \
shrbx_mx(Mebp, inf_SCR01(0x5E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5F)) \
shrbx_mx(Mebp, inf_SCR01(0x5F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x60)) \
shrbx_mx(Mebp, inf_SCR01(0x60)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x61)) \
shrbx_mx(Mebp, inf_SCR01(0x61)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x62)) \
shrbx_mx(Mebp, inf_SCR01(0x62)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x63)) \
shrbx_mx(Mebp, inf_SCR01(0x63)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x64)) \
shrbx_mx(Mebp, inf_SCR01(0x64)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x65)) \
shrbx_mx(Mebp, inf_SCR01(0x65)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x66)) \
shrbx_mx(Mebp, inf_SCR01(0x66)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x67)) \
shrbx_mx(Mebp, inf_SCR01(0x67)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x68)) \
shrbx_mx(Mebp, inf_SCR01(0x68)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x69)) \
shrbx_mx(Mebp, inf_SCR01(0x69)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6A)) \
shrbx_mx(Mebp, inf_SCR01(0x6A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6B)) \
shrbx_mx(Mebp, inf_SCR01(0x6B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6C)) \
shrbx_mx(Mebp, inf_SCR01(0x6C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6D)) \
shrbx_mx(Mebp, inf_SCR01(0x6D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6E)) \
shrbx_mx(Mebp, inf_SCR01(0x6E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6F)) \
shrbx_mx(Mebp, inf_SCR01(0x6F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x70)) \
shrbx_mx(Mebp, inf_SCR01(0x70)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x71)) \
shrbx_mx(Mebp, inf_SCR01(0x71)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x72)) \
shrbx_mx(Mebp, inf_SCR01(0x72)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x73)) \
shrbx_mx(Mebp, inf_SCR01(0x73)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x74)) \
shrbx_mx(Mebp, inf_SCR01(0x74)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x75)) \
shrbx_mx(Mebp, inf_SCR01(0x75)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x76)) \
shrbx_mx(Mebp, inf_SCR01(0x76)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x77)) \
shrbx_mx(Mebp, inf_SCR01(0x77)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x78)) \
shrbx_mx(Mebp, inf_SCR01(0x78)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x79)) \
shrbx_mx(Mebp, inf_SCR01(0x79)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7A)) \
shrbx_mx(Mebp, inf_SCR01(0x7A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7B)) \
shrbx_mx(Mebp, inf_SCR01(0x7B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7C)) \
shrbx_mx(Mebp, inf_SCR01(0x7C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7D)) \
shrbx_mx(Mebp, inf_SCR01(0x7D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7E)) \
shrbx_mx(Mebp, inf_SCR01(0x7E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7F)) \
shrbx_mx(Mebp, inf_SCR01(0x7F)) \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* svr (G = G >> S), (D = S >> T) if (#D != #T) - variable, signed
* for maximum compatibility: shift count must be modulo elem-size */
#define svrmc_rr(XG, XS) /* variable shift with per-elem count */ \
svrmc3rr(W(XG), W(XG), W(XS))
#define svrmc_ld(XG, MS, DS) /* variable shift with per-elem count */ \
svrmc3ld(W(XG), W(XG), W(MS), W(DS))
#define svrmc3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
svrmc_rx(W(XD))
#define svrmc3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
svrmc_rx(W(XD))
#define svrmc_rx(XD) /* not portable, do not use outside */ \
stack_st(Recx) \
movbx_ld(Recx, Mebp, inf_SCR02(0x00)) \
shrbn_mx(Mebp, inf_SCR01(0x00)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x01)) \
shrbn_mx(Mebp, inf_SCR01(0x01)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x02)) \
shrbn_mx(Mebp, inf_SCR01(0x02)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x03)) \
shrbn_mx(Mebp, inf_SCR01(0x03)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x04)) \
shrbn_mx(Mebp, inf_SCR01(0x04)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x05)) \
shrbn_mx(Mebp, inf_SCR01(0x05)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x06)) \
shrbn_mx(Mebp, inf_SCR01(0x06)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x07)) \
shrbn_mx(Mebp, inf_SCR01(0x07)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x08)) \
shrbn_mx(Mebp, inf_SCR01(0x08)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x09)) \
shrbn_mx(Mebp, inf_SCR01(0x09)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0A)) \
shrbn_mx(Mebp, inf_SCR01(0x0A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0B)) \
shrbn_mx(Mebp, inf_SCR01(0x0B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0C)) \
shrbn_mx(Mebp, inf_SCR01(0x0C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0D)) \
shrbn_mx(Mebp, inf_SCR01(0x0D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0E)) \
shrbn_mx(Mebp, inf_SCR01(0x0E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x0F)) \
shrbn_mx(Mebp, inf_SCR01(0x0F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x10)) \
shrbn_mx(Mebp, inf_SCR01(0x10)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x11)) \
shrbn_mx(Mebp, inf_SCR01(0x11)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x12)) \
shrbn_mx(Mebp, inf_SCR01(0x12)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x13)) \
shrbn_mx(Mebp, inf_SCR01(0x13)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x14)) \
shrbn_mx(Mebp, inf_SCR01(0x14)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x15)) \
shrbn_mx(Mebp, inf_SCR01(0x15)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x16)) \
shrbn_mx(Mebp, inf_SCR01(0x16)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x17)) \
shrbn_mx(Mebp, inf_SCR01(0x17)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x18)) \
shrbn_mx(Mebp, inf_SCR01(0x18)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x19)) \
shrbn_mx(Mebp, inf_SCR01(0x19)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1A)) \
shrbn_mx(Mebp, inf_SCR01(0x1A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1B)) \
shrbn_mx(Mebp, inf_SCR01(0x1B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1C)) \
shrbn_mx(Mebp, inf_SCR01(0x1C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1D)) \
shrbn_mx(Mebp, inf_SCR01(0x1D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1E)) \
shrbn_mx(Mebp, inf_SCR01(0x1E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x1F)) \
shrbn_mx(Mebp, inf_SCR01(0x1F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x20)) \
shrbn_mx(Mebp, inf_SCR01(0x20)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x21)) \
shrbn_mx(Mebp, inf_SCR01(0x21)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x22)) \
shrbn_mx(Mebp, inf_SCR01(0x22)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x23)) \
shrbn_mx(Mebp, inf_SCR01(0x23)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x24)) \
shrbn_mx(Mebp, inf_SCR01(0x24)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x25)) \
shrbn_mx(Mebp, inf_SCR01(0x25)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x26)) \
shrbn_mx(Mebp, inf_SCR01(0x26)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x27)) \
shrbn_mx(Mebp, inf_SCR01(0x27)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x28)) \
shrbn_mx(Mebp, inf_SCR01(0x28)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x29)) \
shrbn_mx(Mebp, inf_SCR01(0x29)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2A)) \
shrbn_mx(Mebp, inf_SCR01(0x2A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2B)) \
shrbn_mx(Mebp, inf_SCR01(0x2B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2C)) \
shrbn_mx(Mebp, inf_SCR01(0x2C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2D)) \
shrbn_mx(Mebp, inf_SCR01(0x2D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2E)) \
shrbn_mx(Mebp, inf_SCR01(0x2E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x2F)) \
shrbn_mx(Mebp, inf_SCR01(0x2F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x30)) \
shrbn_mx(Mebp, inf_SCR01(0x30)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x31)) \
shrbn_mx(Mebp, inf_SCR01(0x31)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x32)) \
shrbn_mx(Mebp, inf_SCR01(0x32)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x33)) \
shrbn_mx(Mebp, inf_SCR01(0x33)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x34)) \
shrbn_mx(Mebp, inf_SCR01(0x34)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x35)) \
shrbn_mx(Mebp, inf_SCR01(0x35)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x36)) \
shrbn_mx(Mebp, inf_SCR01(0x36)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x37)) \
shrbn_mx(Mebp, inf_SCR01(0x37)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x38)) \
shrbn_mx(Mebp, inf_SCR01(0x38)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x39)) \
shrbn_mx(Mebp, inf_SCR01(0x39)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3A)) \
shrbn_mx(Mebp, inf_SCR01(0x3A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3B)) \
shrbn_mx(Mebp, inf_SCR01(0x3B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3C)) \
shrbn_mx(Mebp, inf_SCR01(0x3C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3D)) \
shrbn_mx(Mebp, inf_SCR01(0x3D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3E)) \
shrbn_mx(Mebp, inf_SCR01(0x3E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x3F)) \
shrbn_mx(Mebp, inf_SCR01(0x3F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x40)) \
shrbn_mx(Mebp, inf_SCR01(0x40)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x41)) \
shrbn_mx(Mebp, inf_SCR01(0x41)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x42)) \
shrbn_mx(Mebp, inf_SCR01(0x42)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x43)) \
shrbn_mx(Mebp, inf_SCR01(0x43)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x44)) \
shrbn_mx(Mebp, inf_SCR01(0x44)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x45)) \
shrbn_mx(Mebp, inf_SCR01(0x45)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x46)) \
shrbn_mx(Mebp, inf_SCR01(0x46)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x47)) \
shrbn_mx(Mebp, inf_SCR01(0x47)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x48)) \
shrbn_mx(Mebp, inf_SCR01(0x48)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x49)) \
shrbn_mx(Mebp, inf_SCR01(0x49)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4A)) \
shrbn_mx(Mebp, inf_SCR01(0x4A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4B)) \
shrbn_mx(Mebp, inf_SCR01(0x4B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4C)) \
shrbn_mx(Mebp, inf_SCR01(0x4C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4D)) \
shrbn_mx(Mebp, inf_SCR01(0x4D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4E)) \
shrbn_mx(Mebp, inf_SCR01(0x4E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x4F)) \
shrbn_mx(Mebp, inf_SCR01(0x4F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x50)) \
shrbn_mx(Mebp, inf_SCR01(0x50)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x51)) \
shrbn_mx(Mebp, inf_SCR01(0x51)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x52)) \
shrbn_mx(Mebp, inf_SCR01(0x52)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x53)) \
shrbn_mx(Mebp, inf_SCR01(0x53)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x54)) \
shrbn_mx(Mebp, inf_SCR01(0x54)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x55)) \
shrbn_mx(Mebp, inf_SCR01(0x55)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x56)) \
shrbn_mx(Mebp, inf_SCR01(0x56)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x57)) \
shrbn_mx(Mebp, inf_SCR01(0x57)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x58)) \
shrbn_mx(Mebp, inf_SCR01(0x58)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x59)) \
shrbn_mx(Mebp, inf_SCR01(0x59)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5A)) \
shrbn_mx(Mebp, inf_SCR01(0x5A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5B)) \
shrbn_mx(Mebp, inf_SCR01(0x5B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5C)) \
shrbn_mx(Mebp, inf_SCR01(0x5C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5D)) \
shrbn_mx(Mebp, inf_SCR01(0x5D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5E)) \
shrbn_mx(Mebp, inf_SCR01(0x5E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x5F)) \
shrbn_mx(Mebp, inf_SCR01(0x5F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x60)) \
shrbn_mx(Mebp, inf_SCR01(0x60)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x61)) \
shrbn_mx(Mebp, inf_SCR01(0x61)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x62)) \
shrbn_mx(Mebp, inf_SCR01(0x62)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x63)) \
shrbn_mx(Mebp, inf_SCR01(0x63)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x64)) \
shrbn_mx(Mebp, inf_SCR01(0x64)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x65)) \
shrbn_mx(Mebp, inf_SCR01(0x65)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x66)) \
shrbn_mx(Mebp, inf_SCR01(0x66)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x67)) \
shrbn_mx(Mebp, inf_SCR01(0x67)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x68)) \
shrbn_mx(Mebp, inf_SCR01(0x68)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x69)) \
shrbn_mx(Mebp, inf_SCR01(0x69)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6A)) \
shrbn_mx(Mebp, inf_SCR01(0x6A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6B)) \
shrbn_mx(Mebp, inf_SCR01(0x6B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6C)) \
shrbn_mx(Mebp, inf_SCR01(0x6C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6D)) \
shrbn_mx(Mebp, inf_SCR01(0x6D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6E)) \
shrbn_mx(Mebp, inf_SCR01(0x6E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x6F)) \
shrbn_mx(Mebp, inf_SCR01(0x6F)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x70)) \
shrbn_mx(Mebp, inf_SCR01(0x70)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x71)) \
shrbn_mx(Mebp, inf_SCR01(0x71)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x72)) \
shrbn_mx(Mebp, inf_SCR01(0x72)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x73)) \
shrbn_mx(Mebp, inf_SCR01(0x73)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x74)) \
shrbn_mx(Mebp, inf_SCR01(0x74)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x75)) \
shrbn_mx(Mebp, inf_SCR01(0x75)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x76)) \
shrbn_mx(Mebp, inf_SCR01(0x76)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x77)) \
shrbn_mx(Mebp, inf_SCR01(0x77)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x78)) \
shrbn_mx(Mebp, inf_SCR01(0x78)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x79)) \
shrbn_mx(Mebp, inf_SCR01(0x79)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7A)) \
shrbn_mx(Mebp, inf_SCR01(0x7A)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7B)) \
shrbn_mx(Mebp, inf_SCR01(0x7B)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7C)) \
shrbn_mx(Mebp, inf_SCR01(0x7C)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7D)) \
shrbn_mx(Mebp, inf_SCR01(0x7D)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7E)) \
shrbn_mx(Mebp, inf_SCR01(0x7E)) \
movbx_ld(Recx, Mebp, inf_SCR02(0x7F)) \
shrbn_mx(Mebp, inf_SCR01(0x7F)) \
stack_ld(Recx) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/***************** packed byte-precision integer compare ******************/
#if (RT_512X2 < 2)
/* min (G = G < S ? G : S), (D = S < T ? S : T) if (#D != #T), unsigned */
#define minmb_rr(XG, XS) \
minmb3rr(W(XG), W(XG), W(XS))
#define minmb_ld(XG, MS, DS) \
minmb3ld(W(XG), W(XG), W(MS), W(DS))
#define minmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
minmb_rx(W(XD))
#define minmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
minmb_rx(W(XD))
#define minmb_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
minab_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
minab_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
minab_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
minab_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* min (G = G < S ? G : S), (D = S < T ? S : T) if (#D != #T), signed */
#define minmc_rr(XG, XS) \
minmc3rr(W(XG), W(XG), W(XS))
#define minmc_ld(XG, MS, DS) \
minmc3ld(W(XG), W(XG), W(MS), W(DS))
#define minmc3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
minmc_rx(W(XD))
#define minmc3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
minmc_rx(W(XD))
#define minmc_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
minac_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
minac_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
minac_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
minac_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* max (G = G > S ? G : S), (D = S > T ? S : T) if (#D != #T), unsigned */
#define maxmb_rr(XG, XS) \
maxmb3rr(W(XG), W(XG), W(XS))
#define maxmb_ld(XG, MS, DS) \
maxmb3ld(W(XG), W(XG), W(MS), W(DS))
#define maxmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
maxmb_rx(W(XD))
#define maxmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
maxmb_rx(W(XD))
#define maxmb_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
maxab_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
maxab_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
maxab_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
maxab_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* max (G = G > S ? G : S), (D = S > T ? S : T) if (#D != #T), signed */
#define maxmc_rr(XG, XS) \
maxmc3rr(W(XG), W(XG), W(XS))
#define maxmc_ld(XG, MS, DS) \
maxmc3ld(W(XG), W(XG), W(MS), W(DS))
#define maxmc3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
maxmc_rx(W(XD))
#define maxmc3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
maxmc_rx(W(XD))
#define maxmc_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
maxac_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
maxac_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
maxac_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
maxac_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* ceq (G = G == S ? -1 : 0), (D = S == T ? -1 : 0) if (#D != #T) */
#define ceqmb_rr(XG, XS) \
ceqmb3rr(W(XG), W(XG), W(XS))
#define ceqmb_ld(XG, MS, DS) \
ceqmb3ld(W(XG), W(XG), W(MS), W(DS))
#define ceqmb3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
ceqmb_rx(W(XD))
#define ceqmb3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
ceqmb_rx(W(XD))
#define ceqmb_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
ceqab_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
ceqab_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
ceqab_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
ceqab_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* cgt (G = G > S ? -1 : 0), (D = S > T ? -1 : 0) if (#D != #T), signed */
#define cgtmc_rr(XG, XS) \
cgtmc3rr(W(XG), W(XG), W(XS))
#define cgtmc_ld(XG, MS, DS) \
cgtmc3ld(W(XG), W(XG), W(MS), W(DS))
#define cgtmc3rr(XD, XS, XT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_st(W(XT), Mebp, inf_SCR02(0)) \
cgtmc_rx(W(XD))
#define cgtmc3ld(XD, XS, MT, DT) \
movmx_st(W(XS), Mebp, inf_SCR01(0)) \
movmx_ld(W(XD), W(MT), W(DT)) \
movmx_st(W(XD), Mebp, inf_SCR02(0)) \
cgtmc_rx(W(XD))
#define cgtmc_rx(XD) /* not portable, do not use outside */ \
movax_ld(W(XD), Mebp, inf_SCR01(0x00)) \
cgtac_ld(W(XD), Mebp, inf_SCR02(0x00)) \
movax_st(W(XD), Mebp, inf_SCR01(0x00)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x20)) \
cgtac_ld(W(XD), Mebp, inf_SCR02(0x20)) \
movax_st(W(XD), Mebp, inf_SCR01(0x20)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x40)) \
cgtac_ld(W(XD), Mebp, inf_SCR02(0x40)) \
movax_st(W(XD), Mebp, inf_SCR01(0x40)) \
movax_ld(W(XD), Mebp, inf_SCR01(0x60)) \
cgtac_ld(W(XD), Mebp, inf_SCR02(0x60)) \
movax_st(W(XD), Mebp, inf_SCR01(0x60)) \
movmx_ld(W(XD), Mebp, inf_SCR01(0))
/* cne (G = G != S ? -1 : 0), (D = S != T ? -1 : 0) if (#D != #T) */
#define cnemb_rr(XG, XS) \
cnemb3rr(W(XG), W(XG), W(XS))
#define cnemb_ld(XG, MS, DS) \
cnemb3ld(W(XG), W(XG), W(MS), W(DS))
#define cnemb3rr(XD, XS, XT) \
ceqmb3rr(W(XD), W(XS), W(XT)) \
notmx_rx(W(XD))
#define cnemb3ld(XD, XS, MT, DT) \
ceqmb3ld(W(XD), W(XS), W(MT), W(DT)) \
notmx_rx(W(XD))
/* clt (G = G < S ? -1 : 0), (D = S < T ? -1 : 0) if (#D != #T), unsigned */
#define cltmb_rr(XG, XS) \
cltmb3rr(W(XG), W(XG), W(XS))
#define cltmb_ld(XG, MS, DS) \
cltmb3ld(W(XG), W(XG), W(MS), W(DS))
#define cltmb3rr(XD, XS, XT) \
minmb3rr(W(XD), W(XS), W(XT)) \
cnemb_rr(W(XD), W(XT))
#define cltmb3ld(XD, XS, MT, DT) \
minmb3ld(W(XD), W(XS), W(MT), W(DT)) \
cnemb_ld(W(XD), W(MT), W(DT))
/* clt (G = G < S ? -1 : 0), (D = S < T ? -1 : 0) if (#D != #T), signed */
#define cltmc_rr(XG, XS) \
cltmc3rr(W(XG), W(XG), W(XS))
#define cltmc_ld(XG, MS, DS) \
cltmc3ld(W(XG), W(XG), W(MS), W(DS))
#define cltmc3rr(XD, XS, XT) \
cgtmc3rr(W(XD), W(XT), W(XS))
#define cltmc3ld(XD, XS, MT, DT) \
minmc3ld(W(XD), W(XS), W(MT), W(DT)) \
cnemb_ld(W(XD), W(MT), W(DT))
/* cle (G = G <= S ? -1 : 0), (D = S <= T ? -1 : 0) if (#D != #T), unsigned */
#define clemb_rr(XG, XS) \
clemb3rr(W(XG), W(XG), W(XS))
#define clemb_ld(XG, MS, DS) \
clemb3ld(W(XG), W(XG), W(MS), W(DS))
#define clemb3rr(XD, XS, XT) \
maxmb3rr(W(XD), W(XS), W(XT)) \
ceqmb_rr(W(XD), W(XT))
#define clemb3ld(XD, XS, MT, DT) \
maxmb3ld(W(XD), W(XS), W(MT), W(DT)) \
ceqmb_ld(W(XD), W(MT), W(DT))
/* cle (G = G <= S ? -1 : 0), (D = S <= T ? -1 : 0) if (#D != #T), signed */
#define clemc_rr(XG, XS) \
clemc3rr(W(XG), W(XG), W(XS))
#define clemc_ld(XG, MS, DS) \
clemc3ld(W(XG), W(XG), W(MS), W(DS))
#define clemc3rr(XD, XS, XT) \
cgtmc3rr(W(XD), W(XS), W(XT)) \
notmx_rx(W(XD))
#define clemc3ld(XD, XS, MT, DT) \
cgtmc3ld(W(XD), W(XS), W(MT), W(DT)) \
notmx_rx(W(XD))
/* cgt (G = G > S ? -1 : 0), (D = S > T ? -1 : 0) if (#D != #T), unsigned */
#define cgtmb_rr(XG, XS) \
cgtmb3rr(W(XG), W(XG), W(XS))
#define cgtmb_ld(XG, MS, DS) \
cgtmb3ld(W(XG), W(XG), W(MS), W(DS))
#define cgtmb3rr(XD, XS, XT) \
maxmb3rr(W(XD), W(XS), W(XT)) \
cnemb_rr(W(XD), W(XT))
#define cgtmb3ld(XD, XS, MT, DT) \
maxmb3ld(W(XD), W(XS), W(MT), W(DT)) \
cnemb_ld(W(XD), W(MT), W(DT))
/* cge (G = G >= S ? -1 : 0), (D = S >= T ? -1 : 0) if (#D != #T), unsigned */
#define cgemb_rr(XG, XS) \
cgemb3rr(W(XG), W(XG), W(XS))
#define cgemb_ld(XG, MS, DS) \
cgemb3ld(W(XG), W(XG), W(MS), W(DS))
#define cgemb3rr(XD, XS, XT) \
minmb3rr(W(XD), W(XS), W(XT)) \
ceqmb_rr(W(XD), W(XT))
#define cgemb3ld(XD, XS, MT, DT) \
minmb3ld(W(XD), W(XS), W(MT), W(DT)) \
ceqmb_ld(W(XD), W(MT), W(DT))
/* cge (G = G >= S ? -1 : 0), (D = S >= T ? -1 : 0) if (#D != #T), signed */
#define cgemc_rr(XG, XS) \
cgemc3rr(W(XG), W(XG), W(XS))
#define cgemc_ld(XG, MS, DS) \
cgemc3ld(W(XG), W(XG), W(MS), W(DS))
#define cgemc3rr(XD, XS, XT) \
minmc3rr(W(XD), W(XS), W(XT)) \
ceqmb_rr(W(XD), W(XT))
#define cgemc3ld(XD, XS, MT, DT) \
minmc3ld(W(XD), W(XS), W(MT), W(DT)) \
ceqmb_ld(W(XD), W(MT), W(DT))
/* mkj (jump to lb) if (S satisfies mask condition) */
#define RT_SIMD_MASK_NONE08_1K4 0x00 /* none satisfy the condition */
#define RT_SIMD_MASK_FULL08_1K4 0xFF /* all satisfy the condition */
#define movov_rr(XD, XS) /* not portable, do not use outside */ \
EVX(RXB(XD), RXB(XS), 0x00, K, 0, 1) EMITB(0x28) \
MRM(REG(XD), MOD(XS), REG(XS))
#define movov_ld(XD, MS, DS) /* not portable, do not use outside */ \
ADR EVX(RXB(XD), RXB(MS), 0x00, K, 0, 1) EMITB(0x28) \
MRM(REG(XD), MOD(MS), REG(MS)) \
AUX(SIB(MS), CMD(DS), EMPTY)
#define movov_st(XS, MD, DD) /* not portable, do not use outside */ \
ADR EVX(RXB(XS), RXB(MD), 0x00, K, 0, 1) EMITB(0x29) \
MRM(REG(XS), MOD(MD), REG(MD)) \
AUX(SIB(MD), CMD(DD), EMPTY)
#define prmov_rx(XG) /* not portable, do not use outside */ \
EVX(RXB(XG), RXB(XG), REN(XG), K, 1, 3) EMITB(0x43) \
MRM(REG(XG), MOD(XG), REG(XG)) \
AUX(EMPTY, EMPTY, EMITB(0x4E)) /* permute two 256-bit halves */
#define shlov_ri(XG, IS) /* not portable, do not use outside */ \
shlov3ri(W(XG), W(XG), W(IS))
#define shlov3ri(XD, XS, IT) /* not portable, do not use outside */ \
EVX(0, RXB(XS), REN(XD), K, 1, 1) EMITB(0x72) \
MRM(0x06, MOD(XS), REG(XS)) \
AUX(EMPTY, EMPTY, EMITB(VAL(IT)))
/* #define bsncx_rx(XS, mask) (defined in HB_256-bit header) */
#define mkjmb_rx(XS, mask, lb) /* destroys Reax, if S == mask jump lb */ \
movov_st(Xmm0, Mebp, inf_SCR01(0x00)) \
movov_st(Xmm1, Mebp, inf_SCR01(0x40)) \
movov_rr(Xmm0, W(XS)) \
movov_rr(Xmm1, X(XS)) \
VEX(0, 0, 0x00, 1, 0, 1) EMITB(0x50) \
MRM(0x00, 0x03, 0x00) \
bsncx_rx(Xmm1, mask) \
prmov_rx(Xmm0) \
prmov_rx(Xmm1) \
bsncx_rx(Xmm0, mask) \
bsncx_rx(Xmm1, mask) \
shlov_ri(Xmm0, IB(8)) \
shlov_ri(Xmm1, IB(8)) \
bsncx_rx(Xmm0, mask) \
bsncx_rx(Xmm1, mask) \
prmov_rx(Xmm0) \
prmov_rx(Xmm1) \
bsncx_rx(Xmm0, mask) \
bsncx_rx(Xmm1, mask) \
shlov_ri(Xmm0, IB(8)) \
shlov_ri(Xmm1, IB(8)) \
bsncx_rx(Xmm0, mask) \
bsncx_rx(Xmm1, mask) \
prmov_rx(Xmm0) \
prmov_rx(Xmm1) \
bsncx_rx(Xmm0, mask) \
bsncx_rx(Xmm1, mask) \
shlov_ri(Xmm0, IB(8)) \
shlov_ri(Xmm1, IB(8)) \
bsncx_rx(Xmm0, mask) \
bsncx_rx(Xmm1, mask) \
prmov_rx(Xmm0) \
prmov_rx(Xmm1) \
bsncx_rx(Xmm0, mask) \
bsncx_rx(Xmm1, mask) \
movov_ld(Xmm0, Mebp, inf_SCR01(0x00)) \
movov_ld(Xmm1, Mebp, inf_SCR01(0x40)) \
cmpwx_ri(Reax, IB(RT_SIMD_MASK_##mask##08_1K4)) \
jeqxx_lb(lb)
#else /* RT_512X2 >= 2 */
/* min (G = G < S ? G : S), (D = S < T ? S : T) if (#D != #T), unsigned */
#define minmb_rr(XG, XS) \
minmb3rr(W(XG), W(XG), W(XS))
#define minmb_ld(XG, MS, DS) \
minmb3ld(W(XG), W(XG), W(MS), W(DS))
#define minmb3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xDA) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xDA) \
MRM(REG(XD), MOD(XT), REG(XT))
#define minmb3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xDA) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xDA) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* min (G = G < S ? G : S), (D = S < T ? S : T) if (#D != #T), signed */
#define minmc_rr(XG, XS) \
minmc3rr(W(XG), W(XG), W(XS))
#define minmc_ld(XG, MS, DS) \
minmc3ld(W(XG), W(XG), W(MS), W(DS))
#define minmc3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 2) EMITB(0x38) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 2) EMITB(0x38) \
MRM(REG(XD), MOD(XT), REG(XT))
#define minmc3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 2) EMITB(0x38) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 2) EMITB(0x38) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* max (G = G > S ? G : S), (D = S > T ? S : T) if (#D != #T), unsigned */
#define maxmb_rr(XG, XS) \
maxmb3rr(W(XG), W(XG), W(XS))
#define maxmb_ld(XG, MS, DS) \
maxmb3ld(W(XG), W(XG), W(MS), W(DS))
#define maxmb3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 1) EMITB(0xDE) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 1) EMITB(0xDE) \
MRM(REG(XD), MOD(XT), REG(XT))
#define maxmb3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 1) EMITB(0xDE) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 1) EMITB(0xDE) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* max (G = G > S ? G : S), (D = S > T ? S : T) if (#D != #T), signed */
#define maxmc_rr(XG, XS) \
maxmc3rr(W(XG), W(XG), W(XS))
#define maxmc_ld(XG, MS, DS) \
maxmc3ld(W(XG), W(XG), W(MS), W(DS))
#define maxmc3rr(XD, XS, XT) \
EVX(RXB(XD), RXB(XT), REN(XS), K, 1, 2) EMITB(0x3C) \
MRM(REG(XD), MOD(XT), REG(XT)) \
EVX(RMB(XD), RMB(XT), REM(XS), K, 1, 2) EMITB(0x3C) \
MRM(REG(XD), MOD(XT), REG(XT))
#define maxmc3ld(XD, XS, MT, DT) \
ADR EVX(RXB(XD), RXB(MT), REN(XS), K, 1, 2) EMITB(0x3C) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMPTY) \
ADR EVX(RMB(XD), RXB(MT), REM(XS), K, 1, 2) EMITB(0x3C) \
MRM(REG(XD), 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMPTY)
/* ceq (G = G == S ? -1 : 0), (D = S == T ? -1 : 0) if (#D != #T) */
#define ceqmb_rr(XG, XS) \
ceqmb3rr(W(XG), W(XG), W(XS))
#define ceqmb_ld(XG, MS, DS) \
ceqmb3ld(W(XG), W(XG), W(MS), W(DS))
#define ceqmb3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x00)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x00)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define ceqmb3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x00)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x00)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* cne (G = G != S ? -1 : 0), (D = S != T ? -1 : 0) if (#D != #T) */
#define cnemb_rr(XG, XS) \
cnemb3rr(W(XG), W(XG), W(XS))
#define cnemb_ld(XG, MS, DS) \
cnemb3ld(W(XG), W(XG), W(MS), W(DS))
#define cnemb3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x04)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x04)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define cnemb3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x04)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x04)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* clt (G = G < S ? -1 : 0), (D = S < T ? -1 : 0) if (#D != #T), unsigned */
#define cltmb_rr(XG, XS) \
cltmb3rr(W(XG), W(XG), W(XS))
#define cltmb_ld(XG, MS, DS) \
cltmb3ld(W(XG), W(XG), W(MS), W(DS))
#define cltmb3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x01)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x01)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define cltmb3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x01)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x01)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* clt (G = G < S ? -1 : 0), (D = S < T ? -1 : 0) if (#D != #T), signed */
#define cltmc_rr(XG, XS) \
cltmc3rr(W(XG), W(XG), W(XS))
#define cltmc_ld(XG, MS, DS) \
cltmc3ld(W(XG), W(XG), W(MS), W(DS))
#define cltmc3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x01)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x01)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define cltmc3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x01)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x01)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* cle (G = G <= S ? -1 : 0), (D = S <= T ? -1 : 0) if (#D != #T), unsigned */
#define clemb_rr(XG, XS) \
clemb3rr(W(XG), W(XG), W(XS))
#define clemb_ld(XG, MS, DS) \
clemb3ld(W(XG), W(XG), W(MS), W(DS))
#define clemb3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x02)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x02)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define clemb3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x02)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x02)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* cle (G = G <= S ? -1 : 0), (D = S <= T ? -1 : 0) if (#D != #T), signed */
#define clemc_rr(XG, XS) \
clemc3rr(W(XG), W(XG), W(XS))
#define clemc_ld(XG, MS, DS) \
clemc3ld(W(XG), W(XG), W(MS), W(DS))
#define clemc3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x02)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x02)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define clemc3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x02)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x02)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* cgt (G = G > S ? -1 : 0), (D = S > T ? -1 : 0) if (#D != #T), unsigned */
#define cgtmb_rr(XG, XS) \
cgtmb3rr(W(XG), W(XG), W(XS))
#define cgtmb_ld(XG, MS, DS) \
cgtmb3ld(W(XG), W(XG), W(MS), W(DS))
#define cgtmb3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x06)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x06)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define cgtmb3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x06)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x06)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* cgt (G = G > S ? -1 : 0), (D = S > T ? -1 : 0) if (#D != #T), signed */
#define cgtmc_rr(XG, XS) \
cgtmc3rr(W(XG), W(XG), W(XS))
#define cgtmc_ld(XG, MS, DS) \
cgtmc3ld(W(XG), W(XG), W(MS), W(DS))
#define cgtmc3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x06)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x06)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define cgtmc3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x06)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x06)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* cge (G = G >= S ? -1 : 0), (D = S >= T ? -1 : 0) if (#D != #T), unsigned */
#define cgemb_rr(XG, XS) \
cgemb3rr(W(XG), W(XG), W(XS))
#define cgemb_ld(XG, MS, DS) \
cgemb3ld(W(XG), W(XG), W(MS), W(DS))
#define cgemb3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x05)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x05)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define cgemb3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x05)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3E) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x05)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* cge (G = G >= S ? -1 : 0), (D = S >= T ? -1 : 0) if (#D != #T), signed */
#define cgemc_rr(XG, XS) \
cgemc3rr(W(XG), W(XG), W(XS))
#define cgemc_ld(XG, MS, DS) \
cgemc3ld(W(XG), W(XG), W(MS), W(DS))
#define cgemc3rr(XD, XS, XT) \
EVX(0, RXB(XT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x05)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
EVX(0, RMB(XT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, MOD(XT), REG(XT)) \
AUX(EMPTY, EMPTY, EMITB(0x05)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
#define cgemc3ld(XD, XS, MT, DT) \
ADR EVX(0, RXB(MT), REN(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VAL(DT)), EMITB(0x05)) \
mz1mb_ld(W(XD), Mebp, inf_GPC07) \
ADR EVX(0, RXB(MT), REM(XS), K, 1, 3) EMITB(0x3F) \
MRM(0x01, 0x02, REG(MT)) \
AUX(SIB(MT), EMITW(VZL(DT)), EMITB(0x05)) \
mz1mb_ld(X(XD), Mebp, inf_GPC07)
/* mkj (jump to lb) if (S satisfies mask condition) */
#define RT_SIMD_MASK_NONE08_1K4 0x00000000 /* none satisfy the condition */
#define RT_SIMD_MASK_FULL08_1K4 0xFFFFFFFF /* all satisfy the condition */
#define mk1bx_rx(RD) /* not portable, do not use outside */ \
VEW(RXB(RD), 0, 0x00, 0, 3, 1) EMITB(0x93) \
MRM(REG(RD), 0x03, 0x01)
#define mkjmb_rx(XS, mask, lb) /* destroys Reax, if S == mask jump lb */ \
ck1mb_rm(W(XS), Mebp, inf_GPC07) \
mk1bx_rx(Reax) \
REW(1, 0) EMITB(0x8B) \
MRM(0x07, 0x03, 0x00) \
ck1mb_rm(X(XS), Mebp, inf_GPC07) \
mk1bx_rx(Reax) \
REW(0, 1) \
EMITB(0x03 | (0x08 << ((RT_SIMD_MASK_##mask##08_1K4 & 0x1) << 1))) \
MRM(0x00, 0x03, 0x07) \
movzx_mj(Mebp, inf_SCR02(0), IW(RT_SIMD_MASK_##mask##08_1K4), \
IW(RT_SIMD_MASK_##mask##08_1K4)) \
cmpzx_rm(Reax, Mebp, inf_SCR02(0)) \
jeqxx_lb(lb)
#endif /* RT_512X2 >= 2 */
/******************************************************************************/
/******************************** INTERNAL ********************************/
/******************************************************************************/
#endif /* RT_512X2 */
#endif /* RT_SIMD_CODE */
#endif /* RT_RTARCH_XHB_512X2V2_H */
/******************************************************************************/
/******************************************************************************/
/******************************************************************************/
| VectorChief/QuadRay-engine | core/config/rtarch_xHB_512x2v2.h | C | mit | 334,099 |
<?php
/*
* This file is part of the PMD package.
*
* (c) Piotr Minkina <projekty@piotrminkina.pl>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PMD\Bundle\Resource\ResolverBundle\Factory;
use PMD\Bundle\Resource\ResolverBundle\Parser\ExpressionParser;
use PMD\Bundle\Resource\ResolverBundle\Parser\ParserChain;
use PMD\Bundle\Resource\ResolverBundle\Parser\ServiceParser;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use PMD\Bundle\Resource\ResolverBundle\Collector\Decorator\FilterExistsRequestAttribute;
use PMD\Bundle\Resource\ResolverBundle\Collector\Decorator\FilterRequestClass;
use PMD\Bundle\Resource\ResolverBundle\Collector\FunctionRequirements;
use PMD\Bundle\Resource\ResolverBundle\Collector\MethodRequirements;
use PMD\Bundle\Resource\ResolverBundle\Exception\InvalidArgumentException;
use PMD\Bundle\Resource\ResolverBundle\Injector\RequestAttributeInjector;
use PMD\Bundle\Resource\ResolverBundle\Parser\ParserInterface;
use PMD\Bundle\Resource\ResolverBundle\Parser\RecursiveParser;
use PMD\Bundle\Resource\ResolverBundle\Provider\Decorator\ParseDecorator;
use PMD\Bundle\Resource\ResolverBundle\Provider\RequestProvider;
use PMD\Bundle\Resource\ResolverBundle\Resolver\Resolver;
/**
* Class RequestControllerFactory
*
* @author Piotr Minkina <projekty@piotrminkina.pl>
* @package PMD\Bundle\Resource\ResolverBundle\Factory
*/
class RequestControllerFactory implements FactoryInterface
{
/**
* @var ContainerInterface
*/
protected $container;
/**
* @var Request|null
*/
protected $request;
/**
* @var callable|null
*/
protected $controller;
/**
* @param ContainerInterface $container
*/
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
/**
* @param Request $request
* @return RequestControllerFactory
*/
public function setRequest(Request $request)
{
$this->request = $request;
return $this;
}
/**
* @return Request|null
*/
public function getRequest()
{
return $this->request;
}
/**
* @param callable $controller
* @return RequestControllerFactory
*/
public function setController($controller)
{
$this->controller = $controller;
return $this;
}
/**
* @return callable|null
*/
public function getController()
{
return $this->controller;
}
/**
* @inheritdoc
*/
public function createCollector()
{
$request = $this->request;
$controller = $this->controller;
$collector = null;
if (is_array($controller) && count($controller) == 2) {
$collector = new MethodRequirements($controller[0], $controller[1]);
} elseif (is_string($controller)) {
$collector = new FunctionRequirements($controller);
}
if (!$collector) {
throw new InvalidArgumentException('Unsupported controller type');
}
$collector = new FilterExistsRequestAttribute($collector, $request);
$collector = new FilterRequestClass($collector, $request);
return $collector;
}
/**
* @inheritdoc
*/
public function createInjector()
{
$request = $this->request;
if (!$request instanceof Request) {
throw new InvalidArgumentException('Unsupported request type');
}
return new RequestAttributeInjector($this->request);
}
/**
* @return ParserInterface
*/
public function createParser()
{
$parser = new ParserChain(
array(
new ExpressionParser($this->container, $this->request),
new ServiceParser($this->container),
)
);
$parser = new RecursiveParser($parser);
return $parser;
}
/**
* @inheritdoc
*/
public function createProvider()
{
$parser = $this->createParser();
$provider = new RequestProvider($this->request);
$provider = new ParseDecorator($provider, $parser);
return $provider;
}
/**
* @inheritdoc
*/
public function createResolver()
{
$provider = $this->createProvider();
return new Resolver($provider);
}
}
| piotrminkina/pmd | src/PMD/Bundle/Resource/ResolverBundle/Factory/RequestControllerFactory.php | PHP | mit | 4,504 |
-- TABLES
DROP TABLE IF EXISTS `bx_glossary_terms`, `bx_glossary_files`, `bx_glossary_photos_resized`, `bx_glossary_cmts`, `bx_glossary_votes`, `bx_glossary_votes_track`, `bx_glossary_reactions`, `bx_glossary_reactions_track`, `bx_glossary_views_track`, `bx_glossary_meta_keywords`, `bx_glossary_meta_mentions`, `bx_glossary_reports`, `bx_glossary_reports_track`, `bx_glossary_favorites_track`, `bx_glossary_scores`, `bx_glossary_scores_track`;
-- STORAGES & TRANSCODERS
DELETE FROM `sys_objects_storage` WHERE `object` = 'bx_glossary_files' OR `object` = 'bx_glossary_photos_resized';
DELETE FROM `sys_storage_tokens` WHERE `object` = 'bx_glossary_files' OR `object` = 'bx_glossary_photos_resized';
DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_glossary_preview', 'bx_glossary_gallery', 'bx_glossary_cover');
DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_glossary_preview', 'bx_glossary_gallery', 'bx_glossary_cover');
DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_glossary_preview', 'bx_glossary_gallery', 'bx_glossary_cover');
-- FORMS
DELETE FROM `sys_objects_form` WHERE `module` = 'bx_glossary';
DELETE FROM `sys_form_displays` WHERE `module` = 'bx_glossary';
DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_glossary';
DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN ('bx_glossary_entry_add', 'bx_glossary_entry_edit', 'bx_glossary_entry_view', 'bx_glossary_entry_delete');
-- PRE-VALUES
DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_glossary';
DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_glossary_cats');
-- COMMENTS
DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_glossary';
-- VOTES
DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_glossary', 'bx_glossary_reactions');
-- SCORES
DELETE FROM `sys_objects_score` WHERE `name` = 'bx_glossary';
-- REPORTS
DELETE FROM `sys_objects_report` WHERE `name` = 'bx_glossary';
-- VIEWS
DELETE FROM `sys_objects_view` WHERE `name` = 'bx_glossary';
-- FAFORITES
DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_glossary';
-- FEATURED
DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_glossary';
-- CONTENT INFO
DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_glossary', 'bx_glossary_cmts');
DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_glossary');
-- SEARCH EXTENDED
DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_glossary';
-- STUDIO: page & widget
DELETE FROM `tp`, `tw`, `tpw`
USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_glossary';
| unaio/una | modules/boonex/glossary/updates/9.0.3_10.0.0/source/install/sql/uninstall.sql | SQL | mit | 2,747 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>No Locale Test</title>
<link rel="stylesheet" href="qunit.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="../l10n.js"></script>
<script src="qunit.js"></script>
</body>
<script>
test('toLocaleString unaffected', function () {
var input = "The quick brown fox jumps over the lazy dog.",
expected = "The quick brown fox jumps over the lazy dog.";
equal(input, expected, 'This should work with no problem.');
equal(input.toLocaleString(), expected, 'l10n.js does not alter the default behaviour.');
});
</script>
</html>
| JeromeDane/l10n.js | tests/no-locale.html | HTML | mit | 667 |
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'indent', 'eu', {
indent: 'Handitu koska',
outdent: 'Txikitu koska'
} );
| nickofbh/kort2 | app/static/js/ckeditor/plugins/indent/lang/eu.js | JavaScript | mit | 255 |
using Microsoft.MSBuildProjectBuilder;
using Xunit;
namespace MSBuildProjectBuilder.UnitTests
{
public class TargetTest
{
[Fact]
public void AddTarget()
{
string expectedOutput =
@"<?xml version=""1.0"" encoding=""utf-16""?>
<Project ToolsVersion=""4.0"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<PropertyGroup Label=""test label"" Condition=""test Condition"" />
<Target Name=""foo"">
<PropertyGroup>
<fun>bar</fun>
</PropertyGroup>
<ItemGroup>
<testing Include=""cows"" />
</ItemGroup>
</Target>
<PropertyGroup>
<outOfTarget>hello</outOfTarget>
</PropertyGroup>
</Project>";
ProjectBuilder.Create()
.AddPropertyGroup("test Condition", "test label")
.AddTarget("foo")
.AddProperty("fun=bar")
.AddItem("testing=cows")
.ExitTarget()
.AddProperty("outOfTarget=hello")
.ProjectRoot
.RawXmlShouldBe(expectedOutput);
expectedOutput =
@"<?xml version=""1.0"" encoding=""utf-16""?>
<Project ToolsVersion=""4.0"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<Target Name=""foo"" AfterTargets=""after"" BeforeTargets=""before"" DependsOnTargets=""dep"" Inputs=""inp"" Outputs=""out"" Label=""lab"" Condition=""con"" />
<PropertyGroup>
<test>here</test>
</PropertyGroup>
<Target Name=""cow"" />
<Target Name=""bar"">
<PropertyGroup>
<intarget>here</intarget>
</PropertyGroup>
</Target>
</Project>";
ProjectBuilder.Create()
.AddTarget("foo","con","lab","after","before","dep","inp","out", false)
.ExitTarget()
.AddProperty("test=here")
.AddTarget("cow")
.AddTarget("bar")
.AddProperty("intarget=here")
.ProjectRoot
.RawXmlShouldBe(expectedOutput);
}
}
}
| jeffkl/CBT.Modules | src/MSBuildProjectBuilder.UnitTests/TargetTest.cs | C# | mit | 2,009 |
<?php
/*
* This file is part of the PHPExifTool package.
*
* (c) Alchemy <support@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPExiftool\Driver\Tag\DICOM;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class RequestingPhysician extends AbstractTag
{
protected $Id = '0032,1032';
protected $Name = 'RequestingPhysician';
protected $FullName = 'DICOM::Main';
protected $GroupName = 'DICOM';
protected $g0 = 'DICOM';
protected $g1 = 'DICOM';
protected $g2 = 'Image';
protected $Type = '?';
protected $Writable = false;
protected $Description = 'Requesting Physician';
}
| bburnichon/PHPExiftool | lib/PHPExiftool/Driver/Tag/DICOM/RequestingPhysician.php | PHP | mit | 809 |
const path = require('path');
const consoleLogger = require('./logger');
const _ = require('lodash');
module.exports = (config, logger, metrics, next) => {
if (!next) { next = metrics; metrics = { increment: _.noop }; }
if (!next) { next = logger; logger = consoleLogger; }
require('../db')(config, logger, (err, client) => {
if (err) { return next(err); }
const messaging = require('../db/messaging')(config);
const urls = require('./urls');
const visibility = require('./visibility');
const api = {
logger,
metrics,
client,
config,
messaging,
urls,
visibility,
};
const modules = ['auth', 'common', 'user', 'post', 'like', 'feed', 'friend', 'follow', 'group', 'comment', 'moderate', 'interest', '../db/migrations'];
modules.forEach((module) => {
const moduleName = path.basename(module);
api[moduleName] = require(path.resolve(__dirname, module))(api);
});
next(null, api);
});
};
| cliftonc/seguir | api/index.js | JavaScript | mit | 992 |
{% extends "namubufferiapp/base.html" %}
{% load render_bundle from webpack_loader %}
{% block modals %}
<!-- Modals -->
<!-- Always try to place a modal's HTML code in a top-level position in your document to avoid other components affecting the modal's appearance and/or functionality. -->
<!-- Product info/buy Modal -->
<div class="modal fade" id="productUpdateModal" tabindex="-1" role="dialog" aria-labelledby="productUpdateModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<form id="update-product-form" action="{% url 'product_update' %}" method="post">
<div class="modal-body">
{% csrf_token %}
<div class="form-group ">
<label class="control-label" for="id_name">Name</label>
{{ product_form.name }}
</div>
<div class="form-group ">
<label class="control-label" for="id_category">Category</label>
{{ product_form.category }}
</div>
<div class="form-group ">
<label class="control-label" for="id_price">Price</label>
<div class="input-group">
{{ product_form.price }}
<div class="input-group-addon">€</div>
</div>
</div>
<div class="form-group ">
<label class="control-label " for="id_inventory">Stock</label>
{{ product_form.inventory }}
</div>
<div class="form-group">
<label class="checkbox-inline">
{{ product_form.hidden }}
<span>Hidden</span>
</label>
</div>
{{ product_form.barcode.as_hidden }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Cancel</button>
<button type="submit" form="update-product-form" class="btn btn-success">Update</button>
</div>
</form>
</div>
</div>
</div>
{% endblock modals %}
{% block content %}
{{ block.super }}
<!-- Shop Section -->
<section id="shop" class="container text-center">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="input-group input-group">
<span class="input-group-addon" id="basic-addon1"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></span>
<input class="form-control" id="search" name="search" placeholder="Search for products" type="text" data-list=".list"> <!-- .list class for hideseek search -->
</div>
</div>
</div>
<span id="products"></span>
{% for category in categories %}
<div class="list row"> <!-- .list class for hideseek search -->
<div class="col-xs-12">
<h4><strong>{{ category.name }}</strong></h4>
</div>
{% for product in products %}
{% if product.category.name == category.name %}
<div class="col-xs-6 col-sm-3">
<button
type="button"
{% if product.hidden is True %}
class="btn disabled btn-block btn-lg product"
{% elif product.inventory <= 0 %}
class="btn btn-warning btn-block btn-lg product"
{% else %}
class="btn btn-default btn-block btn-lg product"
{% endif %}
data-toggle="modal"
data-target="#productUpdateModal"
data-mode="update"
data-productkey="{{ product.pk }}"
data-productname="{{ product.name }}"
data-productcategory="{{ product.category }}"
data-productcategoryid="{{ product.category.id }}"
data-productprice="{{ product.price }}"
data-producthidden="{%if product.hidden is True%}true{%else%}false{%endif%}"
data-productinventory="{{ product.inventory }}">
{{ product.name }} ({{ product.inventory }})<br>
{{ product.price }}€ <br>
<span hidden>{{ product.category }}</span>
</button>
</div>
{% endif %}
{% endfor%}
</div>
{% endfor %}
</section>
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container-fluid text-center">
<button type="button" class="btn btn-primary btn-lg navbar-btn" data-toggle="modal" data-target="#productUpdateModal" data-mode="add">
Add product
</button>
<button type="button" id="bcode-assign-btn" class="btn btn-lg btn-info hidden" data-barcode="">
Assign <span id="bcode-assign-btn-bcode"></span> by clicking product.
</button>
</div>
</nav>
{% endblock content %}
{% block own_bundles %}
{% render_bundle 'inventoryview' %}
{% endblock own_bundles %}
| oangervuori/namubufferi | namubufferiapp/templates/namubufferiapp/admin_handleinventory.html | HTML | mit | 4,760 |
#include "bitcoinamountfield.h"
#include "qvaluecombobox.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include <QHBoxLayout>
#include <QKeyEvent>
#include <QDoubleSpinBox>
#include <QApplication>
#include <qmath.h> // for qPow()
BitcoinAmountField::BitcoinAmountField(QWidget *parent):
QWidget(parent), amount(0), currentUnit(-1)
{
amount = new QDoubleSpinBox(this);
amount->setLocale(QLocale::c());
amount->setDecimals(8);
amount->installEventFilter(this);
amount->setMaximumWidth(170);
amount->setSingleStep(0.001);
QHBoxLayout *layout = new QHBoxLayout(this);
layout->addWidget(amount);
unit = new QValueComboBox(this);
unit->setModel(new BitcoinUnits(this));
layout->addWidget(unit);
layout->addStretch(1);
layout->setContentsMargins(0,0,0,0);
setLayout(layout);
setFocusPolicy(Qt::TabFocus);
setFocusProxy(amount);
// If one if the widgets changes, the combined content changes as well
connect(amount, SIGNAL(valueChanged(QString)), this, SIGNAL(textChanged()));
connect(unit, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)));
// Set default based on configuration
unitChanged(unit->currentIndex());
}
void BitcoinAmountField::setText(const QString &text)
{
if (text.isEmpty())
amount->clear();
else
amount->setValue(text.toDouble());
}
void BitcoinAmountField::clear()
{
amount->clear();
unit->setCurrentIndex(0);
}
bool BitcoinAmountField::validate()
{
bool valid = true;
if (amount->value() == 0.0)
valid = false;
if (valid && !BitcoinUnits::parse(currentUnit, text(), 0))
valid = false;
setValid(valid);
return valid;
}
void BitcoinAmountField::setValid(bool valid)
{
if (valid)
amount->setStyleSheet("");
else
amount->setStyleSheet(STYLE_INVALID);
}
QString BitcoinAmountField::text() const
{
if (amount->text().isEmpty())
return QString();
else
return amount->text();
}
bool BitcoinAmountField::eventFilter(QObject *object, QEvent *event)
{
if (event->type() == QEvent::FocusIn)
{
// Clear invalid flag on focus
setValid(true);
}
else if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_Comma)
{
// Translate a comma into a period
QKeyEvent periodKeyEvent(event->type(), Qt::Key_Period, keyEvent->modifiers(), ".", keyEvent->isAutoRepeat(), keyEvent->count());
QApplication::sendEvent(object, &periodKeyEvent);
return true;
}
}
return QWidget::eventFilter(object, event);
}
QWidget *BitcoinAmountField::setupTabChain(QWidget *prev)
{
QWidget::setTabOrder(prev, amount);
return amount;
}
qint64 BitcoinAmountField::value(bool *valid_out) const
{
qint64 val_out = 0;
bool valid = BitcoinUnits::parse(currentUnit, text(), &val_out);
if(valid_out)
{
*valid_out = valid;
}
return val_out;
}
void BitcoinAmountField::setValue(qint64 value)
{
setText(BitcoinUnits::format(currentUnit, value));
}
void BitcoinAmountField::unitChanged(int idx)
{
// Use description tooltip for current unit for the combobox
unit->setToolTip(unit->itemData(idx, Qt::ToolTipRole).toString());
// Determine new unit ID
int newUnit = unit->itemData(idx, BitcoinUnits::UnitRole).toInt();
// Parse current value and convert to new unit
bool valid = false;
qint64 currentValue = value(&valid);
currentUnit = newUnit;
// Set max length after retrieving the value, to prevent truncation
amount->setDecimals(BitcoinUnits::decimals(currentUnit));
amount->setMaximum(qPow(10, BitcoinUnits::amountDigits(currentUnit)) - qPow(10, -amount->decimals()));
if(currentUnit == BitcoinUnits::cFz)
amount->setSingleStep(0.01);
else
amount->setSingleStep(0.001);
if(valid)
{
// If value was valid, re-place it in the widget with the new unit
setValue(currentValue);
}
else
{
// If current value is invalid, just clear field
setText("");
}
setValid(true);
}
void BitcoinAmountField::setDisplayUnit(int newUnit)
{
unit->setValue(newUnit);
}
| BlueCoin/BlueCoin | src/qt/bitcoinamountfield.cpp | C++ | mit | 4,375 |
""" FileDialogDelegateQt.py: Delegate that pops up a file dialog when double clicked.
Sets the model data to the selected file name.
"""
import os.path
try:
from PyQt5.QtCore import Qt, QT_VERSION_STR
from PyQt5.QtWidgets import QStyledItemDelegate, QFileDialog
except ImportError:
try:
from PyQt4.QtCore import Qt, QT_VERSION_STR
from PyQt4.QtGui import QStyledItemDelegate, QFileDialog
except ImportError:
raise ImportError("FileDialogDelegateQt: Requires PyQt5 or PyQt4.")
__author__ = "Marcel Goldschen-Ohm <marcel.goldschen@gmail.com>"
class FileDialogDelegateQt(QStyledItemDelegate):
""" Delegate that pops up a file dialog when double clicked.
Sets the model data to the selected file name.
"""
def __init__(self, parent=None):
QStyledItemDelegate.__init__(self, parent)
def createEditor(self, parent, option, index):
""" Instead of creating an editor, just popup a modal file dialog
and set the model data to the selected file name, if any.
"""
pathToFileName = ""
if QT_VERSION_STR[0] == '4':
pathToFileName = QFileDialog.getOpenFileName(None, "Open")
elif QT_VERSION_STR[0] == '5':
pathToFileName, temp = QFileDialog.getOpenFileName(None, "Open")
pathToFileName = str(pathToFileName) # QString ==> str
if len(pathToFileName):
index.model().setData(index, pathToFileName, Qt.EditRole)
index.model().dataChanged.emit(index, index) # Tell model to update cell display.
return None
def displayText(self, value, locale):
""" Show file name without path.
"""
try:
if QT_VERSION_STR[0] == '4':
pathToFileName = str(value.toString()) # QVariant ==> str
elif QT_VERSION_STR[0] == '5':
pathToFileName = str(value)
path, fileName = os.path.split(pathToFileName)
return fileName
except:
return ""
| marcel-goldschen-ohm/ModelViewPyQt | FileDialogDelegateQt.py | Python | mit | 2,023 |
namespace Microsoft.DataTransfer.DocumentDb.Client
{
interface IDocumentDbConnectionSettings
{
string AccountEndpoint { get; }
string AccountKey { get; }
string Database { get; }
}
}
| innovimax/azure-documentdb-datamigrationtool | DocumentDb/Microsoft.DataTransfer.DocumentDb/Client/IDocumentDbConnectionSettings.cs | C# | mit | 223 |
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', ['before' => 'auth', function(){
$store = Auth::user();
$api = new TiendaNube\API($store->tiendanube_id, $store->access_token, 'Awesome App (contact@awesome.com)');
$response = $api->get("products");
return View::make('hello')
->with('products', $response->body)
->with('lang', $response->main_language);
}]);
Route::get('/auth', function(){
//Obtain access token
$code = Input::get('code');
$auth = new TiendaNube\Auth(Config::get('tiendanube.client_id'), Config::get('tiendanube.client_secret'));
$store_info = $auth->request_access_token($code);
//Create or edit existing store with the provided access token
$store = Store::where('tiendanube_id', $store_info['store_id'])->first();
if ($store == null){
$store = new Store();
$store->tiendanube_id = $store_info['store_id'];
}
$store->access_token = $store_info['access_token'];
$store->save();
//Login and redirect to homepage
Auth::login($store);
return Redirect::to('/');
});
| TiendaNube/sample-php-app | app/routes.php | PHP | mit | 1,463 |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Setup_products_category extends Root_Controller
{
private $message;
public $permissions;
public $controller_url;
public function __construct()
{
parent::__construct();
$this->message='';
$this->permissions=User_helper::get_permission('Setup_products_category');
$this->controller_url='setup_products_category';
}
public function index($action='list',$id=0)
{
if($action=='list')
{
$this->system_list($id);
}
elseif($action=='get_items')
{
$this->system_get_items();
}
elseif($action=='add')
{
$this->system_add();
}
elseif($action=='edit')
{
$this->system_edit($id);
}
elseif($action=='save')
{
$this->system_save();
}
elseif($action=='delete')
{
$this->system_delete();
}
else
{
$this->system_list($id);
}
}
private function system_list()
{
if(isset($this->permissions['action0']) && ($this->permissions['action0']==1))
{
$data['title']='পণ্য বিভাগ তালিকা';
$ajax['system_content'][]=array('id'=>'#system_content','html'=>$this->load->view($this->controller_url.'/list',$data,true));
if($this->message)
{
$ajax['system_message']=$this->message;
}
$ajax['system_page_url']=site_url($this->controller_url);
$ajax['status']=true;
$this->json_return($ajax);
}
else
{
$ajax['status']=false;
$ajax['system_message']=$this->lang->line('YOU_DONT_HAVE_ACCESS');
$this->json_return($ajax);
}
}
private function system_get_items()
{
$items=Query_helper::get_info($this->config->item('table_rice_mill_setup_products_category'),array('id','name','status','ordering'),array('status !="'.$this->config->item('system_status_delete').'"'),0,0,array('ordering ASC'));
foreach($items as &$item)
{
$item['ordering']=System_helper::get_bangla_number($item['ordering']);
}
$this->json_return($items);
}
private function system_add()
{
if(isset($this->permissions['action1']) && ($this->permissions['action1']==1))
{
$data['title']='নতুন পণ্য বিভাগ তৈরি করুন';
$data['item']=array
(
'id'=>0,
'name'=>'',
'ordering'=>99,
'status'=>$this->config->item('system_status_active'),
'remarks'=>''
);
$ajax['system_page_url']=site_url($this->controller_url.'/index/add');
$ajax['system_content'][]=array('id'=>'#system_content','html'=>$this->load->view($this->controller_url.'/add_edit',$data,true));
if($this->message)
{
$ajax['system_message']=$this->message;
}
$ajax['status']=true;
$this->json_return($ajax);
}
else
{
$ajax['status']=false;
$ajax['system_message']=$this->lang->line('YOU_DONT_HAVE_ACCESS');
$this->json_return($ajax);
}
}
private function system_edit($id)
{
if(isset($this->permissions['action2']) && ($this->permissions['action2']==1))
{
if(($this->input->post('id')))
{
$item_id=$this->input->post('id');
}
else
{
$item_id=$id;
}
$data['item']=Query_helper::get_info($this->config->item('table_rice_mill_setup_products_category'),'*',array('id ='.$item_id),1);
$data['title']=$data['item']['name'].' পণ্য বিভাগটিকে সংশোধন করুন';
$ajax['system_content'][]=array('id'=>'#system_content','html'=>$this->load->view($this->controller_url.'/add_edit',$data,true));
if($this->message)
{
$ajax['system_message']=$this->message;
}
$ajax['system_page_url']=site_url($this->controller_url.'/index/edit/'.$item_id);
$ajax['status']=true;
$this->json_return($ajax);
}
else
{
$ajax['status']=false;
$ajax['system_message']=$this->lang->line('YOU_DONT_HAVE_ACCESS');
$this->json_return($ajax);
}
}
private function system_save()
{
$id=$this->input->post('id');
$user=User_helper::get_user();
if($id>0)
{
if(!(isset($this->permissions['action2']) && ($this->permissions['action2']==1)))
{
$ajax['status']=false;
$ajax['system_message']=$this->lang->line('YOU_DONT_HAVE_ACCESS');
$this->json_return($ajax);
}
}
else
{
if(!(isset($this->permissions['action1']) && ($this->permissions['action1']==1)))
{
$ajax['status']=false;
$ajax['system_message']=$this->lang->line('YOU_DONT_HAVE_ACCESS');
$this->json_return($ajax);
}
}
if(!$this->check_validation())
{
$ajax['status']=false;
$ajax['system_message']=$this->message;
$this->json_return($ajax);
}
else
{
$data=$this->input->post('item');
$this->db->trans_start();
if($id>0)
{
$data['user_updated']=$user->user_id;
$data['date_updated']=time();
Query_helper::update($this->config->item('table_rice_mill_setup_products_category'),$data,array('id='.$id));
$for_message='EDITED';
}
else
{
$data['user_created']=$user->user_id;
$data['date_created']=time();
Query_helper::add($this->config->item('table_rice_mill_setup_products_category'),$data);
$for_message='SAVED';
}
$this->db->trans_complete();
if($this->db->trans_status()===true)
{
$save_and_new=$this->input->post('system_save_new_status');
$this->message=$this->lang->line('MSG_'.$for_message.'_SUCCESS');
if($save_and_new==1)
{
$this->system_add();
}
else
{
$this->system_list();
}
}
else
{
$ajax['status']=false;
$ajax['system_message']=$this->lang->line('MSG_'.$for_message.'_FAIL');
$this->json_return($ajax);
}
}
}
private function check_validation()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('item[name]',$this->lang->line('LABEL_NAME'),'required');
if($this->form_validation->run()==false)
{
$this->message=validation_errors();
return false;
}
return true;
}
private function system_delete()
{
$id=$this->input->post('id');
$user=User_helper::get_user();
if(!(isset($this->permissions['action3']) && ($this->permissions['action3']==1)))
{
$ajax['status']=false;
$ajax['system_message']=$this->lang->line('YOU_DONT_HAVE_ACCESS');
$this->json_return($ajax);
}
$counter=$this->db->select('COUNT("id") counter')->from($this->config->item('table_rice_mill_setup_products'))->where('id_product_category',$id)->get()->row_array();
if($counter['counter']>0)
{
$ajax['status']=false;
$ajax['system_message']='এটিকে আপনি ডিলিট করতে পারবেন না';
$this->json_return($ajax);
}
$this->db->trans_start();
$data=array();
$data['status']=$this->config->item('system_status_delete');
$data['user_updated']=$user->user_id;
$data['date_updated']=time();
Query_helper::update($this->config->item('table_rice_mill_setup_products_category'),$data,array('id='.$id));
$this->db->trans_complete();
if ($this->db->trans_status()===true)
{
$this->message=$this->lang->line('MSG_DELETED_SUCCESS');
$this->system_list();
}
else
{
$ajax['status']=false;
$ajax['desk_message']=$this->lang->line('MSG_DELETED_FAIL');
$this->json_return($ajax);
}
}
}
| brpp-bipul-roy/rm | application/controllers/Setup_products_category.php | PHP | mit | 8,982 |
package org.knowm.xchange.coinbase.dto.merchant;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.knowm.xchange.coinbase.dto.CoinbaseBaseResponse;
import org.knowm.xchange.coinbase.dto.common.CoinbaseRepeat;
import org.knowm.xchange.coinbase.dto.marketdata.CoinbaseMoney;
import org.knowm.xchange.coinbase.dto.serialization.CoinbaseCentsDeserializer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
/**
* @author jamespedwards42
*/
public class CoinbaseButton extends CoinbaseBaseResponse {
@JsonProperty("button")
private final CoinbaseButtonInfo button;
private CoinbaseButton(@JsonProperty("button") final CoinbaseButtonInfo button, @JsonProperty("success") final boolean success,
@JsonProperty("errors") final List<String> errors) {
super(success, errors);
this.button = button;
}
CoinbaseButton(CoinbaseButtonInfo button) {
super(true);
this.button = button;
}
@JsonIgnore
public CoinbaseButtonType getType() {
return button.getType();
}
@JsonIgnore
public String getName() {
return button.getName();
}
@JsonIgnore
public String getDescription() {
return button.getDescription();
}
@JsonIgnore
public String getId() {
return button.getId();
}
@JsonIgnore
public CoinbaseMoney getPrice() {
return button.getPrice();
}
@JsonIgnore
public String getPriceString() {
return button.getPriceString();
}
@JsonIgnore
public String getCurrency() {
return button.getCurrency();
}
@JsonIgnore
public String getCustom() {
return button.getCustom();
}
@JsonIgnore
public CoinbaseButtonStyle getStyle() {
return button.getStyle();
}
@JsonIgnore
public String getCode() {
return button.getCode();
}
@JsonIgnore
public String getText() {
return button.getText();
}
@JsonIgnore
public CoinbaseRepeat getRepeat() {
return button.getRepeat();
}
@JsonIgnore
public boolean isCustomSecure() {
return button.isCustomSecure();
}
@JsonIgnore
public String getCallbackUrl() {
return button.getCallbackUrl();
}
@JsonIgnore
public String getSuccessUrl() {
return button.getSuccessUrl();
}
@JsonIgnore
public String getCancelUrl() {
return button.getCancelUrl();
}
@JsonIgnore
public String getInfoUrl() {
return button.getInfoUrl();
}
@JsonIgnore
public boolean isAutoReDirect() {
return button.isAutoReDirect();
}
@JsonIgnore
public boolean isVariablePrice() {
return button.isVariablePrice();
}
@JsonIgnore
public boolean isChoosePrice() {
return button.isChoosePrice();
}
@JsonIgnore
public boolean isIncludeAddress() {
return button.isIncludeAddress();
}
@JsonIgnore
public boolean isIncludeEmail() {
return button.isIncludeEmail();
}
@JsonIgnore
public List<String> getSuggestedPrices() {
final List<String> suggestedPrices = new ArrayList<>();
suggestedPrices.add(button.price1);
suggestedPrices.add(button.price2);
suggestedPrices.add(button.price3);
suggestedPrices.add(button.price4);
suggestedPrices.add(button.price5);
return suggestedPrices;
}
@JsonIgnore
public String getPrice1() {
return button.getPrice1();
}
@JsonIgnore
public String getPrice2() {
return button.getPrice2();
}
@JsonIgnore
public String getPrice3() {
return button.getPrice3();
}
@JsonIgnore
public String getPrice4() {
return button.getPrice4();
}
@JsonIgnore
public String getPrice5() {
return button.getPrice5();
}
@Override
public String toString() {
return "CoinbaseButton [button=" + button + "]";
}
public static class CoinbaseButtonBuilder {
private final String name;
private final CoinbaseMoney price;
private CoinbaseButtonType type;
private String description;
private String custom;
private CoinbaseButtonStyle style;
private String text;
private CoinbaseRepeat repeat;
private boolean customSecure;
private String callbackUrl;
private String successUrl;
private String cancelUrl;
private String infoUrl;
private boolean autoDirect;
private boolean variablePrice;
private boolean choosePrice;
private boolean includeAddress;
private boolean includeEmail;
private String price1;
private String price2;
private String price3;
private String price4;
private String price5;
public CoinbaseButtonBuilder(String name, final String currency, final String priceString) {
this(name, new CoinbaseMoney(currency, new BigDecimal(priceString)));
}
public CoinbaseButtonBuilder(String name, final CoinbaseMoney price) {
this.name = name;
this.price = price;
}
public CoinbaseButton buildButton() {
final CoinbaseButtonInfo buttonInfo = new CoinbaseButtonInfo(name, price, type, description, null, custom, style, null, text, repeat,
customSecure, callbackUrl, successUrl, cancelUrl, infoUrl, autoDirect, variablePrice, choosePrice, includeAddress, includeEmail, price1,
price2, price3, price4, price5);
return new CoinbaseButton(buttonInfo);
}
public String getName() {
return name;
}
public CoinbaseMoney getPrice() {
return price;
}
public String getPriceString() {
return price.getAmount().toPlainString();
}
public String getCurrency() {
return price.getCurrency();
}
public CoinbaseButtonType getType() {
return type;
}
public CoinbaseButtonBuilder withType(CoinbaseButtonType type) {
this.type = type;
return this;
}
public String getDescription() {
return description;
}
public CoinbaseButtonBuilder withDescription(String description) {
this.description = description;
return this;
}
public String getCustom() {
return custom;
}
public CoinbaseButtonBuilder withCustom(String custom) {
this.custom = custom;
return this;
}
public CoinbaseButtonStyle getStyle() {
return style;
}
public CoinbaseButtonBuilder withStyle(CoinbaseButtonStyle style) {
this.style = style;
return this;
}
public String getText() {
return text;
}
public CoinbaseButtonBuilder withText(String text) {
this.text = text;
return this;
}
public CoinbaseRepeat getRepeat() {
return repeat;
}
public CoinbaseButtonBuilder withRepeat(CoinbaseRepeat repeat) {
this.repeat = repeat;
return this;
}
public boolean isCustomSecure() {
return customSecure;
}
public CoinbaseButtonBuilder withCustomSecure(boolean customSecure) {
this.customSecure = customSecure;
return this;
}
public String getCallbackUrl() {
return callbackUrl;
}
public CoinbaseButtonBuilder withCallbackUrl(String callbackUrl) {
this.callbackUrl = callbackUrl;
return this;
}
public String getSuccessUrl() {
return successUrl;
}
public CoinbaseButtonBuilder withSuccessUrl(String successUrl) {
this.successUrl = successUrl;
return this;
}
public String getCancelUrl() {
return cancelUrl;
}
public CoinbaseButtonBuilder withCancelUrl(String cancelUrl) {
this.cancelUrl = cancelUrl;
return this;
}
public String getInfoUrl() {
return infoUrl;
}
public CoinbaseButtonBuilder withInfoUrl(String infoUrl) {
this.infoUrl = infoUrl;
return this;
}
public boolean isAutoDirect() {
return autoDirect;
}
public CoinbaseButtonBuilder withAutoDirect(boolean autoDirect) {
this.autoDirect = autoDirect;
return this;
}
public boolean isVariablePrice() {
return variablePrice;
}
public CoinbaseButtonBuilder withVariablePrice(boolean variablePrice) {
this.variablePrice = variablePrice;
return this;
}
public boolean isChoosePrice() {
return choosePrice;
}
public CoinbaseButtonBuilder withChoosePrice(boolean choosePrice) {
this.choosePrice = choosePrice;
return this;
}
public boolean isIncludeAddress() {
return includeAddress;
}
public CoinbaseButtonBuilder withIncludeAddress(boolean includeAddress) {
this.includeAddress = includeAddress;
return this;
}
public boolean isIncludeEmail() {
return includeEmail;
}
public CoinbaseButtonBuilder withIncludeEmail(boolean includeEmail) {
this.includeEmail = includeEmail;
return this;
}
public String getPrice1() {
return price1;
}
public String getPrice2() {
return price2;
}
public String getPrice3() {
return price3;
}
public String getPrice4() {
return price4;
}
public String getPrice5() {
return price5;
}
private static final int MAX_SUGGESTED_PRICES = 5;
public CoinbaseButtonBuilder withSuggestedPrices(String... suggestedPrices) {
if (suggestedPrices.length > MAX_SUGGESTED_PRICES)
throw new IllegalArgumentException(
"Only " + MAX_SUGGESTED_PRICES + " suggested prices are allowed. There was an attempt to add " + suggestedPrices.length + " prices.");
switch (suggestedPrices.length) {
case 5:
this.price5 = suggestedPrices[4];
case 4:
this.price4 = suggestedPrices[3];
case 3:
this.price3 = suggestedPrices[2];
case 2:
this.price2 = suggestedPrices[1];
case 1:
this.price1 = suggestedPrices[0];
}
return this;
}
}
static class CoinbaseButtonInfo {
private final String name;
private final CoinbaseMoney price;
private final CoinbaseButtonType type;
private final String description;
private final String id;
private final String custom;
private final CoinbaseButtonStyle style;
private final String code;
private final String text;
private final CoinbaseRepeat repeat;
private final boolean customSecure;
private final String callbackUrl;
private final String successUrl;
private final String cancelUrl;
private final String infoUrl;
private final boolean autoReDirect;
private final boolean variablePrice;
private final boolean choosePrice;
private final boolean includeAddress;
private final boolean includeEmail;
private final String price1;
private final String price2;
private final String price3;
private final String price4;
private final String price5;
private CoinbaseButtonInfo(@JsonProperty("name") final String name,
@JsonProperty("price") @JsonDeserialize(using = CoinbaseCentsDeserializer.class) final CoinbaseMoney price,
@JsonProperty("type") final CoinbaseButtonType type, @JsonProperty("description") final String description,
@JsonProperty("id") final String id, @JsonProperty("custom") final String custom, @JsonProperty("style") final CoinbaseButtonStyle style,
@JsonProperty("code") final String code, @JsonProperty("text") final String text, @JsonProperty("repeat") final CoinbaseRepeat repeat,
@JsonProperty("custom_secure") final boolean customSecure, @JsonProperty("callback_url") final String callbackUrl,
@JsonProperty("success_url") final String successUrl, @JsonProperty("cancel_url") final String cancelUrl,
@JsonProperty("info_url") final String infoUrl, @JsonProperty("auto_redirect") final boolean autoDirect,
@JsonProperty("variable_price") final boolean variablePrice, @JsonProperty("choose_price") final boolean choosePrice,
@JsonProperty("include_address") final boolean includeAddress, @JsonProperty("include_email") final boolean includeEmail,
@JsonProperty("price1") final String price1, @JsonProperty("price2") final String price2, @JsonProperty("price3") final String price3,
@JsonProperty("price4") final String price4, @JsonProperty("price5") final String price5) {
this.name = name;
this.price = price;
this.type = type;
this.description = description;
this.id = id;
this.custom = custom;
this.style = style;
this.code = code;
this.text = text;
this.repeat = repeat;
this.customSecure = customSecure;
this.callbackUrl = callbackUrl;
this.successUrl = successUrl;
this.cancelUrl = cancelUrl;
this.infoUrl = infoUrl;
this.autoReDirect = autoDirect;
this.variablePrice = variablePrice;
this.choosePrice = choosePrice;
this.includeAddress = includeAddress;
this.includeEmail = includeEmail;
this.price1 = price1;
this.price2 = price2;
this.price3 = price3;
this.price4 = price4;
this.price5 = price5;
}
@JsonProperty("type")
public CoinbaseButtonType getType() {
return type;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("description")
public String getDescription() {
return description;
}
@JsonIgnore
public String getId() {
return id;
}
@JsonIgnore
public CoinbaseMoney getPrice() {
return price;
}
@JsonProperty("price_string")
public String getPriceString() {
return price.getAmount().toPlainString();
}
@JsonProperty("price_currency_iso")
public String getCurrency() {
return price.getCurrency();
}
@JsonProperty("custom")
public String getCustom() {
return custom;
}
@JsonProperty("style")
public CoinbaseButtonStyle getStyle() {
return style;
}
@JsonIgnore
public String getCode() {
return code;
}
@JsonProperty("text")
public String getText() {
return text;
}
@JsonProperty("repeat")
public CoinbaseRepeat getRepeat() {
return repeat;
}
@JsonProperty("custom_secure")
public boolean isCustomSecure() {
return customSecure;
}
@JsonProperty("callback_url")
public String getCallbackUrl() {
return callbackUrl;
}
@JsonProperty("success_url")
public String getSuccessUrl() {
return successUrl;
}
@JsonProperty("cancel_url")
public String getCancelUrl() {
return cancelUrl;
}
@JsonProperty("info_url")
public String getInfoUrl() {
return infoUrl;
}
@JsonProperty("auto_direct")
public boolean isAutoReDirect() {
return autoReDirect;
}
@JsonProperty("variable_price")
public boolean isVariablePrice() {
return variablePrice;
}
@JsonProperty("choose_price")
public boolean isChoosePrice() {
return choosePrice;
}
@JsonProperty("include_address")
public boolean isIncludeAddress() {
return includeAddress;
}
@JsonProperty("include_email")
public boolean isIncludeEmail() {
return includeEmail;
}
@JsonProperty("price1")
public String getPrice1() {
return price1;
}
@JsonProperty("price2")
public String getPrice2() {
return price2;
}
@JsonProperty("price3")
public String getPrice3() {
return price3;
}
@JsonProperty("price4")
public String getPrice4() {
return price4;
}
@JsonProperty("price5")
public String getPrice5() {
return price5;
}
@Override
public String toString() {
return "CoinbaseButtonInfo [name=" + name + ", price=" + price + ", type=" + type + ", description=" + description + ", id=" + id + ", custom="
+ custom + ", style=" + style + ", code=" + code + ", text=" + text + ", repeat=" + repeat + ", customSecure=" + customSecure
+ ", callbackUrl=" + callbackUrl + ", successUrl=" + successUrl + ", cancelUrl=" + cancelUrl + ", infoUrl=" + infoUrl + ", autoDirect="
+ autoReDirect + ", variablePrice=" + variablePrice + ", choosePrice=" + choosePrice + ", includeAddress=" + includeAddress
+ ", includeEmail=" + includeEmail + ", price1=" + price1 + ", price2=" + price2 + ", price3=" + price3 + ", price4=" + price4 + ", price5="
+ price5 + "]";
}
}
}
| gaborkolozsy/XChange | xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/dto/merchant/CoinbaseButton.java | Java | mit | 16,522 |
<!DOCTYPE html>
<html>
<head>
<title> Abhi's Blog</title>
<meta charset="UTF-8">
<link href='https://fonts.googleapis.com/css?family=Lato:400,300,700,900' rel='stylesheet' type='text/css'>
<link href="../styles/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Header -->
<header class="mainHeader">
<div class="header-div">
<a href="../index.html"><img class="head-shot"></img></a>
<div class="header-text">
<p class="title">EDA First Week Impressions</p>
</div>
</div>
</header>
<!-- Table with post links -->
<div class="content">
<p class="question">Introduction:</p>
<p>Serendipity is 'luck that takes the form of finding valuable or pleasant things that are not looked for'. I believe that when someone desires something with utmost sincerity and authenticity they have the power to turn it into a reality and things just start manifesting in front of them and it might get defined as luck. I have been wanting to learn web development for a very long time, and I found out about Enspiral Dev Academy on Friday the 11th of March and the first batch in Auckland started on the 14th of March! Not just that I am on my Sabbatical till the 18th of July and the boot camp finishes on the 15th of July.</p>
<p>I writing this reflection in a state of extreme excitement and exhilaration. It almost feels like this is my call to adventure and I am supported by incredible mentors and a group of passionate learners. The thing that excites me the most is that these mentors are also passionate about making this world a better place for everyone using their super power - Programming.</p>
<p class="question">Whats your take on the DBC / EDA experience ?</p>
<p>It has been a challenging and very rewarding start. I still can't believe that I already feel comfortable with Github and terminal after just one week!</p>
<p class="question">What are your impressions ?</p>
<p>I am thrilled to learn after my first week that staff at EDA are equally focussed on ethics, empathy and programming. This environment already feels like home to me.</p>
<p class="question">How do you see yourself engaging with this type of culture ?</p>
<p>The culture that EDA has created is heavily focussed on the collective consciousness,co-creation and experimentation and I live by these philosophies every day. I already feel very supported by other learners in our cohort. I will try to contribute as much as I can to this experience.</p>
<p class="question">Have your expectations of EDA changed ? If so, how ?</p>
<p>Yes, my expectations have definitely changed. I believe that I will be able to achieve way more than what I anticipated before joining this course. There is a great sense of community within our cohort and the school in general. Everybody is at an arms reach to help you out when you need it.</p>
<p class="question">Are you excited to participate in this kind of learning environment ? Does it make you nervous ?</p>
<p>I am super excited to participate in this kind of learning environment. Yes, I was a bit nervous at the beginning but now that I know the support we have. I am only excited.</p>
</div>
</body>
</html> | abhi-kala/abhi-kala.github.io | v_1/blog/c1-reflection-blog.html | HTML | mit | 3,375 |
//
// detail/null_event.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_DETAIL_NULL_EVENT_HPP
#define BOOST_ASIO_DETAIL_NULL_EVENT_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
namespace detail {
class null_event
: private noncopyable
{
public:
// Constructor.
null_event()
{
}
// Destructor.
~null_event()
{
}
// Signal the event. (Retained for backward compatibility.)
template <typename Lock>
void signal(Lock&)
{
}
// Signal all waiters.
template <typename Lock>
void signal_all(Lock&)
{
}
// Unlock the mutex and signal one waiter.
template <typename Lock>
void unlock_and_signal_one(Lock&)
{
}
// If there's a waiter, unlock the mutex and signal it.
template <typename Lock>
bool maybe_unlock_and_signal_one(Lock&)
{
return false;
}
// Reset the event.
template <typename Lock>
void clear(Lock&)
{
}
// Wait for the event to become signalled.
template <typename Lock>
void wait(Lock&)
{
do_wait();
}
// Timed wait for the event to become signalled.
template <typename Lock>
bool wait_for_usec(Lock&, long usec)
{
do_wait_for_usec(usec);
return true;
}
private:
BOOST_ASIO_DECL static void do_wait();
BOOST_ASIO_DECL static void do_wait_for_usec(long usec);
};
} // namespace detail
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#if defined(BOOST_ASIO_HEADER_ONLY)
# include <boost/asio/detail/impl/null_event.ipp>
#endif // defined(BOOST_ASIO_HEADER_ONLY)
#endif // BOOST_ASIO_DETAIL_NULL_EVENT_HPP
| SingularInversions/FaceGenBaseLibrary | source/LibTpBoost/boost_1_67_0/boost/asio/detail/null_event.hpp | C++ | mit | 2,147 |
<ul class="list-unstyled list-group side-nav">
<li class="list-group-item" ng-class="{'active': $state.is('app.public.blog.post')}" ui-sref-active="active"><a ui-sref="app.public.blog.list">Blog</a></li>
<li class="list-group-item" ui-sref-active="active"><a ui-sref="app.public.music.list">Music</a></li>
<li class="list-group-item" ui-sref-active="active"><a ui-sref="app.public.travel">Travel</a></li>
</ul> | edstevo/EdStphnsn-FrontEnd- | lib/templates/public/components/navbar.tpl.html | HTML | mit | 413 |
---
layout: post
cover: 'assets/images/pipelines.jpg'
title: Jenkins 2.0 - Pipelines with NodeJS
date: 2017-02-03 05:00:00
tags: technologies
subclass: 'post tag-content tag-technologies'
categories: 'jt'
navigation: True
logo: 'assets/images/logo.png'
---
## Future of Jenkins: The Jenkinsfile
The future of Jenkins and CI/CD is having "Pipelines" as code. Delivery pipelines are thought of as a first-class entity in Jenkins 2.0. Just like your typical `.yml` configuration file from Travis, Circle or other popular CI tools - Jenkins 2.0 has been released with a similar concept. Jenkins has the capability with a Pipeline plugin to use Pipelines as code in `Jenkinsfile`s. Users can now model their software delivery pipelines much easier. Another key feature is that the `Jenkinsfile` can be checked into version control.
## Creating A Pipeline For NodeJS Application
### Prerequisites**
* Setup Jenkins with AWS plugin for build agents
* Configure Github plugin to receive PUSH webhooks from git hosted repository
* Configure NodeJS plugin to install selected NodeJS versions for each Jenkins build
** future tutorial for configurations
### NodeJS Application
When building a modern web application many people are moving towards NodeJS and the community around NodeJS to power the future of technologies. One practice I definitely advocate especially in JavaScript, because of it's dynamic typing system, is TDD so you have clarity on how your application "should" run and perform. I am a big advocate for testing with [Jest](https://github.com/facebook/jest) but there are also test libraries like Mocha, Chai, PhantomJS, and others to accomplish TDD.
### Sample Application
I have a small [express.js](https://github.com/expressjs/express) server application that we will use to walk through this pipeline tutorial.**
Note: this application really is only to proof tests and run a "Hello World" express application.
** Github repository: [here](https://github.com/jtaylor32/jenkins-pipeline-express)
### Application Is Ready
After our application is ready to push to Testing, Staging, Production, etc. we need to have a simple way for Jenkins to orchestrate our workflow. Jenkinsfiles can easily get us up and running with pipelines. We start with a specific **node**, or server, in our pipeline to fire off our build process on that machine. Because we are using AWS EC2s -- we can make our node's labels specific to a build agent inside of our Manage Jenkins > Configure System.
Here we have a build agent up called 'testing' that will run the first process in our pipeline.
#### Testing Node
1. use our NodeJS plugin to install version 7.4.0
2. checkout code from version control
3. install dependencies for running tests
4. run tests on testing environment
5. publish our results inside of our Jenkins job's build page
~~~
node('testing') {
stage('Initialize') {
echo 'Initializing...'
def node = tool name: 'Node-7.4.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${node}/bin:${env.PATH}"
}
stage('Checkout') {
echo 'Getting source code...'
checkout scm
}
stage('Build') {
echo 'Building dependencies...'
sh 'npm i'
}
stage('Test') {
echo 'Testing...'
sh 'npm test'
}
stage('Publish') {
echo 'Publishing Test Coverage...'
publishHTML (target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'coverage/lcov-report',
reportFiles: 'index.html',
reportName: "Application Test Coverage"
])
}
}
~~~
{: .language-groovy}
If anything inside of our 'testing' node fails it will not move on to the next 'staging' node. So if our `npm test` fails it will publish that and Jenkins will see that tests failed do not move this application to staging.
We can also add in manual approvals inside of our pipelines with the `input` function.
`input 'Is the application ready for Staging?'`
We won't add that inside of here but there are really awesome things that pipelines can do for us you can check out later on... Onto Staging!
#### Staging Node
1. use our NodeJS plugin to install version 7.4.0
2. checkout code from version control
3. install PM2 globally
4. install dependencies
5. run tests on staging environment
6. stop and start our application with PM2
~~~
node('staging') {
stage('Initialize'){
echo 'Initializing...'
def node = tool name: 'Node-7.4.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${node}/bin:${env.PATH}"
sh "node -v"
// set environment variables
env.VARIABLE_1="10"
env.VARIABLE_2="7"
}
stage('Checkout') {
echo 'Getting source code...'
checkout scm
}
stage('PM2 Install') {
echo 'Installing PM2 to run application as daemon...'
sh "npm install pm2 -g"
}
stage('Build') {
echo 'Building dependencies...'
sh 'npm i'
}
stage('Test') {
echo 'Testing...'
sh 'npm test'
}
stage('Run Application') {
echo 'Stopping old process to run new process...'
sh '''
# show our env variables
env
npm run pm2-stop
npm run pm2-start
'''
}
}
~~~
{: .language-groovy}
#### Environment Variables
If you noticed inside of the staging node I set `env` variables specific to that node so that I can run my Express application with those configurations and not have to worry about hard coding that into my code.
Here is a snippet from my express application that we can reference those environment variables. This is key when dealing with multiple environments and application settings for production applications -- write our code once kind of thing.
~~~
const envOne = process.env.VARIABLE_1;
const envTwo = process.env.VARIABLE_2;
~~~
{: .language-JavaScript}
### Wrapping Up
You can do advanced features in pipeline builds to stash, archive, spin up or tear down servers, and many more -- but this should be a simple way to show how we can do it with a basic starter application. I will put out another article on how to integrate AWS, NodeJS, Github and other useful plugins so that we can production ready for CI/CD with Jenkins.
| jtaylor32/site | _posts/2017-02-03-Jenkins-2.0-Pipeline-NodeJS.md | Markdown | mit | 6,327 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.