answer
stringlengths 15
1.25M
|
|---|
package com.inubit.research.textToProcess.textModel;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Rectangle2D;
import net.frapu.code.visualization.ProcessNode;
import net.frapu.code.visualization.ProcessUtils;
import net.frapu.code.visualization.ProcessUtils.Orientation;
/**
* @author ff
*
*/
public class WordNode extends ProcessNode {
public static final Color HIGHLIGHT_COLOR = new Color(255,255,224);
private static final int PADDING = 3; //pixels
public WordNode(String word) {
setText(word.replaceAll("\\/", "/"));
setBackground(Color.WHITE);
}
public WordNode() {
// TODO Auto-generated constructor stub
}
@Override
protected Shape getOutlineShape() {
Rectangle2D outline = new Rectangle2D.Float(getPos().x - (getSize().width / 2),
getPos().y - (getSize().height / 2), getSize().width, getSize().height);
return outline;
}
@Override
protected void paintInternal(Graphics g) {
Graphics2D _g = (Graphics2D) g;
Shape _s = getOutlineShape();
if(isSelected()) {
_g.setColor(WordNode.HIGHLIGHT_COLOR);
}else {
_g.setColor(getBackground());
_g.setStroke(ProcessUtils.defaultStroke);
}
_g.fill(_s);
_g.setColor(Color.LIGHT_GRAY);
_g.draw(_s);
_g.setColor(Color.BLACK);
if(getText() == null) {
ProcessUtils.drawText(_g, getPos().x, getPos().y, getSize().width, "Word", Orientation.CENTER);
}else {
ProcessUtils.drawText(_g, getPos().x, getPos().y, getSize().width, getText(), Orientation.CENTER);
}
}
@Override
public void setSize(int w, int h) {
return;
}
@Override
public void setPos(int x, int y) {
return;
}
/**
* @return
*/
public String getWord() {
return getText();
}
/**
* @param stringBounds
*/
public void setBounds(Rectangle2D b) {
super.setSize((int)b.getWidth() + 2* PADDING, (int)b.getHeight() + 2* PADDING);
}
/**
* @param _wx
* @param y
*/
public void setLocation(int x, int y) {
super.setPos(x,y);
}
@Override
public String toString() {
return "WordNode ("+getText()+")";
}
}
|
<?php
/*
* $result->groups
* $result->auditories
* $result->lectors
* $result->calendars
*/
?>
<h1>Додати календар</h1>
<div class="uk-margin">
<div class="uk-form">
<?php
if(mysqli_num_rows($result->groups) > 0){
echo '<select>';
while($row = mysqli_fetch_assoc($result->groups)) {
echo '<option value="'.$row->id.'">'.$row->name.'</option>';
}
echo '</select>';
}
?>
<?php
if(mysqli_num_rows($result->auditories) > 0){
echo '<select>';
while($row = mysqli_fetch_assoc($result->auditories)) {
echo '<option value="'.$row->id.'">'.$row->name.'</option>';
}
echo '</select>';
}
?>
<?php
if(mysqli_num_rows($result->lectors) > 0){
echo '<select>';
while($row = mysqli_fetch_assoc($result->lectors)) {
echo '<option value="'.$row->id.'">'.$row->name.'</option>';
}
echo '</select>';
}
?>
</div>
</div>
|
<?php
/*
Scripts and styles options
*/
/**
* Renders the Scripts and styles options section.
*/
function <API key>(){
echo "<p>" . __('You are not forced to use everything that the theme includes. If you are not going to use a feature (because you don\'t like it or because you prefer a different solution, just uncheck it. You will save some kb to load.','electric') . "</p>" ;
echo "<p>" . __('If you use these styles/scripts they will be loaded individually. If you want to boost performance, you can combine them into a single file using a plugin (W3 Total Cache is suggested, but you can use any option or do it manually)','electric') . "</p>" ;
}
/**
* Renders the Icon Fonts checkbox setting field.
*/
function <API key>() {
$options = <API key>();
?>
<label for="use-icon-fonts" class="description">
<input type="checkbox" name="<API key>[use_icon_fonts]" id="use-icon-fonts" <?php checked('on', $options['use_icon_fonts']); ?> />
<?php _e('Check this if you want to use the icon font.', 'electric'); ?>
</label>
<p class="description"><?php _e('You can customize the icons uploading the file electric/fonts/fonts/electric.dev.svg to <a href="http://icomoon.io">icomoon.io</a>.', 'electric'); ?></p>
<?php
}
/**
* Renders the Google Fonts checkbox setting field.
*/
function <API key>() {
$options = <API key>();
?>
<label for="use-google-fonts" class="description">
<input type="checkbox" name="<API key>[use_google_fonts]" id="use-google-fonts" <?php checked('on', $options['use_google_fonts']); ?> />
<?php _e('Check this if you want to use fonts from Google Web Fonts', 'electric'); ?>
</label>
<p class="description"><?php _e('Allows you to use fonts from <a href="http:
<?php
}
/**
* Renders the Google Fonts Family input setting field.
*/
function <API key>() {
$options = <API key>();
?>
<input type="text" name="<API key>[google_fonts_choice]" id="google-fonts-choice" value="<?php echo esc_attr($options['google_fonts_choice']); ?>" />
<label class="description" for="google-fonts-choice"><?php _e('Your font family choice', 'electric'); ?></label>
<p class="description"><?php _e('If you want to use a different set than the default (Comfortaa + Open Sans):', 'electric') ?></p>
<ol class="description">
<li><?php _e('Choose the font(s) you like and click "Use"', 'electric') ?></li>
<li><?php _e('Choose the style(s) you want and character set(s) at point 1 and 2', 'electric') ?></li>
<li><?php _e('Copy the code at the "Standard" tab at point 3 ', 'electric') ?></li>
</ol>
<?php
}
/**
* Renders the tooltip checkbox setting field.
*/
function <API key>() {
$options = <API key>();
?>
<label for="use-tooltip-js" class="description">
<input type="checkbox" name="<API key>[use_tooltip_js]" id="use-tooltip-js" <?php checked('on', $options['use_tooltip_js']); ?> />
<?php _e('Uncheck this if you don\'t want to load the Tooltip script', 'electric'); ?>
</label>
<p class="description"><?php _e('This script is used to display a tooltip in the menus and in the availability widget.
If you don\'t want them, don\'t include the plugin and save some kb', 'electric') ?></p>
<p class="description"><?php _e('More info about this tooltip <a href="http://jquerytools.org/demos/tooltip/index.html">here</a>', 'electric') ?></p>
<?php
}
|
#ifndef __PROCESSOR_H__
#define __PROCESSOR_H__
#include <gctypes.h>
#include "asm.h"
#define __stringify(rn)
#define ATTRIBUTE_ALIGN(v) __attribute__((aligned(v)))
// courtesy of Marcan
#define STACK_ALIGN(type, name, cnt, alignment) u8 _al__##name[((sizeof(type)*(cnt)) + (alignment) + (((sizeof(type)*(cnt))%(alignment)) > 0 ? ((alignment) - ((sizeof(type)*(cnt))%(alignment))) : 0))]; \
type *name = (type*)(((u32)(_al__##name)) + ((alignment) - (((u32)(_al__##name))&((alignment)-1))))
#define _sync() asm volatile("sync")
#define _nop() asm volatile("nop")
#define ppcsync() asm volatile("sc")
#define ppchalt() ({ \
asm volatile("sync"); \
while(1) { \
asm volatile("nop"); \
asm volatile("li 3,0"); \
asm volatile("nop"); \
} \
})
#define mfpvr() ({register u32 _rval; \
asm volatile("mfpvr %0" : "=r"(_rval)); _rval;})
#define mfdcr(_rn) ({register u32 _rval; \
asm volatile("mfdcr %0," __stringify(_rn) \
: "=r" (_rval)); _rval;})
#define mtdcr(rn, val) asm volatile("mtdcr " __stringify(rn) ",%0" : : "r" (val))
#define mfmsr() ({register u32 _rval; \
asm volatile("mfmsr %0" : "=r" (_rval)); _rval;})
#define mtmsr(val) asm volatile("mtmsr %0" : : "r" (val))
#define mfdec() ({register u32 _rval; \
asm volatile("mfdec %0" : "=r" (_rval)); _rval;})
#define mtdec(_val) asm volatile("mtdec %0" : : "r" (_val))
#define mfspr(_rn) \
({ register u32 _rval = 0; \
asm volatile("mfspr %0," __stringify(_rn) \
: "=r" (_rval));\
_rval; \
})
#define mtspr(_rn, _val) asm volatile("mtspr " __stringify(_rn) ",%0" : : "r" (_val))
#define mfwpar() mfspr(WPAR)
#define mtwpar(_val) mtspr(WPAR,_val)
#define mfmmcr0() mfspr(MMCR0)
#define mtmmcr0(_val) mtspr(MMCR0,_val)
#define mfmmcr1() mfspr(MMCR1)
#define mtmmcr1(_val) mtspr(MMCR1,_val)
#define mfpmc1() mfspr(PMC1)
#define mtpmc1(_val) mtspr(PMC1,_val)
#define mfpmc2() mfspr(PMC2)
#define mtpmc2(_val) mtspr(PMC2,_val)
#define mfpmc3() mfspr(PMC3)
#define mtpmc3(_val) mtspr(PMC3,_val)
#define mfpmc4() mfspr(PMC4)
#define mtpmc4(_val) mtspr(PMC4,_val)
#define mfhid0() mfspr(HID0)
#define mthid0(_val) mtspr(HID0,_val)
#define mfhid1() mfspr(HID1)
#define mthid1(_val) mtspr(HID1,_val)
#define mfhid2() mfspr(HID2)
#define mthid2(_val) mtspr(HID2,_val)
#define mfhid4() mfspr(HID4)
#define mthid4(_val) mtspr(HID4,_val)
#define __lhbrx(base,index) \
({ register u16 res; \
__asm__ volatile ("lhbrx %0,%1,%2" : "=r"(res) : "b%"(index), "r"(base) : "memory"); \
res; })
#define __lwbrx(base,index) \
({ register u32 res; \
__asm__ volatile ("lwbrx %0,%1,%2" : "=r"(res) : "b%"(index), "r"(base) : "memory"); \
res; })
#define __sthbrx(base,index,value) \
__asm__ volatile ("sthbrx %0,%1,%2" : : "r"(value), "b%"(index), "r"(base) : "memory")
#define __stwbrx(base,index,value) \
__asm__ volatile ("stwbrx %0,%1,%2" : : "r"(value), "b%"(index), "r"(base) : "memory")
#define cntlzw(_val) ({register u32 _rval; \
asm volatile("cntlzw %0, %1" : "=r"((_rval)) : "r"((_val))); _rval;})
#define _CPU_MSR_GET( _msr_value ) \
do { \
_msr_value = 0; \
asm volatile ("mfmsr %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); \
} while (0)
#define _CPU_MSR_SET( _msr_value ) \
{ asm volatile ("mtmsr %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); }
#define _CPU_ISR_Enable() \
{ register u32 _val = 0; \
__asm__ __volatile__ ( \
"mfmsr %0\n" \
"ori %0,%0,0x8000\n" \
"mtmsr %0" \
: "=&r" ((_val)) : "0" ((_val)) \
); \
}
#define _CPU_ISR_Disable( _isr_cookie ) \
{ register u32 _disable_mask = 0; \
_isr_cookie = 0; \
__asm__ __volatile__ ( \
"mfmsr %0\n" \
"rlwinm %1,%0,0,17,15\n" \
"mtmsr %1\n" \
"extrwi %0,%0,1,16" \
: "=&r" ((_isr_cookie)), "=&r" ((_disable_mask)) \
: "0" ((_isr_cookie)), "1" ((_disable_mask)) \
); \
}
#define _CPU_ISR_Restore( _isr_cookie ) \
{ register u32 _enable_mask = 0; \
__asm__ __volatile__ ( \
" cmpwi %0,0\n" \
" beq 1f\n" \
" mfmsr %1\n" \
" ori %1,%1,0x8000\n" \
" mtmsr %1\n" \
"1:" \
: "=r"((_isr_cookie)),"=&r" ((_enable_mask)) \
: "0"((_isr_cookie)),"1" ((_enable_mask)) \
); \
}
#define _CPU_ISR_Flash( _isr_cookie ) \
{ register u32 _flash_mask = 0; \
__asm__ __volatile__ ( \
" cmpwi %0,0\n" \
" beq 1f\n" \
" mfmsr %1\n" \
" ori %1,%1,0x8000\n" \
" mtmsr %1\n" \
" rlwinm %1,%1,0,17,15\n" \
" mtmsr %1\n" \
"1:" \
: "=r" ((_isr_cookie)), "=&r" ((_flash_mask)) \
: "0" ((_isr_cookie)), "1" ((_flash_mask)) \
); \
}
#define _CPU_FPR_Enable() \
{ register u32 _val = 0; \
asm volatile ("mfmsr %0; ori %0,%0,0x2000; mtmsr %0" : \
"=&r" (_val) : "0" (_val));\
}
#define _CPU_FPR_Disable() \
{ register u32 _val = 0; \
asm volatile ("mfmsr %0; rlwinm %0,%0,0,19,17; mtmsr %0" : \
"=&r" (_val) : "0" (_val));\
}
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
static inline u16 bswap16(u16 val)
{
u16 tmp = val;
return __lhbrx(&tmp,0);
}
static inline u32 bswap32(u32 val)
{
u32 tmp = val;
return __lwbrx(&tmp,0);
}
static inline u64 bswap64(u64 val)
{
union ullc {
u64 ull;
u32 ul[2];
} outv;
u64 tmp = val;
outv.ul[0] = __lwbrx(&tmp,4);
outv.ul[1] = __lwbrx(&tmp,0);
return outv.ull;
}
// Basic I/O
static inline u32 read32(u32 addr)
{
u32 x;
asm volatile("lwz %0,0(%1) ; sync" : "=r"(x) : "b"(0xc0000000 | addr));
return x;
}
static inline void write32(u32 addr, u32 x)
{
asm("stw %0,0(%1) ; eieio" : : "r"(x), "b"(0xc0000000 | addr));
}
static inline void mask32(u32 addr, u32 clear, u32 set)
{
write32(addr, (read32(addr)&(~clear)) | set);
}
static inline u16 read16(u32 addr)
{
u16 x;
asm volatile("lhz %0,0(%1) ; sync" : "=r"(x) : "b"(0xc0000000 | addr));
return x;
}
static inline void write16(u32 addr, u16 x)
{
asm("sth %0,0(%1) ; eieio" : : "r"(x), "b"(0xc0000000 | addr));
}
static inline u8 read8(u32 addr)
{
u8 x;
asm volatile("lbz %0,0(%1) ; sync" : "=r"(x) : "b"(0xc0000000 | addr));
return x;
}
static inline void write8(u32 addr, u8 x)
{
asm("stb %0,0(%1) ; eieio" : : "r"(x), "b"(0xc0000000 | addr));
}
static inline void writef32(u32 addr, f32 x)
{
asm("stfs %0,0(%1) ; eieio" : : "f"(x), "b"(0xc0000000 | addr));
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
|
'use strict';
angular.module('ldrWebApp')
/**
* @name pageSkipper
* @param config
* @param pages
* @type element
* @description Skip to page directive
* @requires $scope
*/
.directive('pageSkipper', function () {
return {
restrict: 'E',
templateUrl: 'components/page-skipper/page-skipper.template.html',
scope: {'config': '=', 'pages': '='},
controller: function ($scope) {
/**
* @name pageSkipper#generateArray
* @param {Number} start
* @param {Number} end
* @description generate an array in form {start} to {end}
* @returns {Array}
*/
function generateArray(start, end) {
var list = [];
for (var i = start; i <= end; i++) {
list.push(i);
}
return list;
}
/**
* @name pageSkipper#skipToPage
* @param {Number} item
* @description get the desired page
* @return {Undefined}
*/
$scope.skipToPage = function (item) {
$scope.config.page = (item === undefined) ? 1 : item;
};
$scope.selectedPage = 1;
$scope.pagesList = generateArray(1, $scope.pages);
}
};
});
|
odoo.define('point_of_sale.DB', function (require) {
"use strict";
var core = require('web.core');
var utils = require('web.utils');
/* The PosDB holds reference to data that is either
* - static: does not change between pos reloads
* - persistent : must stay between reloads ( orders )
*/
var PosDB = core.Class.extend({
name: 'openerp_pos_db', //the prefix of the localstorage data
limit: 100, // the maximum number of results returned by a search
init: function(options){
options = options || {};
this.name = options.name || this.name;
this.limit = options.limit || this.limit;
if (options.uuid) {
this.name = this.name + '_' + options.uuid;
}
//cache the data in memory to avoid roundtrips to the localstorage
this.cache = {};
this.product_by_id = {};
this.product_by_barcode = {};
this.<API key> = {};
this.<API key> = {};
this.partner_sorted = [];
this.partner_by_id = {};
this.partner_by_barcode = {};
this.<API key> = "";
this.partner_write_date = null;
this.category_by_id = {};
this.root_category_id = 0;
this.category_products = {};
this.category_ancestors = {};
this.category_childs = {};
this.category_parent = {};
this.<API key> = {};
},
/**
* sets an uuid to prevent conflict in locally stored data between multiple PoS Configs. By
* using the uuid of the config the local storage from other configs will not get effected nor
* loaded in sessions that don't belong to them.
*
* @param {string} uuid Unique identifier of the PoS Config linked to the current session.
*/
set_uuid: function(uuid){
this.name = this.name + '_' + uuid;
},
/* returns the category object from its id. If you pass a list of id as parameters, you get
* a list of category objects.
*/
get_category_by_id: function(categ_id){
if(categ_id instanceof Array){
var list = [];
for(var i = 0, len = categ_id.length; i < len; i++){
var cat = this.category_by_id[categ_id[i]];
if(cat){
list.push(cat);
}else{
console.error("get_category_by_id: no category has id:",categ_id[i]);
}
}
return list;
}else{
return this.category_by_id[categ_id];
}
},
/* returns a list of the category's child categories ids, or an empty list
* if a category has no childs */
<API key>: function(categ_id){
return this.category_childs[categ_id] || [];
},
/* returns a list of all ancestors (parent, grand-parent, etc) categories ids
* starting from the root category to the direct parent */
<API key>: function(categ_id){
return this.category_ancestors[categ_id] || [];
},
/* returns the parent category's id of a category, or the root_category_id if no parent.
* the root category is parent of itself. */
<API key>: function(categ_id){
return this.category_parent[categ_id] || this.root_category_id;
},
/* adds categories definitions to the database. categories is a list of categories objects as
* returned by the openerp server. Categories must be inserted before the products or the
* product/ categories association may (will) not work properly */
add_categories: function(categories){
var self = this;
if(!this.category_by_id[this.root_category_id]){
this.category_by_id[this.root_category_id] = {
id : this.root_category_id,
name : 'Root',
};
}
categories.forEach(function(cat){
self.category_by_id[cat.id] = cat;
});
categories.forEach(function(cat){
var parent_id = cat.parent_id[0];
if(!(parent_id && self.category_by_id[parent_id])){
parent_id = self.root_category_id;
}
self.category_parent[cat.id] = parent_id;
if(!self.category_childs[parent_id]){
self.category_childs[parent_id] = [];
}
self.category_childs[parent_id].push(cat.id);
});
function make_ancestors(cat_id, ancestors){
self.category_ancestors[cat_id] = ancestors;
ancestors = ancestors.slice(0);
ancestors.push(cat_id);
var childs = self.category_childs[cat_id] || [];
for(var i=0, len = childs.length; i < len; i++){
make_ancestors(childs[i], ancestors);
}
}
make_ancestors(this.root_category_id, []);
},
category_contains: function(categ_id, product_id) {
var product = this.product_by_id[product_id];
if (product) {
var cid = product.pos_categ_id[0];
while (cid && cid !== categ_id){
cid = this.category_parent[cid];
}
return !!cid;
}
return false;
},
/* loads a record store from the database. returns default if nothing is found */
load: function(store,deft){
if(this.cache[store] !== undefined){
return this.cache[store];
}
var data = localStorage[this.name + '_' + store];
if(data !== undefined && data !== ""){
data = JSON.parse(data);
this.cache[store] = data;
return data;
}else{
return deft;
}
},
/* saves a record store to the database */
save: function(store,data){
localStorage[this.name + '_' + store] = JSON.stringify(data);
this.cache[store] = data;
},
<API key>: function(product){
var str = product.display_name;
if (product.barcode) {
str += '|' + product.barcode;
}
if (product.default_code) {
str += '|' + product.default_code;
}
if (product.description) {
str += '|' + product.description;
}
if (product.description_sale) {
str += '|' + product.description_sale;
}
str = product.id + ':' + str.replace(/:/g,'') + '\n';
return str;
},
add_products: function(products){
var stored_categories = this.<API key>;
if(!products instanceof Array){
products = [products];
}
for(var i = 0, len = products.length; i < len; i++){
var product = products[i];
if (product.id in this.product_by_id) continue;
if (product.available_in_pos){
var search_string = utils.unaccent(this.<API key>(product));
var categ_id = product.pos_categ_id ? product.pos_categ_id[0] : this.root_category_id;
product.product_tmpl_id = product.product_tmpl_id[0];
if(!stored_categories[categ_id]){
stored_categories[categ_id] = [];
}
stored_categories[categ_id].push(product.id);
if(this.<API key>[categ_id] === undefined){
this.<API key>[categ_id] = '';
}
this.<API key>[categ_id] += search_string;
var ancestors = this.<API key>(categ_id) || [];
for(var j = 0, jlen = ancestors.length; j < jlen; j++){
var ancestor = ancestors[j];
if(! stored_categories[ancestor]){
stored_categories[ancestor] = [];
}
stored_categories[ancestor].push(product.id);
if( this.<API key>[ancestor] === undefined){
this.<API key>[ancestor] = '';
}
this.<API key>[ancestor] += search_string;
}
}
this.product_by_id[product.id] = product;
if(product.barcode){
this.product_by_barcode[product.barcode] = product;
}
}
},
add_packagings: function(product_packagings){
var self = this;
_.map(product_packagings, function (product_packaging) {
if (_.find(self.product_by_id, {'id': product_packaging.product_id[0]})) {
self.<API key>[product_packaging.barcode] = product_packaging;
}
});
},
<API key>: function(partner){
var str = partner.name || '';
if(partner.barcode){
str += '|' + partner.barcode;
}
if(partner.address){
str += '|' + partner.address;
}
if(partner.phone){
str += '|' + partner.phone.split(' ').join('');
}
if(partner.mobile){
str += '|' + partner.mobile.split(' ').join('');
}
if(partner.email){
str += '|' + partner.email;
}
if(partner.vat){
str += '|' + partner.vat;
}
str = '' + partner.id + ':' + str.replace(':', '').replace(/\n/g, ' ') + '\n';
return str;
},
add_partners: function(partners){
var updated_count = 0;
var new_write_date = '';
var partner;
for(var i = 0, len = partners.length; i < len; i++){
partner = partners[i];
var local_partner_date = (this.partner_write_date || '').replace(/^(\d{4}-\d{2}-\d{2}) ((\d{2}:?){3})$/, '$1T$2Z');
var dist_partner_date = (partner.write_date || '').replace(/^(\d{4}-\d{2}-\d{2}) ((\d{2}:?){3})$/, '$1T$2Z');
if ( this.partner_write_date &&
this.partner_by_id[partner.id] &&
new Date(local_partner_date).getTime() + 1000 >=
new Date(dist_partner_date).getTime() ) {
// FIXME: The write_date is stored with milisec precision in the database
// but the dates we get back are only precise to the second. This means when
// you read partners modified strictly after time X, you get back partners that were
// modified X - 1 sec ago.
continue;
} else if ( new_write_date < partner.write_date ) {
new_write_date = partner.write_date;
}
if (!this.partner_by_id[partner.id]) {
this.partner_sorted.push(partner.id);
}
this.partner_by_id[partner.id] = partner;
updated_count += 1;
}
this.partner_write_date = new_write_date || this.partner_write_date;
if (updated_count) {
// If there were updates, we need to completely
// rebuild the search string and the barcode indexing
this.<API key> = "";
this.partner_by_barcode = {};
for (var id in this.partner_by_id) {
partner = this.partner_by_id[id];
if(partner.barcode){
this.partner_by_barcode[partner.barcode] = partner;
}
partner.address = (partner.street ? partner.street + ', ': '') +
(partner.zip ? partner.zip + ', ': '') +
(partner.city ? partner.city + ', ': '') +
(partner.state_id ? partner.state_id[1] + ', ': '') +
(partner.country_id ? partner.country_id[1]: '');
this.<API key> += this.<API key>(partner);
}
this.<API key> = utils.unaccent(this.<API key>);
}
return updated_count;
},
<API key>: function(){
return this.partner_write_date || "1970-01-01 00:00:00";
},
get_partner_by_id: function(id){
return this.partner_by_id[id];
},
<API key>: function(barcode){
return this.partner_by_barcode[barcode];
},
get_partners_sorted: function(max_count){
max_count = max_count ? Math.min(this.partner_sorted.length, max_count) : this.partner_sorted.length;
var partners = [];
for (var i = 0; i < max_count; i++) {
partners.push(this.partner_by_id[this.partner_sorted[i]]);
}
return partners;
},
search_partner: function(query){
try {
query = query.replace(/[\[\]\(\)\+\*\?\.\-\!\&\^\$\|\~\_\{\}\:\,\\\/]/g,'.');
query = query.replace(/ /g,'.+');
var re = RegExp("([0-9]+):.*?"+utils.unaccent(query),"gi");
}catch(e){
return [];
}
var results = [];
for(var i = 0; i < this.limit; i++){
var r = re.exec(this.<API key>);
if(r){
var id = Number(r[1]);
results.push(this.get_partner_by_id(id));
}else{
break;
}
}
return results;
},
/* removes all the data from the database. TODO : being able to selectively remove data */
clear: function(){
for(var i = 0, len = arguments.length; i < len; i++){
localStorage.removeItem(this.name + '_' + arguments[i]);
}
},
/* this internal methods returns the count of properties in an object. */
_count_props : function(obj){
var count = 0;
for(var prop in obj){
if(obj.hasOwnProperty(prop)){
count++;
}
}
return count;
},
get_product_by_id: function(id){
return this.product_by_id[id];
},
<API key>: function(barcode){
if(this.product_by_barcode[barcode]){
return this.product_by_barcode[barcode];
} else if (this.<API key>[barcode]) {
return this.product_by_id[this.<API key>[barcode].product_id[0]];
}
return undefined;
},
<API key>: function(category_id){
var product_ids = this.<API key>[category_id];
var list = [];
if (product_ids) {
for (var i = 0, len = Math.min(product_ids.length, this.limit); i < len; i++) {
const product = this.product_by_id[product_ids[i]];
if (!(product.active && product.available_in_pos)) continue;
list.push(product);
}
}
return list;
},
/* returns a list of products with :
* - a category that is or is a child of category_id,
* - a name, package or barcode containing the query (case insensitive)
*/
<API key>: function(category_id, query){
try {
query = query.replace(/[\[\]\(\)\+\*\?\.\-\!\&\^\$\|\~\_\{\}\:\,\\\/]/g,'.');
query = query.replace(/ /g,'.+');
var re = RegExp("([0-9]+):.*?"+utils.unaccent(query),"gi");
}catch(e){
return [];
}
var results = [];
for(var i = 0; i < this.limit; i++){
var r = re.exec(this.<API key>[category_id]);
if(r){
var id = Number(r[1]);
const product = this.get_product_by_id(id);
if (!(product.active && product.available_in_pos)) continue;
results.push(product);
}else{
break;
}
}
return results;
},
/* from a product id, and a list of category ids, returns
* true if the product belongs to one of the provided category
* or one of its child categories.
*/
<API key>: function(category_ids, product_id) {
if (!(category_ids instanceof Array)) {
category_ids = [category_ids];
}
var cat = this.get_product_by_id(product_id).pos_categ_id[0];
while (cat) {
for (var i = 0; i < category_ids.length; i++) {
if (cat == category_ids[i]) { // The == is important, ids may be strings
return true;
}
}
cat = this.<API key>(cat);
}
return false;
},
/* paid orders */
add_order: function(order){
var order_id = order.uid;
var orders = this.load('orders',[]);
// if the order was already stored, we overwrite its data
for(var i = 0, len = orders.length; i < len; i++){
if(orders[i].id === order_id){
orders[i].data = order;
this.save('orders',orders);
return order_id;
}
}
// Only necessary when we store a new, validated order. Orders
// that where already stored should already have been removed.
this.remove_unpaid_order(order);
orders.push({id: order_id, data: order});
this.save('orders',orders);
return order_id;
},
remove_order: function(order_id){
var orders = this.load('orders',[]);
orders = _.filter(orders, function(order){
return order.id !== order_id;
});
this.save('orders',orders);
},
remove_all_orders: function(){
this.save('orders',[]);
},
get_orders: function(){
return this.load('orders',[]);
},
get_order: function(order_id){
var orders = this.get_orders();
for(var i = 0, len = orders.length; i < len; i++){
if(orders[i].id === order_id){
return orders[i];
}
}
return undefined;
},
/* working orders */
save_unpaid_order: function(order){
var order_id = order.uid;
var orders = this.load('unpaid_orders',[]);
var serialized = order.export_as_JSON();
for (var i = 0; i < orders.length; i++) {
if (orders[i].id === order_id){
orders[i].data = serialized;
this.save('unpaid_orders',orders);
return order_id;
}
}
orders.push({id: order_id, data: serialized});
this.save('unpaid_orders',orders);
return order_id;
},
remove_unpaid_order: function(order){
var orders = this.load('unpaid_orders',[]);
orders = _.filter(orders, function(o){
return o.id !== order.uid;
});
this.save('unpaid_orders',orders);
},
<API key>: function(){
this.save('unpaid_orders',[]);
},
get_unpaid_orders: function(){
var saved = this.load('unpaid_orders',[]);
var orders = [];
for (var i = 0; i < saved.length; i++) {
orders.push(saved[i].data);
}
return orders;
},
/**
* Return the orders with requested ids if they are unpaid.
* @param {array<number>} ids order_ids.
* @return {array<object>} list of orders.
*/
<API key>: function(ids){
var saved = this.load('unpaid_orders',[]);
var orders = [];
saved.forEach(function(o) {
if (ids.includes(o.id)){
orders.push(o);
}
});
return orders;
},
/**
* Add a given order to the orders to be removed from the server.
*
* If an order is removed from a table it also has to be removed from the server to prevent it from reapearing
* after syncing. This function will add the server_id of the order to a list of orders still to be removed.
* @param {object} order object.
*/
<API key>: function(order){
if (order.server_id !== undefined) {
var to_remove = this.load('<API key>',[]);
to_remove.push(order.server_id);
this.save('<API key>', to_remove);
}
},
/**
* Get a list of server_ids of orders to be removed.
* @return {array<number>} list of server_ids.
*/
<API key>: function(){
return this.load('<API key>',[]);
},
/**
* Remove server_ids from the list of orders to be removed.
* @param {array<number>} ids
*/
<API key>: function(ids){
var to_remove = this.load('<API key>',[]);
to_remove = _.filter(to_remove, function(id){
return !ids.includes(id);
});
this.save('<API key>', to_remove);
},
set_cashier: function(cashier) {
// Always update if the user is the same as before
this.save('cashier', cashier || null);
},
get_cashier: function() {
return this.load('cashier');
}
});
return PosDB;
});
|
<div class="container">
<div class="row jumbotron indexBKGD">
<div class="col-xs-12 col-sm-10 col-sm-offset-1">
<div class="row">
<div class="col-12 col-sm-12 col-lg-12" style="text-align: center;">
<div class="panel panel-default">
<div class="panel-body">
<h2 style="text-align: center;"><strong>Nathaniel Buechler</strong></h2>
<h6 style="text-align: center;"><i>Multifaceted Specialist</i></h6>
<h6 style="text-align: center;">
<a class="btn btn-default" href="https://github.com/nbuechler"><i class="fa fa-2x fa-github"></i></a>
<a class="btn btn-default" href="https:
<a class="btn btn-default" href="mailto:natebuechler@gmail.com?Subject=Hello%20Nathaniel"><i class="fa fa-2x fa-envelope"></i></a>
<a class="btn btn-default" href="/resume/<API key>.pdf"><i class="fa fa-2x fa-file-text"></i></a>
</h6>
<hr></hr>
<h6 class="well" style="text-align: center;">
<i>Where is my attention?</i><br></br>
My talents as a Full-Stack JavaScript Engineer combined with my Python experience allow me to actively experiment with basic ML, AC, NLP, IoT, and microservices to solve real problems.
</h6>
<h6 style="text-align: center;">
I'm passionate about connecting many different themes with many "lenses" of knowledge.
If you would like to learn more about me, below you will see a few different clickable icons to spark your interest about my interests. Please, enjoy my website!
</h6>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-lg-5 mobile" style="text-align: center; padding-bottom: 5%; padding-top: 6%;">
<a href="http://nathanielbuechler.com/"><img style="height: 220px; cursor: default;" onclick="alert('You found the secret!!')" src="images/default-hex.png" alt="Nathaniel" /></a>
</div>
<div class="col-xs-12 mobile" id="roleBarMobile">
<div class="hextopshift">
<a ui-sref="artist"><img class="roleIcon-hex" src="images/web-rdy_icons/artist-hex.png" alt="artist" /></a>
<a ui-sref="painter"><img class="roleIcon-hex" src="images/web-rdy_icons/painter-hex.png" alt="painter" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="photographer"><img class="roleIcon-hex" src="images/web-rdy_icons/photographer-hex.png" alt="photographer" /></a>
</div>
<div class="hextopshift">
<a ui-sref="graphic-designer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="graphic-designer" /></a>
<a ui-sref="sound-designer"><img class="roleIcon-hex" src="images/web-rdy_icons/sound-designer-hex.png" alt="sound-designer" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="musician"><img class="roleIcon-hex" src="images/web-rdy_icons/musician-hex.png" alt="musician" /></a>
</div>
<div class="hextopshift">
<a ui-sref="journalist"><img class="roleIcon-hex" src="images/web-rdy_icons/journalist-hex.png" alt="journalist" /></a>
<a ui-sref="world-historian"><img class="roleIcon-hex" src="images/web-rdy_icons/world-historian-hex.png" alt="world historian" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="political-economist"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="political economist" /></a>
</div>
<div class="hextopshift">
<a ui-sref="social-activist"><img class="roleIcon-hex" src="images/web-rdy_icons/social-activist-hex.png" alt="social activist" /></a>
<a ui-sref="social-scientist"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="social_scientist" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="<API key>"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="comparative institutionalist"/></a>
</div>
<div class="hextopshift">
<a ui-sref="<API key>"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="<API key>" /></a>
<a ui-sref="linguist"><img class="roleIcon-hex" src="images/web-rdy_icons/linguist-hex.png" alt="linguist" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="computer-programmer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="computer_programmer" /></a>
</div>
<div class="hextopshift">
<a ui-sref="back-end-developer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="back-end developer"/></a>
<a ui-sref="front-end-developer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="front-end developer" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="natural-scientist"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="natural_scientist" /></a>
</div>
<div class="hextopshift">
<a ui-sref="engineer"><img class="roleIcon-hex" src="images/web-rdy_icons/engineer-hex.png" alt="engineer" /></a>
<a ui-sref="biologist"><img class="roleIcon-hex" src="images/web-rdy_icons/biologist-hex.png" alt="biologist" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="affective-engineer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="affective-engineer"/></a>
</div>
<div class="hextopshift">
<a ui-sref="software-engineer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="software-engineer" /></a>
<a ui-sref="botanist"><img class="roleIcon-hex" src="images/web-rdy_icons/botanist-hex.png" alt="botanist" /></a>
</div>
<!
<div class="hextopshift hexrightshift">
<a ui-sref="hardware-engineer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="hardware-engineer" /></a>
<a ui-sref="chemist"><img class="roleIcon-hex" src="images/web-rdy_icons/chemist-hex.png" alt="chemist" /></a>
</div>
</div>
<!-- Mobile above, desktop below -->
<div class="col-sm-12 col-lg-5 desktop" style="text-align: center; padding-bottom: 5%; padding-top: 6%;">
<a href="http://nathanielbuechler.com/"><img style="height: 320px; cursor: default;" onclick="alert('You found the secret!!')" src="images/default-hex.png" alt="Nathaniel" /></a>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-7 desktop" id="roleBarDesktop">
<div class="hextopshift">
<a ui-sref="artist"><img class="roleIcon-hex" src="images/web-rdy_icons/artist-hex.png" alt="artist" /></a>
<a ui-sref="painter"><img class="roleIcon-hex" src="images/web-rdy_icons/painter-hex.png" alt="painter" /></a>
<a ui-sref="photographer"><img class="roleIcon-hex" src="images/web-rdy_icons/photographer-hex.png" alt="photographer" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="graphic-designer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="graphic-designer" /></a>
<a ui-sref="sound-designer"><img class="roleIcon-hex" src="images/web-rdy_icons/sound-designer-hex.png" alt="sound-designer" /></a>
</div>
<div class="hextopshift">
<a ui-sref="musician"><img class="roleIcon-hex" src="images/web-rdy_icons/musician-hex.png" alt="musician" /></a>
<a ui-sref="journalist"><img class="roleIcon-hex" src="images/web-rdy_icons/journalist-hex.png" alt="journalist" /></a>
<a ui-sref="world-historian"><img class="roleIcon-hex" src="images/web-rdy_icons/world-historian-hex.png" alt="world historian" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="political-economist"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="political economist" /></a>
<a ui-sref="social-activist"><img class="roleIcon-hex" src="images/web-rdy_icons/social-activist-hex.png" alt="social activist" /></a>
</div>
<div class="hextopshift">
<a ui-sref="social-scientist"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="social_scientist" /></a>
<a ui-sref="<API key>"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="comparative institutionalist"/></a>
<a ui-sref="<API key>"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="<API key>" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="linguist"><img class="roleIcon-hex" src="images/web-rdy_icons/linguist-hex.png" alt="linguist" /></a>
<a ui-sref="computer-programmer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="computer_programmer" /></a>
</div>
<div class="hextopshift">
<a ui-sref="back-end-developer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="back-end developer"/></a>
<a ui-sref="front-end-developer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="front-end developer" /></a>
<a ui-sref="natural-scientist"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="natural_scientist" /></a>
</div>
<div class="hextopshift hexrightshift">
<a ui-sref="engineer"><img class="roleIcon-hex" src="images/web-rdy_icons/engineer-hex.png" alt="engineer" /></a>
<a ui-sref="biologist"><img class="roleIcon-hex" src="images/web-rdy_icons/biologist-hex.png" alt="biologist" /></a>
</div>
<div class="hextopshift">
<a ui-sref="affective-engineer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="affective-engineer"/></a>
<a ui-sref="software-engineer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="software-engineer" /></a>
<a ui-sref="botanist"><img class="roleIcon-hex" src="images/web-rdy_icons/botanist-hex.png" alt="botanist" /></a>
</div>
<!
<div class="hextopshift hexrightshift">
<a ui-sref="hardware-engineer"><img class="roleIcon-hex" src="images/web-rdy_icons/<API key>.png" alt="hardware-engineer" /></a>
<a ui-sref="chemist"><img class="roleIcon-hex" src="images/web-rdy_icons/chemist-hex.png" alt="chemist" /></a>
</div>
</div>
</div>
<br></br>
<div class="row">
<div class="col-12 col-sm-12 col-lg-12" style="text-align: center;">
<div class="panel panel-default">
<div class="panel-body">
<h2 style="text-align: center;"><strong>>30 Seconds</strong></h2>
<h6 style="text-align: center;"><i>About Me</i></h6>
<hr></hr>
<h6 style="text-align: center;">
A dream job would be working on trying to solve societal and institutional problems. For more information on that, consider reading <i><a style="color:
</h6>
<hr></hr>
<h6 style="text-align: center;">
In a technology sense, my latest intrigue is focused on the field of <i><a style="color:
</h6>
<hr></hr>
<h6 style="text-align: center;">
As for other technologies, I prefer using Flask and configuration based frameworks, but I am additionally looking into polyglot programming and polyglot persistence as it pertains to microservices. If you want more information on that, Google <i><a style="color:
</h6>
<hr></hr>
<h6 style="text-align: center;">
Lastly, I had some experience watching others program with iOS and Android, and I'm continuing to pay attention to the intersection of mobile and cloud computing. This is one area which is very nebulous to me, but I would be interested in discovering more about the 'Internet of Things' ecosystem. I've made a plan to begin experimenting with a Raspberry Pi, but haven't been able to do much with it.
</h6>
<hr></hr>
<h6>
<h5 class="well" style="text-align: center;"><strong>Still Interested?</strong> <a class="btn btn-md btn-default" href="/resume/<API key>.pdf" style="color: white; margin: 10px;">Download my Résumé</a></h5>
</h6>
</div>
</div>
</div>
</div>
</div><!--/span-->
</div><!--/row-->
</div><!--/container-->
<div class="row jumbotron mainBKGD">
<div class="container">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">Role Perspective</div>
<div class="panel-body">
<div id="roleFocus" class="well col-lg-3 col-md-12 col-sm-12" style="text-align: center; height: 420px">
<div style='margin-top: 80px'><span><img height="150" src="images/default-hex.png" alt="Nathaniel" /><br><h6 class="well">Multifaceted Specialist</h6></div>
</div>
<div class="col-lg-9 col-md-12 col-sm-12 content canvasHolderBkgd">
<div id="roleChart" style="font: white; text-align: center;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div ng-controller="homeController">
<div ui-view="artist"></div>
<div ui-view="social-scientist"></div>
<div ui-view="computer-programmer"></div>
<div ui-view="natural-scientist"></div>
<div ui-view="engineer"></div>
</div>
<div class="row jumbotron mainBKGD">
<div class="container">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">Skill Perspective</div>
<div class="panel-body">
<div id="skillFocus" class="well col-lg-3 col-md-12 col-sm-12" style="text-align: center; height: 460px">
<div style='margin-top: 80px'><span><img height="150" src="images/default-hex.png" alt="Nathaniel" /><br><h6 class="well">Multifaceted Specialist</h6></div>
</div>
<div class="col-lg-9 col-md-12 col-sm-12 content canvasHolderBkgd">
<div id="navSunBurst" style="font: white; text-align: center;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row jumbotron mainBKGD">
<div class="container">
<div class="col-xs-12">
<div class="row">
<div class="col-12 col-sm-12 col-lg-12" style="text-align: center;">
<div class="panel panel-default">
<div class="panel-body">
<h2 style="text-align: center;"><strong>Software Documentation</strong></h2>
<h6 style="text-align: center;"><i>Project Notes from Nathaniel Buechler</i></h6>
<hr></hr>
<div class="well">
<div class="row">
<h6>Maybe one day, someone else will want to use some of my code, and I want to make it easier for them. Also, I want to make it easier for myself to use as a reference in the distant future.</h6>
<h6>Over 25 repositories are show on this site, but some of the projects more documented due to their importance and complexity. My hope is that this documentation makes it easier for you to understand the projects that I have created.</h6>
</div>
</div>
<hr></hr>
<h5 class="well" style="text-align: center;">
<a href="http://nathanielbuechler.io/" class="btn btn-default">
<i class="fa fa-book fa-2x"
aria-hidden="true"
style="vertical-align: middle;"></i>
<span style="display: inline-block; vertical-align: middle;">
View the project documentation
</span>
</a>
</h5>
</div>
</div>
</div>
</div>
</div><!--/span-->
</div><!--/row-->
</div><!--/container-->
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-10 col-sm-offset-1">
<div class="row">
<div class="col-12 col-sm-12 col-lg-12" style="text-align: center;">
<div class="panel panel-default">
<div class="panel-body">
<h2 style="text-align: center;"><strong>Recap</strong></h2>
<h6 style="text-align: center;"><i>Roles of this Multifaceted Specialist</i></h6>
<hr></hr>
<div class="well">
<div class="row">
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="affective-engineer">Affective Engineer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="artist">Artist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="back-end-developer">Back-End Developer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="biologist">Biologist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="botanist">Botanist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="<API key>">Comparative Institutionalist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="computer-programmer">Computer Programmer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="<API key>">Cultural Anthropologist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="engineer">Engineer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="front-end-developer">Front-End Developer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="graphic-designer">Graphic Designer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="journalist">Journalist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="linguist">Linguist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="musician">Musician</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="natural-scientist">Natural Scientist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="painter">Painter</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="photographer">Photographer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="political-economist">Political Economist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="social-activist">Social Activist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="social-scientist">Social Scientist</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="software-engineer">Software Engineer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="sound-designer">Sound Designer</a>
<a class="col-xs-12 col-sm-12 col-md-6 col-lg-3" style="text-align: center; color: white;" ui-sref="world-historian">World Historian</a>
</div>
</div>
<hr></hr>
<h5 class="well" style="text-align: center;">
<a class="btn btn-default" href="https://github.com/nbuechler"><i class="fa fa-2x fa-github"></i></a>
<a class="btn btn-default" href="https:
<a class="btn btn-default" href="mailto:natebuechler@gmail.com?Subject=Hello%20Nathaniel"><i class="fa fa-2x fa-envelope"></i></a>
<a class="btn btn-default" href="/resume/<API key>.pdf"><i class="fa fa-2x fa-file-text"></i></a>
</h5>
</div>
</div>
</div>
</div>
</div><!--/span-->
</div><!--/row-->
</div><!--/container-->
<!--d3, application JavaScript Files
<script type="text/javascript" src="js/d3-charts/roleTimeline.js"></script>
<script type="text/javascript" src="js/d3-charts/skillBurst.js"></script>
|
.PHONY: all help build run builddocker rundocker kill rm-image rm clean enter logs
all: help
help:
@echo ""
@echo "-- Help Menu"
@echo "" This is merely a base image for usage read the README file
@echo "" 1. make run - build and run docker container
@echo "" 2. make build - build docker container
@echo "" 3. make clean - kill and remove docker container
@echo "" 4. make enter - execute an interactive bash in docker container
@echo "" 3. make logs - follow the logs of docker container
build: NAME TAG builddocker
# run a plain container
run: TZ PORT LOGDIR DATADIR rundocker
prod: run
temp: init
init: DATADIR TZ PORT config pull initdocker
auto: init next
initdocker:
$(eval TMP := $(shell mktemp -d --suffix=DOCKERTMP))
$(eval NAME := $(shell cat NAME))
$(eval PORT := $(shell cat PORT))
$(eval TAG := $(shell cat TAG))
$(eval DOMOTICZ_OPTS := $(shell cat DOMOTICZ_OPTS))
$(eval TZ := $(shell cat TZ))
chmod 777 $(TMP)
@docker run --name=$(NAME)-init \
--cidfile="cid" \
-e TZ=$(TZ) \
-e DOMOTICZ_OPTS=$(DOMOTICZ_OPTS) \
-v $(TMP):/tmp \
--device=/dev/ttyUSB0 \
--device=/dev/pts/0 \
--privileged \
--device=/dev/ttyUSB0 \
--device=/dev/pts/0 \
-d \
-p $(PORT):8080 \
-t $(TAG)
debugdocker:
$(eval TMP := $(shell mktemp -d --suffix=DOCKERTMP))
$(eval NAME := $(shell cat NAME))
$(eval PORT := $(shell cat PORT))
$(eval TAG := $(shell cat TAG))
$(eval DOMOTICZ_OPTS := $(shell cat DOMOTICZ_OPTS))
$(eval TZ := $(shell cat TZ))
chmod 777 $(TMP)
@docker run --name=$(NAME)-init \
--cidfile="cid" \
-e TZ=$(TZ) \
-e DOMOTICZ_OPTS=$(DOMOTICZ_OPTS) \
-v $(TMP):/tmp \
--privileged \
--device=/dev/ttyUSB0 \
--device=/dev/pts/0 \
-d \
-p $(PORT):8080 \
-t $(TAG) /bin/bash
rundocker:
$(eval TMP := $(shell mktemp -d --suffix=DOCKERTMP))
$(eval NAME := $(shell cat NAME))
$(eval TZ := $(shell cat TZ))
$(eval DOMOTICZ_OPTS := $(shell cat DOMOTICZ_OPTS))
$(eval DATADIR := $(shell cat DATADIR))
$(eval LOGDIR := $(shell cat LOGDIR))
$(eval PORT := $(shell cat PORT))
$(eval TAG := $(shell cat TAG))
chmod 777 $(TMP)
@docker run --name=$(NAME) \
--cidfile="cid" \
-v $(TMP):/tmp \
-e TZ=$(TZ) \
-e DOMOTICZ_OPTS=$(DOMOTICZ_OPTS) \
--privileged \
-d \
--device=/dev/ttyUSB0 \
--device=/dev/pts/0 \
-p $(PORT):8080 \
-v $(DATADIR)/config:/config \
-v $(LOGDIR)/log:/log \
-t $(TAG)
builddocker:
docker build -t `cat TAG` .
kill:
-@docker kill `cat cid`
rm-image:
-@docker rm `cat cid`
-@rm cid
rm: kill rm-image
clean: rm
enter:
docker exec -i -t `cat cid` /bin/bash
logs:
docker logs -f `cat cid`
rmall: rm
config: datadir/domoticz.db
datadir/domoticz.db:
tar jxvf domoticz.db.tz2
mkdir -p datadir
mv domoticz.db datadir/
TZ:
@while [ -z "$$TZ" ]; do \
read -r -p "Enter the timezone you wish to associate with this container [America/Denver]: " TZ; echo "$$TZ">>TZ; cat TZ; \
done ;
DOMOTICZ_OPTS:
@while [ -z "$$DOMOTICZ_OPTS" ]; do \
read -r -p "Enter the domoticz options you wish to associate with this container: " DOMOTICZ_OPTS; echo "$$DOMOTICZ_OPTS">>DOMOTICZ_OPTS; cat DOMOTICZ_OPTS; \
done ;
PORT:
@while [ -z "$$PORT" ]; do \
read -r -p "Enter the port you wish to associate with this container [PORT]: " PORT; echo "$$PORT">>PORT; cat PORT; \
done ;
LOGDIR:
@while [ -z "$$LOGDIR" ]; do \
read -r -p "Enter the datadir you wish to associate with this container (i.e. /exports/mkdomoticz) [LOGDIR]: " LOGDIR; echo "$$LOGDIR">>LOGDIR; cat LOGDIR; \
done ;
DATADIR:
@while [ -z "$$DATADIR" ]; do \
read -r -p "Enter the datadir you wish to associate with this container (i.e. /exports/mkdomoticz) [DATADIR]: " DATADIR; echo "$$DATADIR">>DATADIR; cat DATADIR; \
done ;
REGISTRY:
@while [ -z "$$REGISTRY" ]; do \
read -r -p "Enter the registry you wish to associate with this container [REGISTRY]: " REGISTRY; echo "$$REGISTRY">>REGISTRY; cat REGISTRY; \
done ;
REGISTRY_PORT:
@while [ -z "$$REGISTRY_PORT" ]; do \
read -r -p "Enter the port of the registry you wish to associate with this container, usually 5000 [REGISTRY_PORT]: " REGISTRY_PORT; echo "$$REGISTRY_PORT">>REGISTRY_PORT; cat REGISTRY_PORT; \
done ;
grab: DATADIR GRABDATADIR
GRABDATADIR:
-@mkdir -p datadir/domoticz
docker cp `cat cid`:/config - |sudo tar -C datadir/ -pxf -
push: TAG REGISTRY REGISTRY_PORT
$(eval TAG := $(shell cat TAG))
$(eval REGISTRY := $(shell cat REGISTRY))
$(eval REGISTRY_PORT := $(shell cat REGISTRY_PORT))
docker tag $(TAG) $(REGISTRY):$(REGISTRY_PORT)/$(TAG)
docker push $(REGISTRY):$(REGISTRY_PORT)/$(TAG)
pull:
docker pull `cat TAG`
next: waitforport grab clean place run
place:
$(eval DATADIR := $(shell cat DATADIR))
mkdir -p $(DATADIR)
sudo mv datadir $(DATADIR)/
echo "$(DATADIR)/datadir" > DATADIR
sync
@echo "Moved datadir to $(DATADIR)"
waitforport:
$(eval PORT := $(shell cat PORT))
@echo "Waiting for port to become available"
@while ! curl --output /dev/null --silent --head --fail http://127.0.0.1:$(PORT); do sleep 10 && echo -n .; done;
@echo "check port $(PORT), it appears that now it is up!"
|
<!DOCTYPE html
PUBLIC "-
<html xmlns="http:
<head>
<link rel="stylesheet" type="text/css" href="assets/style.css"></link>
</head>
<body>
<div class="content">
<h1><a href="page_rationale.html"><span class="mute">wi</span><span class="bright">doh</span></a></h1>
<ul class="menu">
<li><a href="list_persons.html">People</a></li>
<li><a href="list_projects.html">Projects</a></li>
<li><a href="page_rationale.html">Rationale</a></li>
<li><a href="page_index.html">About</a></li>
</ul>
<div class="page">
<div>
<h2>2008-11-17</h2>
<p>
<p><a href="project_bjax.html">BJax - javascript for managers</a></p>
<p><a href="project_geodevice.html">Geographical Tracking Device</a></p>
<p><a href="project_hillsearch.html">Paragliding Hill Gazetteer</a></p>
<p><a href="project_trainclock.html">Train Clock</a></p>
</p>
</div>
<div>
<h2>2008-11-10</h2>
<p>
<p><a href="project_foleyfeet.html">Foley Footsteps</a></p>
<p><a href="<API key>.html">One Pixel Webcam</a></p>
<p><a href="<API key>.html">Semaphore to SMS Gateway</a></p>
<p><a href="<API key>.html">Statistical Distributions of Train Delays</a></p>
</p>
</div>
</div>
<div class="menu">
<div>
<h2>Widoh Projects</h2>
<p>Whatever the technology project, the more playful the better. No business cases required.</p>
</div>
</div>
<div class="footer">
CSS copyright: © 2008, Cefn Hoile, inspired by Adam Particka's orangray.
</div>
</div>
</body>
</html>
|
// This program is free software: you can redistribute it and/or modify
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// <API key>.h
// BeSport Mobile
#import "BSLoginSegue.h"
@interface <API key> : BSLoginSegue
@end
|
var searchData=
[
['a',['a',['../structRREP.html#<API key>',1,'RREP']]],
['ack_5ftimer',['ack_timer',['../structrt__table.html#<API key>',1,'rt_table']]],
['active',['active',['../classNA__NesgLog.html#<API key>',1,'NA_NesgLog']]],
['<API key>',['<API key>',['../classNA__AODVUU.html#<API key>',1,'NA_AODVUU::<API key>()'],['../main_8c.html#<API key>',1,'<API key>(): main.c'],['../NA__nl_8c.html#<API key>',1,'<API key>(): main.c']]],
['aodvnl',['aodvnl',['../NA__nl_8c.html#<API key>',1,'NA_nl.c']]],
['aodvrttablemap',['aodvRtTableMap',['../classNA__AODVUU.html#<API key>',1,'NA_AODVUU']]],
['aodvtimermap',['aodvTimerMap',['../classNA__AODVUU.html#<API key>',1,'NA_AODVUU']]],
['attacktype',['attackType',['../classNA__Attack.html#<API key>',1,'NA_Attack']]],
['avhopcount',['avHopCount',['../<API key>.html#<API key>',1,'NA_UDPBasicBurst']]]
];
|
namespace MyNes.Core
{
class <API key>
{
private int dutyForm;
private int dutyStep;
private bool enabled = true;
private bool mode = false;
public byte output;
private byte volume;
private int freqTimer;
private int frequency;
private int cycles;
public void HardReset()
{
dutyForm = 0;
dutyStep = 0xF;
enabled = true;
mode = false;
output = 0;
}
public void Write0(ref byte data)
{
mode = (data & 0x80) == 0x80;
dutyForm = ((data & 0x70) >> 4);
volume = (byte)(data & 0xF);
}
public void Write1(ref byte data)
{
frequency = (frequency & 0x0F00) | data;
}
public void Write2(ref byte data)
{
frequency = (frequency & 0x00FF) | ((data & 0xF) << 8);
enabled = (data & 0x80) == 0x80;
}
public void ClockSingle()
{
if (--cycles <= 0)
{
cycles = (frequency << 1) + 2;
if (enabled)
{
if (mode)
output = volume;
else
{
dutyStep
if (dutyStep < 0)
dutyStep = 0xF;
if (dutyStep <= dutyForm)
output = volume;
else
output = 0;
}
}
else
output = 0;
}
}
<summary>
Save state
</summary>
<param name="stream">The stream that should be used to write data</param>
public void SaveState(System.IO.BinaryWriter stream)
{
stream.Write(dutyForm);
stream.Write(dutyStep);
stream.Write(enabled);
stream.Write(mode);
stream.Write(output);
stream.Write(volume);
stream.Write(freqTimer);
stream.Write(frequency);
stream.Write(cycles);
}
<summary>
Load state
</summary>
<param name="stream">The stream that should be used to read data</param>
public void LoadState(System.IO.BinaryReader stream)
{
dutyForm = stream.ReadInt32();
dutyStep = stream.ReadInt32();
enabled = stream.ReadBoolean();
mode = stream.ReadBoolean();
output = stream.ReadByte();
volume = stream.ReadByte();
freqTimer = stream.ReadInt32();
frequency = stream.ReadInt32();
cycles = stream.ReadInt32();
}
}
}
|
package neon.editor.ui;
import java.io.IOException;
import java.util.logging.Logger;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.Window;
import neon.common.files.NeonFileSystem;
import neon.common.resources.ResourceManager;
import neon.editor.LoadEvent;
import neon.editor.controllers.CreatureHandler;
import neon.editor.controllers.ItemHandler;
import neon.editor.controllers.MapHandler;
import neon.editor.controllers.MenuHandler;
import neon.editor.controllers.TerrainHandler;
import neon.editor.resource.CEditor;
/**
* The {@code UserInterface} takes care of most ui-related editor functionality.
*
* @author mdriesen
*
*/
public final class UserInterface {
private static final Logger logger = Logger.getGlobal();
private final CreatureHandler creatureHandler;
private final MapHandler mapHandler;
private final MenuHandler menuHandler;
private final ItemHandler itemHandler;
private final TerrainHandler terrainHandler;
private Stage stage;
private Scene scene;
/**
* Initializes the {@code UserInterface}.
*
* @param files
* @param resources
* @param bus
* @param config
*/
public UserInterface(NeonFileSystem files, ResourceManager resources, EventBus bus, CEditor config) {
// separate handlers for all the different ui elements
menuHandler = new MenuHandler(resources, bus, this);
bus.register(menuHandler);
mapHandler = new MapHandler(resources, bus, config);
bus.register(mapHandler);
creatureHandler = new CreatureHandler(resources, bus);
bus.register(creatureHandler);
itemHandler = new ItemHandler(resources, bus);
bus.register(itemHandler);
terrainHandler = new TerrainHandler(resources, bus);
bus.register(terrainHandler);
// load the user interface
FXMLLoader loader = new FXMLLoader(getClass().getResource("Editor.fxml"));
loader.<API key>(this::getController);
try {
scene = new Scene(loader.load());
scene.getStylesheets().add(getClass().getResource("editor.css").toExternalForm());
} catch (IOException e) {
logger.severe("failed to load editor ui: " + e.getMessage());
}
}
/**
* Returns the correct controller for a JavaFX node.
*
* @param type
* @return
*/
private Object getController(Class<?> type) {
if(type.equals(MenuHandler.class)) {
return menuHandler;
} else if (type.equals(MapHandler.class)) {
return mapHandler;
} else if (type.equals(CreatureHandler.class)) {
return creatureHandler;
} else if (type.equals(ItemHandler.class)) {
return itemHandler;
} else if (type.equals(TerrainHandler.class)) {
return terrainHandler;
} else {
throw new <API key>("No controller found for class " + type + "!");
}
}
/**
*
* @return the main window of the editor
*/
public Window getWindow() {
return stage;
}
/**
* Shows the main window on screen.
*
* @param stage
*/
public void start(Stage stage) {
this.stage = stage;
stage.setTitle("The Neon Roguelike Editor");
stage.setScene(scene);
stage.setWidth(1440);
stage.setMinWidth(800);
stage.setHeight(720);
stage.setMinHeight(600);
stage.show();
stage.centerOnScreen();
stage.setOnCloseRequest(event -> System.exit(0));
}
/**
* Sets the title of the main window.
*
* @param event
*/
@Subscribe
private void onModuleLoad(LoadEvent event) {
stage.setTitle("The Neon Roguelike Editor - " + event.id);
}
/**
* Checks if any resources are still opened and should be saved. This
* method should be called when saving a module or exiting the editor.
*/
public void saveResources() {
// check if any maps are still opened
mapHandler.saveMaps();
}
}
|
// This file has been generated by the GUI designer. Do not modify.
public partial class WinCryptoSec2Config
{
private global::Gtk.VBox vbox2;
private global::Gtk.Button btnDatabase;
private global::Gtk.Button btnFtp;
private global::Gtk.Button btnString;
private global::Gtk.Button btnXml;
private global::Gtk.Button btnCancel;
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
// Widget WinCryptoSec2Config
this.Name = "WinCryptoSec2Config";
this.Title = global::Mono.Unix.Catalog.GetString ("InCrtyptoSec2 Modes");
this.Icon = global::Gdk.Pixbuf.LoadFromResource ("InGtkCryptoSec2.icons.keys_16x16.png");
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
this.Modal = true;
// Internal child WinCryptoSec2Config.VBox
global::Gtk.VBox w1 = this.VBox;
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.vbox2 = new global::Gtk.VBox ();
this.vbox2.Name = "vbox2";
this.vbox2.Spacing = 10;
this.vbox2.BorderWidth = ((uint)(5));
// Container child vbox2.Gtk.Box+BoxChild
this.btnDatabase = new global::Gtk.Button ();
this.btnDatabase.TooltipMarkup = "InCryptoSec2 module for Database security.";
this.btnDatabase.CanFocus = true;
this.btnDatabase.Name = "btnDatabase";
this.btnDatabase.UseUnderline = true;
this.btnDatabase.Label = global::Mono.Unix.Catalog.GetString ("Database");
global::Gtk.Image w2 = new global::Gtk.Image ();
w2.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("InGtkCryptoSec2.icons.database1_32x32.png");
this.btnDatabase.Image = w2;
this.vbox2.Add (this.btnDatabase);
global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnDatabase]));
w3.Position = 0;
w3.Expand = false;
w3.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.btnFtp = new global::Gtk.Button ();
this.btnFtp.TooltipMarkup = "InCryptoSec2 module for FTP security.";
this.btnFtp.CanFocus = true;
this.btnFtp.Name = "btnFtp";
this.btnFtp.UseUnderline = true;
this.btnFtp.Label = global::Mono.Unix.Catalog.GetString ("FTP");
global::Gtk.Image w4 = new global::Gtk.Image ();
w4.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("InGtkCryptoSec2.icons.server_client_32x32.png");
this.btnFtp.Image = w4;
this.vbox2.Add (this.btnFtp);
global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnFtp]));
w5.Position = 1;
w5.Expand = false;
w5.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.btnString = new global::Gtk.Button ();
this.btnString.TooltipMarkup = "InCryptoSec2 module for String security.";
this.btnString.CanFocus = true;
this.btnString.Name = "btnString";
this.btnString.UseUnderline = true;
this.btnString.Label = global::Mono.Unix.Catalog.GetString ("String");
global::Gtk.Image w6 = new global::Gtk.Image ();
w6.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("InGtkCryptoSec2.icons.text_32x32.png");
this.btnString.Image = w6;
this.vbox2.Add (this.btnString);
global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnString]));
w7.Position = 2;
w7.Expand = false;
w7.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.btnXml = new global::Gtk.Button ();
this.btnXml.TooltipMarkup = "InCryptoSec2 module for XML security.";
this.btnXml.CanFocus = true;
this.btnXml.Name = "btnXml";
this.btnXml.UseUnderline = true;
this.btnXml.Label = global::Mono.Unix.Catalog.GetString ("XML");
global::Gtk.Image w8 = new global::Gtk.Image ();
w8.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("InGtkCryptoSec2.icons.text_tree_32x32.png");
this.btnXml.Image = w8;
this.vbox2.Add (this.btnXml);
global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnXml]));
w9.Position = 3;
w9.Expand = false;
w9.Fill = false;
w1.Add (this.vbox2);
global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
w10.Position = 0;
w10.Expand = false;
w10.Fill = false;
// Internal child WinCryptoSec2Config.ActionArea
global::Gtk.HButtonBox w11 = this.ActionArea;
w11.Name = "dialog1_Action";
w11.Spacing = 10;
w11.BorderWidth = ((uint)(5));
w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_Action.Gtk.ButtonBox+ButtonBoxChild
this.btnCancel = new global::Gtk.Button ();
this.btnCancel.CanDefault = true;
this.btnCancel.CanFocus = true;
this.btnCancel.Name = "btnCancel";
this.btnCancel.UseStock = true;
this.btnCancel.UseUnderline = true;
this.btnCancel.Label = "gtk-cancel";
this.AddActionWidget (this.btnCancel, -6);
global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.btnCancel]));
w12.Expand = false;
w12.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
this.DefaultWidth = 246;
this.DefaultHeight = 276;
this.Show ();
this.btnDatabase.Clicked += new global::System.EventHandler (this.btnDatabase_OnClick);
this.btnFtp.Clicked += new global::System.EventHandler (this.btnFtp_OnClick);
this.btnString.Clicked += new global::System.EventHandler (this.btnString_OnClick);
this.btnXml.Clicked += new global::System.EventHandler (this.btnXml_OnClick);
}
}
|
package net.minecraft.server;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.SpawnerSpawnEvent;
// CraftBukkit end
public abstract class MobSpawnerAbstract {
public int spawnDelay = 20;
private String mobName = "Pig";
private List mobs;
private <API key> spawnData;
public double c;
public double d;
private int minSpawnDelay = 200;
private int maxSpawnDelay = 800;
private int spawnCount = 4;
private Entity j;
private int maxNearbyEntities = 6;
private int requiredPlayerRange = 16;
private int spawnRange = 4;
public MobSpawnerAbstract() {}
public String getMobName() {
if (this.i() == null) {
if (this.mobName.equals("Minecart")) {
this.mobName = "MinecartRideable";
}
return this.mobName;
} else {
return this.i().c;
}
}
public void setMobName(String s) {
this.mobName = s;
}
public boolean f() {
return this.a().findNearbyPlayer((double) this.b() + 0.5D, (double) this.c() + 0.5D, (double) this.d() + 0.5D, (double) this.requiredPlayerRange) != null;
}
public void g() {
if (this.f()) {
double d0;
if (this.a().isStatic) {
double d1 = (double) ((float) this.b() + this.a().random.nextFloat());
double d2 = (double) ((float) this.c() + this.a().random.nextFloat());
d0 = (double) ((float) this.d() + this.a().random.nextFloat());
this.a().addParticle("smoke", d1, d2, d0, 0.0D, 0.0D, 0.0D);
this.a().addParticle("flame", d1, d2, d0, 0.0D, 0.0D, 0.0D);
if (this.spawnDelay > 0) {
--this.spawnDelay;
}
this.d = this.c;
this.c = (this.c + (double) (1000.0F / ((float) this.spawnDelay + 200.0F))) % 360.0D;
} else {
if (this.spawnDelay == -1) {
this.j();
}
if (this.spawnDelay > 0) {
--this.spawnDelay;
return;
}
boolean flag = false;
for (int i = 0; i < this.spawnCount; ++i) {
Entity entity = EntityTypes.createEntityByName(this.getMobName(), this.a());
if (entity == null) {
return;
}
int j = this.a().a(entity.getClass(), AxisAlignedBB.a((double) this.b(), (double) this.c(), (double) this.d(), (double) (this.b() + 1), (double) (this.c() + 1), (double) (this.d() + 1)).grow((double) (this.spawnRange * 2), 4.0D, (double) (this.spawnRange * 2))).size();
if (j >= this.maxNearbyEntities) {
this.j();
return;
}
d0 = (double) this.b() + (this.a().random.nextDouble() - this.a().random.nextDouble()) * (double) this.spawnRange;
double d3 = (double) (this.c() + this.a().random.nextInt(3) - 1);
double d4 = (double) this.d() + (this.a().random.nextDouble() - this.a().random.nextDouble()) * (double) this.spawnRange;
EntityInsentient entityinsentient = entity instanceof EntityInsentient ? (EntityInsentient) entity : null;
entity.setPositionRotation(d0, d3, d4, this.a().random.nextFloat() * 360.0F, 0.0F);
if (entityinsentient == null || entityinsentient.canSpawn()) {
this.a(entity);
this.a().triggerEffect(2004, this.b(), this.c(), this.d(), 0);
if (entityinsentient != null) {
entityinsentient.s();
}
flag = true;
}
}
if (flag) {
this.j();
}
}
}
}
public Entity a(Entity entity) {
if (this.i() != null) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
entity.d(nbttagcompound);
Iterator iterator = this.i().b.c().iterator();
while (iterator.hasNext()) {
String s = (String) iterator.next();
NBTBase nbtbase = this.i().b.get(s);
nbttagcompound.set(s, nbtbase.clone());
}
entity.f(nbttagcompound);
if (entity.world != null) {
// CraftBukkit start - call SpawnerSpawnEvent, abort if cancelled
SpawnerSpawnEvent event = CraftEventFactory.<API key>(entity, this.b(), this.c(), this.d());
if (!event.isCancelled()) {
entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
// Spigot Start
if ( entity.world.spigotConfig.nerfSpawnerMobs )
{
entity.fromMobSpawner = true;
}
// Spigot End
}
// CraftBukkit end
}
NBTTagCompound nbttagcompound1;
for (Entity entity1 = entity; nbttagcompound.hasKeyOfType("Riding", 10); nbttagcompound = nbttagcompound1) {
nbttagcompound1 = nbttagcompound.getCompound("Riding");
Entity entity2 = EntityTypes.createEntityByName(nbttagcompound1.getString("id"), entity.world);
if (entity2 != null) {
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
entity2.d(nbttagcompound2);
Iterator iterator1 = nbttagcompound1.c().iterator();
while (iterator1.hasNext()) {
String s1 = (String) iterator1.next();
NBTBase nbtbase1 = nbttagcompound1.get(s1);
nbttagcompound2.set(s1, nbtbase1.clone());
}
entity2.f(nbttagcompound2);
entity2.setPositionRotation(entity1.locX, entity1.locY, entity1.locZ, entity1.yaw, entity1.pitch);
// CraftBukkit start - call SpawnerSpawnEvent, skip if cancelled
SpawnerSpawnEvent event = CraftEventFactory.<API key>(entity2, this.b(), this.c(), this.d());
if (event.isCancelled()) {
continue;
}
if (entity.world != null) {
entity.world.addEntity(entity2, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
}
entity1.mount(entity2);
}
entity1 = entity2;
}
} else if (entity instanceof EntityLiving && entity.world != null) {
((EntityInsentient) entity).prepare((GroupDataEntity) null);
// Spigot start - call SpawnerSpawnEvent, abort if cancelled
SpawnerSpawnEvent event = CraftEventFactory.<API key>(entity, this.b(), this.c(), this.d());
if (!event.isCancelled()) {
this.a().addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
// Spigot Start
if ( entity.world.spigotConfig.nerfSpawnerMobs )
{
entity.fromMobSpawner = true;
}
// Spigot End
}
// Spigot end
}
return entity;
}
private void j() {
if (this.maxSpawnDelay <= this.minSpawnDelay) {
this.spawnDelay = this.minSpawnDelay;
} else {
int i = this.maxSpawnDelay - this.minSpawnDelay;
this.spawnDelay = this.minSpawnDelay + this.a().random.nextInt(i);
}
if (this.mobs != null && this.mobs.size() > 0) {
this.a((<API key>) WeightedRandom.a(this.a().random, (Collection) this.mobs));
}
this.a(1);
}
public void a(NBTTagCompound nbttagcompound) {
this.mobName = nbttagcompound.getString("EntityId");
this.spawnDelay = nbttagcompound.getShort("Delay");
if (nbttagcompound.hasKeyOfType("SpawnPotentials", 9)) {
this.mobs = new ArrayList();
NBTTagList nbttaglist = nbttagcompound.getList("SpawnPotentials", 10);
for (int i = 0; i < nbttaglist.size(); ++i) {
this.mobs.add(new <API key>(this, nbttaglist.get(i)));
}
} else {
this.mobs = null;
}
if (nbttagcompound.hasKeyOfType("SpawnData", 10)) {
this.a(new <API key>(this, nbttagcompound.getCompound("SpawnData"), this.mobName));
} else {
this.a((<API key>) null);
}
if (nbttagcompound.hasKeyOfType("MinSpawnDelay", 99)) {
this.minSpawnDelay = nbttagcompound.getShort("MinSpawnDelay");
this.maxSpawnDelay = nbttagcompound.getShort("MaxSpawnDelay");
this.spawnCount = nbttagcompound.getShort("SpawnCount");
}
if (nbttagcompound.hasKeyOfType("MaxNearbyEntities", 99)) {
this.maxNearbyEntities = nbttagcompound.getShort("MaxNearbyEntities");
this.requiredPlayerRange = nbttagcompound.getShort("RequiredPlayerRange");
}
if (nbttagcompound.hasKeyOfType("SpawnRange", 99)) {
this.spawnRange = nbttagcompound.getShort("SpawnRange");
}
if (this.a() != null && this.a().isStatic) {
this.j = null;
}
}
public void b(NBTTagCompound nbttagcompound) {
nbttagcompound.setString("EntityId", this.getMobName());
nbttagcompound.setShort("Delay", (short) this.spawnDelay);
nbttagcompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay);
nbttagcompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay);
nbttagcompound.setShort("SpawnCount", (short) this.spawnCount);
nbttagcompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities);
nbttagcompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange);
nbttagcompound.setShort("SpawnRange", (short) this.spawnRange);
if (this.i() != null) {
nbttagcompound.set("SpawnData", this.i().b.clone());
}
if (this.i() != null || this.mobs != null && this.mobs.size() > 0) {
NBTTagList nbttaglist = new NBTTagList();
if (this.mobs != null && this.mobs.size() > 0) {
Iterator iterator = this.mobs.iterator();
while (iterator.hasNext()) {
<API key> <API key> = (<API key>) iterator.next();
nbttaglist.add(<API key>.a());
}
} else {
nbttaglist.add(this.i().a());
}
nbttagcompound.set("SpawnPotentials", nbttaglist);
}
}
public boolean b(int i) {
if (i == 1 && this.a().isStatic) {
this.spawnDelay = this.minSpawnDelay;
return true;
} else {
return false;
}
}
public <API key> i() {
return this.spawnData;
}
public void a(<API key> <API key>) {
this.spawnData = <API key>;
}
public abstract void a(int i);
public abstract World a();
public abstract int b();
public abstract int c();
public abstract int d();
}
|
#ifndef <API key>
#define <API key>
#include "IOdictionary.H"
#include "typeInfo.H"
#include "<API key>.H"
#include "autoPtr.H"
#include "pairPotentialModel.H"
#include "reducedUnits.H"
namespace Foam
{
class <API key>
{
protected:
// Protected data
word name_;
dictionary <API key>;
const pairPotentialModel& pairPot_;
const reducedUnits& rU_;
// Private Member Functions
//- Disallow copy construct
<API key>(const <API key>&);
//- Disallow default bitwise assignment
void operator=(const <API key>&);
public:
//- Runtime type information
TypeName("<API key>");
// Declare run-time constructor selection table
<API key>
(
autoPtr,
<API key>,
dictionary,
(
const word& name,
const dictionary& <API key>,
const pairPotentialModel& pairPot,
const reducedUnits& rU
),
(name, <API key>, pairPot, rU)
);
// Selectors
//- Return a reference to the selected viscosity model
static autoPtr<<API key>> New
(
const word& name,
const dictionary& <API key>,
const pairPotentialModel& pairPot,
const reducedUnits& rU
);
// Constructors
//- Construct from components
<API key>
(
const word& name,
const dictionary& <API key>,
const pairPotentialModel& pairPot,
const reducedUnits& rU
);
// Destructor
virtual ~<API key>()
{}
// Member Functions
virtual void scaleEnergy(scalar& e, const scalar r) const = 0;
const dictionary& <API key>() const
{
return <API key>;
}
//- Read <API key> dictionary
virtual bool read
(
const dictionary& <API key>
) = 0;
};
} // End namespace Foam
#endif
|
#!/usr/bin/python3
rev: 5.0
author: <zhq>
features:
errors included
up to 63 bases (2 to 64)
caps recognition and same output format (deprecated)
for the function parameters, `cur` represents the current (input) base, `res` represents the result (output) base, and `num` represents the current (input) number.
def scale(cur, res, num):
# int, int, str -> str
# Default Settings
num = str(num)
iscaps = False
positive = True
# Input
if cur == res: return num
if num == "0": return "0"
assert cur in range(2, 65) and res in range(2, 65), "Base not defined."
if num[0] == "-":
positive = False
num = num[1:]
result = 0
unit = 1
if cur != 10:
for i in num[::-1]:
value = ord(i)
if value in range(48, 58): value -= 48
elif value in range(65, 92): value -= 55
elif value in range(97, 123): value -= 61
elif value == 64: value = 62
elif value == 95: value = 63
assert value <= cur, "Digit larger than original base. v:%d(%s) b:%d\nCall: scale(%d, %d, %s)" % (value, i, cur, cur, res, num)
result += value * unit
unit *= cur
result = str(result)
# Output
if res != 10:
num = int(result or num)
result = ""
while num > 0:
num, value = divmod(num, res)
if value < 10: digit = value + 48
elif value < 36: digit = value + 55
elif value < 62: digit = value + 61
elif value == 62: digit = 64
elif value == 63: digit = 95
result = chr(digit) + result
if not positive: result = "-" + result
return result
|
<?php
/**
* This is the model class for table "family_history".
*
* The followings are the available columns in table 'family_history':
* @property integer $id
* @property string $name
*/
class FamilyHistory extends <API key>
{
/**
* Returns the static model of the specified AR class.
* @return FamilyHistory the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'family_history';
}
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('patient_id, relative_id, side_id, condition_id, comments','safe'),
array('patient_id, relative_id, side_id, condition_id','required'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, name', 'safe', 'on'=>'search'),
);
}
/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'relative' => array(self::BELONGS_TO, '<API key>', 'relative_id'),
'side' => array(self::BELONGS_TO, 'FamilyHistorySide', 'side_id'),
'condition' => array(self::BELONGS_TO, '<API key>', 'condition_id'),
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'id' => 'ID',
'name' => 'Name',
);
}
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id,true);
$criteria->compare('name',$this->name,true);
return new CActiveDataProvider(get_class($this), array(
'criteria'=>$criteria,
));
}
}
|
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
// manager for the gondola spawning
public class GondolaManager : MonoBehaviour {
private static int N = 50;
private static int DELAY = 4;
private static float OFFSET = -1.8f; // the offet between the rope center and a gondola center
private int count = 0; // the count of ropes in the scene
private DateTime curr; // the current time for second counting use
public GameObject rope; // the rope object
public GameObject gondola;// the gondola object
public GameObject currentRope; // the last rope spawned
public Transform firstRope; // the first rope in the scene
private static GondolaManager instance; // the instance of the GondolaManager
public static GondolaManager Instance {
get { // an instance getter
if (instance == null) {
instance = GameObject.FindObjectOfType<GondolaManager> ();
}
return instance;
}
}
void Start () {
curr = DateTime.Now; // the time now
// initialization of ropes and gondolas
for (int i = 0; i < N; i++) {
count++;
SpawnRope ();
if (count % 3 == 0) {
SpawnGondola (currentRope.transform);
}
}
SpawnGondola (firstRope);
}
void FixedUpdate () {
DateTime now = DateTime.Now;
if ((now - curr).TotalSeconds >= DELAY) { // if the interval has passed
SpawnGondola (firstRope); // spawn fondola in the first rope
for (int i = 0; i < N / 10; i++) { // spawn N/10 ropes
SpawnRope ();
count++;
}
curr = now;
}
}
// spawns a rope object in the scene
private void SpawnRope() {
GameObject tmp = Instantiate (rope);
tmp.transform.position = currentRope.transform.GetChild (0).position;
// creates the link between the current and new rope
currentRope.GetComponent<Rope> ().next = tmp.transform;
currentRope = tmp;
currentRope.GetComponent<Rope> ().next = firstRope.transform;
}
private void SpawnGondola(Transform parent) {
GameObject gon = Instantiate (gondola);
// new location of the gondole minus the offset between its senter and location of the parent
gon.transform.localPosition = new Vector3 (0,OFFSET,0) + parent.position;
}
}
|
module <API key>
end
|
import { Component } from '@angular/core';
import { NavController, ToastController } from 'ionic-angular';
import { Http } from '@angular/http';
import { <API key> } from 'ionic-angular';
import { NotifikasiPage } from '../notifikasi/notifikasi';
import { ArtikelBacaPage } from '../artikel-baca/artikel-baca';
import { TulisArtikelPage } from '../tulis-artikel/tulis-artikel';
import { TulisDiskusiPage } from '../tulis-diskusi/tulis-diskusi';
import '../../providers/user-data';
@Component({
selector: 'page-cari',
templateUrl: 'cari.html'
})
export class CariPage {
public searchQuery = "";
public posts;
public limit = 0;
public httpErr = false;
constructor(public navCtrl: NavController, public actionSheetCtrl: <API key>, public http: Http, public toastCtrl: ToastController) {
this.getData();
}
ionViewDidLoad() {
console.log('Hello CariPage Page');
}
notif() {
this.navCtrl.push(NotifikasiPage);
}
getData() {
this.limit = 0;
this.http.get('http://cybex.ipb.ac.id/api/search.php?search='+this.searchQuery+'&limit='+this.limit).subscribe(res => {
this.posts = res.json();
console.log('dapet data');
this.httpErr = false;
}, err => {this.showAlert(err.status)});
}
getItems(searchbar){
this.getData();
}
doInfinite(infiniteScroll) {
console.log('Begin async operation');
setTimeout(() => {
this.limit = this.limit+5;
this.http.get('http://cybex.ipb.ac.id/api/search.php?search='+this.searchQuery+'&limit='+this.limit).subscribe(res => {
this.posts = this.posts.concat(res.json());
});
console.log('Async operation has ended');
infiniteScroll.complete();
}, 2000);
}
baca(idArtikel){
this.navCtrl.push(ArtikelBacaPage, idArtikel);
}
presentActionSheet() {
let actionSheet = this.actionSheetCtrl.create({
title: 'Pilihan',
buttons: [
{
text: 'Tulis Artikel',
role: 'tulisArtikel',
handler: () => {
console.log('Tulis Artikel clicked');
this.navCtrl.push(TulisArtikelPage);
}
},{
text: 'Tanya/Diskusi',
role: 'tulisDiskusi',
handler: () => {
console.log('Tulis Diskusi clicked');
this.navCtrl.push(TulisDiskusiPage);
}
},{
text: 'Batal',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actionSheet.present();
}
showAlert(status){
if(status == 0){
let toast = this.toastCtrl.create({
message: 'Tidak ada koneksi. Cek kembali sambungan Internet perangkat Anda.',
position: 'bottom',
showCloseButton: true,
closeButtonText: 'X'
});
toast.present();
}else{
let toast = this.toastCtrl.create({
message: 'Tidak dapat menyambungkan ke server. Mohon muat kembali halaman ini.',
position: 'bottom',
showCloseButton: true,
closeButtonText: 'X'
});
toast.present();
}
this.httpErr = true;
}
}
|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'events.ui'
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from collections import *
from functools import *
import os, glob
import pandas as pd
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_SamplesDialog(QtGui.QDialog):
def __init__(self, parent=None, datafolder=None):
"""
Constructor
"""
QtGui.QDialog.__init__(self, parent)
# self.filelist = filelist
self.datafolder = datafolder
# labels font
self.font_labels = QtGui.QFont("Arial", 12, QtGui.QFont.Bold)
self.font_edits = QtGui.QFont("Arial", 12)
self.font_buttons = QtGui.QFont("Arial", 10, QtGui.QFont.Bold)
self.setupUi(self)
self.exec_()
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(1000, 400)
self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
# list of Events
self.prepare_form(Dialog)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def load_data(self):
print(self.datafolder)
self.samplefile = glob.glob(os.path.join(self.datafolder, "*_SAMPLES.csv"))[0]
if os.path.isfile(self.samplefile):
self.samplesdf = pd.read_csv(self.samplefile, encoding='ISO-8859-1')
else:
print("File not found: ", self.samplefile)
self.samplesdf = None
self.combodefaults = {'cuvette': ['600', '2000', '4000']}
def prepare_form(self, Dialog):
# load or reload data
self.load_data()
# form dicts
edit_list = ['date', 'time', 'samplename', 'filename', 'smoothing', 'cal32', 'cal44', 'cons32', 'cons44',
'zero44', 'zero45', 'zero46', 'zero47', 'zero49']
combo_list = ['user', 'membrane', 'cuvette']
self.labels = defaultdict(defaultdict)
self.edits = defaultdict(defaultdict)
self.radios = defaultdict(defaultdict)
self.combobox = defaultdict(defaultdict)
self.labs = defaultdict(defaultdict)
self.labs = {"time": "Time",
"date": "Date",
"samplename": "Sample Name",
"filename": "File Name",
"smoothing": "Smoothing",
"cuvette": "Cuvette",
"user": "User",
"membrane": "Membrane",
"cal44": "Calibration 44",
"cal32": "Calibration 32",
"cons32": "Consumption 32",
"cons44": "Consumption 44",
"zero32": "Zero 32",
"zero44": "Zero 44",
"zero45": "Zero 45",
"zero46": "Zero 46",
"zero47": "Zero 47",
"zero49": "Zero 49"}
self.buttons = OrderedDict(sorted({'Apply': defaultdict(object), 'Delete': defaultdict(object)}.items()))
xpos, ypos = 1, 0
for row in self.samplesdf.iterrows():
row_index = row[0]
r = row[1]
self.radios[row_index] = QtGui.QRadioButton(Dialog)
self.radios[row_index].setObjectName(_fromUtf8("_".join(["radio", str(row_index)])))
self.gridLayout.addWidget(self.radios[row_index], ypos+1, 0, 1, 1)
for k in ['samplename', 'date', 'time', 'cuvette']:
# create labels
if ypos == 0:
self.labels[k] = QtGui.QLabel(Dialog)
self.labels[k].setObjectName(_fromUtf8("_".join(["label", k])))
self.labels[k].setText(str(self.labs[k]))
self.labels[k].setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
self.labels[k].setFont(self.font_labels)
self.gridLayout.addWidget(self.labels[k], 0, xpos, 1, 1)
if k in edit_list:
self.edits[k][row_index] = QtGui.QLineEdit(Dialog)
self.edits[k][row_index].setObjectName(_fromUtf8("_".join(["edit", k, str(row_index)])))
self.edits[k][row_index].setText(str(r[k]))
self.edits[k][row_index].setFont(self.font_edits)
if k in ['time', 'date']:
self.edits[k][row_index].setFixedWidth(80)
self.gridLayout.addWidget(self.edits[k][row_index], ypos+1, xpos, 1, 1)
elif k in combo_list:
self.combobox[k][row_index] = QtGui.QComboBox(Dialog)
self.combobox[k][row_index].setObjectName(_fromUtf8("_".join(["combo", k, str(row_index)])))
self.combobox[k][row_index].addItems(self.combodefaults[k])
self.combobox[k][row_index].setCurrentIndex(self.combobox[k][row_index].findText(str(r[k]), QtCore.Qt.MatchFixedString))
self.combobox[k][row_index].setFont(self.font_edits)
self.gridLayout.addWidget(self.combobox[k][row_index], ypos+1, xpos, 1, 1)
xpos += 1
# create buttons
for k in self.buttons.keys():
# if ypos > 0:
self.buttons[k][row_index] = QtGui.QPushButton(Dialog)
self.buttons[k][row_index].setObjectName(_fromUtf8("_".join(["event", k, "button", str(row_index)])))
self.buttons[k][row_index].setText(_translate("Dialog", k + str(row_index), None))
self.buttons[k][row_index].setFont(self.font_buttons)
if k == 'Apply':
self.buttons[k][row_index].clicked.connect(partial(self.ask_apply_changes, [row_index, Dialog]))
self.buttons[k][row_index].setStyleSheet("background-color: #ffeedd")
elif k == 'Delete':
self.buttons[k][row_index].clicked.connect(partial(self.ask_delete_confirm1, [row_index, Dialog]))
self.buttons[k][row_index].setStyleSheet("background-color: #ffcddd")
self.gridLayout.addWidget(self.buttons[k][row_index], ypos+1, xpos, 1, 1)
xpos += 1
# increments
ypos += 1
xpos = 1
Dialog.resize(1000, 70 + (30 * ypos))
# self.add_row(Dialog)
def ask_delete_confirm1(self, args):
sid = args[0]
Dialog = args[1]
# check if radio button is checked.
if self.radios[sid].isChecked():
msg = "Are you sure you want to delete the following sample : \n\n"
details = ""
for c in self.samplesdf.columns:
details += str(c) + ": " + str(self.samplesdf.at[sid, c]) + "\n"
reply = QtGui.QMessageBox.warning(self, 'Confirmation
msg + details, QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes:
msg2 = "Are you sure REALLY REALLY sure you want to delete the following sample ? \n\n" + \
"This is the last confirmation message. After confirming, the files will be PERMANENTLY deleted and the data WILL be lost ! \n\n"
msgbox = QtGui.QMessageBox.critical(self, 'Confirmation
msg2 + details, QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No)
reply2 = msgbox
if reply2 == QtGui.QMessageBox.Yes:
# deletion confirmed
self.delete_confirmed(sid)
self.update_form( Dialog)
else:
QtGui.QMessageBox.question(self, 'Error', 'Please select the sample you want to delete on the left',
QtGui.QMessageBox.Ok)
def delete_confirmed(self, sid):
# sample file
filename = self.samplesdf.loc[sid, 'filename']
# delete row in samplesdf
self.samplesdf = self.samplesdf.drop(self.samplesdf.index[sid])
self.samplesdf.to_csv(self.samplefile, index=False, encoding='ISO-8859-1')
# delete file in rawdata
if os.path.isfile(os.path.join(self.datafolder, "rawdata", filename)):
os.remove(os.path.join(self.datafolder, "rawdata", filename))
# print(" delete: ", os.path.join(self.datafolder, "rawdata", filename))
# delete file in data
if os.path.isfile(os.path.join(self.datafolder, filename)):
os.remove(os.path.join(self.datafolder, filename))
# print(" delete: ", os.path.join(self.datafolder, filename))
def ask_apply_changes(self, args):
sid = args[0]
Dialog = args[1]
newdata=defaultdict(str)
for k in self.edits.keys():
newdata[k] = self.edits[k][sid].text()
for k in self.combobox.keys():
newdata[k] = self.combobox[k][sid].currentText()
details = ""
for k in newdata:
details += str(self.samplesdf.at[sid, k]) + '\t --> \t' + str(newdata[k]) + "\n"
msg = "Are you sure you want to apply the changes to sample " + str(self.samplesdf.at[sid, 'samplename']) + " ?\n\n"
reply = QtGui.QMessageBox.question(self, 'Modify a sample', msg + details, QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes:
self.<API key>(sid, newdata)
self.update_form(Dialog)
else:
print('cancel modification')
def <API key>(self, sid, newdata):
# rename files
newdata['filename'] = str(newdata['date']) + "_" + str(newdata['samplename']) + ".csv"
os.rename(os.path.join(self.datafolder, str(self.samplesdf.at[sid, 'filename'])),
os.path.join(self.datafolder, str(newdata['filename'])))
os.rename(os.path.join(self.datafolder, "rawdata", str(self.samplesdf.at[sid, 'filename'])),
os.path.join(self.datafolder, "rawdata", str(newdata['filename'])))
for k in newdata.keys():
self.samplesdf.at[sid, k] = newdata[k]
self.samplesdf.to_csv(self.samplefile, index=False, encoding='ISO-8859-1')
def update_form(self, Dialog):
# empty variables
self.edits = None
self.combobox = None
self.buttons = None
self.radios = None
self.labs = None
self.labels = None
# empty layout
for i in reversed(range(self.gridLayout.count())):
self.gridLayout.itemAt(i).widget().setParent(None)
self.prepare_form(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(_translate("Dialog", "Samples Manager", None))
# self.label.setText(_translate("Dialog", "File", None))
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>linalg: linalg_immutable::eigen_results Type Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">linalg
 <span id="projectnumber">1.6.0</span>
</div>
<div id="projectbrief">A linear algebra library that provides a user-friendly interface to several BLAS and LAPACK routines.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('<API key>.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pri-attribs">Private Attributes</a> |
<a href="<API key>.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">linalg_immutable::eigen_results Type Reference</div> </div>
</div><!--header
<div class="contents">
<p>Defines a container for the output of an Eigen analysis of a square matrix.
<a href="<API key>.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a id="<API key>"></a>
complex(real64), dimension(:), allocatable </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">values</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">An N-element array containing the eigenvalues. <br /></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a id="<API key>"></a>
complex(real64), dimension(:,:), allocatable </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">vectors</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">An N-by-N matrix containing the N right eigenvectors (one per column). <br /></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Defines a container for the output of an Eigen analysis of a square matrix. </p>
<p class="definition">Definition at line <a class="el" href="<API key>.html#l00187">187</a> of file <a class="el" href="<API key>.html">linalg_immutable.f90</a>.</p>
</div><hr/>The documentation for this type was generated from the following file:<ul>
<li>C:/Users/jchri/Documents/github/linalg/src/<a class="el" href="<API key>.html">linalg_immutable.f90</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="<API key>.html">linalg_immutable</a></li><li class="navelem"><a class="el" href="<API key>.html">eigen_results</a></li>
<li class="footer">Generated by
<a href="http:
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.16 </li>
</ul>
</div>
</body>
</html>
|
#include "../../StdAfx.h"
#include "<API key>.h"
#include <common/log/log.h>
#include <common/diagnostics/graph.h>
#include <common/concurrency/future_util.h>
#include <core/video_format.h>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/min_element.hpp>
#include <boost/range/algorithm/max_element.hpp>
#include <boost/range/algorithm/for_each.hpp>
#include <boost/range/algorithm/count_if.hpp>
#include <boost/range/numeric.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/thread/future.hpp>
#include <functional>
#include <vector>
#include <queue>
#include <utility>
#include <tbb/atomic.h>
namespace caspar { namespace core {
using namespace boost::adaptors;
class <API key> : public frame_consumer
{
safe_ptr<frame_consumer> consumer_;
public:
<API key>(const safe_ptr<frame_consumer>& consumer)
: consumer_(consumer)
{
}
frame_consumer& get_delegate()
{
return *consumer_;
}
const frame_consumer& get_delegate() const
{
return *consumer_;
}
virtual void initialize(
const video_format_desc& format_desc, int channel_index) override
{
get_delegate().initialize(format_desc, channel_index);
}
virtual int64_t <API key>() const
{
return get_delegate().<API key>();
}
virtual boost::unique_future<bool> send(
const safe_ptr<read_frame>& frame) override
{
return get_delegate().send(frame);
}
virtual std::wstring print() const override
{
return get_delegate().print();
}
virtual boost::property_tree::wptree info() const override
{
return get_delegate().info();
}
virtual bool <API key>() const override
{
return get_delegate().<API key>();
}
virtual size_t buffer_depth() const override
{
return get_delegate().buffer_depth();
}
virtual int index() const override
{
return get_delegate().index();
}
};
const std::vector<int>& diag_colors()
{
static std::vector<int> colors = boost::assign::list_of<int>
(diagnostics::color(0.0f, 0.6f, 0.9f))
(diagnostics::color(0.6f, 0.3f, 0.3f))
(diagnostics::color(0.3f, 0.6f, 0.3f))
(diagnostics::color(0.4f, 0.3f, 0.8f))
(diagnostics::color(0.9f, 0.9f, 0.5f))
(diagnostics::color(0.2f, 0.9f, 0.9f));
return colors;
}
class <API key> : public <API key>
{
std::queue<safe_ptr<read_frame>> buffer_;
tbb::atomic<size_t> buffered_;
tbb::atomic<int64_t> duplicate_next_;
public:
<API key>(const safe_ptr<frame_consumer>& consumer)
: <API key>(consumer)
{
buffered_ = 0;
duplicate_next_ = 0;
}
boost::unique_future<bool> consume_one()
{
if (!buffer_.empty())
{
buffer_.pop();
--buffered_;
}
return get_delegate().send(buffer_.front());
}
virtual boost::unique_future<bool> send(
const safe_ptr<read_frame>& frame) override
{
if (duplicate_next_)
{
--duplicate_next_;
}
else if (!buffer_.empty())
{
buffer_.pop();
--buffered_;
}
buffer_.push(frame);
++buffered_;
return get_delegate().send(buffer_.front());
}
void duplicate_next(int64_t to_duplicate)
{
duplicate_next_ += to_duplicate;
}
size_t num_buffered() const
{
return buffered_ - 1;
}
virtual std::wstring print() const override
{
return L"buffering[" + get_delegate().print() + L"]";
}
virtual boost::property_tree::wptree info() const override
{
boost::property_tree::wptree info;
info.add(L"type", L"<API key>");
info.add_child(L"consumer", get_delegate().info());
info.add(L"buffered-frames", num_buffered());
return info;
}
};
static const uint64_t <API key> = 5;
struct <API key>::implementation
{
private:
std::vector<safe_ptr<<API key>>> consumers_;
size_t buffer_depth_;
bool <API key>;
std::vector<boost::unique_future<bool>> results_;
boost::promise<bool> promise_;
video_format_desc format_desc_;
safe_ptr<diagnostics::graph> graph_;
int64_t grace_period_;
tbb::atomic<int64_t> current_diff_;
public:
implementation(const std::vector<safe_ptr<frame_consumer>>& consumers)
: grace_period_(0)
{
BOOST_FOREACH(auto& consumer, consumers)
consumers_.push_back(make_safe<<API key>>(consumer));
current_diff_ = 0;
auto buffer_depths = consumers | transformed(std::mem_fn(&frame_consumer::buffer_depth));
std::vector<size_t> depths(buffer_depths.begin(), buffer_depths.end());
buffer_depth_ = *boost::max_element(depths);
<API key> = boost::count_if(consumers, std::mem_fn(&frame_consumer::<API key>)) > 0;
diagnostics::register_graph(graph_);
}
boost::unique_future<bool> send(const safe_ptr<read_frame>& frame)
{
results_.clear();
BOOST_FOREACH(auto& consumer, consumers_)
results_.push_back(consumer->send(frame));
promise_ = boost::promise<bool>();
promise_.set_wait_callback(std::function<void(boost::promise<bool>&)>([this](boost::promise<bool>& promise)
{
BOOST_FOREACH(auto& result, results_)
{
result.get();
}
auto frame_ages = consumers_ | transformed(std::mem_fn(&frame_consumer::<API key>));
std::vector<int64_t> ages(frame_ages.begin(), frame_ages.end());
auto max_age_iter = boost::max_element(ages);
auto min_age_iter = boost::min_element(ages);
int64_t min_age = *min_age_iter;
if (min_age == 0)
{
// One of the consumers have yet no measurement, wait until next
// frame until we make any assumptions.
promise.set_value(true);
return;
}
int64_t max_age = *max_age_iter;
int64_t age_diff = max_age - min_age;
current_diff_ = age_diff;
for (unsigned i = 0; i < ages.size(); ++i)
graph_->set_value(
narrow(consumers_[i]->print()),
static_cast<double>(ages[i]) / *max_age_iter);
bool grace_period_over = grace_period_ == 1;
if (grace_period_)
--grace_period_;
if (grace_period_ == 0)
{
int64_t frame_duration = static_cast<int64_t>(1000 / format_desc_.fps);
if (age_diff >= frame_duration)
{
CASPAR_LOG(info) << print() << L" Consumers not in sync. min: " << min_age << L" max: " << max_age;
auto index = min_age_iter - ages.begin();
auto to_duplicate = age_diff / frame_duration;
auto& consumer = *consumers_.at(index);
auto currently_buffered = consumer.num_buffered();
if (currently_buffered + to_duplicate > <API key>)
{
CASPAR_LOG(info) << print() << L" Protecting from out of memory. Duplicating less frames than calculated";
to_duplicate = <API key> - currently_buffered;
}
consumer.duplicate_next(to_duplicate);
grace_period_ = 10 + to_duplicate + buffer_depth_;
}
else if (grace_period_over)
{
CASPAR_LOG(info) << print() << L" Consumers resynced. min: " << min_age << L" max: " << max_age;
}
}
<API key>();
promise.set_value(true);
}));
return promise_.get_future();
}
void <API key>()
{
auto buffered = consumers_ | transformed(std::mem_fn(&<API key>::num_buffered));
std::vector<size_t> num_buffered(buffered.begin(), buffered.end());
auto min_buffered = *boost::min_element(num_buffered);
if (min_buffered)
CASPAR_LOG(info) << print() << L" " << min_buffered
<< L" frames unnecessarily buffered. Consuming and letting channel pause during that time.";
while (min_buffered)
{
std::vector<boost::unique_future<bool>> results;
BOOST_FOREACH(auto& consumer, consumers_)
results.push_back(consumer->consume_one());
BOOST_FOREACH(auto& result, results)
result.get();
--min_buffered;
}
}
void initialize(const video_format_desc& format_desc, int channel_index)
{
for (size_t i = 0; i < consumers_.size(); ++i)
{
auto& consumer = consumers_.at(i);
consumer->initialize(format_desc, channel_index);
graph_->set_color(
narrow(consumer->print()),
diag_colors().at(i % diag_colors().size()));
}
graph_->set_text(print());
format_desc_ = format_desc;
}
int64_t <API key>() const
{
int64_t result = 0;
BOOST_FOREACH(auto& consumer, consumers_)
result = std::max(result, consumer-><API key>());
return result;
}
std::wstring print() const
{
return L"synchronized[" + boost::algorithm::join(consumers_ | transformed(std::mem_fn(&frame_consumer::print)), L"|") + L"]";
}
boost::property_tree::wptree info() const
{
boost::property_tree::wptree info;
info.add(L"type", L"<API key>");
BOOST_FOREACH(auto& consumer, consumers_)
info.add_child(L"consumer", consumer->info());
info.add(L"age-diff", current_diff_);
return info;
}
bool <API key>() const
{
return <API key>;
}
size_t buffer_depth() const
{
return buffer_depth_;
}
int index() const
{
return boost::accumulate(consumers_ | transformed(std::mem_fn(&frame_consumer::index)), 10000);
}
};
<API key>::<API key>(const std::vector<safe_ptr<frame_consumer>>& consumers)
: impl_(new implementation(consumers))
{
}
boost::unique_future<bool> <API key>::send(const safe_ptr<read_frame>& frame)
{
return impl_->send(frame);
}
void <API key>::initialize(const video_format_desc& format_desc, int channel_index)
{
impl_->initialize(format_desc, channel_index);
}
int64_t <API key>::<API key>() const
{
return impl_-><API key>();
}
std::wstring <API key>::print() const
{
return impl_->print();
}
boost::property_tree::wptree <API key>::info() const
{
return impl_->info();
}
bool <API key>::<API key>() const
{
return impl_-><API key>();
}
size_t <API key>::buffer_depth() const
{
return impl_->buffer_depth();
}
int <API key>::index() const
{
return impl_->index();
}
}}
|
package nest.util;
import android.text.TextUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import timber.log.Timber;
public class TraceTree extends Timber.HollowTree {
private final DebugTree debugTree;
public TraceTree(boolean useTraces) {
debugTree = new DebugTree(useTraces);
}
@Override
public void v(String message, Object... args) {
debugTree.v(message, args);
}
@Override
public void v(Throwable t, String message, Object... args) {
debugTree.v(t, message, args);
}
@Override
public void d(String message, Object... args) {
debugTree.d(message, args);
}
@Override
public void d(Throwable t, String message, Object... args) {
debugTree.d(t, message, args);
}
@Override
public void i(String message, Object... args) {
debugTree.i(message, args);
}
@Override
public void i(Throwable t, String message, Object... args) {
debugTree.i(t, message, args);
}
@Override
public void w(String message, Object... args) {
debugTree.w(message, args);
}
@Override
public void w(Throwable t, String message, Object... args) {
debugTree.w(t, message, args);
}
@Override
public void e(String message, Object... args) {
debugTree.e(message, args);
}
@Override
public void e(Throwable t, String message, Object... args) {
debugTree.e(t, message, args);
}
private static class DebugTree extends Timber.DebugTree {
private static final Pattern ANONYMOUS_CLASS = Pattern.compile("\\$\\d+$");
private static final int STACK_POSITION = 6;
private final boolean useTraces;
private StackTraceElement lastTrace;
private DebugTree(boolean useTraces) {
this.useTraces = useTraces;
}
@Override
protected String createTag() {
String tag;
if (!useTraces) {
tag = nextTag();
if (tag != null) {
return tag;
}
}
StackTraceElement[] stackTrace = new Throwable().getStackTrace();
if (stackTrace.length < STACK_POSITION) {
return "
}
if (useTraces) {
lastTrace = stackTrace[STACK_POSITION];
}
tag = stackTrace[STACK_POSITION].getClassName();
Matcher m = ANONYMOUS_CLASS.matcher(tag);
if (m.find()) {
tag = m.replaceAll("");
}
return tag.substring(tag.lastIndexOf('.') + 1);
}
@Override
protected void logMessage(int priority, String tag, String message) {
if (lastTrace != null) {
message = (TextUtils.isEmpty(message) ? "" : message +" ") + "at "+ lastTrace;
lastTrace = null;
}
super.logMessage(priority, tag, message);
}
}
}
|
package info.carlwithak.mpxg2.sysex.effects.algorithms;
import info.carlwithak.mpxg2.model.effects.algorithms.DetuneStereo;
/**
* Class to parse parameter data for Detune (S) effect.
*
* @author Carl Green
*/
public class DetuneStereoParser {
public static DetuneStereo parse(byte[] effectParameters) {
DetuneStereo detuneStereo = new DetuneStereo();
int mix = effectParameters[0] + effectParameters[1] * 16;
detuneStereo.mix.setValue(mix);
int level = effectParameters[2] + effectParameters[3] * 16;
detuneStereo.level.setValue(level);
int tune = effectParameters[4] + effectParameters[5] * 16;
detuneStereo.tune.setValue(tune);
int optimize = effectParameters[6] + effectParameters[7] * 16;
detuneStereo.optimize.setValue(optimize);
int preDelay = effectParameters[8] + effectParameters[9] * 16;
detuneStereo.preDelay.setValue(preDelay);
return detuneStereo;
}
}
|
#include "faceTriangulation.H"
#include "plane.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::scalar Foam::faceTriangulation::edgeRelTol = 1E-6;
// Edge to the right of face vertex i
Foam::label Foam::faceTriangulation::right(const label, label i)
{
return i;
}
// Edge to the left of face vertex i
Foam::label Foam::faceTriangulation::left(const label size, label i)
{
return i ? i-1 : size-1;
}
// Calculate (normalized) edge vectors.
// edges[i] gives edge between point i+1 and i.
Foam::tmp<Foam::vectorField> Foam::faceTriangulation::calcEdges
(
const face& f,
const pointField& points
)
{
tmp<vectorField> tedges(new vectorField(f.size()));
vectorField& edges = tedges();
forAll(f, i)
{
point thisPt = points[f[i]];
point nextPt = points[f[f.fcIndex(i)]];
vector vec(nextPt - thisPt);
vec /= mag(vec) + VSMALL;
edges[i] = vec;
}
return tedges;
}
// Calculates half angle components of angle from e0 to e1
void Foam::faceTriangulation::calcHalfAngle
(
const vector& normal,
const vector& e0,
const vector& e1,
scalar& cosHalfAngle,
scalar& sinHalfAngle
)
{
// truncate cos to +-1 to prevent negative numbers
scalar cos = max(-1, min(1, e0 & e1));
scalar sin = (e0 ^ e1) & normal;
if (sin < -ROOTVSMALL)
{
// 3rd or 4th quadrant
cosHalfAngle = - Foam::sqrt(0.5*(1 + cos));
sinHalfAngle = Foam::sqrt(0.5*(1 - cos));
}
else
{
// 1st or 2nd quadrant
cosHalfAngle = Foam::sqrt(0.5*(1 + cos));
sinHalfAngle = Foam::sqrt(0.5*(1 - cos));
}
}
// Calculate intersection point between edge p1-p2 and ray (in 2D).
// Return true and intersection point if intersection between p1 and p2.
Foam::pointHit Foam::faceTriangulation::rayEdgeIntersect
(
const vector& normal,
const point& rayOrigin,
const vector& rayDir,
const point& p1,
const point& p2,
scalar& posOnEdge
)
{
// Start off from miss
pointHit result(p1);
// Construct plane normal to rayDir and intersect
const vector y = normal ^ rayDir;
posOnEdge = plane(rayOrigin, y).normalIntersect(p1, (p2-p1));
// Check intersection to left of p1 or right of p2
if ((posOnEdge < 0) || (posOnEdge > 1))
{
// Miss
}
else
{
// Check intersection behind rayOrigin
point intersectPt = p1 + posOnEdge * (p2 - p1);
if (((intersectPt - rayOrigin) & rayDir) < 0)
{
// Miss
}
else
{
// Hit
result.setHit();
result.setPoint(intersectPt);
result.setDistance(mag(intersectPt - rayOrigin));
}
}
return result;
}
// Return true if triangle given its three points (anticlockwise ordered)
// contains point
bool Foam::faceTriangulation::<API key>
(
const vector& n,
const point& p0,
const point& p1,
const point& p2,
const point& pt
)
{
scalar area01Pt = triPointRef(p0, p1, pt).normal() & n;
scalar area12Pt = triPointRef(p1, p2, pt).normal() & n;
scalar area20Pt = triPointRef(p2, p0, pt).normal() & n;
if ((area01Pt > 0) && (area12Pt > 0) && (area20Pt > 0))
{
return true;
}
else if ((area01Pt < 0) && (area12Pt < 0) && (area20Pt < 0))
{
FatalErrorIn("<API key>") << abort(FatalError);
return false;
}
else
{
return false;
}
}
// Starting from startIndex find diagonal. Return in index1, index2.
// Index1 always startIndex except when convex polygon
void Foam::faceTriangulation::findDiagonal
(
const pointField& points,
const face& f,
const vectorField& edges,
const vector& normal,
const label startIndex,
label& index1,
label& index2
)
{
const point& startPt = points[f[startIndex]];
// Calculate angle at startIndex
const vector& rightE = edges[right(f.size(), startIndex)];
const vector leftE = -edges[left(f.size(), startIndex)];
// Construct ray which bisects angle
scalar cosHalfAngle = GREAT;
scalar sinHalfAngle = GREAT;
calcHalfAngle(normal, rightE, leftE, cosHalfAngle, sinHalfAngle);
vector rayDir
(
cosHalfAngle*rightE
+ sinHalfAngle*(normal ^ rightE)
);
// rayDir should be normalized already but is not due to rounding errors
// so normalize.
rayDir /= mag(rayDir) + VSMALL;
// Check all edges (apart from rightE and leftE) for nearest intersection
label faceVertI = f.fcIndex(startIndex);
pointHit minInter(false, vector::zero, GREAT, true);
label minIndex = -1;
scalar minPosOnEdge = GREAT;
for (label i = 0; i < f.size() - 2; i++)
{
scalar posOnEdge;
pointHit inter =
rayEdgeIntersect
(
normal,
startPt,
rayDir,
points[f[faceVertI]],
points[f[f.fcIndex(faceVertI)]],
posOnEdge
);
if (inter.hit() && inter.distance() < minInter.distance())
{
minInter = inter;
minIndex = faceVertI;
minPosOnEdge = posOnEdge;
}
faceVertI = f.fcIndex(faceVertI);
}
if (minIndex == -1)
{
//WarningIn("faceTriangulation::findDiagonal")
// << "Could not find intersection starting from " << f[startIndex]
// << " for face " << f << endl;
index1 = -1;
index2 = -1;
return;
}
const label leftIndex = minIndex;
const label rightIndex = f.fcIndex(minIndex);
// Now ray intersects edge from leftIndex to rightIndex.
// Check for intersection being one of the edge points. Make sure never
// to return two consecutive points.
if (mag(minPosOnEdge) < edgeRelTol && f.fcIndex(startIndex) != leftIndex)
{
index1 = startIndex;
index2 = leftIndex;
return;
}
if
(
mag(minPosOnEdge - 1) < edgeRelTol
&& f.fcIndex(rightIndex) != startIndex
)
{
index1 = startIndex;
index2 = rightIndex;
return;
}
// Select visible vertex that minimizes
// angle to bisection. Visibility checking by checking if inside triangle
// formed by startIndex, leftIndex, rightIndex
const point& leftPt = points[f[leftIndex]];
const point& rightPt = points[f[rightIndex]];
minIndex = -1;
scalar maxCos = -GREAT;
// all vertices except for startIndex and ones to left and right of it.
faceVertI = f.fcIndex(f.fcIndex(startIndex));
for (label i = 0; i < f.size() - 3; i++)
{
const point& pt = points[f[faceVertI]];
if
(
(faceVertI == leftIndex)
|| (faceVertI == rightIndex)
|| (<API key>(normal, startPt, leftPt, rightPt, pt))
)
{
// pt inside triangle (so perhaps visible)
// Select based on minimal angle (so guaranteed visible).
vector edgePt0 = pt - startPt;
edgePt0 /= mag(edgePt0);
scalar cos = rayDir & edgePt0;
if (cos > maxCos)
{
maxCos = cos;
minIndex = faceVertI;
}
}
faceVertI = f.fcIndex(faceVertI);
}
if (minIndex == -1)
{
// no vertex found. Return startIndex and one of the intersected edge
// endpoints.
index1 = startIndex;
if (f.fcIndex(startIndex) != leftIndex)
{
index2 = leftIndex;
}
else
{
index2 = rightIndex;
}
return;
}
index1 = startIndex;
index2 = minIndex;
}
// Find label of vertex to start splitting from. Is:
// 1] flattest concave angle
// 2] flattest convex angle if no concave angles.
Foam::label Foam::faceTriangulation::findStart
(
const face& f,
const vectorField& edges,
const vector& normal
)
{
const label size = f.size();
scalar minCos = GREAT;
label minIndex = -1;
forAll(f, fp)
{
const vector& rightEdge = edges[right(size, fp)];
const vector leftEdge = -edges[left(size, fp)];
if (((rightEdge ^ leftEdge) & normal) < ROOTVSMALL)
{
scalar cos = rightEdge & leftEdge;
if (cos < minCos)
{
minCos = cos;
minIndex = fp;
}
}
}
if (minIndex == -1)
{
// No concave angle found. Get flattest convex angle
minCos = GREAT;
forAll(f, fp)
{
const vector& rightEdge = edges[right(size, fp)];
const vector leftEdge = -edges[left(size, fp)];
scalar cos = rightEdge & leftEdge;
if (cos < minCos)
{
minCos = cos;
minIndex = fp;
}
}
}
return minIndex;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Split face f into triangles. Handles all simple (convex & concave)
// polygons.
bool Foam::faceTriangulation::split
(
const bool fallBack,
const pointField& points,
const face& f,
const vector& normal,
label& triI
)
{
const label size = f.size();
if (size <= 2)
{
WarningIn
(
"split(const bool, const pointField&, const face&"
", const vector&, label&)"
) << "Illegal face:" << f
<< " with points " << UIndirectList<point>(points, f)()
<< endl;
return false;
}
else if (size == 3)
{
// Triangle. Just copy.
triFace& tri = operator[](triI++);
tri[0] = f[0];
tri[1] = f[1];
tri[2] = f[2];
return true;
}
else
{
// General case. Start splitting for -flattest concave angle
// -or flattest convex angle if no concave angles.
tmp<vectorField> tedges(calcEdges(f, points));
const vectorField& edges = tedges();
label startIndex = findStart(f, edges, normal);
// Find diagonal to split face across
label index1 = -1;
label index2 = -1;
for (label iter = 0; iter < f.size(); iter++)
{
findDiagonal
(
points,
f,
edges,
normal,
startIndex,
index1,
index2
);
if (index1 != -1 && index2 != -1)
{
// Found correct diagonal
break;
}
// Try splitting from next startingIndex.
startIndex = f.fcIndex(startIndex);
}
if (index1 == -1 || index2 == -1)
{
if (fallBack)
{
// Do naive triangulation. Find smallest angle to start
// triangulating from.
label maxIndex = -1;
scalar maxCos = -GREAT;
forAll(f, fp)
{
const vector& rightEdge = edges[right(size, fp)];
const vector leftEdge = -edges[left(size, fp)];
scalar cos = rightEdge & leftEdge;
if (cos > maxCos)
{
maxCos = cos;
maxIndex = fp;
}
}
WarningIn
(
"split(const bool, const pointField&, const face&"
", const vector&, label&)"
) << "Cannot find valid diagonal on face " << f
<< " with points " << UIndirectList<point>(points, f)()
<< nl
<< "Returning naive triangulation starting from "
<< f[maxIndex] << " which might not be correct for a"
<< " concave or warped face" << endl;
label fp = f.fcIndex(maxIndex);
for (label i = 0; i < size-2; i++)
{
label nextFp = f.fcIndex(fp);
triFace& tri = operator[](triI++);
tri[0] = f[maxIndex];
tri[1] = f[fp];
tri[2] = f[nextFp];
fp = nextFp;
}
return true;
}
else
{
WarningIn
(
"split(const bool, const pointField&, const face&"
", const vector&, label&)"
) << "Cannot find valid diagonal on face " << f
<< " with points " << UIndirectList<point>(points, f)()
<< nl
<< "Returning empty triFaceList" << endl;
return false;
}
}
// Split into two subshapes.
// face1: index1 to index2
// face2: index2 to index1
// Get sizes of the two subshapes
label diff = 0;
if (index2 > index1)
{
diff = index2 - index1;
}
else
{
// folded round
diff = index2 + size - index1;
}
label nPoints1 = diff + 1;
label nPoints2 = size - diff + 1;
if (nPoints1 == size || nPoints2 == size)
{
FatalErrorIn
(
"split(const bool, const pointField&, const face&"
", const vector&, label&)"
) << "Illegal split of face:" << f
<< " with points " << UIndirectList<point>(points, f)()
<< " at indices " << index1 << " and " << index2
<< abort(FatalError);
}
// Collect face1 points
face face1(nPoints1);
label faceVertI = index1;
for (int i = 0; i < nPoints1; i++)
{
face1[i] = f[faceVertI];
faceVertI = f.fcIndex(faceVertI);
}
// Collect face2 points
face face2(nPoints2);
faceVertI = index2;
for (int i = 0; i < nPoints2; i++)
{
face2[i] = f[faceVertI];
faceVertI = f.fcIndex(faceVertI);
}
// Decompose the split faces
//Pout<< "Split face:" << f << " into " << face1 << " and " << face2
// << endl;
//string oldPrefix(Pout.prefix());
//Pout.prefix() = " " + oldPrefix;
bool splitOk =
split(fallBack, points, face1, normal, triI)
&& split(fallBack, points, face2, normal, triI);
//Pout.prefix() = oldPrefix;
return splitOk;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
Foam::faceTriangulation::faceTriangulation()
:
triFaceList()
{}
// Construct from components
Foam::faceTriangulation::faceTriangulation
(
const pointField& points,
const face& f,
const bool fallBack
)
:
triFaceList(f.size()-2)
{
vector avgNormal = f.normal(points);
avgNormal /= mag(avgNormal) + VSMALL;
label triI = 0;
bool valid = split(fallBack, points, f, avgNormal, triI);
if (!valid)
{
setSize(0);
}
}
// Construct from components
Foam::faceTriangulation::faceTriangulation
(
const pointField& points,
const face& f,
const vector& n,
const bool fallBack
)
:
triFaceList(f.size()-2)
{
label triI = 0;
bool valid = split(fallBack, points, f, n, triI);
if (!valid)
{
setSize(0);
}
}
// Construct from Istream
Foam::faceTriangulation::faceTriangulation(Istream& is)
:
triFaceList(is)
{}
|
<?php /*%%SmartyHeaderCode:<API key>%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'<SHA1-like>' =>
array (
0 => '/Users/Evergreen/Documents/workspace/licpresta/admin/themes/default/template/controllers/shop/helpers/list/list_action_delete.tpl',
1 => 1452095428,
2 => 'file',
),
),
'nocache_hash' => '<API key>',
'function' =>
array (
),
'variables' =>
array (
'href' => 0,
'action' => 0,
'id_shop' => 0,
'<API key>' => 0,
'confirm' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.19',
'unifunc' => '<API key>',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('<API key>')) {function <API key>($_smarty_tpl) {?>
<a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['href']->value, ENT_QUOTES, 'UTF-8', true);?>
" class="delete" title="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['action']->value, ENT_QUOTES, 'UTF-8', true);?>
"
<?php if (in_array($_smarty_tpl->tpl_vars['id_shop']->value,$_smarty_tpl->tpl_vars['<API key>']->value)) {?>
onclick="jAlert('<?php echo smartyTranslate(array('s'=>'You cannot delete this shop\'s (customer and/or order dependency)','js'=>1),$_smarty_tpl);?>
'); return false;"
<?php } elseif (isset($_smarty_tpl->tpl_vars['confirm']->value)) {?>
onclick="if (confirm('<?php echo $_smarty_tpl->tpl_vars['confirm']->value;?>
')){return true;}else{event.stopPropagation(); event.preventDefault();};"
<?php }?>>
<i class="icon-trash"></i> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['action']->value, ENT_QUOTES, 'UTF-8', true);?>
</a><?php }} ?>
|
<?php
namespace UJM\ExoBundle\Installation;
use Claroline\InstallationBundle\Additional\AdditionalInstaller as BaseInstaller;
use UJM\ExoBundle\Installation\Updater\Updater060000;
use UJM\ExoBundle\Installation\Updater\Updater060001;
use UJM\ExoBundle\Installation\Updater\Updater060200;
use UJM\ExoBundle\Installation\Updater\Updater070000;
use UJM\ExoBundle\Installation\Updater\Updater090000;
use UJM\ExoBundle\Installation\Updater\Updater090002;
class AdditionalInstaller extends BaseInstaller
{
public function preUpdate($currentVersion, $targetVersion)
{
if (version_compare($currentVersion, '6.0.0', '<=')) {
$updater = new Updater060000($this->container->get('doctrine.dbal.default_connection'));
$updater->setLogger($this->logger);
$updater->preUpdate();
}
if (version_compare($currentVersion, '6.0.0', '=')) {
$updater = new Updater060001($this->container->get('doctrine.dbal.default_connection'));
$updater->setLogger($this->logger);
$updater->preUpdate();
}
if (version_compare($currentVersion, '6.2.0', '<')) {
$updater = new Updater060200($this->container->get('doctrine.dbal.default_connection'));
$updater->setLogger($this->logger);
$updater->preUpdate();
}
if (version_compare($currentVersion, '7.0.0', '<=')) {
$updater = new Updater070000($this->container->get('doctrine.dbal.default_connection'));
$updater->setLogger($this->logger);
$updater->preUpdate();
}
}
public function postUpdate($currentVersion, $targetVersion)
{
if (version_compare($currentVersion, '6.0.0', '<=')) {
$updater = new Updater060000($this->container->get('doctrine.dbal.default_connection'));
$updater->setLogger($this->logger);
$updater->postUpdate();
}
if (version_compare($currentVersion, '6.2.0', '<')) {
$updater = new Updater060200($this->container->get('doctrine.dbal.default_connection'));
$updater->setLogger($this->logger);
$updater->postUpdate();
}
if (version_compare($currentVersion, '9.0.0', '<')) {
$updater = new Updater090000(
$this->container->get('doctrine.dbal.default_connection'),
$this->container->get('claroline.persistence.object_manager'),
$this->container->get('ujm_exo.serializer.exercise'),
$this->container->get('ujm_exo.serializer.step'),
$this->container->get('ujm_exo.serializer.item')
);
$updater->setLogger($this->logger);
$updater->postUpdate();
}
if (version_compare($currentVersion, '9.0.2', '<')) {
$updater = new Updater090002(
$this->container->get('doctrine.dbal.default_connection')
);
$updater->setLogger($this->logger);
$updater->postUpdate();
}
}
}
|
package org.tritania.stables;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.Bukkit;
import org.tritania.stables.Stables;
import org.tritania.stables.util.Message;
import org.tritania.stables.util.Log;
public class RaceSystem
{
public Stables ht;
public RaceSystem(Stables ht)
{
this.ht = ht;
}
}
|
// This is a generated file. Not intended for manual editing.
package org.modula.parsing.definition.psi.impl;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static org.modula.parsing.definition.psi.ModulaTypes.*;
import com.intellij.extapi.psi.<API key>;
import org.modula.parsing.definition.psi.*;
public class <API key> extends <API key> implements <API key> {
public <API key>(ASTNode node) {
super(node);
}
public void accept(@NotNull PsiElementVisitor visitor) {
if (visitor instanceof DefinitionVisitor) ((DefinitionVisitor)visitor).<API key>(this);
else super.accept(visitor);
}
@Override
@NotNull
public List<DefinitionFPSection> getFPSectionList() {
return PsiTreeUtil.<API key>(this, DefinitionFPSection.class);
}
@Override
@Nullable
public DefinitionQualident getQualident() {
return findChildByClass(DefinitionQualident.class);
}
}
|
class MeetingQuery < Query
self.queried_class = Meeting
self.available_columns = [
QueryColumn.new(:subject, :sortable => "#{Meeting.table_name}.subject",:groupable => true),
QueryColumn.new(:location_online, :sortable => "#{Meeting.table_name}.location_online",:groupable => true, caption: 'location'),
QueryColumn.new(:date, :sortable => "#{Meeting.table_name}.date",:groupable => true),
QueryColumn.new(:end_date, :sortable => "#{Meeting.table_name}.end_date",:groupable => true),
QueryColumn.new(:start_time, :sortable => "#{Meeting.table_name}.start_time",:groupable => true),
QueryColumn.new(:status, :sortable => "#{Meeting.table_name}.status",:groupable => true),
]
def initialize(attributes=nil, *args)
super attributes
self.filters ||= {}
add_filter('subject', '*') unless filters.present?
end
def <API key>
<API key> "subject", :type => :string, :order => 0
<API key> "date", :type => :string, :order => 1
<API key> "end_date", :type => :string, :order => 1
<API key> "start_time", :type => :string, :order => 2
<API key> "location_online", :type => :string, :order => 3
<API key> "status", :type => :string, :order => 4
# <API key>(MeetingCustomField.where(:is_filter => true))
end
def available_columns
return @available_columns if @available_columns
@available_columns = self.class.available_columns.dup
# @available_columns += CustomField.where(:type => 'MeetingCustomField').all.map {|cf| <API key>.new(cf) }
@available_columns
end
def <API key>
@<API key> ||= [:subject, :date, :end_date, :start_time, :location_online, :status]
end
def results_scope(options={})
order_option = [group_by_sort_order, options[:order]].flatten.reject(&:blank?)
Meeting.visible.
where(statement).where(project_id: options[:project_id]).
order(order_option).
joins(<API key>(order_option.join(',')))
end
def meetings
end
end
|
function start() {
cm.sendSimple ("What do you want from me?\r #L0##bGather up some information on the hideout.#l\r\n#L1#Take me to the hideout#l\r\n#L2#Nothing#l#k");
}
function action(mode, type, selection) {
if (mode < 1) {
cm.dispose();
} else {
status++;
if (status == 1) {
if (selection == 0) {
cm.sendNext("I can take you to the hideout, but the place is infested with thugs looking for trouble. You'll need to be both incredibly strong and brave to enter the premise. At the hideaway, you'll find the Boss that controls all the other bosses around this area. It's easy to get to the hideout, but the room on the top floor of the place can only be entered ONCE a day. The Boss's Room is not a place to mess around. I suggest you don't stay there for too long; you'll need to swiftly take care of the business once inside. The boss himself is a difficult foe, but you'll run into some incredibly powerful enemies on you way to meeting the boss! It ain't going to be easy.");
cm.dispose();
} else if (selection == 1)
cm.sendNext("Oh, the brave one. I've been awaiting your arrival. If these\r\nthugs are left unchecked, there's no telling what going to\r\nhappen in this neighborhood. Before that happens, I hope\r\nyou take care of all them and beat the boss, who resides\r\non the 5th floor. You'll need to be on alert at all times, since\r\nthe boss is too tough for even wisemen to handle.\r\nLooking at your eyes, however, I can see that eye of the\r\ntiger, the eyes that tell me you can do this. Let's go!");
else {
cm.sendOk("I'm a busy person! Leave me alone if that's all you need!");
cm.dispose();
}
} else {
cm.warp(801040000);
cm.dispose();
}
}
}
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE <API key> #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -<API key> #-}
-- Module : Network.AWS.CloudWatchLogs.PutLogEvents
-- you can obtain it at http://mozilla.org/MPL/2.0/.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : experimental
-- Portability : non-portable (GHC extensions)
-- | Uploads a batch of log events to the specified log stream.
-- Every PutLogEvents request must include the 'sequenceToken' obtained from the
-- response of the previous request. An upload in a newly created log stream
-- does not require a 'sequenceToken'.
-- The batch of events must satisfy the following constraints: The maximum
-- batch size is 32,768 bytes, and this size is calculated as the sum of all
-- event messages in UTF-8, plus 26 bytes for each log event. None of the log
-- events in the batch can be more than 2 hours in the future. None of the log
-- events in the batch can be older than 14 days or the retention period of the
-- log group. The log events in the batch must be in chronological ordered by
-- their 'timestamp'. The maximum number of log events in a batch is 1,000.
-- <http://docs.aws.amazon.com/<API key>/latest/APIReference/API_PutLogEvents.html>
module Network.AWS.CloudWatchLogs.PutLogEvents
(
-- * Request
PutLogEvents
-- ** Request constructor
, putLogEvents
-- ** Request lenses
, pleLogEvents
, pleLogGroupName
, pleLogStreamName
, pleSequenceToken
-- * Response
, <API key>
-- ** Response constructor
, <API key>
-- ** Response lenses
, <API key>
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CloudWatchLogs.Types
import qualified GHC.Exts
data PutLogEvents = PutLogEvents
{ _pleLogEvents :: List1 "logEvents" InputLogEvent
, _pleLogGroupName :: Text
, _pleLogStreamName :: Text
, _pleSequenceToken :: Maybe Text
} deriving (Eq, Read, Show)
-- | 'PutLogEvents' constructor.
-- The fields accessible through corresponding lenses are:
-- * 'pleLogEvents' @::@ 'NonEmpty' 'InputLogEvent'
-- * 'pleLogGroupName' @::@ 'Text'
-- * 'pleLogStreamName' @::@ 'Text'
-- * 'pleSequenceToken' @::@ 'Maybe' 'Text'
putLogEvents :: Text -- ^ 'pleLogGroupName'
-> Text -- ^ 'pleLogStreamName'
-> NonEmpty InputLogEvent -- ^ 'pleLogEvents'
-> PutLogEvents
putLogEvents p1 p2 p3 = PutLogEvents
{ _pleLogGroupName = p1
, _pleLogStreamName = p2
, _pleLogEvents = withIso _List1 (const id) p3
, _pleSequenceToken = Nothing
}
pleLogEvents :: Lens' PutLogEvents (NonEmpty InputLogEvent)
pleLogEvents = lens _pleLogEvents (\s a -> s { _pleLogEvents = a }) . _List1
pleLogGroupName :: Lens' PutLogEvents Text
pleLogGroupName = lens _pleLogGroupName (\s a -> s { _pleLogGroupName = a })
pleLogStreamName :: Lens' PutLogEvents Text
pleLogStreamName = lens _pleLogStreamName (\s a -> s { _pleLogStreamName = a })
-- | A string token that must be obtained from the response of the previous 'PutLogEvents' request.
pleSequenceToken :: Lens' PutLogEvents (Maybe Text)
pleSequenceToken = lens _pleSequenceToken (\s a -> s { _pleSequenceToken = a })
newtype <API key> = <API key>
{ <API key> :: Maybe Text
} deriving (Eq, Ord, Read, Show, Monoid)
-- | '<API key>' constructor.
-- The fields accessible through corresponding lenses are:
-- * '<API key>' @::@ 'Maybe' 'Text'
<API key> :: <API key>
<API key> = <API key>
{ <API key> = Nothing
}
<API key> :: Lens' <API key> (Maybe Text)
<API key> =
lens <API key> (\s a -> s { <API key> = a })
instance ToPath PutLogEvents where
toPath = const "/"
instance ToQuery PutLogEvents where
toQuery = const mempty
instance ToHeaders PutLogEvents
instance ToJSON PutLogEvents where
toJSON PutLogEvents{..} = object
[ "logGroupName" .= _pleLogGroupName
, "logStreamName" .= _pleLogStreamName
, "logEvents" .= _pleLogEvents
, "sequenceToken" .= _pleSequenceToken
]
instance AWSRequest PutLogEvents where
type Sv PutLogEvents = CloudWatchLogs
type Rs PutLogEvents = <API key>
request = post "PutLogEvents"
response = jsonResponse
instance FromJSON <API key> where
parseJSON = withObject "<API key>" $ \o -> <API key>
<$> o .:? "nextSequenceToken"
|
var test = require('./test-namer')('vm-to-zones');
var util = require('util');
var bunyan = require('bunyan');
var utils = require('../../lib/utils');
var buildZonesFromVm = require('../../lib/vm-to-zones');
var log = bunyan.createLogger({name: 'cns'});
test('basic single container', function (t) {
var config = {
forward_zones: {
'foo': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
services: [],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones), ['foo', '3.2.1.in-addr.arpa']);
t.deepEqual(Object.keys(zones['foo']), ['abc123.inst.def432']);
t.deepEqual(Object.keys(zones['3.2.1.in-addr.arpa']), ['4']);
var fwd = zones['foo']['abc123.inst.def432'];
t.deepEqual(fwd, [
{constructor: 'A', args: ['1.2.3.4']},
{constructor: 'TXT', args: ['abc123']}
]);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['abc123.inst.def432.foo']}
]);
t.end();
});
test('cloudapi instance', function (t) {
var config = {
forward_zones: {
'foo': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
services: [ { name: 'cloudapi', ports: [] } ],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432',
login: 'admin'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones), ['foo', '3.2.1.in-addr.arpa']);
t.deepEqual(Object.keys(zones['foo']), [
'abc123.inst.def432', 'cloudapi.svc.def432', 'cloudapi']);
t.deepEqual(Object.keys(zones['3.2.1.in-addr.arpa']), ['4']);
var fwd = zones['foo']['cloudapi'];
t.deepEqual(fwd, [
{constructor: 'A', args: ['1.2.3.4'], src: 'abc123'},
{constructor: 'TXT', args: ['abc123'], src: 'abc123'}
]);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['abc123.inst.def432.foo']}
]);
t.end();
});
test('with use_alias', function (t) {
var config = {
use_alias: true,
forward_zones: {
'foo': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
alias: 'test',
services: [],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones), ['foo', '3.2.1.in-addr.arpa']);
t.deepEqual(Object.keys(zones['foo']),
['abc123.inst.def432', 'test.inst.def432']);
t.deepEqual(Object.keys(zones['3.2.1.in-addr.arpa']), ['4']);
var fwd = zones['foo']['test.inst.def432'];
t.deepEqual(fwd, [
{constructor: 'A', args: ['1.2.3.4']},
{constructor: 'TXT', args: ['abc123']}
]);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['test.inst.def432.foo']}
]);
t.end();
});
test('with use_login', function (t) {
var config = {
use_login: true,
forward_zones: {
'foo': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
alias: 'test',
services: [],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432',
login: 'bar'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones), ['foo', '3.2.1.in-addr.arpa']);
t.deepEqual(Object.keys(zones['foo']),
['abc123.inst.def432', 'abc123.inst.bar']);
t.deepEqual(Object.keys(zones['3.2.1.in-addr.arpa']), ['4']);
var fwd = zones['foo']['abc123.inst.bar'];
t.deepEqual(fwd, [
{constructor: 'A', args: ['1.2.3.4']},
{constructor: 'TXT', args: ['abc123']}
]);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['abc123.inst.bar.foo']}
]);
t.end();
});
test('with use_alias and use_login', function (t) {
var config = {
use_alias: true,
use_login: true,
forward_zones: {
'foo': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
alias: 'test',
services: [],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432',
login: 'bar'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones), ['foo', '3.2.1.in-addr.arpa']);
t.deepEqual(Object.keys(zones['foo']),
['abc123.inst.def432', 'abc123.inst.bar', 'test.inst.def432',
'test.inst.bar']);
t.deepEqual(Object.keys(zones['3.2.1.in-addr.arpa']), ['4']);
var fwd = zones['foo']['test.inst.bar'];
t.deepEqual(fwd, [
{constructor: 'A', args: ['1.2.3.4']},
{constructor: 'TXT', args: ['abc123']}
]);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['test.inst.bar.foo']}
]);
t.end();
});
test('using a PTR name', function (t) {
var config = {
use_alias: true,
use_login: true,
forward_zones: {
'foo': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
alias: 'test',
services: [],
ptrname: 'test.something.com',
listInstance: true,
listServices: true,
owner: {
uuid: 'def432',
login: 'bar'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones), ['foo', '3.2.1.in-addr.arpa']);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['test.something.com']}
]);
t.end();
});
test('multi-zone', function (t) {
var config = {
use_alias: true,
use_login: true,
forward_zones: {
'foo': {},
'bar': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
alias: 'test',
services: [],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432',
login: 'bar'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo']
},
{
ip: '3.2.1.4',
zones: ['bar']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones).sort(),
['1.2.3.in-addr.arpa', '3.2.1.in-addr.arpa', 'bar', 'foo']);
t.deepEqual(Object.keys(zones['foo']).sort(),
['abc123.inst.bar', 'abc123.inst.def432', 'test.inst.bar',
'test.inst.def432']);
t.deepEqual(Object.keys(zones['bar']).sort(),
Object.keys(zones['foo']).sort());
t.deepEqual(Object.keys(zones['3.2.1.in-addr.arpa']), ['4']);
t.deepEqual(Object.keys(zones['1.2.3.in-addr.arpa']), ['4']);
var fwd = zones['foo']['test.inst.bar'];
t.deepEqual(fwd, [
{constructor: 'A', args: ['1.2.3.4']},
{constructor: 'TXT', args: ['abc123']}
]);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['test.inst.bar.foo']}
]);
var rev2 = zones['1.2.3.in-addr.arpa']['4'];
t.deepEqual(rev2, [
{constructor: 'PTR', args: ['test.inst.bar.bar']}
]);
t.end();
});
test('multi-zone, single PTRs', function (t) {
var config = {
use_alias: true,
use_login: true,
forward_zones: {
'foo': {},
'bar': {},
'baz': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
alias: 'test',
services: [],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432',
login: 'bar'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo', 'bar']
},
{
ip: '3.2.1.4',
zones: ['baz']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones).sort(),
['1.2.3.in-addr.arpa', '3.2.1.in-addr.arpa', 'bar', 'baz', 'foo']);
t.deepEqual(Object.keys(zones['foo']).sort(),
['abc123.inst.bar', 'abc123.inst.def432', 'test.inst.bar',
'test.inst.def432']);
t.deepEqual(Object.keys(zones['bar']).sort(),
Object.keys(zones['foo']).sort());
t.deepEqual(Object.keys(zones['3.2.1.in-addr.arpa']), ['4']);
t.deepEqual(Object.keys(zones['1.2.3.in-addr.arpa']), ['4']);
var fwd = zones['foo']['test.inst.bar'];
t.deepEqual(fwd, [
{constructor: 'A', args: ['1.2.3.4']},
{constructor: 'TXT', args: ['abc123']}
]);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['test.inst.bar.foo']}
]);
var rev2 = zones['1.2.3.in-addr.arpa']['4'];
t.deepEqual(rev2, [
{constructor: 'PTR', args: ['test.inst.bar.baz']}
]);
t.end();
});
test('multi-zone, shortest zone priority PTR', function (t) {
var config = {
use_alias: true,
use_login: true,
forward_zones: {
'foobarbaz': {},
'foobar': {},
'baz': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
alias: 'test',
services: [],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432',
login: 'bar'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foobar', 'foobarbaz', 'baz']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
var rev = zones['3.2.1.in-addr.arpa']['4'];
t.deepEqual(rev, [
{constructor: 'PTR', args: ['test.inst.bar.baz']}
]);
t.end();
});
test('service with srvs', function (t) {
var config = {
use_alias: true,
forward_zones: {
'foo': {}
},
reverse_zones: {}
};
var vm = {
uuid: 'abc123',
alias: 'test',
services: [
{ name: 'svc1', ports: [1234, 1235] }
],
listInstance: true,
listServices: true,
owner: {
uuid: 'def432'
},
nics: [
{
ip: '1.2.3.4',
zones: ['foo']
}
]
};
var zones = buildZonesFromVm(vm, config, log);
t.deepEqual(Object.keys(zones), ['foo', '3.2.1.in-addr.arpa']);
t.deepEqual(Object.keys(zones['foo']),
['abc123.inst.def432', 'test.inst.def432', 'svc1.svc.def432']);
var fwd = zones['foo']['test.inst.def432'];
t.deepEqual(fwd, [
{constructor: 'A', args: ['1.2.3.4']},
{constructor: 'TXT', args: ['abc123']}
]);
var svc = zones['foo']['svc1.svc.def432'];
t.deepEqual(svc, [
{constructor: 'A', args: ['1.2.3.4'], src: 'abc123'},
{constructor: 'TXT', args: ['abc123'], src: 'abc123'},
{constructor: 'SRV', args: ['test.inst.def432.foo', 1234],
src: 'abc123'},
{constructor: 'SRV', args: ['test.inst.def432.foo', 1235],
src: 'abc123'}
]);
t.end();
});
|
from cProfile import Profile
from optparse import make_option
from django.conf import settings
from django.core.management.base import (BaseCommand,
CommandError)
from treeherder.etl.buildapi import (Builds4hJobsProcess,
PendingJobsProcess,
RunningJobsProcess)
from treeherder.etl.pushlog import HgPushlogProcess
from treeherder.model.derived import RefDataManager
class Command(BaseCommand):
"""Management command to ingest data from a single push."""
help = "Ingests a single push into treeherder"
args = '<project> <changeset>'
option_list = BaseCommand.option_list + (
make_option('--profile-file',
action='store',
dest='profile_file',
default=None,
help='Profile command and write result to profile file'),
make_option('--filter-job-group',
action='store',
dest='filter_job_group',
default=None,
help="Only process jobs in specified group symbol "
"(e.g. 'T')")
)
def _handle(self, *args, **options):
if len(args) != 2:
raise CommandError("Need to specify (only) branch and changeset")
(project, changeset) = args
# get reference to repo
rdm = RefDataManager()
repos = filter(lambda x: x['name'] == project,
rdm.<API key>())
if not repos:
raise CommandError("No project found named '%s'" % project)
repo = repos[0]
# make sure all tasks are run synchronously / immediately
settings.CELERY_ALWAYS_EAGER = True
# get hg pushlog
pushlog_url = '%s/json-pushes/?full=1&version=2' % repo['url']
# ingest this particular revision for this project
process = HgPushlogProcess()
# Use the actual push SHA, in case the changeset specified was a tag
# or branch name (eg tip). HgPushlogProcess returns the full SHA, but
# job ingestion expects the short version, so we truncate it.
push_sha = process.run(pushlog_url, project, changeset=changeset)[0:12]
Builds4hJobsProcess().run(filter_to_project=project,
filter_to_revision=push_sha,
filter_to_job_group=options['filter_job_group'])
PendingJobsProcess().run(filter_to_project=project,
filter_to_revision=push_sha,
filter_to_job_group=options['filter_job_group'])
RunningJobsProcess().run(filter_to_project=project,
filter_to_revision=push_sha,
filter_to_job_group=options['filter_job_group'])
def handle(self, *args, **options):
if options['profile_file']:
profiler = Profile()
profiler.runcall(self._handle, *args, **options)
profiler.dump_stats(options['profile_file'])
else:
self._handle(*args, **options)
|
<header class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Chamilo Messaging</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" id="messages-update">
<i class="glyphicon glyphicon-refresh"></i> Actualizar
</a>
</li>
<li>
<a href="#logout">
<i class="glyphicon glyphicon-log-out"></i> Cerrar sesión
</a>
</li>
</ul>
</div>
</div>
</div>
</header>
<div class="container">
<div class="list-group" id="messages-list"></div>
</div>
|
<?php
return function ($bh) {
$bh->match('progressbar', function($ctx, $json) {
$val = $json->val ?: 0;
$ctx
->js([ 'val' => $val ])
->content([
'elem' => 'bar',
'attrs' => [ 'style' => 'width:' . $val . '%' ]
]);
});
};
|
// Code generated. DO NOT EDIT.
// Management Agent API
// API for Management Agent Cloud Service
package managementagent
// EditModesEnum Enum with underlying type: string
type EditModesEnum string
// Set of constants representing the allowable values for EditModesEnum
const (
EditModesReadOnly EditModesEnum = "READ_ONLY"
EditModesWritable EditModesEnum = "WRITABLE"
EditModesExtensible EditModesEnum = "EXTENSIBLE"
)
var mappingEditModes = map[string]EditModesEnum{
"READ_ONLY": EditModesReadOnly,
"WRITABLE": EditModesWritable,
"EXTENSIBLE": EditModesExtensible,
}
// <API key> Enumerates the set of values for EditModesEnum
func <API key>() []EditModesEnum {
values := make([]EditModesEnum, 0)
for _, v := range mappingEditModes {
values = append(values, v)
}
return values
}
|
#include "p12plcy.h"
#include "secoid.h"
#include "secport.h"
#include "secpkcs5.h"
#define PKCS12_NULL 0x0000
typedef struct pkcs12SuiteMapStr {
SECOidTag algTag;
unsigned int keyLengthBits; /* in bits */
unsigned long suite;
PRBool allowed;
PRBool preferred;
} pkcs12SuiteMap;
static pkcs12SuiteMap pkcs12SuiteMaps[] = {
{ SEC_OID_RC4, 40, PKCS12_RC4_40, PR_FALSE, PR_FALSE },
{ SEC_OID_RC4, 128, PKCS12_RC4_128, PR_FALSE, PR_FALSE },
{ SEC_OID_RC2_CBC, 40, PKCS12_RC2_CBC_40, PR_FALSE, PR_TRUE },
{ SEC_OID_RC2_CBC, 128, PKCS12_RC2_CBC_128, PR_FALSE, PR_FALSE },
{ SEC_OID_DES_CBC, 64, PKCS12_DES_56, PR_FALSE, PR_FALSE },
{ <API key>, 192, PKCS12_DES_EDE3_168, PR_FALSE, PR_FALSE },
{ SEC_OID_UNKNOWN, 0, PKCS12_NULL, PR_FALSE, PR_FALSE },
{ SEC_OID_UNKNOWN, 0, 0L, PR_FALSE, PR_FALSE }
};
/* determine if algid is an algorithm which is allowed */
PRBool
<API key>(SECAlgorithmID *algid)
{
unsigned int keyLengthBits;
SECOidTag algId;
int i;
algId = <API key>(algid);
if (algId == SEC_OID_UNKNOWN) {
return PR_FALSE;
}
keyLengthBits = (unsigned int)(<API key>(algid) * 8);
i = 0;
while (pkcs12SuiteMaps[i].algTag != SEC_OID_UNKNOWN) {
if ((pkcs12SuiteMaps[i].algTag == algId) &&
(pkcs12SuiteMaps[i].keyLengthBits == keyLengthBits)) {
return pkcs12SuiteMaps[i].allowed;
}
i++;
}
return PR_FALSE;
}
/* is any encryption allowed? */
PRBool
<API key>(void)
{
int i;
i = 0;
while (pkcs12SuiteMaps[i].algTag != SEC_OID_UNKNOWN) {
if (pkcs12SuiteMaps[i].allowed == PR_TRUE) {
return PR_TRUE;
}
i++;
}
return PR_FALSE;
}
SECStatus
<API key>(long which, int on)
{
int i;
i = 0;
while (pkcs12SuiteMaps[i].suite != 0L) {
if (pkcs12SuiteMaps[i].suite == (unsigned long)which) {
if (on) {
pkcs12SuiteMaps[i].allowed = PR_TRUE;
} else {
pkcs12SuiteMaps[i].allowed = PR_FALSE;
}
return SECSuccess;
}
i++;
}
return SECFailure;
}
SECStatus
<API key>(long which, int on)
{
int i;
PRBool turnedOff = PR_FALSE;
PRBool turnedOn = PR_FALSE;
i = 0;
while (pkcs12SuiteMaps[i].suite != 0L) {
if (pkcs12SuiteMaps[i].preferred == PR_TRUE) {
pkcs12SuiteMaps[i].preferred = PR_FALSE;
turnedOff = PR_TRUE;
}
if (pkcs12SuiteMaps[i].suite == (unsigned long)which) {
pkcs12SuiteMaps[i].preferred = PR_TRUE;
turnedOn = PR_TRUE;
}
i++;
}
if ((turnedOn) && (turnedOff)) {
return SECSuccess;
}
return SECFailure;
}
|
package de.maxgb.vertretungsplan.manager;
import android.content.Context;
import android.os.AsyncTask;
import de.maxgb.android.util.Logger;
import de.maxgb.vertretungsplan.util.Constants;
import de.maxgb.vertretungsplan.util.Stunde;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
public class StundenplanManager {
public static final int BEGINN_NACHMITTAG = 8;
public static final int ANZAHL_SAMSTAG = 4;
public static final int ANZAHL_NACHMITTAG = 2;
private static StundenplanManager instance;
public static synchronized StundenplanManager getInstance(Context context) {
if (instance == null) {
instance = new StundenplanManager(context);
}
return instance;
}
private final String TAG = "StundenplanManager";
private int lastResult = 0;
private ArrayList<Stunde[]> woche;
private Context context;
private ArrayList<OnUpdateListener> listener = new ArrayList<OnUpdateListener>();
private StundenplanManager(Context context) {
this.context = context;
auswerten();
}
public void asyncAuswerten() {
AuswertenTask task = new AuswertenTask();
task.execute();
}
public void auswerten() {
lastResult = dateiAuswerten();
if (lastResult == -1) {
} else {
woche = null;
}
}
public void auswertenWithNotify() {
auswerten();
notifyListener();
}
public ArrayList<Stunde[]> <API key>() {
if (woche == null) return null;
ArrayList<Stunde[]> clone;
try {
clone = new ArrayList<Stunde[]>(woche.size());
for (Stunde[] item : woche) {
Stunde[] clone2 = new Stunde[item.length];
for (int i = 0; i < item.length; i++) {
clone2[i] = item[i].clone();
}
clone.add(clone2);
}
return clone;
} catch (<API key> e) {
Logger.e(TAG, "Failed to clone stundenplan", e);
return null;
}
}
public String getLastResult() {
switch (lastResult) {
case -1:
return "Erfolgreich ausgewertet";
case 1:
return "Datei existiert nicht";
case 2:
return "Kann Datei nicht lesen";
case 3:
return "Zugriffsfehler";
case 4:
return "Parsingfehler";
default:
return "Noch nicht ausgewertet";
}
}
public ArrayList<Stunde[]> getStundenplan() {
return woche;
}
public void notifyListener() {
for (int i = 0; i < listener.size(); i++) {
if (listener.get(i) != null) {
listener.get(i).onStundenplanUpdate();
}
}
}
public void <API key>(OnUpdateListener listener) {
this.listener.add(listener);
}
public void <API key>(OnUpdateListener listener) {
this.listener.remove(listener);
}
private Stunde[] <API key>(JSONArray tag) throws JSONException {
Stunde[] result = new Stunde[BEGINN_NACHMITTAG - 1 + ANZAHL_NACHMITTAG];
for (int i = 0; i < BEGINN_NACHMITTAG - 1 + ANZAHL_NACHMITTAG; i++) {
JSONArray stunde = tag.getJSONArray(i);
if (i >= BEGINN_NACHMITTAG - 1) {
result[i] = new Stunde(stunde.getString(0), stunde.getString(1), i + 1, stunde.getString(2));
} else {
result[i] = new Stunde(stunde.getString(0), stunde.getString(1), i + 1);
}
}
return result;
}
/**
* Wertet die Stundenplandatei aus
*
* @return Fehlercode -1 bei Erfolg,1 Datei existiert nicht, 2 Datei kann nicht gelesen werden,3 Fehler beim Lesen,4 Fehler
* beim Parsen
*
*/
private int dateiAuswerten() {
File loadoutFile = new File(context.getFilesDir(), Constants.SP_FILE_NAME);
ArrayList<Stunde[]> w = new ArrayList<Stunde[]>();
if (!loadoutFile.exists()) {
Logger.w(TAG, "Stundenplan file doesn´t exist");
return 1;
}
if (!loadoutFile.canRead()) {
Logger.w(TAG, "Can´t read Stundenplan file");
return 2;
}
try {
BufferedReader br = new BufferedReader(new FileReader(loadoutFile));
String line = br.readLine();
br.close();
JSONObject stundenplan = new JSONObject(line);
JSONArray mo = stundenplan.getJSONArray("mo");
JSONArray di = stundenplan.getJSONArray("di");
JSONArray mi = stundenplan.getJSONArray("mi");
JSONArray d = stundenplan.getJSONArray("do");
JSONArray fr = stundenplan.getJSONArray("fr");
JSONObject sa = stundenplan.getJSONObject("sa");
// Samstag
Stunde[] samstag = new Stunde[9];
JSONArray eins = sa.getJSONArray("0");
JSONArray zwei = sa.getJSONArray("1");
JSONArray drei = sa.getJSONArray("2");
JSONArray vier = sa.getJSONArray("3");
JSONArray acht = sa.getJSONArray("7");
JSONArray neun = sa.getJSONArray("8");
samstag[0] = new Stunde(eins.getString(0), eins.getString(1), 1);
samstag[1] = new Stunde(zwei.getString(0), zwei.getString(1), 2);
samstag[2] = new Stunde(drei.getString(0), drei.getString(1), 3);
samstag[3] = new Stunde(vier.getString(0), vier.getString(1), 4);
samstag[4] = new Stunde("", "", 5);
samstag[5] = new Stunde("", "", 6);
samstag[6] = new Stunde("", "", 7);
samstag[7] = new Stunde(acht.getString(0), acht.getString(1), 8, acht.getString(2));
samstag[8] = new Stunde(neun.getString(0), neun.getString(1), 9, neun.getString(2));
w.add(<API key>(mo));
w.add(<API key>(di));
w.add(<API key>(mi));
w.add(<API key>(d));
w.add(<API key>(fr));
w.add(samstag);
/*
* for(int i=0;i<w.size();i++){ for(int j=0;j<w.get(i).length;j++){ System.out.println(w.get(i)[j].toString()); } }
*/
} catch (IOException e) {
Logger.e(TAG, "Fehler beim Lesen der Datei", e);
return 3;
} catch (JSONException e) {
Logger.e(TAG, "Fehler beim Parsen der Datei", e);
return 4;
}
woche = w;
return -1;
}
public interface OnUpdateListener {
void onStundenplanUpdate();
}
private class AuswertenTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
auswerten();
return null;
}
@Override
protected void onPostExecute(Void v) {
notifyListener();
}
}
}
|
import tape from 'tape'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { <API key> } from '@ethereumjs/tx'
import { Block } from '@ethereumjs/block'
import { PeerPool } from '../../lib/net/peerpool'
import { TxPool } from '../../lib/sync/txpool'
import { Config } from '../../lib/config'
tape('[TxPool]', async (t) => {
const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London })
const config = new Config({ transports: [] })
const A = {
address: Buffer.from('<SHA1-like>', 'hex'),
privateKey: Buffer.from(
'<SHA256-like>',
'hex'
),
}
const B = {
address: Buffer.from('<SHA1-like>', 'hex'),
privateKey: Buffer.from(
'<SHA256-like>',
'hex'
),
}
const createTx = (from = A, to = B, nonce = 0, value = 1) => {
const txData = {
nonce,
maxFeePerGas: 1000000000,
<API key>: 100000000,
gasLimit: 100000,
to: to.address,
value,
}
const tx = <API key>.fromTxData(txData, { common })
const signedTx = tx.sign(from.privateKey)
return signedTx
}
const txA01 = createTx() // A -> B, nonce: 0, value: 1
const txA02 = createTx(A, B, 0, 2) // A -> B, nonce: 0, value: 2 (different hash)
const txB01 = createTx(B, A) // B -> A, nonce: 0, value: 1
const txB02 = createTx(B, A, 1, 5) // B -> A, nonce: 1, value: 5
t.test('should initialize correctly', (t) => {
const config = new Config({ transports: [] })
const pool = new TxPool({ config })
t.equal(pool.pool.size, 0, 'pool empty')
t.notOk((pool as any).opened, 'pool not opened yet')
pool.open()
t.ok((pool as any).opened, 'pool opened')
pool.start()
t.ok((pool as any).running, 'pool running')
pool.stop()
t.notOk((pool as any).running, 'pool not running anymore')
pool.close()
t.notOk((pool as any).opened, 'pool not opened anymore')
t.end()
})
t.test('should open/close', async (t) => {
t.plan(3)
const config = new Config({ transports: [] })
const pool = new TxPool({ config })
pool.open()
pool.start()
t.ok((pool as any).opened, 'pool opened')
t.equals(pool.open(), false, 'already opened')
pool.stop()
pool.close()
t.notOk((pool as any).opened, 'closed')
})
t.test('announcedTxHashes() -> add single tx / knownByPeer / getByHash()', async (t) => {
// Safeguard that send() method from peer2 gets called
t.plan(12)
const pool = new TxPool({ config })
pool.open()
pool.start()
const peer: any = {
id: '1',
eth: {
<API key>: () => {
return [null, [txA01]]
},
send: () => {
t.fail('should not send to announcing peer')
},
},
}
let sentToPeer2 = 0
const peer2: any = {
id: '2',
eth: {
send: () => {
sentToPeer2++
t.equal(sentToPeer2, 1, 'should send once to non-announcing peer')
},
},
}
const peerPool = new PeerPool({ config })
peerPool.add(peer)
peerPool.add(peer2)
await pool.<API key>([txA01.hash()], peer, peerPool)
t.equal(pool.pool.size, 1, 'pool size 1')
t.equal((pool as any).pending.length, 0, 'cleared pending txs')
t.equal((pool as any).handled.size, 1, 'added to handled txs')
t.equal((pool as any).knownByPeer.size, 2, 'known tx hashes size 2 (entries for both peers)')
t.equal((pool as any).knownByPeer.get(peer.id).length, 1, 'one tx added for peer 1')
t.equal(
(pool as any).knownByPeer.get(peer.id)[0].hash,
txA01.hash().toString('hex'),
'new known tx hashes entry for announcing peer'
)
const txs = pool.getByHash([txA01.hash()])
t.equal(txs.length, 1, 'should get correct number of txs by hash')
t.equal(
txs[0].serialize().toString('hex'),
txA01.serialize().toString('hex'),
'should get correct tx by hash'
)
pool.pool.clear()
await pool.<API key>([txA01.hash()], peer, peerPool)
t.equal(pool.pool.size, 0, 'should not add a once handled tx')
t.equal(
(pool as any).knownByPeer.get(peer.id).length,
1,
'should add tx only once to known tx hashes'
)
t.equal((pool as any).knownByPeer.size, 2, 'known tx hashes size 2 (entries for both peers)')
pool.stop()
pool.close()
})
t.test('announcedTxHashes() -> TX_RETRIEVAL_LIMIT', async (t) => {
const pool = new TxPool({ config })
const TX_RETRIEVAL_LIMIT: number = (pool as any).TX_RETRIEVAL_LIMIT
pool.open()
pool.start()
const peer = {
eth: {
<API key>: (res: any) => {
t.equal(res['hashes'].length, TX_RETRIEVAL_LIMIT, 'should limit to TX_RETRIEVAL_LIMIT')
return [null, []]
},
},
}
const peerPool = new PeerPool({ config })
const hashes = []
for (let i = 1; i <= TX_RETRIEVAL_LIMIT + 1; i++) {
// One more than TX_RETRIEVAL_LIMIT
hashes.push(Buffer.from(i.toString().padStart(64, '0'), 'hex')) // '<SHA256-like>',...
}
await pool.<API key>(hashes, peer as any, peerPool)
pool.stop()
pool.close()
})
t.test('announcedTxHashes() -> add two txs (different sender)', async (t) => {
const pool = new TxPool({ config })
pool.open()
pool.start()
const peer: any = {
eth: {
<API key>: () => {
return [null, [txA01, txB01]]
},
},
}
const peerPool = new PeerPool({ config })
await pool.<API key>([txA01.hash(), txB01.hash()], peer, peerPool)
t.equal(pool.pool.size, 2, 'pool size 2')
pool.stop()
pool.close()
})
t.test('announcedTxHashes() -> add two txs (same sender and nonce)', async (t) => {
const config = new Config({ transports: [] })
const pool = new TxPool({ config })
pool.open()
pool.start()
const peer: any = {
eth: {
<API key>: () => {
return [null, [txA01, txA02]]
},
},
}
const peerPool = new PeerPool({ config })
await pool.<API key>([txA01.hash(), txA02.hash()], peer, peerPool)
t.equal(pool.pool.size, 1, 'pool size 1')
const address = A.address.toString('hex')
const poolContent = pool.pool.get(address)!
t.equal(poolContent.length, 1, 'only one tx')
t.deepEqual(poolContent[0].tx.hash(), txA02.hash(), 'only later-added tx')
pool.stop()
pool.close()
})
t.test('announcedTxs()', async (t) => {
const config = new Config({ transports: [] })
const pool = new TxPool({ config })
pool.open()
pool.start()
const peer: any = {
eth: {
send: () => {},
},
}
const peerPool = new PeerPool({ config })
await pool.handleAnnouncedTxs([txA01], peer, peerPool)
t.equal(pool.pool.size, 1, 'pool size 1')
const address = A.address.toString('hex')
const poolContent = pool.pool.get(address)!
t.equal(poolContent.length, 1, 'one tx')
t.deepEqual(poolContent[0].tx.hash(), txA01.hash(), 'correct tx')
pool.stop()
pool.close()
})
t.test('newBlocks() -> should remove included txs', async (t) => {
const config = new Config({ transports: [] })
const pool = new TxPool({ config })
pool.open()
pool.start()
let peer: any = {
eth: {
<API key>: () => {
return [null, [txA01]]
},
},
}
const peerPool = new PeerPool({ config })
await pool.<API key>([txA01.hash()], peer, peerPool)
t.equal(pool.pool.size, 1, 'pool size 1')
// Craft block with tx not in pool
let block = Block.fromBlockData({ transactions: [txA02] }, { common })
pool.removeNewBlockTxs([block])
t.equal(pool.pool.size, 1, 'pool size 1')
// Craft block with tx in pool
block = Block.fromBlockData({ transactions: [txA01] }, { common })
pool.removeNewBlockTxs([block])
t.equal(pool.pool.size, 0, 'pool should be empty')
peer = {
eth: {
<API key>: () => {
return [null, [txB01, txB02]]
},
},
}
await pool.<API key>([txB01.hash(), txB02.hash()], peer, peerPool)
t.equal(pool.pool.size, 1, 'pool size 1')
const address = B.address.toString('hex')
let poolContent = pool.pool.get(address)!
t.equal(poolContent.length, 2, 'two txs')
// Craft block with tx not in pool
block = Block.fromBlockData({ transactions: [txA02] }, { common })
pool.removeNewBlockTxs([block])
t.equal(pool.pool.size, 1, 'pool size 1')
poolContent = pool.pool.get(address)!
t.equal(poolContent.length, 2, 'two txs')
// Craft block with tx in pool
block = Block.fromBlockData({ transactions: [txB01] }, { common })
pool.removeNewBlockTxs([block])
poolContent = pool.pool.get(address)!
t.equal(poolContent.length, 1, 'only one tx')
// Craft block with tx in pool
block = Block.fromBlockData({ transactions: [txB02] }, { common })
pool.removeNewBlockTxs([block])
t.equal(pool.pool.size, 0, 'pool size 0')
pool.stop()
pool.close()
})
t.test('cleanup()', async (t) => {
const pool = new TxPool({ config })
pool.open()
pool.start()
const peer: any = {
eth: {
<API key>: () => {
return [null, [txA01, txB01]]
},
},
send: () => {},
}
const peerPool = new PeerPool({ config })
peerPool.add(peer)
await pool.<API key>([txA01.hash(), txB01.hash()], peer, peerPool)
t.equal(pool.pool.size, 2, 'pool size 2')
t.equal((pool as any).handled.size, 2, 'handled size 2')
t.equal((pool as any).knownByPeer.size, 1, 'known by peer size 1')
t.equal((pool as any).knownByPeer.get(peer.id).length, 2, '2 known txs')
pool.cleanup()
t.equal(
pool.pool.size,
2,
'should not remove txs from pool (<API key> within range)'
)
t.equal(
(pool as any).knownByPeer.size,
1,
'should not remove txs from known by peer map (<API key> within range)'
)
t.equal(
(pool as any).handled.size,
2,
'should not remove txs from handled (<API key> within range)'
)
const address = txB01.getSenderAddress().toString().slice(2)
const poolObj = pool.pool.get(address)![0]
poolObj.added = Date.now() - pool.<API key> * 60 - 1
pool.pool.set(address, [poolObj])
const knownByPeerObj1 = (pool as any).knownByPeer.get(peer.id)[0]
const knownByPeerObj2 = (pool as any).knownByPeer.get(peer.id)[1]
knownByPeerObj1.added = Date.now() - pool.<API key> * 60 - 1
;(pool as any).knownByPeer.set(peer.id, [knownByPeerObj1, knownByPeerObj2])
const hash = txB01.hash().toString('hex')
const handledObj = (pool as any).handled.get(hash)
handledObj.added = Date.now() - pool.<API key> * 60 - 1
;(pool as any).handled.set(hash, handledObj)
pool.cleanup()
t.equal(
pool.pool.size,
1,
'should remove txs from pool (<API key> before range)'
)
t.equal(
(pool as any).knownByPeer.get(peer.id).length,
1,
'should remove one tx from known by peer map (<API key> before range)'
)
t.equal(
(pool as any).handled.size,
1,
'should remove txs from handled (<API key> before range)'
)
pool.stop()
pool.close()
})
})
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -<API key> #-}
{-# OPTIONS_GHC -<API key> #-}
{-# OPTIONS_GHC -<API key> #-}
-- Module : Network.Google.Resource.GamesConfiguration.<API key>.Get
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
-- Retrieves the metadata of the achievement configuration with the given
-- /See:/ <https://developers.google.com/games/ Google Play Game Services Publishing API Reference> for @gamesConfiguration.<API key>.get@.
module Network.Google.Resource.GamesConfiguration.<API key>.Get
(
-- * REST Resource
<API key>
-- * Creating a Request
, <API key>
, <API key>
-- * Request Lenses
, acgXgafv
, acgUploadProtocol
, acgAchievementId
, acgAccessToken
, acgUploadType
, acgCallback
) where
import Network.Google.GamesConfiguration.Types
import Network.Google.Prelude
-- | A resource alias for @gamesConfiguration.<API key>.get@ method which the
-- '<API key>' request conforms to.
type <API key> =
"games" :>
"v1configuration" :>
"achievements" :>
Capture "achievementId" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] <API key>
-- | Retrieves the metadata of the achievement configuration with the given
-- /See:/ '<API key>' smart constructor.
data <API key> =
<API key>'
{ _acgXgafv :: !(Maybe Xgafv)
, _acgUploadProtocol :: !(Maybe Text)
, _acgAchievementId :: !Text
, _acgAccessToken :: !(Maybe Text)
, _acgUploadType :: !(Maybe Text)
, _acgCallback :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of '<API key>' with the minimum fields required to make a request.
-- Use one of the following lenses to modify other fields as desired:
-- * 'acgXgafv'
-- * 'acgUploadProtocol'
-- * 'acgAchievementId'
-- * 'acgAccessToken'
-- * 'acgUploadType'
-- * 'acgCallback'
<API key>
:: Text -- ^ 'acgAchievementId'
-> <API key>
<API key> pAcgAchievementId_ =
<API key>'
{ _acgXgafv = Nothing
, _acgUploadProtocol = Nothing
, _acgAchievementId = pAcgAchievementId_
, _acgAccessToken = Nothing
, _acgUploadType = Nothing
, _acgCallback = Nothing
}
-- | V1 error format.
acgXgafv :: Lens' <API key> (Maybe Xgafv)
acgXgafv = lens _acgXgafv (\ s a -> s{_acgXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
acgUploadProtocol :: Lens' <API key> (Maybe Text)
acgUploadProtocol
= lens _acgUploadProtocol
(\ s a -> s{_acgUploadProtocol = a})
-- | The ID of the achievement used by this method.
acgAchievementId :: Lens' <API key> Text
acgAchievementId
= lens _acgAchievementId
(\ s a -> s{_acgAchievementId = a})
-- | OAuth access token.
acgAccessToken :: Lens' <API key> (Maybe Text)
acgAccessToken
= lens _acgAccessToken
(\ s a -> s{_acgAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
acgUploadType :: Lens' <API key> (Maybe Text)
acgUploadType
= lens _acgUploadType
(\ s a -> s{_acgUploadType = a})
-- | JSONP
acgCallback :: Lens' <API key> (Maybe Text)
acgCallback
= lens _acgCallback (\ s a -> s{_acgCallback = a})
instance GoogleRequest <API key>
where
type Rs <API key> =
<API key>
type Scopes <API key> =
'["https:
requestClient <API key>'{..}
= go _acgAchievementId _acgXgafv _acgUploadProtocol
_acgAccessToken
_acgUploadType
_acgCallback
(Just AltJSON)
<API key>
where go
= buildClient
(Proxy :: Proxy <API key>)
mempty
|
package minejava.reg.util.concurrent;
public interface RunnableFuture<V> extends Runnable, Future<V>{
@Override
void run();
}
|
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: predefined colorspaces, rec2020, percent values</title>
<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#predefined">
<link rel="match" href="greensquare-ref.html">
<meta name="assert" content="Color function with explicit rec2020 value as percent matches sRGB #009900">
<style>
.test { background-color: red; width: 12em; height: 6em; margin-top:0}
.ref { background-color: #009900; width: 12em; height: 6em; margin-bottom: 0}
.test {background-color: color(rec2020 33.033% 55.976% 14.863%)}
</style>
<body>
<p>Test passes if you see a green square, and no red.</p>
<p class="ref"> </p>
<p class="test"> </p>
</body>
|
FCKConfig.<API key> = '' ;
FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
FCKConfig.EditorAreaStyles = '' ;
FCKConfig.<API key> = '' ;
FCKConfig.DocType = '' ;
FCKConfig.BaseHref = '' ;
FCKConfig.FullPage = false ;
// The following option determines whether the "Show Blocks" feature is enabled or not at startup.
FCKConfig.StartupShowBlocks = false ;
FCKConfig.Debug = false ;
FCKConfig.<API key> = true ;
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
FCKConfig.SkinEditorCSS = '' ; // FCKConfig.SkinPath + "|<minified css>" ;
FCKConfig.SkinDialogCSS = '' ; // FCKConfig.SkinPath + "|<minified css>" ;
FCKConfig.PreloadImages = [ FCKConfig.SkinPath + 'images/toolbar.start.gif', FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ] ;
FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
// FCKConfig.Plugins.Add( 'autogrow' ) ;
// FCKConfig.Plugins.Add( 'dragresizetable' );
FCKConfig.AutoGrowMax = 400 ;
// FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ; // ASP style server side code <%...%>
// FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code
// FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control>
FCKConfig.AutoDetectLanguage = true ;
FCKConfig.DefaultLanguage = 'en' ;
FCKConfig.<API key> = 'ltr' ;
FCKConfig.ProcessHTMLEntities = true ;
FCKConfig.<API key> = true ;
FCKConfig.<API key> = true ;
FCKConfig.<API key> = false ;
FCKConfig.<API key> = '' ; // Single Quote: "'"
FCKConfig.FillEmptyBlocks = true ;
FCKConfig.FormatSource = true ;
FCKConfig.FormatOutput = true ;
FCKConfig.FormatIndentator = ' ' ;
FCKConfig.EMailProtection = 'encode' ; // none | encode | function
FCKConfig.<API key> = 'mt(NAME,DOMAIN,SUBJECT,BODY)' ;
FCKConfig.StartupFocus = false ;
FCKConfig.<API key> = false ;
FCKConfig.<API key> = true ; // IE only.
FCKConfig.ShowDropDialog = true ;
FCKConfig.<API key> = false ;
FCKConfig.TabSpaces = 0 ;
FCKConfig.ShowBorders = true ;
FCKConfig.SourcePopup = false ;
FCKConfig.<API key> = true ;
FCKConfig.ToolbarCanCollapse = true ;
FCKConfig.<API key> = true ;
FCKConfig.<API key> = 10000 ;
FCKConfig.HtmlEncodeOutput = false ;
FCKConfig.TemplateReplaceAll = true ;
FCKConfig.<API key> = true ;
FCKConfig.ToolbarLocation = 'In' ;
FCKConfig.ToolbarSets["Default"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'] // No comma for the last row.
] ;
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;
FCKConfig.EnterMode = 'p' ; // p | div | br
FCKConfig.ShiftEnterMode = 'br' ; // p | div | br
FCKConfig.Keystrokes = [
[ CTRL + 65 , true ],
[ CTRL + 67 , true ],
[ CTRL + 70 , true ],
[ CTRL + 83 , true ],
[ CTRL + 84 , true ],
[ CTRL + 88 , true ],
[ CTRL + 86 , 'Paste' ],
[ CTRL + 45 /*INS*/, true ],
[ SHIFT + 45 /*INS*/, 'Paste' ],
[ CTRL + 88 , 'Cut' ],
[ SHIFT + 46 /*DEL*/, 'Cut' ],
[ CTRL + 90 , 'Undo' ],
[ CTRL + 89 , 'Redo' ],
[ CTRL + SHIFT + 90 , 'Redo' ],
[ CTRL + 76 , 'Link' ],
[ CTRL + 66 , 'Bold' ],
[ CTRL + 73 , 'Italic' ],
[ CTRL + 85 , 'Underline' ],
[ CTRL + SHIFT + 83 , 'Save' ],
[ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ],
[ SHIFT + 32 /*SPACE*/, 'Nbsp' ]
] ;
FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form','DivContainer'] ;
FCKConfig.<API key> = false ;
FCKConfig.BrowserContextMenu = false ;
FCKConfig.<API key> = true ;
FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;
FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5;h6;pre;address;div' ;
FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
FCKConfig.FontSizes = 'smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large' ;
FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ;
FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ;
FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
FCKConfig.IeSpellDownloadUrl = 'http:
FCKConfig.<API key> = 'server-scripts/spellchecker.php' ; // Available extension: .php .cfm .pl
FCKConfig.FirefoxSpellChecker = false ;
FCKConfig.MaxUndoLevels = 15 ;
FCKConfig.<API key> = false ;
FCKConfig.<API key> = true ;
FCKConfig.LinkDlgHideTarget = false ;
FCKConfig.LinkDlgHideAdvanced = false ;
FCKConfig.ImageDlgHideLink = false ;
FCKConfig.<API key> = false ;
FCKConfig.<API key> = false ;
FCKConfig.ProtectedTags = '' ;
// This will be applied to the body element of the editor
FCKConfig.BodyId = '' ;
FCKConfig.BodyClass = '' ;
FCKConfig.DefaultStyleLabel = '' ;
FCKConfig.<API key> = '' ;
FCKConfig.DefaultFontLabel = '' ;
FCKConfig.<API key> = '' ;
FCKConfig.DefaultLinkTarget = '' ;
// The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word
FCKConfig.<API key> = false ;
// Only inline elements are valid.
FCKConfig.RemoveFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' ;
// Attributes that will be removed
FCKConfig.RemoveAttributes = 'class,style,lang,width,height,align,hspace,valign' ;
FCKConfig.CustomStyles =
{
'Red Title' : { Element : 'h3', Styles : { 'color' : 'Red' } }
};
// Do not add, rename or remove styles here. Only apply definition changes.
FCKConfig.CoreStyles =
{
// Basic Inline Styles.
'Bold' : { Element : 'strong', Overrides : 'b' },
'Italic' : { Element : 'em', Overrides : 'i' },
'Underline' : { Element : 'u' },
'StrikeThrough' : { Element : 'strike' },
'Subscript' : { Element : 'sub' },
'Superscript' : { Element : 'sup' },
// Basic Block Styles (Font Format Combo).
'p' : { Element : 'p' },
'div' : { Element : 'div' },
'pre' : { Element : 'pre' },
'address' : { Element : 'address' },
'h1' : { Element : 'h1' },
'h2' : { Element : 'h2' },
'h3' : { Element : 'h3' },
'h4' : { Element : 'h4' },
'h5' : { Element : 'h5' },
'h6' : { Element : 'h6' },
// Other formatting features.
'FontFace' :
{
Element : 'span',
Styles : { 'font-family' : '#("Font")' },
Overrides : [ { Element : 'font', Attributes : { 'face' : null } } ]
},
'Size' :
{
Element : 'span',
Styles : { 'font-size' : '#("Size","fontSize")' },
Overrides : [ { Element : 'font', Attributes : { 'size' : null } } ]
},
'Color' :
{
Element : 'span',
Styles : { 'color' : '#("Color","color")' },
Overrides : [ { Element : 'font', Attributes : { 'color' : null } } ]
},
'BackColor' : { Element : 'span', Styles : { 'background-color' : '#("Color","color")' } },
'SelectionHighlight' : { Element : 'span', Styles : { 'background-color' : 'navy', 'color' : 'white' } }
};
// The distance of an indentation step.
FCKConfig.IndentLength = 40 ;
FCKConfig.IndentUnit = 'px' ;
// Alternatively, FCKeditor allows the use of CSS classes for block indentation.
// This overrides the IndentLength/IndentUnit settings.
FCKConfig.IndentClasses = [] ;
// [ Left, Center, Right, Justified ]
FCKConfig.JustifyClasses = [] ;
// The following value defines which File Browser connector and Quick Upload
// "uploader" to use. It is valid for the default implementaion and it is here
// just to make this configuration file cleaner.
// It is not possible to change this value using an external file or even
// inline when creating the editor instance. In that cases you must set the
// values of LinkBrowserURL, ImageBrowserURL and so on.
// Custom implementations should just ignore it.
var <API key> = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
var <API key> = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
// Don't care about the following two lines. It just calculates the correct connector
// extension to use for the default File Browser (Perl uses "cgi").
var <API key> = <API key> == 'perl' ? 'cgi' : <API key> ;
var <API key> = <API key> == 'perl' ? 'cgi' : <API key> ;
FCKConfig.LinkBrowser = true ;
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + <API key> + '/connector.' + <API key> ) ;
FCKConfig.<API key> = FCKConfig.ScreenWidth * 0.7 ;
FCKConfig.<API key> = FCKConfig.ScreenHeight * 0.7 ;
FCKConfig.ImageBrowser = true ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + <API key> + '/connector.' + <API key> ) ;
FCKConfig.<API key> = FCKConfig.ScreenWidth * 0.7 ;
FCKConfig.<API key> = FCKConfig.ScreenHeight * 0.7 ;
FCKConfig.FlashBrowser = true ;
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + <API key> + '/connector.' + <API key> ) ;
FCKConfig.<API key> = FCKConfig.ScreenWidth * 0.7 ;
FCKConfig.<API key> = FCKConfig.ScreenHeight * 0.7 ;
FCKConfig.LinkUpload = true ;
FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + <API key> + '/upload.' + <API key> ;
FCKConfig.<API key> = ".(7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip)$" ; // empty for all
FCKConfig.<API key> = "" ; // empty for no one
FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + <API key> + '/upload.' + <API key> + '?Type=Image' ;
FCKConfig.<API key> = ".(jpg|gif|jpeg|png|bmp)$" ; // empty for all
FCKConfig.<API key> = "" ; // empty for no one
FCKConfig.FlashUpload = true ;
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + <API key> + '/upload.' + <API key> + '?Type=Flash' ;
FCKConfig.<API key> = ".(swf|flv)$" ; // empty for all
FCKConfig.<API key> = "" ; // empty for no one
FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ;
FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','<API key>.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;
FCKConfig.SmileyColumns = 8 ;
FCKConfig.SmileyWindowWidth = 320 ;
FCKConfig.SmileyWindowHeight = 210 ;
FCKConfig.<API key> = '#ffffff' ;
FCKConfig.<API key> = 0.50 ;
FCKConfig.<API key> = false ;
FCKConfig.<API key> = false ;
|
package testtravis;
import static org.junit.Assert.*;
import org.junit.Test;
public class Operar_unit {
@Test
public void testSumar() {
System.out.println("Sumar dos numeros");
int numero1 = 6;
int numero2 = 6;
Operaciones instance = new Operaciones();
int expResult = 12;
int result = instance.sumar(numero1, numero2);
assertEquals(expResult, result);
}
@Test
public void testRestar() {
System.out.println("Restar dos numeros");
int numero1 = 4;
int numero2 = 2;
Operaciones instance = new Operaciones();
int expResult = 2;
int result = instance.restar(numero1, numero2);
assertEquals(expResult, result);
}
@Test
public void testMultiplicar() {
System.out.println("Multiplicar dos numeros");
int numero1 = 3;
int numero2 =3;
Operaciones instance = new Operaciones();
int expResult = 9;
int result = instance.multiplicar(numero1, numero2);
assertEquals(expResult, result);
}
@Test
public void testDividir() {
System.out.println("Dividir Dos numeros");
int numero1 = 6;
int numero2 = 3;
Operaciones instance = new Operaciones();
int expResult = 2;
int result = instance.dividir(numero1, numero2);
assertEquals(expResult, result);
}
}
|
#ifndef <API key>
#define <API key>
#include "ast_node.h"
#include "ast_node_visitor.h"
#include <string>
namespace fparser
{
namespace ast
{
class MethodArgument : public ast::ASTNode
{
public:
virtual void accept(ASTNodeVisitor& visitor) override;
public:
MethodArgument();
virtual ~MethodArgument();
};
} // namespace ast
} // namespace fparser
#endif /* end of include guard: <API key> */
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
#ifndef <API key>
#define <API key>
#include "nsString.h"
#include "TimeUnits.h"
namespace mozilla {
nsCString DumpTimeRanges(const media::TimeIntervals& aRanges);
} // namespace mozilla
#endif /* <API key> */
|
SUBROUTINE PSGEQR2( M, N, A, IA, JA, DESCA, TAU, WORK, LWORK,
$ INFO )
*
* -- ScaLAPACK routine (version 1.7) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* May 25, 2001
*
* .. Scalar Arguments ..
INTEGER IA, INFO, JA, LWORK, M, N
* ..
* .. Array Arguments ..
INTEGER DESCA( * )
REAL A( * ), TAU( * ), WORK( * )
* ..
*
* Purpose
* =======
*
* PSGEQR2 computes a QR factorization of a real distributed M-by-N
* matrix sub( A ) = A(IA:IA+M-1,JA:JA+N-1) = Q * R.
*
* Notes
* =====
*
* Each global data object is described by an associated description
* vector. This vector stores the information required to establish
* the mapping between an object element and its corresponding process
* and memory location.
*
* Let A be a generic term for any 2D block cyclicly distributed array.
* Such a global array has an associated description vector DESCA.
* In the following comments, the character _ should be read as
* "of the global array".
*
* NOTATION STORED IN EXPLANATION
*
* DTYPE_A(global) DESCA( DTYPE_ )The descriptor type. In this case,
* DTYPE_A = 1.
* CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating
* the BLACS process grid A is distribu-
* ted over. The context itself is glo-
* bal, but the handle (the integer
* value) may vary.
* M_A (global) DESCA( M_ ) The number of rows in the global
* array A.
* N_A (global) DESCA( N_ ) The number of columns in the global
* array A.
* MB_A (global) DESCA( MB_ ) The blocking factor used to distribute
* the rows of the array.
* NB_A (global) DESCA( NB_ ) The blocking factor used to distribute
* the columns of the array.
* RSRC_A (global) DESCA( RSRC_ ) The process row over which the first
* row of the array A is distributed.
* CSRC_A (global) DESCA( CSRC_ ) The process column over which the
* first column of the array A is
* distributed.
* LLD_A (local) DESCA( LLD_ ) The leading dimension of the local
* array. LLD_A >= MAX(1,LOCr(M_A)).
*
* Let K be the number of rows or columns of a distributed matrix,
* and assume that its process grid has dimension p x q.
* LOCr( K ) denotes the number of elements of K that a process
* would receive if K were distributed over the p processes of its
* process column.
* Similarly, LOCc( K ) denotes the number of elements of K that a
* process would receive if K were distributed over the q processes of
* its process row.
* The values of LOCr() and LOCc() may be determined via a call to the
* ScaLAPACK tool function, NUMROC:
* LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ),
* LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ).
* An upper bound for these quantities may be computed by:
* LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A
* LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A
*
* Arguments
* =========
*
* M (global input) INTEGER
* The number of rows to be operated on, i.e. the number of rows
* of the distributed submatrix sub( A ). M >= 0.
*
* N (global input) INTEGER
* The number of columns to be operated on, i.e. the number of
* columns of the distributed submatrix sub( A ). N >= 0.
*
* A (local input/local output) REAL pointer into the
* local memory to an array of dimension (LLD_A, LOCc(JA+N-1)).
* On entry, the local pieces of the M-by-N distributed matrix
* sub( A ) which is to be factored. On exit, the elements on
* and above the diagonal of sub( A ) contain the min(M,N) by N
* upper trapezoidal matrix R (R is upper triangular if M >= N);
* the elements below the diagonal, with the array TAU,
* represent the orthogonal matrix Q as a product of elementary
* reflectors (see Further Details).
*
* IA (global input) INTEGER
* The row index in the global array A indicating the first
* row of sub( A ).
*
* JA (global input) INTEGER
* The column index in the global array A indicating the
* first column of sub( A ).
*
* DESCA (global and local input) INTEGER array of dimension DLEN_.
* The array descriptor for the distributed matrix A.
*
* TAU (local output) REAL, array, dimension
* LOCc(JA+MIN(M,N)-1). This array contains the scalar factors
* TAU of the elementary reflectors. TAU is tied to the
* distributed matrix A.
*
* WORK (local workspace/local output) REAL array,
* dimension (LWORK)
* On exit, WORK(1) returns the minimal and optimal LWORK.
*
* LWORK (local or global input) INTEGER
* The dimension of the array WORK.
* LWORK is local input and must be at least
* LWORK >= Mp0 + MAX( 1, Nq0 ), where
*
* IROFF = MOD( IA-1, MB_A ), ICOFF = MOD( JA-1, NB_A ),
* IAROW = INDXG2P( IA, MB_A, MYROW, RSRC_A, NPROW ),
* IACOL = INDXG2P( JA, NB_A, MYCOL, CSRC_A, NPCOL ),
* Mp0 = NUMROC( M+IROFF, MB_A, MYROW, IAROW, NPROW ),
* Nq0 = NUMROC( N+ICOFF, NB_A, MYCOL, IACOL, NPCOL ),
*
* and NUMROC, INDXG2P are ScaLAPACK tool functions;
* MYROW, MYCOL, NPROW and NPCOL can be determined by calling
* the subroutine BLACS_GRIDINFO.
*
* If LWORK = -1, then LWORK is global input and a workspace
* query is assumed; the routine only calculates the minimum
* and optimal size for all work arrays. Each of these
* values is returned in the first entry of the corresponding
* work array, and no error message is issued by PXERBLA.
*
* INFO (local output) INTEGER
* = 0: successful exit
* < 0: If the i-th argument is an array and the j-entry had
* an illegal value, then INFO = -(i*100+j), if the i-th
* argument is a scalar and had an illegal value, then
* INFO = -i.
*
* Further Details
* ===============
*
* The matrix Q is represented as a product of elementary reflectors
*
* Q = H(ja) H(ja+1) . . . H(ja+k-1), where k = min(m,n).
*
* Each H(i) has the form
*
* H(j) = I - tau * v * v'
*
* where tau is a real scalar, and v is a real vector with v(1:i-1) = 0
* and v(i) = 1; v(i+1:m) is stored on exit in A(ia+i:ia+m-1,ja+i-1),
* and tau in TAU(ja+i-1).
*
* =====================================================================
*
* .. Parameters ..
INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
$ LLD_, MB_, M_, NB_, N_, RSRC_
PARAMETER ( BLOCK_CYCLIC_2D = 1, DLEN_ = 9, DTYPE_ = 1,
$ CTXT_ = 2, M_ = 3, N_ = 4, MB_ = 5, NB_ = 6,
$ RSRC_ = 7, CSRC_ = 8, LLD_ = 9 )
REAL ONE
PARAMETER ( ONE = 1.0E+0 )
* ..
* .. Local Scalars ..
LOGICAL LQUERY
CHARACTER COLBTOP, ROWBTOP
INTEGER I, II, IACOL, IAROW, ICTXT, J, JJ, K, LWMIN,
$ MP, MYCOL, MYROW, NPCOL, NPROW, NQ
REAL AJJ, ALPHA
* ..
* .. External Subroutines ..
EXTERNAL BLACS_ABORT, BLACS_GRIDINFO, CHK1MAT, INFOG2L,
$ PSELSET, PSLARF, PSLARFG, PB_TOPGET,
$ PB_TOPSET, PXERBLA, SGEBR2D, SGEBS2D,
$ SLARFG, SSCAL
* ..
* .. External Functions ..
INTEGER INDXG2P, NUMROC
EXTERNAL INDXG2P, NUMROC
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN, MOD, REAL
* ..
* .. Executable Statements ..
*
* Get grid parameters
*
ICTXT = DESCA( CTXT_ )
CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
*
* Test the input parameters
*
INFO = 0
IF( NPROW.EQ.-1 ) THEN
INFO = -(600+CTXT_)
ELSE
CALL CHK1MAT( M, 1, N, 2, IA, JA, DESCA, 6, INFO )
IF( INFO.EQ.0 ) THEN
IAROW = INDXG2P( IA, DESCA( MB_ ), MYROW, DESCA( RSRC_ ),
$ NPROW )
IACOL = INDXG2P( JA, DESCA( NB_ ), MYCOL, DESCA( CSRC_ ),
$ NPCOL )
MP = NUMROC( M+MOD( IA-1, DESCA( MB_ ) ), DESCA( MB_ ),
$ MYROW, IAROW, NPROW )
NQ = NUMROC( N+MOD( JA-1, DESCA( NB_ ) ), DESCA( NB_ ),
$ MYCOL, IACOL, NPCOL )
LWMIN = MP + MAX( 1, NQ )
*
WORK( 1 ) = REAL( LWMIN )
LQUERY = ( LWORK.EQ.-1 )
IF( LWORK.LT.LWMIN .AND. .NOT.LQUERY )
$ INFO = -9
END IF
END IF
*
IF( INFO.NE.0 ) THEN
CALL PXERBLA( ICTXT, 'PSGEQR2', -INFO )
CALL BLACS_ABORT( ICTXT, 1 )
RETURN
ELSE IF( LQUERY ) THEN
RETURN
END IF
*
* Quick return if possible
*
IF( M.EQ.0 .OR. N.EQ.0 )
$ RETURN
*
CALL PB_TOPGET( ICTXT, 'Broadcast', 'Rowwise', ROWBTOP )
CALL PB_TOPGET( ICTXT, 'Broadcast', 'Columnwise', COLBTOP )
CALL PB_TOPSET( ICTXT, 'Broadcast', 'Rowwise', 'I-ring' )
CALL PB_TOPSET( ICTXT, 'Broadcast', 'Columnwise', ' ' )
*
IF( DESCA( M_ ).EQ.1 ) THEN
CALL INFOG2L( IA, JA, DESCA, NPROW, NPCOL, MYROW, MYCOL, II,
$ JJ, IAROW, IACOL )
IF( MYROW.EQ.IAROW ) THEN
NQ = NUMROC( JA+N-1, DESCA( NB_ ), MYCOL, DESCA( CSRC_ ),
$ NPCOL )
I = II+(JJ-1)*DESCA( LLD_ )
IF( MYCOL.EQ.IACOL ) THEN
AJJ = A( I )
CALL SLARFG( 1, AJJ, A( I ), 1, TAU( JJ ) )
IF( N.GT.1 ) THEN
ALPHA = ONE - TAU( JJ )
CALL SGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, ALPHA, 1 )
CALL SSCAL( NQ-JJ, ALPHA, A( I+DESCA( LLD_ ) ),
$ DESCA( LLD_ ) )
END IF
CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, TAU( JJ ),
$ 1 )
A( I ) = AJJ
ELSE
IF( N.GT.1 ) THEN
CALL SGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, ALPHA,
$ 1, IAROW, IACOL )
CALL SSCAL( NQ-JJ+1, ALPHA, A( I ), DESCA( LLD_ ) )
END IF
END IF
ELSE IF( MYCOL.EQ.IACOL ) THEN
CALL SGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, TAU( JJ ), 1,
$ IAROW, IACOL )
END IF
*
ELSE
*
K = MIN( M, N )
DO 10 J = JA, JA+K-1
I = IA + J - JA
*
* Generate elementary reflector H(j) to annihilate
* A(i+1:ia+m-1,j)
*
CALL PSLARFG( M-J+JA, AJJ, I, J, A, MIN( I+1, IA+M-1 ), J,
$ DESCA, 1, TAU )
IF( J.LT.JA+N-1 ) THEN
*
* Apply H(j)' to A(i:ia+m-1,j+1:ja+n-1) from the left
*
CALL PSELSET( A, I, J, DESCA, ONE )
*
CALL PSLARF( 'Left', M-J+JA, N-J+JA-1, A, I, J, DESCA, 1,
$ TAU, A, I, J+1, DESCA, WORK )
END IF
CALL PSELSET( A, I, J, DESCA, AJJ )
*
10 CONTINUE
*
END IF
*
CALL PB_TOPSET( ICTXT, 'Broadcast', 'Rowwise', ROWBTOP )
CALL PB_TOPSET( ICTXT, 'Broadcast', 'Columnwise', COLBTOP )
*
WORK( 1 ) = REAL( LWMIN )
*
RETURN
*
* End of PSGEQR2
*
END
|
require 'test_helper'
class CFRGCurvesTest < Minitest::Test
def <API key>
vectors = [
[ # TEST 1
hexstr2bin(
"<API key>"\
"<API key>"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"), # PUBLIC KEY
"", # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>") # SIGNATURE
],
[ # TEST 2
hexstr2bin(
"<API key>"\
"<API key>"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"), # PUBLIC KEY
hexstr2bin("72"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>") # SIGNATURE
],
[ # TEST 3
hexstr2bin(
"<API key>"\
"<API key>"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"), # PUBLIC KEY
hexstr2bin("af82"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>") # SIGNATURE
],
[ # TEST 1024
hexstr2bin(
"<API key>"\
"<API key>"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"), # PUBLIC KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>") # SIGNATURE
],
[ # TEST SHA(abc)
hexstr2bin(
"<API key>"\
"<API key>"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"), # PUBLIC KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>") # SIGNATURE
]
]
vectors.each do |(secret, pk, m, sig)|
_pk, sk = JOSE::JWA::Ed25519.keypair(secret)
assert_equal pk, _pk
_sig = JOSE::JWA::Ed25519.sign(m, sk)
assert_equal sig, _sig
assert JOSE::JWA::Ed25519.verify(sig, m, pk)
if JOSE::JWA::Curve25519_RbNaCl.__supported__?
_pk, sk = JOSE::JWA::Ed25519_RbNaCl.keypair(secret)
assert_equal pk, _pk
_sig = JOSE::JWA::Ed25519_RbNaCl.sign(m, sk)
assert_equal sig, _sig
assert JOSE::JWA::Ed25519_RbNaCl.verify(sig, m, pk)
end
end
end
def <API key>
vectors = [
[ # TEST abc
hexstr2bin(
"<API key>"\
"<API key>"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"), # PUBLIC KEY
hexstr2bin("616263"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>") # SIGNATURE
]
]
vectors.each do |(secret, pk, m, sig)|
if JOSE::JWA::Curve25519_RbNaCl.__supported__?
_pk, sk = JOSE::JWA::Ed25519_RbNaCl.keypair(secret)
assert_equal pk, _pk
_sig = JOSE::JWA::Ed25519_RbNaCl.sign_ph(m, sk)
assert_equal sig, _sig
assert JOSE::JWA::Ed25519_RbNaCl.verify_ph(sig, m, pk)
end
end
end
def <API key>
vectors = [
[
<API key>, # Input scalar
<API key>, # Input u-coordinate
hexstr2lint("<SHA256-like>") # Output u-coordinate
],
[
<API key>, # Input scalar
<API key>, # Input u-coordinate
hexstr2lint("<SHA256-like>") # Output u-coordinate
]
]
vectors.each do |(input_scalar, input_u_coordinate, output_u_coordinate)|
input_scalar = JOSE::JWA::X25519.coerce_scalar_fe!(input_scalar)
input_u_coordinate = JOSE::JWA::X25519.<API key>!(input_u_coordinate)
output_u_coordinate = JOSE::JWA::X25519.<API key>!(output_u_coordinate)
assert_equal output_u_coordinate, JOSE::JWA::X25519.curve25519(input_scalar, input_u_coordinate)
if JOSE::JWA::Curve25519_RbNaCl.__supported__?
assert_equal output_u_coordinate.to_bytes(256), JOSE::JWA::X25519_RbNaCl.curve25519(input_scalar, input_u_coordinate)
end
end
end
def <API key>
vectors = [
[
hexstr2bin("<SHA256-like>"), # Alice's private key, f
hexstr2bin("<SHA256-like>"), # Alice's public key, X25519(f, 9)
hexstr2bin("<SHA256-like>"), # Bob's private key, g
hexstr2bin("<SHA256-like>"), # Bob's public key, X25519(g, 9)
hexstr2bin("<SHA256-like>") # Their shared secret, K
]
]
vectors.each do |(alice_sk, alice_pk, bob_sk, bob_pk, k)|
assert_equal k, JOSE::JWA::X25519.shared_secret(alice_pk, bob_sk)
assert_equal k, JOSE::JWA::X25519.shared_secret(bob_pk, alice_sk)
if JOSE::JWA::Curve25519_RbNaCl.__supported__?
assert_equal k, JOSE::JWA::X25519_RbNaCl.shared_secret(alice_pk, bob_sk)
assert_equal k, JOSE::JWA::X25519_RbNaCl.shared_secret(bob_pk, alice_sk)
end
end
end
def <API key>
vectors = [
[ # Blank
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"032e7549a20098f95b"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"d1fa1abeafe8256180"), # PUBLIC KEY
"", # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"2600") # SIGNATURE
],
[ # 1 octet
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"f8021e954e0a12274e"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"235160627b4c3a9480"), # PUBLIC KEY
hexstr2bin("03"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"3a00") # SIGNATURE
],
[ # 1 octet (with context)
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"f8021e954e0a12274e"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"235160627b4c3a9480"), # PUBLIC KEY
hexstr2bin("03"), # MESSAGE
hexstr2bin("666f6f"), # CONTEXT
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"3c00") # SIGNATURE
],
[ # 11 octets
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"d67e187951267eb328"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"1d8b00696447001400"), # PUBLIC KEY
hexstr2bin("<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"0e00") # SIGNATURE
],
[ # 12 octets
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"cb52c1c5fd2ff7e21b"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"d75e149ef09817f580"), # PUBLIC KEY
hexstr2bin("<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"3c00") # SIGNATURE
],
[ # 13 octets
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"c0266a11a93970100e"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"7b174be65dfa578e80"), # PUBLIC KEY
hexstr2bin("<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"3100") # SIGNATURE
],
[ # 64 octets
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"b4fa135d5542ea3f01"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"0906cb28bd8a081f00"), # PUBLIC KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"3900") # SIGNATURE
],
[ # 64 octets
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"b4fa135d5542ea3f01"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"0906cb28bd8a081f00"), # PUBLIC KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"3900") # SIGNATURE
],
[ # 256 octets
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"a9cebca9014c636df5"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"7690862ef3d4ed3a00"), # PUBLIC KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"3d00") # SIGNATURE
],
[ # 1023 octets
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"9ea165f5ad55dd9ce8"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"f11cc38737838cf400"), # PUBLIC KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"1a00") # SIGNATURE
]
]
vectors.each do |vector|
secret, pk, m, ctx, sig = vector
if sig.nil?
sig = ctx
ctx = nil
end
_pk, sk = JOSE::JWA::Ed448.keypair(secret)
assert_equal pk, _pk
_sig = JOSE::JWA::Ed448.sign(m, sk, ctx)
assert_equal sig, _sig
assert JOSE::JWA::Ed448.verify(sig, m, pk, ctx)
end
end
def <API key>
vectors = [
[ # TEST abc
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"ab2cec7c867c6e2c49"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"d5ed3d5d01c0f53880"), # PUBLIC KEY
hexstr2bin("616263"), # MESSAGE
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"1a00") # SIGNATURE
],
[ # TEST abc (with context)
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"ab2cec7c867c6e2c49"), # SECRET KEY
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"d5ed3d5d01c0f53880"), # PUBLIC KEY
hexstr2bin("616263"), # MESSAGE
hexstr2bin("666f6f"), # CONTEXT
hexstr2bin(
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"<API key>"\
"3f00") # SIGNATURE
]
]
vectors.each do |vector|
secret, pk, m, ctx, sig = vector
if sig.nil?
sig = ctx
ctx = nil
end
_pk, sk = JOSE::JWA::Ed448.keypair(secret)
assert_equal pk, _pk
_sig = JOSE::JWA::Ed448.sign_ph(m, sk, ctx)
assert_equal sig, _sig
assert JOSE::JWA::Ed448.verify_ph(sig, m, pk, ctx)
end
end
def <API key>
vectors = [
[
599189175373896402783756016145213256157230856085026129926891459468622403380588640249457727683869421921443004045221642549886377526240828, # Input scalar
382239910814107330116229961234899377031416365240571325148346555922438025162094455820962429142971339584360034337310079791515452463053830, # Input u-coordinate
hexstr2lint("ce3e4ff95a60dc6697da1db1d85e6afbdf79b50a2412d7546d5f239fe14fbaadeb445fc66a01b0779d98223961111e21766282f73dd96b6f") # Output u-coordinate
],
[
633254335906970592779259481534862372382525155252028961056404001332122152890562527156973881968934311400345568203929409663925541994577184, # Input scalar
622761797758325444462922068431234180649590390024811299761625153767228042600197997696167956134770744996690267634159427999832340166786063, # Input u-coordinate
hexstr2lint("884a02576239ff7a2f2f63b2db6a9ff37047ac13568e1e30fe63c4a7ad1b3ee3a5700df34321d62077e63633c575c1c954514e99da7c179d") # Output u-coordinate
]
]
vectors.each do |(input_scalar, input_u_coordinate, output_u_coordinate)|
input_scalar = JOSE::JWA::X448.coerce_scalar_fe!(input_scalar)
input_u_coordinate = JOSE::JWA::X448.<API key>!(input_u_coordinate)
output_u_coordinate = JOSE::JWA::X448.<API key>!(output_u_coordinate)
assert_equal output_u_coordinate, JOSE::JWA::X448.curve448(input_scalar, input_u_coordinate)
end
end
def <API key>
vectors = [
[
hexstr2bin("9a8f4925d1519f5775cf46b04b5800d4ee9ee8bae8bc5565d498c28dd9c9baf574a9419744897391006382a6f127ab1d9ac2d8c0a598726b"), # Alice's private key, f
hexstr2bin("9b08f7cc31b7e3e67d22d5aea121074a273bd2b83de09c63faa73d2c22c5d9bbc836647241d953d40c5b12da88120d53177f80e532c41fa0"), # Alice's public key, X448(f, 9)
hexstr2bin("1c306a7ac2a0e2e0990b294470cba339e6453772b075811d8fad0d1d6927c120bb5ee8972b0d3e21374c9c921b09d1b0366f10b65173992d"), # Bob's private key, g
hexstr2bin("3eb7a829b0cd20f5bcfc0b599b6feccf6da4627107bdb0d4f345b43027d8b972fc3e34fb4232a13ca706dcb57aec3dae07bdc1c67bf33609"), # Bob's public key, X448(g, 9)
hexstr2bin("07fff4181ac6cc95ec1c16a94a0f74d12da232ce40a77552281d282bb60c0b56fd2464c335543936521c24403085d59a449a5037514a879d") # Their shared secret, K
]
]
vectors.each do |(alice_sk, alice_pk, bob_sk, bob_pk, k)|
assert_equal k, JOSE::JWA::X448.shared_secret(alice_pk, bob_sk)
assert_equal k, JOSE::JWA::X448.shared_secret(bob_pk, alice_sk)
end
end
private
def hexstr2bin(hexstr)
return [hexstr].pack('H*')
end
def hexstr2lint(hexstr)
return OpenSSL::BN.new(hexstr2bin(hexstr).reverse, 2).to_i
end
end
|
"use strict";
add_task(<API key>);
let testcases = [
/**
* A portal is detected when there's no browser window,
* then a browser window is opened, and the portal is logged into
* and redirects to a different page. The portal tab should be added
* and focused when the window is opened, and left open after login
* since it redirected.
*/
function* <API key>() {
yield portalDetected();
let win = yield <API key>();
let browser = win.gBrowser.selectedTab.linkedBrowser;
let loadPromise =
BrowserTestUtils.browserLoaded(browser, false, <API key>);
BrowserTestUtils.loadURI(browser, <API key>);
yield loadPromise;
yield freePortal(true);
ensurePortalTab(win);
<API key>(win);
yield <API key>(win);
},
/**
* Test the various expected behaviors of the "Show Login Page" button
* in the captive portal notification. The button should be visible for
* all tabs except the captive portal tab, and when clicked, should
* ensure a captive portal tab is open and select it.
*/
function* <API key>() {
let win = yield <API key>();
yield portalDetected();
let notification = <API key>(win);
<API key>(notification, "visible");
function <API key>() {
is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected.");
<API key>(notification, "hidden");
}
let button = notification.querySelector("button.notification-button");
function* <API key>() {
let p = BrowserTestUtils.waitForNewTab(win.gBrowser, CANONICAL_URL);
button.click();
let tab = yield p;
is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected.");
return tab;
}
// Simulate clicking the button. The portal tab should be opened and
// selected and the button should hide.
let tab = yield <API key>();
<API key>();
// Close the tab. The button should become visible.
yield BrowserTestUtils.removeTab(tab);
ensureNoPortalTab(win);
<API key>(notification, "visible");
// When the button is clicked, a new portal tab should be opened and
// selected.
tab = yield <API key>();
// Open another arbitrary tab. The button should become visible. When it's clicked,
// the portal tab should be selected.
let anotherTab = yield BrowserTestUtils.<API key>(win.gBrowser);
<API key>(notification, "visible");
button.click();
is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected.");
// Close the portal tab and select the arbitrary tab. The button should become
// visible and when it's clicked, a new portal tab should be opened.
yield BrowserTestUtils.removeTab(tab);
win.gBrowser.selectedTab = anotherTab;
<API key>(notification, "visible");
tab = yield <API key>();
yield BrowserTestUtils.removeTab(anotherTab);
yield freePortal(true);
ensureNoPortalTab(win);
<API key>(win);
yield <API key>(win);
},
];
for (let testcase of testcases) {
add_task(testcase);
}
|
# This is the configuration file for the RPi environd
Presentation - General
# The date/time stamp of the last (most current) reading.
<API key> = "%I:%M %p on %A, %b %d"
# How many decimal places to round to when displaying temperatures. For
# presentation only - does not impact reading precision in the database.
<API key> = 1
Presentation - Recent Graph
# The date/time stamp on the x-axis
<API key> = "%I:%M %p"
# How many data points to use.
# This does _not_ reflect how many points will be drawn. Also consider how
# often the readings are made - e.g., if a value is recorded every 15 minutes,
# then a full day's worth of data requires 24x(60/15) = 96 points.
<API key> = 720
# How much to reduce the specified number of data points.
# This is how many points will be drawn. The value of
# <API key> is divided in to this many chunks, and then time
# stamp and value of each chunk is averaged.
<API key> = 16
Presentation - All Time Graph
# < tbd... not implemented yet >
Files
# The static html file that is output. Must be writable by the user running
# environd. Presumably this is in the www directory of a web server.
www_out = "/var/www/environd.html"
# The template to use for generating static html.
# Must be readable by the user running environd.
html_template = "/opt/environd/template/environd.tpl"
# The (flat text) database file.
# Must be writable by the user running environd, and must exist, even if empty.
database = "/opt/environd/database/<API key>.json"
# The log file. Must be writable by the user running environd.
log_file = "/var/log/environd.log"
# Format of the timestamping used internally.
# Does not impact presentation unless presented values are omitted.
<API key> = "%Y%m%dT%H%M%S"
Tinker/Debug
# Set to True to print all log messages to the terminal, or False to suppress
# most output.
terminal_verbosity = True
# The size in mb after which the db file is rotated.
# The entire db is loaded in to memory, but each reading is a mere 60-80
# bytes, so 100 megs is about 10 years of recording every 15 minutes.
max_db_file_size = 100
|
#ifndef GBA_VIDEO_H
#define GBA_VIDEO_H
#include <mgba-util/common.h>
CXX_GUARD_START
#include <mgba/core/log.h>
#include <mgba/core/timing.h>
#include <mgba/gba/interface.h>
<API key>(GBA_VIDEO);
enum {
VIDEO_HBLANK_PIXELS = 68,
VIDEO_HDRAW_LENGTH = 960,
VIDEO_HBLANK_LENGTH = 272,
VIDEO_HBLANK_FLIP = 46,
<API key> = 1232,
VIDEO_VBLANK_PIXELS = 68,
<API key> = 228,
VIDEO_TOTAL_LENGTH = 280896,
<API key> = 954,
OBJ_LENGTH = 1210,
BASE_TILE = 0x00010000
};
enum GBAVideoObjMode {
OBJ_MODE_NORMAL = 0,
<API key> = 1,
OBJ_MODE_OBJWIN = 2
};
enum GBAVideoObjShape {
OBJ_SHAPE_SQUARE = 0,
<API key> = 1,
OBJ_SHAPE_VERTICAL = 2
};
enum GBAVideoBlendEffect {
BLEND_NONE = 0,
BLEND_ALPHA = 1,
BLEND_BRIGHTEN = 2,
BLEND_DARKEN = 3
};
DECL_BITFIELD(GBAObjAttributesA, uint16_t);
DECL_BITS(GBAObjAttributesA, Y, 0, 8);
DECL_BIT(GBAObjAttributesA, Transformed, 8);
DECL_BIT(GBAObjAttributesA, Disable, 9);
DECL_BIT(GBAObjAttributesA, DoubleSize, 9);
DECL_BITS(GBAObjAttributesA, Mode, 10, 2);
DECL_BIT(GBAObjAttributesA, Mosaic, 12);
DECL_BIT(GBAObjAttributesA, 256Color, 13);
DECL_BITS(GBAObjAttributesA, Shape, 14, 2);
DECL_BITFIELD(GBAObjAttributesB, uint16_t);
DECL_BITS(GBAObjAttributesB, X, 0, 9);
DECL_BITS(GBAObjAttributesB, MatIndex, 9, 5);
DECL_BIT(GBAObjAttributesB, HFlip, 12);
DECL_BIT(GBAObjAttributesB, VFlip, 13);
DECL_BITS(GBAObjAttributesB, Size, 14, 2);
DECL_BITFIELD(GBAObjAttributesC, uint16_t);
DECL_BITS(GBAObjAttributesC, Tile, 0, 10);
DECL_BITS(GBAObjAttributesC, Priority, 10, 2);
DECL_BITS(GBAObjAttributesC, Palette, 12, 4);
struct GBAObj {
GBAObjAttributesA a;
GBAObjAttributesB b;
GBAObjAttributesC c;
uint16_t d;
};
struct GBAOAMMatrix {
int16_t padding0[3];
int16_t a;
int16_t padding1[3];
int16_t b;
int16_t padding2[3];
int16_t c;
int16_t padding3[3];
int16_t d;
};
union GBAOAM {
struct GBAObj obj[128];
struct GBAOAMMatrix mat[32];
uint16_t raw[512];
};
struct <API key> {
uint8_t end;
uint8_t start;
};
#define GBA_TEXT_MAP_TILE(MAP) ((MAP) & 0x03FF)
#define GBA_TEXT_MAP_HFLIP(MAP) ((MAP) & 0x0400)
#define GBA_TEXT_MAP_VFLIP(MAP) ((MAP) & 0x0800)
#define <API key>(MAP) (((MAP) & 0xF000) >> 12)
DECL_BITFIELD(GBARegisterDISPCNT, uint16_t);
DECL_BITS(GBARegisterDISPCNT, Mode, 0, 3);
DECL_BIT(GBARegisterDISPCNT, Cgb, 3);
DECL_BIT(GBARegisterDISPCNT, FrameSelect, 4);
DECL_BIT(GBARegisterDISPCNT, HblankIntervalFree, 5);
DECL_BIT(GBARegisterDISPCNT, ObjCharacterMapping, 6);
DECL_BIT(GBARegisterDISPCNT, ForcedBlank, 7);
DECL_BIT(GBARegisterDISPCNT, Bg0Enable, 8);
DECL_BIT(GBARegisterDISPCNT, Bg1Enable, 9);
DECL_BIT(GBARegisterDISPCNT, Bg2Enable, 10);
DECL_BIT(GBARegisterDISPCNT, Bg3Enable, 11);
DECL_BIT(GBARegisterDISPCNT, ObjEnable, 12);
DECL_BIT(GBARegisterDISPCNT, Win0Enable, 13);
DECL_BIT(GBARegisterDISPCNT, Win1Enable, 14);
DECL_BIT(GBARegisterDISPCNT, ObjwinEnable, 15);
DECL_BITFIELD(GBARegisterDISPSTAT, uint16_t);
DECL_BIT(GBARegisterDISPSTAT, InVblank, 0);
DECL_BIT(GBARegisterDISPSTAT, InHblank, 1);
DECL_BIT(GBARegisterDISPSTAT, Vcounter, 2);
DECL_BIT(GBARegisterDISPSTAT, VblankIRQ, 3);
DECL_BIT(GBARegisterDISPSTAT, HblankIRQ, 4);
DECL_BIT(GBARegisterDISPSTAT, VcounterIRQ, 5);
DECL_BITS(GBARegisterDISPSTAT, VcountSetting, 8, 8);
DECL_BITFIELD(GBARegisterBGCNT, uint16_t);
DECL_BITS(GBARegisterBGCNT, Priority, 0, 2);
DECL_BITS(GBARegisterBGCNT, CharBase, 2, 2);
DECL_BIT(GBARegisterBGCNT, Mosaic, 6);
DECL_BIT(GBARegisterBGCNT, 256Color, 7);
DECL_BITS(GBARegisterBGCNT, ScreenBase, 8, 5);
DECL_BIT(GBARegisterBGCNT, Overflow, 13);
DECL_BITS(GBARegisterBGCNT, Size, 14, 2);
DECL_BITFIELD(GBARegisterBLDCNT, uint16_t);
DECL_BIT(GBARegisterBLDCNT, Target1Bg0, 0);
DECL_BIT(GBARegisterBLDCNT, Target1Bg1, 1);
DECL_BIT(GBARegisterBLDCNT, Target1Bg2, 2);
DECL_BIT(GBARegisterBLDCNT, Target1Bg3, 3);
DECL_BIT(GBARegisterBLDCNT, Target1Obj, 4);
DECL_BIT(GBARegisterBLDCNT, Target1Bd, 5);
DECL_BITS(GBARegisterBLDCNT, Effect, 6, 2);
DECL_BIT(GBARegisterBLDCNT, Target2Bg0, 8);
DECL_BIT(GBARegisterBLDCNT, Target2Bg1, 9);
DECL_BIT(GBARegisterBLDCNT, Target2Bg2, 10);
DECL_BIT(GBARegisterBLDCNT, Target2Bg3, 11);
DECL_BIT(GBARegisterBLDCNT, Target2Obj, 12);
DECL_BIT(GBARegisterBLDCNT, Target2Bd, 13);
DECL_BITFIELD(GBAWindowControl, uint8_t);
DECL_BIT(GBAWindowControl, Bg0Enable, 0);
DECL_BIT(GBAWindowControl, Bg1Enable, 1);
DECL_BIT(GBAWindowControl, Bg2Enable, 2);
DECL_BIT(GBAWindowControl, Bg3Enable, 3);
DECL_BIT(GBAWindowControl, ObjEnable, 4);
DECL_BIT(GBAWindowControl, BlendEnable, 5);
DECL_BITFIELD(GBAMosaicControl, uint16_t);
DECL_BITS(GBAMosaicControl, BgH, 0, 4);
DECL_BITS(GBAMosaicControl, BgV, 4, 4);
DECL_BITS(GBAMosaicControl, ObjH, 8, 4);
DECL_BITS(GBAMosaicControl, ObjV, 12, 4);
struct GBAVideoRenderer {
void (*init)(struct GBAVideoRenderer* renderer);
void (*reset)(struct GBAVideoRenderer* renderer);
void (*deinit)(struct GBAVideoRenderer* renderer);
uint16_t (*writeVideoRegister)(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value);
void (*writeVRAM)(struct GBAVideoRenderer* renderer, uint32_t address);
void (*writePalette)(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value);
void (*writeOAM)(struct GBAVideoRenderer* renderer, uint32_t oam);
void (*drawScanline)(struct GBAVideoRenderer* renderer, int y);
void (*finishFrame)(struct GBAVideoRenderer* renderer);
void (*getPixels)(struct GBAVideoRenderer* renderer, size_t* stride, const void** pixels);
void (*putPixels)(struct GBAVideoRenderer* renderer, size_t stride, const void* pixels);
uint16_t* palette;
uint16_t* vram;
union GBAOAM* oam;
struct mCacheSet* cache;
bool disableBG[4];
bool disableOBJ;
bool disableWIN[2];
bool disableOBJWIN;
bool highlightBG[4];
bool highlightOBJ[128];
color_t highlightColor;
uint8_t highlightAmount;
};
struct GBAVideo {
struct GBA* p;
struct GBAVideoRenderer* renderer;
struct mTimingEvent event;
int vcount;
int shouldStall;
uint16_t palette[512];
uint16_t* vram;
union GBAOAM oam;
int32_t frameCounter;
int frameskip;
int frameskipCounter;
};
void GBAVideoInit(struct GBAVideo* video);
void GBAVideoReset(struct GBAVideo* video);
void GBAVideoDeinit(struct GBAVideo* video);
void <API key>(struct GBAVideoRenderer*);
void <API key>(struct GBAVideo* video, struct GBAVideoRenderer* renderer);
void <API key>(struct GBAVideo* video, uint16_t value);
struct GBASerializedState;
void GBAVideoSerialize(const struct GBAVideo* video, struct GBASerializedState* state);
void GBAVideoDeserialize(struct GBAVideo* video, const struct GBASerializedState* state);
extern MGBA_EXPORT const int GBAVideoObjSizes[16][2];
CXX_GUARD_END
#endif
|
/* This file provides interfaces to perform certain atomic operations
* on variables. Atomic in this sense means that an operation
* performed in one thread shows up in another thread either
* completely or not at all.
*
* If the symbol ATOMIC_LOCK is defined, a variable of type MT_Lock
* must be declared and initialized. The latter can be done using the
* macro ATOMIC_INIT which expands to nothing if ATOMIC_LOCK is not
* defined.
*
* The following operations are defined:
* ATOMIC_GET -- return the value of a variable;
* ATOMIC_SET -- set the value of a variable;
* ATOMIC_ADD -- add a value to a variable, return original value;
* ATOMIC_SUB -- subtract a value from a variable, return original value;
* ATOMIC_INC -- increment a variable's value, return new value;
* ATOMIC_DEC -- decrement a variable's value, return new value;
* These interfaces work on variables of type ATOMIC_TYPE
* (int or lng depending on architecture).
*
* In addition, the following operations are defined:
* ATOMIC_TAS -- test-and-set: set variable to "true" and return old value
* ATOMIC_CLEAR -- set variable to "false"
* These two operations are only defined on variables of type
* ATOMIC_FLAG, and the only values defined for such a variable are
* "false" (zero) and "true" (non-zero). The variable can be statically
* initialized using the ATOMIC_FLAG_INIT macro.
*/
#ifndef _GDK_ATOMIC_H_
#define _GDK_ATOMIC_H_
/* define this if you don't want to use atomic instructions */
/* #define <API key> */
#if defined(HAVE_LIBATOMIC_OPS) && !defined(<API key>)
#include <atomic_ops.h>
#define ATOMIC_TYPE AO_t
#define ATOMIC_GET(var, lck) AO_load_full(&var)
#define ATOMIC_SET(var, val, lck) AO_store_full(&var, (val))
#define ATOMIC_ADD(var, val, lck) AO_fetch_and_add(&var, (val))
#define ATOMIC_SUB(var, val, lck) AO_fetch_and_add(&var, -(val))
#define ATOMIC_INC(var, lck) (AO_fetch_and_add1(&var) + 1)
#define ATOMIC_DEC(var, lck) (AO_fetch_and_sub1(&var) - 1)
#define ATOMIC_INIT(lck) ((void) 0)
#define ATOMIC_FLAG AO_TS_t
#define ATOMIC_FLAG_INIT { AO_TS_INITIALIZER }
#define ATOMIC_CLEAR(var, lck) AO_CLEAR(&var)
#define ATOMIC_TAS(var, lck) (<API key>(&var) != AO_TS_CLEAR)
#else
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(<API key>)
#include <intrin.h>
#if SIZEOF_SSIZE_T == SIZEOF_LNG
#define ATOMIC_TYPE lng
#define ATOMIC_GET(var, lck) var
#define ATOMIC_SET(var, val, lck) <API key>(&var, (val))
#define ATOMIC_ADD(var, val, lck) <API key>(&var, val)
#define ATOMIC_SUB(var, val, lck) <API key>(&var, -(val))
#define ATOMIC_INC(var, lck) <API key>(&var)
#define ATOMIC_DEC(var, lck) <API key>(&var)
#pragma intrinsic(<API key>)
#pragma intrinsic(<API key>)
#pragma intrinsic(<API key>)
#pragma intrinsic(<API key>)
#pragma intrinsic(<API key>)
#else
#define ATOMIC_TYPE int
#define ATOMIC_GET(var, lck) var
#define ATOMIC_SET(var, val, lck) <API key>(&var, (val))
#define ATOMIC_ADD(var, val, lck) <API key>(&var, (val))
#define ATOMIC_SUB(var, val, lck) <API key>(&var, -(val))
#define ATOMIC_INC(var, lck) <API key>(&var)
#define ATOMIC_DEC(var, lck) <API key>(&var)
#pragma intrinsic(<API key>)
#pragma intrinsic(<API key>)
#pragma intrinsic(<API key>)
#pragma intrinsic(<API key>)
#endif
#define ATOMIC_INIT(lck) ((void) 0)
#define ATOMIC_FLAG int
#define ATOMIC_FLAG_INIT { 0 }
#define ATOMIC_CLEAR(var, lck) <API key>(&var, 0)
#define ATOMIC_TAS(var, lck) <API key>(&var, 1, 0)
#pragma intrinsic(<API key>)
#elif (defined(__GNUC__) || defined(__INTEL_COMPILER)) && !(defined(__sun__) && SIZEOF_SIZE_T == SIZEOF_LNG) && !defined(_MSC_VER) && !defined(<API key>)
#if SIZEOF_SSIZE_T == SIZEOF_LNG
#define ATOMIC_TYPE lng
#else
#define ATOMIC_TYPE int
#endif
#ifdef __ATOMIC_SEQ_CST
/* the new way of doing this according to GCC */
#define ATOMIC_GET(var, lck) __atomic_load_n(&var, __ATOMIC_SEQ_CST)
#define ATOMIC_SET(var, val, lck) __atomic_store_n(&var, (val), __ATOMIC_SEQ_CST)
#define ATOMIC_ADD(var, val, lck) __atomic_fetch_add(&var, (val), __ATOMIC_SEQ_CST)
#define ATOMIC_SUB(var, val, lck) __atomic_fetch_sub(&var, (val), __ATOMIC_SEQ_CST)
#define ATOMIC_INC(var, lck) __atomic_add_fetch(&var, 1, __ATOMIC_SEQ_CST)
#define ATOMIC_DEC(var, lck) __atomic_sub_fetch(&var, 1, __ATOMIC_SEQ_CST)
#define ATOMIC_FLAG char
#define ATOMIC_FLAG_INIT { 0 }
#define ATOMIC_CLEAR(var, lck) __atomic_clear(&var, __ATOMIC_SEQ_CST)
#define ATOMIC_TAS(var, lck) <API key>(&var, __ATOMIC_SEQ_CST)
#else
/* the old way of doing this, (still?) needed for Intel compiler on Linux */
#define ATOMIC_GET(var, lck) var
#define ATOMIC_SET(var, val, lck) (var = (val))
#define ATOMIC_ADD(var, val, lck) <API key>(&var, (val))
#define ATOMIC_SUB(var, val, lck) <API key>(&var, (val))
#define ATOMIC_INC(var, lck) <API key>(&var, 1)
#define ATOMIC_DEC(var, lck) <API key>(&var, 1)
#define ATOMIC_FLAG int
#define ATOMIC_FLAG_INIT { 0 }
#define ATOMIC_CLEAR(var, lck) __sync_lock_release(&var)
#define ATOMIC_TAS(var, lck) <API key>(&var, 1)
#endif
#define ATOMIC_INIT(lck) ((void) 0)
#else
#if SIZEOF_SSIZE_T == SIZEOF_LNG
#define ATOMIC_TYPE lng
#else
#define ATOMIC_TYPE int
#endif
static inline ATOMIC_TYPE
__ATOMIC_GET(volatile ATOMIC_TYPE *var, pthread_mutex_t *lck)
{
ATOMIC_TYPE old;
pthread_mutex_lock(lck);
old = *var;
<API key>(lck);
return old;
}
#define ATOMIC_GET(var, lck) __ATOMIC_GET(&var, &(lck).lock)
static inline ATOMIC_TYPE
__ATOMIC_SET(volatile ATOMIC_TYPE *var, ATOMIC_TYPE val, pthread_mutex_t *lck)
{
ATOMIC_TYPE new;
pthread_mutex_lock(lck);
*var = val;
new = *var;
<API key>(lck);
return new;
}
#define ATOMIC_SET(var, val, lck) __ATOMIC_SET(&var, (val), &(lck).lock)
static inline ATOMIC_TYPE
__ATOMIC_ADD(volatile ATOMIC_TYPE *var, ATOMIC_TYPE val, pthread_mutex_t *lck)
{
ATOMIC_TYPE old;
pthread_mutex_lock(lck);
old = *var;
*var += val;
<API key>(lck);
return old;
}
#define ATOMIC_ADD(var, val, lck) __ATOMIC_ADD(&var, (val), &(lck).lock)
static inline ATOMIC_TYPE
__ATOMIC_SUB(volatile ATOMIC_TYPE *var, ATOMIC_TYPE val, pthread_mutex_t *lck)
{
ATOMIC_TYPE old;
pthread_mutex_lock(lck);
old = *var;
*var -= val;
<API key>(lck);
return old;
}
#define ATOMIC_SUB(var, val, lck) __ATOMIC_SUB(&var, (val), &(lck).lock)
static inline ATOMIC_TYPE
__ATOMIC_INC(volatile ATOMIC_TYPE *var, pthread_mutex_t *lck)
{
ATOMIC_TYPE new;
pthread_mutex_lock(lck);
new = ++*var;
<API key>(lck);
return new;
}
#define ATOMIC_INC(var, lck) __ATOMIC_INC(&var, &(lck).lock)
static inline ATOMIC_TYPE
__ATOMIC_DEC(volatile ATOMIC_TYPE *var, pthread_mutex_t *lck)
{
ATOMIC_TYPE new;
pthread_mutex_lock(lck);
new = --*var;
<API key>(lck);
return new;
}
#define ATOMIC_DEC(var, lck) __ATOMIC_DEC(&var, &(lck).lock)
#define USE_PTHREAD_LOCKS /* must use pthread locks */
#define ATOMIC_LOCK /* must use locks for atomic access */
#define ATOMIC_INIT(lck) MT_lock_init(&(lck), #lck)
#define ATOMIC_FLAG int
#define ATOMIC_FLAG_INIT {0}
static inline ATOMIC_FLAG
__ATOMIC_TAS(volatile ATOMIC_FLAG *var, pthread_mutex_t *lck)
{
ATOMIC_FLAG orig;
pthread_mutex_lock(lck);
if ((orig = *var) == 0)
*var = 1;
<API key>(lck);
return orig;
}
#define ATOMIC_TAS(var, lck) __ATOMIC_TAS(&var, &(lck).lock)
static inline void
__ATOMIC_CLEAR(volatile ATOMIC_FLAG *var, pthread_mutex_t *lck)
{
pthread_mutex_lock(lck);
*var = 0;
<API key>(lck);
}
#define ATOMIC_CLEAR(var, lck) __ATOMIC_CLEAR(&var, &(lck).lock)
#endif
#endif /* LIBATOMIC_OPS */
#endif /* _GDK_ATOMIC_H_ */
|
class VoidTile
include IndefiniteArticle
DEAD_COORDINATE = -9001
attr_reader :x
attr_reader :y
attr_reader :z
attr_reader :plane
def self.generate_hash(x, y, z)
{ x: x, y: y, z: z, name: '', description: '', colour: 'black', type: 'Void', occupants: 0}
end
class FakeArray < Array
def <<(ignored)
self
end
end
@@fakearray = FakeArray.new
def initialize(p, x, y, z)
@x = x
@y = y
@z = z
@plane = p
end
def colour
'black'
end
def type
Entity::VoidTileType
end
def description
''
end
def name
''
end
def characters
@@fakearray
end
def <API key>
0
end
def occupants
@@fakearray
end
def traversible?
false
end
def portals_packets
[]
end
def save
end
def statuses
[]
end
def type_statuses
[]
end
def to_h
{name: self.name, type: self.type.name, type_id: self.type.id, description: self.description, x: self.x, y: self.y, z: self.z, plane: self.plane, occupants: self.<API key>}
end
def <API key>
# do nothing
end
end
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `CaptureIndex` type in crate `regex_syntax`.">
<meta name="keywords" content="rust, rustlang, rust-lang, CaptureIndex">
<title>regex_syntax::CaptureIndex - Rust</title>
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<nav class="sidebar">
<p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'CaptureIndex', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content type">
<h1 class='fqn'><span class='in-band'><a href='index.html'>regex_syntax</a>::<wbr><a class='type' href=''>CaptureIndex</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-1269' class='srclink' href='../src/regex_syntax/lib.rs.html#181' title='goto source code'>[src]</a></span></h1>
<pre class='rust typedef'>type CaptureIndex = <a class='enum' href='../core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='primitive' href='../std/primitive.usize.html'>usize</a>>;</pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "regex_syntax";
window.playgroundUrl = "";
</script>
<script src="../jquery.js"></script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `<API key>` fn in crate `js`.">
<meta name="keywords" content="rust, rustlang, rust-lang, <API key>">
<title>js::glue::<API key> - Rust</title>
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<section class="sidebar">
<p class='location'><a href='../index.html'>js</a>::<wbr><a href='index.html'>glue</a></p><script>window.sidebarCurrent = {name: '<API key>', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'><a href='../index.html'>js</a>::<wbr><a href='index.html'>glue</a>::<wbr><a class='fn' href=''><API key></a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-44187' class='srclink' href='../../src/js/glue.rs.html#228' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'>pub unsafe extern fn <API key>(v: <a href='../../std/primitive.pointer.html'>*mut <a class='struct' href='../../js/jsapi/struct.AutoIdVector.html' title='js::jsapi::AutoIdVector'>AutoIdVector</a></a>, id: <a class='struct' href='../../js/jsapi/struct.jsid.html' title='js::jsapi::jsid'>jsid</a>) -> <a href='../../std/primitive.u8.html'>u8</a></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div>
<div class="shortcuts">
<h1>Keyboard Shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search Tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code>)
</p>
</div>
</div>
</div>
<script>
window.rootPath = "../../";
window.currentCrate = "js";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script async src="../../search-index.js"></script>
</body>
</html>
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_45) on Fri Dec 27 12:52:45 CST 2013 -->
<title><API key> (apache-cassandra API)</title>
<meta name="date" content="2013-12-27">
<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="<API key> (apache-cassandra API)";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<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 class="navBarCell1Rev">Class</li>
<li><a href="class-use/<API key>.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/exceptions/TruncateException.html" title="class in org.apache.cassandra.exceptions"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/exceptions/<API key>.html" target="_top">Frames</a></li>
<li><a href="<API key>.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#<API key>.apache.cassandra.exceptions.CassandraException">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li>Method</li>
</ul>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<div class="subTitle">org.apache.cassandra.exceptions</div>
<h2 title="Class <API key>" class="title">Class <API key></h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>java.lang.Throwable</li>
<li>
<ul class="inheritance">
<li>java.lang.Exception</li>
<li>
<ul class="inheritance">
<li><a href="../../../../org/apache/cassandra/exceptions/CassandraException.html" title="class in org.apache.cassandra.exceptions">org.apache.cassandra.exceptions.CassandraException</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions">org.apache.cassandra.exceptions.<API key></a></li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.exceptions.<API key></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, <a href="../../../../org/apache/cassandra/exceptions/TransportException.html" title="interface in org.apache.cassandra.exceptions">TransportException</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong"><API key></span>
extends <a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><API key></a></pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../serialized-form.html#org.apache.cassandra.exceptions.<API key>">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/exceptions/<API key>.html#<API key>(java.lang.String)"><API key></a></strong>(java.lang.String msg)</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_summary">
</a>
<h3>Method Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="<API key>.apache.cassandra.exceptions.CassandraException">
</a>
<h3>Methods inherited from class org.apache.cassandra.exceptions.<a href="../../../../org/apache/cassandra/exceptions/CassandraException.html" title="class in org.apache.cassandra.exceptions">CassandraException</a></h3>
<code><a href="../../../../org/apache/cassandra/exceptions/CassandraException.html#code()">code</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="<API key>.lang.Throwable">
</a>
<h3>Methods inherited from class java.lang.Throwable</h3>
<code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="<API key>.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="<API key>.apache.cassandra.exceptions.TransportException">
</a>
<h3>Methods inherited from interface org.apache.cassandra.exceptions.<a href="../../../../org/apache/cassandra/exceptions/TransportException.html" title="interface in org.apache.cassandra.exceptions">TransportException</a></h3>
<code><a href="../../../../org/apache/cassandra/exceptions/TransportException.html#getMessage()">getMessage</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
</a>
<h3>Constructor Detail</h3>
<a name="<API key>(java.lang.String)">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4><API key></h4>
<pre>public <API key>(java.lang.String msg)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/<API key>.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/exceptions/TruncateException.html" title="class in org.apache.cassandra.exceptions"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/exceptions/<API key>.html" title="class in org.apache.cassandra.exceptions"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/exceptions/<API key>.html" target="_top">Frames</a></li>
<li><a href="<API key>.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#<API key>.apache.cassandra.exceptions.CassandraException">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li>Method</li>
</ul>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>Copyright © 2013 The Apache Software Foundation</small></p>
</body>
</html>
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `<API key>` constant in crate `glutin`.">
<meta name="keywords" content="rust, rustlang, rust-lang, <API key>">
<title>glutin::api::egl::ffi::egl::<API key> - Rust</title>
<link rel="stylesheet" type="text/css" href="../../../../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<section class="sidebar">
<p class='location'><a href='../../../../index.html'>glutin</a>::<wbr><a href='../../../index.html'>api</a>::<wbr><a href='../../index.html'>egl</a>::<wbr><a href='../index.html'>ffi</a>::<wbr><a href='index.html'>egl</a></p><script>window.sidebarCurrent = {name: '<API key>', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content constant">
<h1 class='fqn'><span class='in-band'><a href='../../../../index.html'>glutin</a>::<wbr><a href='../../../index.html'>api</a>::<wbr><a href='../../index.html'>egl</a>::<wbr><a href='../index.html'>ffi</a>::<wbr><a href='index.html'>egl</a>::<wbr><a class='constant' href=''><API key></a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-2662' class='srclink' href='../../../../../src/glutin///home/servo/buildbot/slave/doc/build/target/debug/build/<API key>/out/egl_bindings.rs.html#647' title='goto source code'>[src]</a></span></h1>
<pre class='rust const'>pub const <API key>: <a class='type' href='../../../../../glutin/api/egl/ffi/egl/types/type.GLenum.html' title='glutin::api::egl::ffi::egl::types::GLenum'>GLenum</a><code> = </code><code>0x31BE</code></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div>
<div class="shortcuts">
<h1>Keyboard Shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search Tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code>)
</p>
</div>
</div>
</div>
<script>
window.rootPath = "../../../../../";
window.currentCrate = "glutin";
window.playgroundUrl = "";
</script>
<script src="../../../../../jquery.js"></script>
<script src="../../../../../main.js"></script>
<script async src="../../../../../search-index.js"></script>
</body>
</html>
|
<!
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2014 Mozilla Corporation
<template name="alertdetails">
<div class="container">
<div class="row">
<div class="row"><button class="btn btn-sm btn-warning col-xs-2 makeinvestigation" data-alertid={{esmetadata.id}}>Escalate To Investigation</button></div>
<div class="row"><button class="btn btn-sm btn-danger col-xs-2 makeincident" data-alertid={{esmetadata.id}}>Escalate To Incident</button></div>
<div class="row" id="alert" >
<table class="table table-reactive table-hover table-condensed" id="alert-table">
<thead>
<tr>
<td class="upperwhite">Timestamp</td>
<td class="upperwhite">Links</td>
<td class="upperwhite">Severity</td>
<td class="upperwhite">Category</td>
<td class="upperwhite">Summary</td>
</tr>
</thead>
<tbody>
<tr>
<td>{{utctimestamp}}</td>
<td>
<a target="_blank" href="{{kibanaurl}}">open in kibana</a>
{{#if url}}
<br><a href="{{url}}" target ="_blank">docs</a>
{{/if}}
</td>
<td>{{severity}}</td>
<td>{{category}}</td>
<td class="alertsummary">{{{ipDecorate summary}}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<table class="table table-reactive table-hover table-condensed" id="alert-events-table">
<tbody class="table-striped">
{{#each this.events}}
{{>alert_event}}
{{/each}}
</tbody>
</table>
</div>
</template>
<!--each individual event
<template name="alert_event">
<tr>
<td>{{documentindex}}</td>
<td>{{documentid}}</td>
<td>{{documenttype}}</td>
<td>{{{ ipDecorate documentsource.summary}}}</td>
<td>{{>eventdetails}}</td>
</tr>
</template>
|
using System.Linq;
using Xunit;
namespace Kf.Core.Tests._extensions_.Collections
{
public class <API key>
{
[Fact]
public void <API key>() {
// Arrange
var index = 0;
var sut = Enumerable.Range(0, 500);
// Act
var foreachWithIndex = sut.Index();
// Assert
foreach (var element in foreachWithIndex) {
Assert.Equal(index, element.Index);
Assert.Equal(index, element.Value);
Assert.Equal(element.Value, element.Index);
index++;
}
}
[Fact]
public void <API key>() {
var sut = Enumerable.Range(0, 500);
var result = sut.ForEach(i => { return 0; });
Assert.True(result.All(i => i == 0));
}
[Fact]
public void <API key>() {
var sut = Enumerable.Range(0, 500);
var result = sut.ForEach(i => { return i.ToString("000"); });
Assert.True(result.All(i => i.Length.Equals(3)));
}
[Fact]
public void <API key>() {
var sut = Enumerable.Range(0, 500);
var result = sut.ForEach(i => { return i.ToString("000"); });
result = result.Where(x => x.Contains("449"));
Assert.True(result.Count().Equals(1));
}
}
}
|
package com.muzima.api.model.algorithm;
import com.muzima.api.model.PersonAttributeType;
import com.muzima.search.api.model.object.Searchable;
import com.muzima.util.JsonUtils;
import net.minidev.json.JSONObject;
import java.io.IOException;
public class <API key> extends <API key> {
public static final String <API key> = "(uuid,name)";
private String uuid;
/**
* Implementation of this method will define how the object will be serialized from the String representation.
*
* @param serialized the string representation
* @return the concrete object
*/
@Override
public Searchable deserialize(final String serialized, final boolean isFullSerialization) throws IOException {
PersonAttributeType attributeType = new PersonAttributeType();
attributeType.setUuid(JsonUtils.readAsString(serialized, "$['uuid']"));
attributeType.setName(JsonUtils.readAsString(serialized, "$['name']"));
return attributeType;
}
/**
* Implementation of this method will define how the object will be de-serialized into the String representation.
*
* @param object the object
* @return the string representation
*/
@Override
public String serialize(final Searchable object, final boolean isFullSerialization) throws IOException {
PersonAttributeType attributeType = (PersonAttributeType) object;
JSONObject jsonObject = new JSONObject();
JsonUtils.writeAsString(jsonObject, "uuid", attributeType.getUuid());
JsonUtils.writeAsString(jsonObject, "name", attributeType.getName());
return jsonObject.toJSONString();
}
}
|
package com.digi.xbee.api.packet.thread;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.Assert.*;
import java.net.Inet6Address;
import java.net.<API key>;
import java.util.Arrays;
import java.util.LinkedHashMap;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import com.digi.xbee.api.models.CoAPURI;
import com.digi.xbee.api.models.HTTPMethodEnum;
import com.digi.xbee.api.models.<API key>;
import com.digi.xbee.api.packet.APIFrameType;
import com.digi.xbee.api.packet.thread.CoAPTxRequestPacket;
import com.digi.xbee.api.utils.HexUtils;
@PrepareForTest({Inet6Address.class, CoAPTxRequestPacket.class})
@RunWith(PowerMockRunner.class)
public class <API key> {
// Constants.
private static final String IPV6_ADDRESS = "FDB3:0001:0002:0000:0004:0005:0006:0007";
// Variables.
private int frameType = APIFrameType.COAP_TX_REQUEST.getValue();
private int frameID = 0x01;
private int options = <API key>.OPTION_NONE;
private Inet6Address destAddress;
private HTTPMethodEnum method = HTTPMethodEnum.GET;
private String uriData = CoAPURI.<API key>;
private byte[] data = "Test".getBytes();
@Rule
public ExpectedException exception = ExpectedException.none();
public <API key>() throws Exception {
destAddress = (Inet6Address) Inet6Address.getByName(IPV6_ADDRESS);
}
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}.
*
* <p>A {@code <API key>} exception must be thrown when parsing
* a {@code null} byte array.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] payload = null;
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("CoAP Tx Request packet payload cannot be null.")));
// Call the method under test that should throw a <API key>.
CoAPTxRequestPacket.createPacket(payload);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}.
*
* <p>An {@code <API key>} exception must be thrown when
* parsing an empty byte array.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] payload = new byte[0];
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Incomplete CoAP Tx Request packet.")));
// Call the method under test that should throw an <API key>.
CoAPTxRequestPacket.createPacket(payload);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}.
*
* <p>An {@code <API key>} exception must be thrown when
* parsing a byte array shorter than the needed one is provided.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] payload = new byte[25];
payload[0] = (byte)frameType;
payload[1] = (byte)frameID;
payload[2] = (byte)options;
payload[3] = (byte)method.getValue();
System.arraycopy(destAddress.getAddress(), 0, payload, 4, destAddress.getAddress().length);
payload[20] = (byte)(uriData.length());
System.arraycopy(uriData.getBytes(), 0, payload, 21, uriData.getBytes().length - 1);
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Incomplete CoAP Tx Request packet.")));
// Call the method under test that should throw an <API key>.
CoAPTxRequestPacket.createPacket(payload);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}.
*
* <p>An {@code <API key>} exception must be thrown when
* parsing a byte array not including the Frame type.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] payload = new byte[25 + data.length];
payload[0] = (byte)frameID;
payload[1] = (byte)options;
payload[2] = (byte)method.getValue();
System.arraycopy(destAddress.getAddress(), 0, payload, 3, destAddress.getAddress().length);
payload[20] = (byte)(uriData.length());
System.arraycopy(uriData.getBytes(), 0, payload, 20, uriData.getBytes().length);
System.arraycopy(data, 0, payload, 20 + uriData.getBytes().length, data.length);
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Payload is not a CoAP Tx Request packet.")));
// Call the method under test that should throw an <API key>.
CoAPTxRequestPacket.createPacket(payload);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}.
*
* <p>An {@code <API key>} exception must be thrown when
* parsing a byte array with an invalid IPv6 address.</p>
*/
@Test
public final void <API key>() throws Exception {
// Set up the resources for the test.
byte[] payload = new byte[26];
payload[0] = (byte)frameType;
payload[1] = (byte)frameID;
payload[2] = (byte)options;
payload[3] = (byte)method.getValue();
System.arraycopy(destAddress.getAddress(), 0, payload, 4, destAddress.getAddress().length);
payload[20] = (byte)(uriData.length());
System.arraycopy(uriData.getBytes(), 0, payload, 21, uriData.getBytes().length);
PowerMockito.mockStatic(Inet6Address.class);
PowerMockito.when(Inet6Address.getByAddress(Mockito.any(byte[].class))).thenThrow(new <API key>());
exception.expect(<API key>.class);
// Call the method under test that should throw an <API key>.
CoAPTxRequestPacket.createPacket(payload);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}.
*
* <p>A valid CoAP TX Request packet with the provided options and without
* data is created.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] payload = new byte[26];
payload[0] = (byte)frameType;
payload[1] = (byte)frameID;
payload[2] = (byte)options;
payload[3] = (byte)method.getValue();
System.arraycopy(destAddress.getAddress(), 0, payload, 4, destAddress.getAddress().length);
payload[20] = (byte)(uriData.length());
System.arraycopy(uriData.getBytes(), 0, payload, 21, uriData.getBytes().length);
// Call the method under test.
CoAPTxRequestPacket packet = CoAPTxRequestPacket.createPacket(payload);
// Verify the result.
assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(payload.length)));
assertThat("Returned frame ID is not the expected one", packet.getFrameID(), is(equalTo(frameID)));
assertThat("Returned options are not the expected ones", packet.getTransmitOptions(), is(equalTo(options)));
assertThat("Returned RESTul method is not the expected one", packet.getMethod(), is(equalTo(method)));
assertThat("Returned dest address is not the expected one", packet.getDestAddress(), is(equalTo(destAddress)));
assertThat("Returned URI is not the expected one", packet.getURI(), is(equalTo(uriData)));
assertThat("Returned data is not the expected one", packet.getPayload(), is(nullValue()));
assertThat("Returned payload array is not the expected one", packet.getPacketData(), is(equalTo(payload)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}.
*
* <p>A valid CoAP TX Request packet with the provided options and data is
* created.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] payload = new byte[26 + data.length];
payload[0] = (byte)frameType;
payload[1] = (byte)frameID;
payload[2] = (byte)options;
payload[3] = (byte)method.getValue();
System.arraycopy(destAddress.getAddress(), 0, payload, 4, destAddress.getAddress().length);
payload[20] = (byte)(uriData.length());
System.arraycopy(uriData.getBytes(), 0, payload, 21, uriData.getBytes().length);
System.arraycopy(data, 0, payload, 21 + uriData.getBytes().length, data.length);
// Call the method under test.
CoAPTxRequestPacket packet = CoAPTxRequestPacket.createPacket(payload);
// Verify the result.
assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(payload.length)));
assertThat("Returned frame ID is not the expected one", packet.getFrameID(), is(equalTo(frameID)));
assertThat("Returned options are not the expected ones", packet.getTransmitOptions(), is(equalTo(options)));
assertThat("Returned RESTul method is not the expected one", packet.getMethod(), is(equalTo(method)));
assertThat("Returned dest address is not the expected one", packet.getDestAddress(), is(equalTo(destAddress)));
assertThat("Returned URI is not the expected one", packet.getURI(), is(equalTo(uriData)));
assertThat("Returned data is not the expected one", packet.getPayload(), is(equalTo(data)));
assertThat("Returned payload array is not the expected one", packet.getPacketData(), is(equalTo(payload)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}.
*
* <p>Construct a new CoAP TX Request packet with a frame ID bigger than
* 255. This must throw an {@code <API key>}.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
int frameID = 524;
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Frame ID must be between 0 and 255.")));
// Call the method under test that should throw an <API key>.
new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}.
*
* <p>Construct a new CoAP TX Request packet with a negative frame ID. This
* must throw an {@code <API key>}.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
int frameID = -6;
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Frame ID must be between 0 and 255.")));
// Call the method under test that should throw an <API key>.
new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}.
*
* <p>Construct a new CoAP TX Request packet with invalid transmit options.
* This must throw a {@code <API key>}.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
int options = -1;
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Transmit options can only be " +
<API key>.OPTION_NONE +
" or " + <API key>.<API key> + ".")));
// Call the method under test that should throw a <API key>.
new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}.
*
* <p>Construct a new CoAP TX Request packet with a null RESTful method.
* This must throw a {@code <API key>}.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
HTTPMethodEnum method = null;
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("HTTP Method cannot be null.")));
// Call the method under test that should throw a <API key>.
new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}.
*
* <p>Construct a new CoAP TX Request packet with a null destination
* address. This must throw a {@code <API key>}.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
Inet6Address destAddress = null;
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Destination address cannot be null.")));
// Call the method under test that should throw a <API key>.
new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}.
*
* <p>Construct a new CoAP TX Request packet with a null URI. This must
* throw a {@code <API key>}.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
String uriData = null;
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("URI cannot be null.")));
// Call the method under test that should throw a <API key>.
new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}.
*
* <p>Construct a new CoAP TX Request packet without data ({@code null}).</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
data = null;
int expectedLength = 26;
// Call the method under test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Verify the result.
assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(expectedLength)));
assertThat("Returned frame ID is not the expected one", packet.getFrameID(), is(equalTo(frameID)));
assertThat("Returned options are not the expected ones", packet.getTransmitOptions(), is(equalTo(options)));
assertThat("Returned RESTul method is not the expected one", packet.getMethod(), is(equalTo(method)));
assertThat("Returned dest address is not the expected one", packet.getDestAddress(), is(equalTo(destAddress)));
assertThat("Returned URI is not the expected one", packet.getURI(), is(equalTo(uriData)));
assertThat("Returned data is not the expected one", packet.getPayload(), is(nullValue()));
assertThat("CoAP TX Request packet needs API Frame ID", packet.needsAPIFrameID(), is(equalTo(true)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}.
*
* <p>Construct a new CoAP TX Request packet with data.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
int expectedLength = 26 + data.length;
// Call the method under test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Verify the result.
assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(expectedLength)));
assertThat("Returned frame ID is not the expected one", packet.getFrameID(), is(equalTo(frameID)));
assertThat("Returned options are not the expected ones", packet.getTransmitOptions(), is(equalTo(options)));
assertThat("Returned RESTul method is not the expected one", packet.getMethod(), is(equalTo(method)));
assertThat("Returned dest address is not the expected one", packet.getDestAddress(), is(equalTo(destAddress)));
assertThat("Returned URI is not the expected one", packet.getURI(), is(equalTo(uriData)));
assertThat("Returned data is not the expected one", packet.getPayload(), is(data));
assertThat("CoAP TX Request packet needs API Frame ID", packet.needsAPIFrameID(), is(equalTo(true)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getAPIData()}.
*
* <p>Test the get API parameters with a {@code null} received data.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] data = null;
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
int expectedLength = 25;
byte[] expectedData = new byte[expectedLength];
expectedData[0] = (byte)frameID;
expectedData[1] = (byte)options;
expectedData[2] = (byte)method.getValue();
System.arraycopy(destAddress.getAddress(), 0, expectedData, 3, destAddress.getAddress().length);
expectedData[19] = (byte)(uriData.length());
System.arraycopy(uriData.getBytes(), 0, expectedData, 20, uriData.getBytes().length);
// Call the method under test.
byte[] apiData = packet.getAPIData();
// Verify the result.
assertThat("API data is not the expected", apiData, is(equalTo(expectedData)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getAPIData()}.
*
* <p>Test the get API parameters with a not-{@code null} received data.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
int expectedLength = 25 + data.length;
byte[] expectedData = new byte[expectedLength];
expectedData[0] = (byte)frameID;
expectedData[1] = (byte)options;
expectedData[2] = (byte)method.getValue();
System.arraycopy(destAddress.getAddress(), 0, expectedData, 3, destAddress.getAddress().length);
expectedData[19] = (byte)(uriData.length());
System.arraycopy(uriData.getBytes(), 0, expectedData, 20, uriData.getBytes().length);
System.arraycopy(data, 0, expectedData, 20 + uriData.getBytes().length, data.length);
// Call the method under test.
byte[] apiData = packet.getAPIData();
// Verify the result.
assertThat("API data is not the expected", apiData, is(equalTo(expectedData)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#<API key>()}.
*
* <p>Test the get API parameters with a {@code null} received data.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] data = null;
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Call the method under test.
LinkedHashMap<String, String> packetParams = packet.<API key>();
// Verify the result.
assertThat("Packet parameters map size is not the expected one", packetParams.size(), is(equalTo(6)));
assertThat("Returned transmit options are not the expected ones", packetParams.get("Options"),
is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(options, 1)))));
assertThat("Returned HTTP method is not the expected one", packetParams.get("Method"),
is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(method.getValue(), 1)) + " (" + method.getName() + ")")));
assertThat("Returned dest address is not the expected one", packetParams.get("Destination address"),
is(equalTo(HexUtils.prettyHexString(destAddress.getAddress()) + " (" + destAddress.getHostAddress() + ")")));
assertThat("Returned URI length is not the expected one", packetParams.get("URI length"),
is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(uriData.length(), 1)) + " (" + uriData.length() + ")")));
assertThat("Returned URI is not the expected one", packetParams.get("URI"),
is(equalTo(HexUtils.prettyHexString(HexUtils.<API key>(uriData.getBytes())) + " (" + uriData + ")")));
assertThat("RF data is not the expected", packetParams.get("RF data"), is(nullValue(String.class)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#<API key>()}.
*
* <p>Test the get API parameters with a not-{@code null} received data.</p>
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Call the method under test.
LinkedHashMap<String, String> packetParams = packet.<API key>();
// Verify the result.
assertThat("Packet parameters map size is not the expected one", packetParams.size(), is(equalTo(7)));
assertThat("Returned transmit options are not the expected ones", packetParams.get("Options"),
is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(options, 1)))));
assertThat("Returned HTTP method is not the expected one", packetParams.get("Method"),
is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(method.getValue(), 1)) + " (" + method.getName() + ")")));
assertThat("Returned dest address is not the expected one", packetParams.get("Destination address"),
is(equalTo(HexUtils.prettyHexString(destAddress.getAddress()) + " (" + destAddress.getHostAddress() + ")")));
assertThat("Returned URI length is not the expected one", packetParams.get("URI length"),
is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(uriData.length(), 1)) + " (" + uriData.length() + ")")));
assertThat("Returned URI is not the expected one", packetParams.get("URI"),
is(equalTo(HexUtils.prettyHexString(HexUtils.<API key>(uriData.getBytes())) + " (" + uriData + ")")));
assertThat("RF data is not the expected", packetParams.get("Payload"),
is(equalTo(HexUtils.prettyHexString(HexUtils.<API key>(data)))));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setDestAddress(Inet6Address)}.
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Destination address cannot be null.")));
// Call the method under test that should throw a <API key>.
packet.setDestAddress(null);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setDestAddress(Inet6Address)}.
*
* @throws Exception
*/
@Test
public final void <API key>() throws Exception {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
Inet6Address newAddress = (Inet6Address) Inet6Address.getByName("fd8a:cb11:ad71:0000:7662:c401:5efe:dc41");
// Call the method under test.
packet.setDestAddress(newAddress);
// Verify the result.
assertThat("Dest address is not the expected one", packet.getDestAddress(), is(equalTo(newAddress)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setTransmitOptions(int)}.
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, CoAPURI.URI_AT_COMMAND, data);
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Transmit options can only be " +
<API key>.OPTION_NONE +
" or " + <API key>.<API key> + ".")));
// Call the method under test that should throw an <API key>.
packet.setTransmitOptions(0x03);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setTransmitOptions(int)}.
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, CoAPURI.<API key>, data);
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("Transmit options can only be " +
<API key>.OPTION_NONE +
" or " + <API key>.<API key> + ".")));
// Call the method under test that should throw an <API key>.
packet.setTransmitOptions(0x02);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setTransmitOptions(int)}.
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
int newOptions = 0x00;
// Call the method under test.
packet.setTransmitOptions(newOptions);
// Verify the result.
assertThat("Transmit options are not the expected ones", packet.getTransmitOptions(), is(equalTo(newOptions)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setMethod(HTTPMethodEnum)}.
*/
@Test
public final void testSetMEthodNull() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
exception.expect(<API key>.class);
exception.expectMessage(is(equalTo("HTTP Method cannot be null.")));
// Call the method under test that should throw a <API key>.
packet.setMethod(null);
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setMethod(HTTPMethodEnum)}.
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
HTTPMethodEnum newMethod = HTTPMethodEnum.PUT;
// Call the method under test.
packet.setMethod(newMethod);
// Verify the result.
assertThat("HTTP method is not the expected one", packet.getMethod(), is(equalTo(newMethod)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getPayload()}.
*/
@Test
public final void testGetDataNullData() {
// Set up the resources for the test.
byte[] data = null;
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Call the method under test.
byte[] result = packet.getPayload();
// Verify the result.
assertThat("RF data must be the same", result, is(equalTo(data)));
assertThat("RF data must be null", result, is(nullValue(byte[].class)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getPayload()}.
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Call the method under test.
byte[] result = packet.getPayload();
// Verify the result.
assertThat("Data must be the same", result, is(equalTo(data)));
assertThat("Data must not be the same object", result.hashCode(), is(not(equalTo(data.hashCode()))));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setPayload(byte[])}.
*/
@Test
public final void testSetDataNullData() {
// Set up the resources for the test.
byte[] newData = null;
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Call the method under test.
packet.setPayload(newData);
byte[] result = packet.getPayload();
// Verify the result.
assertThat("Data must be the same", result, is(equalTo(newData)));
assertThat("Data must be null", result, is(nullValue(byte[].class)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setPayload(byte[])}.
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] newData = "New data".getBytes();
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Call the method under test.
packet.setPayload(newData);
byte[] result = packet.getPayload();
// Verify the result.
assertThat("Data must be the same", result, is(equalTo(newData)));
}
/**
* Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setPayload(byte[])}.
*/
@Test
public final void <API key>() {
// Set up the resources for the test.
byte[] newData = "New data".getBytes();
CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);
// Call the method under test.
packet.setPayload(newData);
byte[] backup = Arrays.copyOf(newData, newData.length);
newData[0] = 0x00;
byte[] result = packet.getPayload();
// Verify the result.
assertThat("Data must be the same as the setted data", result, is(equalTo(backup)));
assertThat("Data must not be the current value of received data", result, is(not(equalTo(data))));
assertThat("Data must not be the same object", result.hashCode(), is(not(equalTo(backup.hashCode()))));
assertThat("Data must not be the same object", result.hashCode(), is(not(equalTo(data.hashCode()))));
}
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `GENERATE_MIPMAP` constant in crate `servo`.">
<meta name="keywords" content="rust, rustlang, rust-lang, GENERATE_MIPMAP">
<title>servo::gl::GENERATE_MIPMAP - Rust</title>
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<section class="sidebar">
<p class='location'><a href='../index.html'>servo</a>::<wbr><a href='index.html'>gl</a></p><script>window.sidebarCurrent = {name: 'GENERATE_MIPMAP', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content constant">
<h1 class='fqn'><span class='in-band'><a href='../index.html'>servo</a>::<wbr><a href='index.html'>gl</a>::<wbr><a class='constant' href=''>GENERATE_MIPMAP</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-3989' class='srclink' href='../../export/gleam/ffi/constant.GENERATE_MIPMAP.html?gotosrc=3989' title='goto source code'>[src]</a></span></h1>
<pre class='rust const'>pub const GENERATE_MIPMAP: <a href='../../std/primitive.u32.html'>u32</a><code> = </code><code>33169</code></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div>
<div class="shortcuts">
<h1>Keyboard Shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search Tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code>)
</p>
</div>
</div>
</div>
<script>
window.rootPath = "../../";
window.currentCrate = "servo";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script async src="../../search-index.js"></script>
</body>
</html>
|
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({
port: LIVERELOAD_PORT
});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
var fs = require('fs');
var delayApiCalls = function (request, response, next) {
if (request.url.indexOf('/api') !== -1) {
setTimeout(function () {
next();
}, 1000);
} else {
next();
}
};
var httpMethods = function (request, response, next) {
console.log("request method: " + JSON.stringify(request.method));
var rawpath = request.url.split('?')[0];
console.log("request url: " + JSON.stringify(request.url));
var path = require('path').resolve(__dirname, 'app/' + rawpath);
console.log("request path : " + JSON.stringify(path));
console.log("request current dir : " + JSON.stringify(__dirname));
if ((request.method === 'PUT' || request.method === 'POST')) {
console.log('inside put/post');
request.content = '';
request.addListener("data", function (chunk) {
request.content += chunk;
});
request.addListener("end", function () {
console.log("request content: " + JSON.stringify(request.content));
if (fs.existsSync(path)) {
if (request.method === 'POST') {
response.statusCode = 403;
response.end('Resource already exists.');
return;
}
fs.writeFile(path, request.content, function (err) {
if (err) {
response.statusCode(404);
console.log('File not saved: ' + JSON.stringify(err));
response.end('Error writing to file.');
} else {
console.log('File saved to: ' + path);
response.end('File was saved.');
}
});
return;
} else {
if (request.method === 'PUT') {
response.statusCode = 404;
response.end('Resource not found: ' + JSON.stringify(request.url));
return;
}
}
if (request.url === '/log') {
var filePath = 'server/log/server.log';
var logData = JSON.parse(request.content);
fs.appendFile(filePath, logData.logUrl + '\n' + logData.logMessage + '\n', function (err) {
if (err) {
throw err;
}
console.log('log saved');
response.end('log was saved');
});
return;
}
});
return;
}
next();
};
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec*.js'
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
// configurable paths
var yeomanConfig = {
app: 'app',
dist: 'dist',
doc: 'doc',
test: 'test'
};
try {
yeomanConfig.app = require('./bower.json').appPath || yeomanConfig.app;
} catch (e) {}
grunt.initConfig({
yeoman: yeomanConfig,
watch: {
compass: {
files: ['<%= yeoman.app %>/styles*.{scss,sass}'],
tasks: ['compass:server', 'autoprefixer:tmp']
},
styles: {
files: ['<%= yeoman.app %>/styles*.css'],
tasks: ['autoprefixer:styles']
},
livereload: {
options: {
livereload: LIVERELOAD_PORT
},
files: [
'<%= yeoman.app %>*.html',
'{.tmp,<%= yeoman.app %>}/styles*.css',
'{.tmp,<%= yeoman.app %>}/scripts*.js',
'{.tmp,<%= yeoman.app %>}/resources*',
'<%= yeoman.app %>/images*.{png,jpg,jpeg,gif,webp,svg}'
]
}
// doc: {
// files: ['{.tmp,<%= yeoman.app %>}/scripts*.js'],
// tasks: ['docular']
},
autoprefixer: {
options: ['last 1 version'],
tmp: {
files: [{
expand: true,
cwd: '.tmp/styles/',
src: '**/*.css',
dest: '.tmp/styles/'
}]
},
styles: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/styles/',
src: '**/*.css',
dest: '.tmp/styles/'
}]
}
},
connect: {
options: {
protocol: 'http',
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost'
},
livereload: {
options: {
middleware: function (connect) {
return [
delayApiCalls,
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app),
httpMethods
];
}
}
},
test: {
options: {
port: 9090,
middleware: function (connect) {
return [
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app),
mountFolder(connect, '<%= yeoman.test %>'),
httpMethods
];
}
}
},
dist: {
options: {
middleware: function (connect) {
return [
delayApiCalls,
mountFolder(connect, yeomanConfig.dist),
httpMethods
];
}
}
},
doc: {
options: {
port: 3000,
middleware: function (connect) {
return [
mountFolder(connect, yeomanConfig.doc)
];
}
}
}
},
open: {
server: {
url: '<%= connect.options.protocol %>://<%= connect.options.hostname %>:<%= connect.options.port %>'
},
doc: {
url: '<%= connect.options.protocol %>://<%= connect.options.hostname %>:9001'
}
},
clean: {
dist: {
files: [{
dot: true,
src: [
'.tmp',
'<%= yeoman.dist %>/*',
'!<%= yeoman.dist %>/.git*'
]
}]
},
server: '.tmp'
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'<%= yeoman.app %>/scripts/{,*/}*.js'
]
},
compass: {
options: {
sassDir: '<%= yeoman.app %>/styles',
cssDir: '.tmp/styles',
generatedImagesDir: '.tmp/images/generated',
imagesDir: '<%= yeoman.app %>/images',
javascriptsDir: '<%= yeoman.app %>/scripts',
fontsDir: '<%= yeoman.app %>/styles/fonts',
importPath: '<%= yeoman.app %>/bower_components',
httpImagesPath: '/images',
<API key>: '/images/generated',
httpFontsPath: '/styles/fonts',
relativeAssets: false
},
dist: {
options: {
debugInfo: false
}
},
server: {
options: {
debugInfo: true
}
}
},
uglify: {
dist: {
files: {
'<%= yeoman.dist %>/scripts/api/angular-jqm.js': ['<%= yeoman.app %>/scripts/api/angular-jqm.js'],
'<%= yeoman.dist %>/bower_components/angular-animate/angular-animate.js': ['<%= yeoman.app %>/bower_components/angular-animate/angular-animate.js'],
'<%= yeoman.dist %>/bower_components/angular-route/angular-route.js': ['<%= yeoman.app %>/bower_components/angular-route/angular-route.js'],
'<%= yeoman.dist %>/bower_components/angular-touch/angular-touch.js': ['<%= yeoman.app %>/bower_components/angular-touch/angular-touch.js']
}
}
},
rev: {
dist: {
files: {
src: [
'<%= yeoman.dist %>/images*.{png,jpg,jpeg,gif,webp,svg}',
html: ['<%= yeoman.dist %>/*.html', '<%= yeoman.dist %>/views/**/*.html'],
css: ['<%= yeoman.dist %>/styles*.css'],
src: 'images*.png',
'views*.html',
'template*.html'
'api/**',
'images/{,*/}*.{gif,webp}',
'views*.html',
'template*.html'
src: '**/*.css'
src: '**/*'
src: 'images*.png'
|
#!/usr/bin/execlineb -P
with-contenv
s6-envuidgid www-data
foreground {
if { s6-test -n $WP_RESET }
foreground { ln -s /resetter /public/resetter }
|
#include <stdio.h>
int main(int argc, char const *argv[])
{
//COQ=customer order quantity, COQV=COQ value, SV= Stock value
int COQ,COQV,Credit,SV;
if ((COQ<SV)&&(Credit>=COQV))
{
printf("Supply successfull\n");
}
else if ((COQ<SV)&&(Credit<COQV))
{
/* code */
printf("Amount given is less than value of stock supplied.");
}
else if((COQ>SV)&&(Credit>=COQV)){
printf("Whatever in stock is given. Remaining balance would be returned in two days.\n");
}
}
|
//This file is part of Finjin Engine (finjin-engine).
//Finjin Engine is distributed in the hope that it will be useful,
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//This Source Code Form is subject to the terms of the Mozilla Public
#pragma once
#include "finjin/engine/GenericInputDevice.hpp"
namespace Finjin { namespace Engine {
using namespace Finjin::Common;
class <API key>;
} }
|
# <API key>: true
# Setup used to generate email message
class ApplicationMailer < ActionMailer::Base
default from: "noreply@smoothiefunds.com"
layout "mailer"
end
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -<API key> #-}
{-# OPTIONS_GHC -<API key> #-}
{-# OPTIONS_GHC -<API key> #-}
-- Module : Network.Google.Resource.Storage.Objects.Update
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
-- Updates an object\'s metadata.
-- /See:/ <https://developers.google.com/storage/docs/json_api/ Cloud Storage JSON API Reference> for @storage.objects.update@.
module Network.Google.Resource.Storage.Objects.Update
(
-- * REST Resource
<API key>
-- * Creating a Request
, objectsUpdate
, ObjectsUpdate
-- * Request Lenses
, <API key>
, <API key>
, ouIfGenerationMatch
, ouPredefinedACL
, ouBucket
, ouPayload
, ouUserProject
, <API key>
, ouObject
, ouProjection
, <API key>
, ouGeneration
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
-- | A resource alias for @storage.objects.update@ method which the
-- 'ObjectsUpdate' request conforms to.
type <API key> =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"o" :>
Capture "object" Text :>
QueryParam "<API key>" (Textual Int64) :>
QueryParam "<API key>" (Textual Int64) :>
QueryParam "ifGenerationMatch" (Textual Int64) :>
QueryParam "predefinedAcl" <API key>
:>
QueryParam "userProject" Text :>
QueryParam "<API key>" (Textual Int64)
:>
QueryParam "projection" <API key> :>
QueryParam "<API key>" Text :>
QueryParam "generation" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Object :>
Put '[JSON] Object
-- | Updates an object\'s metadata.
-- /See:/ 'objectsUpdate' smart constructor.
data ObjectsUpdate =
ObjectsUpdate'
{ <API key> :: !(Maybe (Textual Int64))
, <API key> :: !(Maybe (Textual Int64))
, <API key> :: !(Maybe (Textual Int64))
, _ouPredefinedACL :: !(Maybe <API key>)
, _ouBucket :: !Text
, _ouPayload :: !Object
, _ouUserProject :: !(Maybe Text)
, <API key> :: !(Maybe (Textual Int64))
, _ouObject :: !Text
, _ouProjection :: !(Maybe <API key>)
, <API key> :: !(Maybe Text)
, _ouGeneration :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'ObjectsUpdate' with the minimum fields required to make a request.
-- Use one of the following lenses to modify other fields as desired:
-- * '<API key>'
-- * '<API key>'
-- * 'ouIfGenerationMatch'
-- * 'ouPredefinedACL'
-- * 'ouBucket'
-- * 'ouPayload'
-- * 'ouUserProject'
-- * '<API key>'
-- * 'ouObject'
-- * 'ouProjection'
-- * '<API key>'
-- * 'ouGeneration'
objectsUpdate
:: Text -- ^ 'ouBucket'
-> Object -- ^ 'ouPayload'
-> Text -- ^ 'ouObject'
-> ObjectsUpdate
objectsUpdate pOuBucket_ pOuPayload_ pOuObject_ =
ObjectsUpdate'
{ <API key> = Nothing
, <API key> = Nothing
, <API key> = Nothing
, _ouPredefinedACL = Nothing
, _ouBucket = pOuBucket_
, _ouPayload = pOuPayload_
, _ouUserProject = Nothing
, <API key> = Nothing
, _ouObject = pOuObject_
, _ouProjection = Nothing
, <API key> = Nothing
, _ouGeneration = Nothing
}
-- | Makes the operation conditional on whether the object\'s current
-- metageneration matches the given value.
<API key> :: Lens' ObjectsUpdate (Maybe Int64)
<API key>
= lens <API key>
(\ s a -> s{<API key> = a})
. mapping _Coerce
-- | Makes the operation conditional on whether the object\'s current
-- generation does not match the given value. If no live object exists, the
-- precondition fails. Setting to 0 makes the operation succeed only if
-- there is a live version of the object.
<API key> :: Lens' ObjectsUpdate (Maybe Int64)
<API key>
= lens <API key>
(\ s a -> s{<API key> = a})
. mapping _Coerce
-- | Makes the operation conditional on whether the object\'s current
-- generation matches the given value. Setting to 0 makes the operation
-- succeed only if there are no live versions of the object.
ouIfGenerationMatch :: Lens' ObjectsUpdate (Maybe Int64)
ouIfGenerationMatch
= lens <API key>
(\ s a -> s{<API key> = a})
. mapping _Coerce
-- | Apply a predefined set of access controls to this object.
ouPredefinedACL :: Lens' ObjectsUpdate (Maybe <API key>)
ouPredefinedACL
= lens _ouPredefinedACL
(\ s a -> s{_ouPredefinedACL = a})
-- | Name of the bucket in which the object resides.
ouBucket :: Lens' ObjectsUpdate Text
ouBucket = lens _ouBucket (\ s a -> s{_ouBucket = a})
-- | Multipart request metadata.
ouPayload :: Lens' ObjectsUpdate Object
ouPayload
= lens _ouPayload (\ s a -> s{_ouPayload = a})
-- | The project to be billed for this request. Required for Requester Pays
-- buckets.
ouUserProject :: Lens' ObjectsUpdate (Maybe Text)
ouUserProject
= lens _ouUserProject
(\ s a -> s{_ouUserProject = a})
-- | Makes the operation conditional on whether the object\'s current
-- metageneration does not match the given value.
<API key> :: Lens' ObjectsUpdate (Maybe Int64)
<API key>
= lens <API key>
(\ s a -> s{<API key> = a})
. mapping _Coerce
-- | Name of the object. For information about how to URL encode object names
-- to be path safe, see Encoding URI Path Parts.
ouObject :: Lens' ObjectsUpdate Text
ouObject = lens _ouObject (\ s a -> s{_ouObject = a})
-- | Set of properties to return. Defaults to full.
ouProjection :: Lens' ObjectsUpdate (Maybe <API key>)
ouProjection
= lens _ouProjection (\ s a -> s{_ouProjection = a})
-- | The project to be billed for this request if the target bucket is
-- requester-pays bucket.
<API key> :: Lens' ObjectsUpdate (Maybe Text)
<API key>
= lens <API key>
(\ s a -> s{<API key> = a})
-- | If present, selects a specific revision of this object (as opposed to
-- the latest version, the default).
ouGeneration :: Lens' ObjectsUpdate (Maybe Int64)
ouGeneration
= lens _ouGeneration (\ s a -> s{_ouGeneration = a})
. mapping _Coerce
instance GoogleRequest ObjectsUpdate where
type Rs ObjectsUpdate = Object
type Scopes ObjectsUpdate =
'["https:
"https:
requestClient ObjectsUpdate'{..}
= go _ouBucket _ouObject <API key>
<API key>
<API key>
_ouPredefinedACL
_ouUserProject
<API key>
_ouProjection
<API key>
_ouGeneration
(Just AltJSON)
_ouPayload
storageService
where go
= buildClient (Proxy :: Proxy <API key>)
mempty
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HaJS
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void ofdBox_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog() { Filter = "XML Files|*.xml" };
if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
((TextBox)sender).Text = ofd.FileName;
}
private void button1_Click(object sender, EventArgs e)
{
if (serverConfigPathBox.Text == "" || inputXmlBox.Text == "")
return;
HaJSCompiler jsc = new HaJSCompiler(serverConfigPathBox.Text);
string outPath = Path.Combine(Path.GetDirectoryName(inputXmlBox.Text), Path.<API key>(inputXmlBox.Text) + ".js");
#if !DEBUG
try
{
#endif
jsc.Compile(inputXmlBox.Text, outPath);
MessageBox.Show("Finished compiling to " + outPath);
#if !DEBUG
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#endif
}
private void button2_Click(object sender, EventArgs e)
{
if (serverConfigPathBox.Text == "" || inputXmlBox.Text == "")
return;
HaJSCompiler jsc = new HaJSCompiler(serverConfigPathBox.Text);
string folder = Path.GetDirectoryName(inputXmlBox.Text);
foreach (FileInfo fi in new DirectoryInfo(folder).GetFiles())
{
if (fi.Extension.ToLower() == ".xml")
{
#if !DEBUG
try
{
#endif
jsc.Compile(fi.FullName, Path.Combine(folder, Path.<API key>(fi.FullName) + ".js"));
#if !DEBUG
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
}
#endif
}
}
MessageBox.Show("Finished compiling " + folder);
}
}
}
|
package org.seedstack.seed.core.internal.configuration.tool;
import com.google.common.base.Strings;
import java.io.PrintStream;
import org.fusesource.jansi.Ansi;
import org.seedstack.shed.text.TextWrapper;
class DetailPrinter {
private static final TextWrapper textWrapper = new TextWrapper(120);
private final PropertyInfo propertyInfo;
DetailPrinter(PropertyInfo propertyInfo) {
this.propertyInfo = propertyInfo;
}
void printDetail(PrintStream stream) {
Ansi ansi = Ansi.ansi();
String title = "Details of " + propertyInfo.getName();
ansi
.a(title)
.newline()
.a(Strings.repeat("-", title.length()))
.newline().newline();
printSummary(propertyInfo, ansi);
printDeclaration(propertyInfo, ansi);
<API key>(propertyInfo, ansi);
printAdditionalInfo(propertyInfo, ansi);
ansi.newline();
stream.print(ansi.toString());
}
private Ansi printSummary(PropertyInfo propertyInfo, Ansi ansi) {
return ansi.a(propertyInfo.getShortDescription()).newline();
}
private void printDeclaration(PropertyInfo propertyInfo, Ansi ansi) {
ansi
.newline()
.a(" ")
.fgBright(Ansi.Color.MAGENTA)
.a(propertyInfo.getType())
.reset()
.a(" ")
.fgBright(Ansi.Color.BLUE)
.a(propertyInfo.getName())
.reset();
Object defaultValue = propertyInfo.getDefaultValue();
if (defaultValue != null) {
ansi
.a(" = ")
.fgBright(Ansi.Color.GREEN)
.a(String.valueOf(defaultValue))
.reset();
}
ansi
.a(";")
.newline();
}
private void <API key>(PropertyInfo propertyInfo, Ansi ansi) {
String longDescription = propertyInfo.getLongDescription();
if (longDescription != null) {
ansi.newline().a(textWrapper.wrap(longDescription)).newline();
}
}
private void printAdditionalInfo(PropertyInfo propertyInfo, Ansi ansi) {
if (propertyInfo.isMandatory() || propertyInfo.isSingleValue()) {
ansi.newline();
}
if (propertyInfo.isMandatory()) {
ansi.a("* This property is mandatory.").newline();
}
if (propertyInfo.isSingleValue()) {
ansi.a("* This property is the default property of its declaring object").newline();
}
}
}
|
layout: "cf"
page_title: "Cloud Foundry: cf_service_access"
sidebar_current: "<API key>"
description: |-
Provides a Cloud Foundry Service Access resource.
# cf\_service\_access
Provides a Cloud Foundry resource for managing [access](https:
## Example Usage
The following example enables access to a specific plan of a given service broker within an Org.
resource "cf_service_access" "org1-mysql-512mb" {
plan = "${cf_service_broker.mysql.service_plans["p-mysql/512mb"]}"
org = "${cf_org.org1.id}"
}
## Argument Reference
The following arguments are supported:
* `plan` - (Required) The ID of the service plan to grant access to
* `org` - (Required) The ID of the Org which should have access to the plan
|
const html = require('choo/html');
module.exports = function(name, url) {
const dialog = function(state, emit, close) {
return html`
<send-share-dialog
class="flex flex-col items-center text-center p-4 max-w-sm m-auto"
>
<h1 class="text-3xl font-bold my-4">
${state.translate('<API key>')}
</h1>
<p class="font-normal leading-normal text-grey-80 dark:text-grey-40">
${state.translate('<API key>')}<br />
<span class="word-break-all">${name}</span>
</p>
<input
type="text"
id="share-url"
class="w-full my-4 border rounded-lg leading-loose h-12 px-2 py-1 dark:bg-grey-80"
value="${url}"
readonly="true"
/>
<button
class="btn rounded-lg w-full flex-shrink-0 focus:outline"
onclick="${share}"
title="${state.translate('shareLinkButton')}"
>
${state.translate('shareLinkButton')}
</button>
<button
class="link-blue my-4 font-medium cursor-pointer focus:outline"
onclick="${close}"
title="${state.translate('okButton')}"
>
${state.translate('okButton')}
</button>
</send-share-dialog>
`;
async function share(event) {
event.stopPropagation();
try {
await navigator.share({
title: state.translate('-send-brand'),
text: state.translate('shareMessage', { name }),
url
});
} catch (e) {
if (e.code === e.ABORT_ERR) {
return;
}
console.error(e);
}
close();
}
};
dialog.type = 'share';
return dialog;
};
|
#ifndef <API key>
#define <API key>
#include "plastiqobject.h"
class <API key> : public PlastiQObject {
PLASTIQ_OBJECT(IsQEvent,<API key>,QAccessibleEvent)
PLASTIQ_INHERITS(QAccessibleEvent)
public: ~<API key>();
};
#endif // <API key>
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Input;
using System.Threading;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.GamerServices;
namespace Sims2Online.UI.Elements
{
class UIButton : UIControl
{
MouseState oldMouseState;
KeyboardState oldKBState;
Vector2 selected;
Texture2D backtex;
public string text;
public Color color = Color.White;
public event EventHandler onClicked;
public event EventHandler onHover;
public event EventHandler onMouseLeft;
public float scale;
public override void Init(SpriteBatch spb)
{
selected = Vector2.Zero;
using (var stream1 = new FileStream("./content/colour.png", FileMode.Open))
{
backtex = Texture2D.FromStream(spb.GraphicsDevice, stream1);
}
}
public override void Update(SpriteBatch spb, S2OGame game)
{
spb.Draw(backtex, rect, Color.Black * 0.25f);
var currentMouseState = Mouse.GetState();
var currentKBState = Keyboard.GetState();
if (rect.Contains(new Point(currentMouseState.X, currentMouseState.Y)) && currentMouseState.LeftButton == ButtonState.Pressed)
{
this.onClicked?.Invoke(this, EventArgs.Empty);
}
else if (rect.Contains(new Point(currentMouseState.X, currentMouseState.Y)))
{
this.onHover?.Invoke(this, EventArgs.Empty);
}
else
{
this.onMouseLeft?.Invoke(this, EventArgs.Empty);
}
spb.DrawString(S2OGame.Font1, text, new Vector2(rect.X + ((rect.Width / 2) - ((S2OGame.Font1.MeasureString(text) * scale).X / 2)), rect.Y + ((rect.Height / 2) - ((S2OGame.Font1.MeasureString(text) * scale).Y / 2))), color, 0, Vector2.Zero, scale, SpriteEffects.None, 0.5f);
oldMouseState = currentMouseState;
oldKBState = currentKBState;
}
}
}
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -<API key> #-}
{-# OPTIONS_GHC -<API key> #-}
{-# OPTIONS_GHC -<API key> #-}
-- Module : Network.Google.Resource.Analytics.Management.WebProperties.Update
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
-- Updates an existing web property.
-- /See:/ <https://developers.google.com/analytics/ Google Analytics API Reference> for @analytics.management.webproperties.update@.
module Network.Google.Resource.Analytics.Management.WebProperties.Update
(
-- * REST Resource
<API key>
-- * Creating a Request
, <API key>
, <API key>
-- * Request Lenses
, mwpuWebPropertyId
, mwpuPayload
, mwpuAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
-- | A resource alias for @analytics.management.webproperties.update@ method which the
-- '<API key>' request conforms to.
type <API key> =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] WebProperty :>
Put '[JSON] WebProperty
-- | Updates an existing web property.
-- /See:/ '<API key>' smart constructor.
data <API key> = <API key>'
{ _mwpuWebPropertyId :: !Text
, _mwpuPayload :: !WebProperty
, _mwpuAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of '<API key>' with the minimum fields required to make a request.
-- Use one of the following lenses to modify other fields as desired:
-- * 'mwpuWebPropertyId'
-- * 'mwpuPayload'
-- * 'mwpuAccountId'
<API key>
:: Text -- ^ 'mwpuWebPropertyId'
-> WebProperty -- ^ 'mwpuPayload'
-> Text -- ^ 'mwpuAccountId'
-> <API key>
<API key> pMwpuWebPropertyId_ pMwpuPayload_ pMwpuAccountId_ =
<API key>'
{ _mwpuWebPropertyId = pMwpuWebPropertyId_
, _mwpuPayload = pMwpuPayload_
, _mwpuAccountId = pMwpuAccountId_
}
-- | Web property ID
mwpuWebPropertyId :: Lens' <API key> Text
mwpuWebPropertyId
= lens _mwpuWebPropertyId
(\ s a -> s{_mwpuWebPropertyId = a})
-- | Multipart request metadata.
mwpuPayload :: Lens' <API key> WebProperty
mwpuPayload
= lens _mwpuPayload (\ s a -> s{_mwpuPayload = a})
-- | Account ID to which the web property belongs
mwpuAccountId :: Lens' <API key> Text
mwpuAccountId
= lens _mwpuAccountId
(\ s a -> s{_mwpuAccountId = a})
instance GoogleRequest <API key>
where
type Rs <API key> = WebProperty
type Scopes <API key> =
'["https:
requestClient <API key>'{..}
= go _mwpuAccountId _mwpuWebPropertyId (Just AltJSON)
_mwpuPayload
analyticsService
where go
= buildClient
(Proxy ::
Proxy <API key>)
mempty
|
<?php
namespace ide\formats\form\elements;
use ide\editors\value\<API key>;
use ide\editors\value\ColorPropertyEditor;
use ide\editors\value\FontPropertyEditor;
use ide\editors\value\<API key>;
use ide\editors\value\<API key>;
use ide\editors\value\<API key>;
use ide\editors\value\TextPropertyEditor;
use ide\formats\form\AbstractFormElement;
use php\gui\designer\UXDesignProperties;
use php\gui\designer\<API key>;
use php\gui\layout\UXAnchorPane;
use php\gui\layout\UXHBox;
use php\gui\layout\UXPanel;
use php\gui\UXButton;
use php\gui\UXNode;
use php\gui\UXTableCell;
use php\gui\UXTextField;
use php\gui\UXTitledPane;
/**
* Class ButtonFormElement
* @package ide\formats\form
*/
class PanelFormElement extends AbstractFormElement
{
public function getGroup()
{
return 'Панели';
}
public function getElementClass()
{
return UXPanel::class;
}
public function getName()
{
return 'Панель';
}
public function getIcon()
{
return 'icons/panel16.png';
}
public function getIdPattern()
{
return "panel%s";
}
public function isLayout()
{
return true;
}
public function addToLayout($self, $node, $screenX = null, $screenY = null)
{
/** @var UXPanel $self */
$node->position = $self->screenToLocal($screenX, $screenY);
$self->add($node);
}
public function getLayoutChildren($layout)
{
$children = flow($layout->children)
->find(function (UXNode $it) { return !$it->classes->has('x-system-element'); })
->toArray();
return $children;
}
/**
* @return UXNode
*/
public function createElement()
{
$button = new UXPanel();
$button->backgroundColor = 'white';
return $button;
}
public function getDefaultSize()
{
return [150, 100];
}
public function isOrigin($any)
{
return get_class($any) == UXPanel::class;
}
}
|
<HTML>
<HEAD>
<TITLE>HPL_ptimer_walltime HPL 2.1 Library Functions October 26, 2012</TITLE>
</HEAD>
<BODY BGCOLOR="WHITE" TEXT = "#000000" LINK = "#0000ff" VLINK = "#000099"
ALINK = "#ffff00">
<H1>Name</H1>
<B>HPL_ptimer_walltime</B> Return the elapsed (wall-clock) time.
<H1>Synopsis</H1>
<CODE>#include "hpl.h"</CODE><BR><BR>
<CODE>double</CODE>
<CODE>HPL_ptimer_walltime();</CODE>
<H1>Description</H1>
<B>HPL_ptimer_walltime</B>
returns the elapsed (wall-clock) time.
<H1>See Also</H1>
<A HREF="HPL_ptimer_cputime.html">HPL_ptimer_cputime</A>,
<A HREF="HPL_ptimer.html">HPL_ptimer</A>.
</BODY>
</HTML>
|
package com.storage.mywarehouse.Dao;
import com.storage.mywarehouse.View.WarehouseProduct;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
import java.util.List;
public class WarehouseProductDAO {
@SuppressWarnings("unchecked")
public static List<WarehouseProduct> findById(int id) {
Session session = NewHibernateUtil.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
List products = session.createCriteria(WarehouseProduct.class)
.add(Restrictions.eq("productId", id))
.list();
tx.commit();
session.close();
return products;
}
@SuppressWarnings("unchecked")
public static List<WarehouseProduct> findByQuantity(int quantity) {
Session session = NewHibernateUtil.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
List <API key> = session.createCriteria(WarehouseProduct.class)
.add(Restrictions.eq("quantity", quantity))
.list();
tx.commit();
session.close();
return <API key>;
}
@SuppressWarnings("unchecked")
public static List<WarehouseProduct> findByParam(String param, String value) {
Session session = NewHibernateUtil.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
List products = session.createCriteria(WarehouseProduct.class)
.add(Restrictions.eq(param.toLowerCase(), value))
.list();
tx.commit();
session.close();
return products;
}
@SuppressWarnings("unchecked")
public static List<WarehouseProduct> <API key>(String param, String value) {
Session session = NewHibernateUtil.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
List products = session.createCriteria(WarehouseProduct.class)
.add(Restrictions.like(param.toLowerCase(), "%" + value + "%"))
.list();
tx.commit();
session.close();
return products;
}
}
|

This is the JavaScript API documentation for Sozi.
Additional information about the Sozi project can be found at:
* [The main web site for Sozi, with the user manual and tutorials](https://sozi.baierouge.fr)
* [The source code repository at GitHub](https://github.com/sozi-projects/Sozi)
|
# gsd
Getting stuff done - more vapourware, this time with shiny new tech
## TL;DR
Playing around with shiny new tech by creating a web app for following the [Getting Things Done](https://hamberg.no/gtd/) organisational framework.
## What's this all about?
I want to play with a whole bunch of shiny(ish), new(ish) tech and methodologies. I intend to do this by building a vapourware web app to help follow the [Getting Things Done](https://hamberg.no/gtd/) organisational framework.
To this end this project will hopefully/kinda/sorta do some of the following:
* Built using Clojure
* Use BDD to specify the application using plain English
* Cucumber
* Property based testing
* test.check
* Use mobile first, responsive web design
* Isomorphic web app using Om Next and the Nashorn javascript engine
* Continuous deployment
## Contributing
Should you ever find this project useful and feel the urge to contribute something back this project follows the [latest C4 process](http://rfc.zeromq.org/spec:42/C4/) for contributions.
## Style guide
Code should be formatted as defaulted to by the [Cursive](https://cursive-ide.com/) Intellij plugin.
This project uses the [MPLv2](https:
|
package iso
import (
"fmt"
"github.com/mitchellh/multistep"
vmwcommon "github.com/mitchellh/packer/builder/vmware/common"
"github.com/mitchellh/packer/packer"
"log"
)
// stepRemoteUpload uploads some thing from the state bag to a remote driver
// (if it can) and stores that new remote path into the state bag.
type stepRemoteUpload struct {
Key string
Message string
}
func (s *stepRemoteUpload) Run(state multistep.StateBag) multistep.StepAction {
driver := state.Get("driver").(vmwcommon.Driver)
ui := state.Get("ui").(packer.Ui)
remote, ok := driver.(RemoteDriver)
if !ok {
return multistep.ActionContinue
}
path, ok := state.Get(s.Key).(string)
if !ok {
return multistep.ActionContinue
}
ui.Say(s.Message)
log.Printf("Remote uploading: %s", path)
newPath, err := remote.UploadISO(path)
if err != nil {
err := fmt.Errorf("Error uploading file: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
state.Put(s.Key, newPath)
return multistep.ActionContinue
}
func (s *stepRemoteUpload) Cleanup(state multistep.StateBag) {
}
|
package app.intelehealth.client.models.pushRequestApiCall;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class Person {
@SerializedName("uuid")
@Expose
private String uuid;
@SerializedName("gender")
@Expose
private String gender;
@SerializedName("names")
@Expose
private List<Name> names = null;
@SerializedName("birthdate")
@Expose
private String birthdate;
@SerializedName("attributes")
@Expose
private List<Attribute> attributes = null;
@SerializedName("addresses")
@Expose
private List<Address> addresses = null;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public List<Name> getNames() {
return names;
}
public void setNames(List<Name> names) {
this.names = names;
}
public String getBirthdate() {
return birthdate;
}
public void setBirthdate(String birthdate) {
this.birthdate = birthdate;
}
public List<Attribute> getAttributes() {
return attributes;
}
public void setAttributes(List<Attribute> attributes) {
this.attributes = attributes;
}
public List<Address> getAddresses() {
return addresses;
}
public void setAddresses(List<Address> addresses) {
this.addresses = addresses;
}
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `XK_F1` constant in crate `x11`.">
<meta name="keywords" content="rust, rustlang, rust-lang, XK_F1">
<title>x11::keysym::XK_F1 - Rust</title>
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<section class="sidebar">
<p class='location'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>keysym</a></p><script>window.sidebarCurrent = {name: 'XK_F1', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content constant">
<h1 class='fqn'><span class='in-band'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>keysym</a>::<wbr><a class='constant' href=''>XK_F1</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-1174' class='srclink' href='../../src/x11/keysym.rs.html#100' title='goto source code'>[src]</a></span></h1>
<pre class='rust const'>pub const XK_F1: <a class='type' href='../../libc/types/os/arch/c95/type.c_uint.html' title='libc::types::os::arch::c95::c_uint'>c_uint</a><code> = </code><code>0xFFBE</code></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div>
<div class="shortcuts">
<h1>Keyboard Shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search Tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code>)
</p>
</div>
</div>
</div>
<script>
window.rootPath = "../../";
window.currentCrate = "x11";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script async src="../../search-index.js"></script>
</body>
</html>
|
{
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
{% extends "firefox/base/base-protocol.html" %}
{% from "macros-protocol.html" import split, card with context %}
{% block page_title %}{{ ftl('<API key>') }}{% endblock %}
{% block page_desc %}{{ ftl('learn-more-about') }}{% endblock %}
{% block page_css %}
{{ css_bundle('more') }}
{% endblock %}
{% block content %}
<main>
{% call split(
image_url='img/firefox/privacy/promise/privacy-hero.png',
<API key>=True,
block_class='page-hero <API key> mzp-t-split-nospace',
theme_class='mzp-t-dark',
media_class='mzp-l-split-v-end'
) %}
<h2>{{ ftl('<API key>', fallback='<API key>') }}</h2>
<p><a href="{{ url('firefox.faq') }}" class="mzp-c-button mzp-t-product">{{ ftl('learn-more-faq') }}</a></p>
{% endcall %}
<div class="mzp-l-content">
<div class="mzp-l-card-quarter">
{{ card(
title=ftl('firefox-fights-for'),
ga_title='Firefox Windows',
image_url='img/firefox/more/firefox-windows.jpg',
desc=ftl('easy-migration-of'),
link_url=url('firefox.windows')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Firefox Mac',
image_url='img/firefox/more/firefox-mac.jpg',
desc=ftl('firefox-doesnt-spy'),
link_url=url('firefox.mac')
)}}
{{ card(
title=ftl('firefox-for-linux'),
ga_title='Firefox Linux',
image_url='img/firefox/more/firefox-linux.jpg',
desc=ftl('new-school-meets'),
link_url=url('firefox.linux')
)}}
{{ card(
title=ftl('firefox-for-windows'),
ga_title='Firefox Win 64',
image_url='img/firefox/more/firefox-64-bit.jpg',
desc=ftl('we-worry-about'),
link_url=url('firefox.browsers.windows-64-bit')
)}}
</div>
<div class="mzp-l-card-third">
{{ card(
title=ftl('the-history-of'),
ga_title='Browser History',
image_url='img/firefox/more/browser-history.jpg',
desc=ftl('firefox-has-been'),
link_url=url('firefox.browsers.browser-history')
)}}
{{ card(
title=ftl('what-is-a'),
ga_title='What is a browser',
image_url='img/firefox/more/what-is-a-browser.jpg',
desc=ftl('a-web-browser'),
link_url=url('firefox.browsers.what-is-a-browser')
)}}
{{ card(
title=ftl('update-your-browser'),
ga_title='Update Browser',
image_url='img/firefox/more/update-browser.jpg',
desc=ftl('the-firefox-browser'),
link_url=url('firefox.browsers.update-browser')
)}}
</div>
<div class="mzp-l-card-third">
{{ card(
title=ftl('<API key>'),
ga_title='Firefox All',
image_url='img/firefox/more/firefox-all.jpg',
desc=ftl('we-believe-everyone'),
link_url=url('firefox.all')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Firefox Products',
image_url='img/firefox/more/firefox-chromebook.jpg',
desc=ftl('<API key>'),
link_url=url('firefox.browsers.chromebook')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Firefox Browsers',
image_url='img/firefox/more/firefox-quantum.jpg',
desc=ftl('<API key>'),
link_url=url('firefox.browsers.quantum')
)}}
</div>
<div class="mzp-l-card-third">
{{ card(
title=ftl('firefox-rebel-with'),
ga_title="Independent",
image_url='img/firefox/more/independent.jpg',
desc= ftl('<API key>'),
link_url=url('firefox.features.independent')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Features Private Browsing',
image_url='img/firefox/more/<API key>.jpg',
desc= ftl('<API key>'),
link_url=url('firefox.privacy.book')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Features Private Browsing',
image_url='img/firefox/more/incognito-browser.jpg',
desc=ftl('firefox-calls-it'),
link_url=url('firefox.browsers.incognito-browser')
)}}
</div>
<div class="mzp-l-card-quarter">
{{ card(
title=ftl('the-ad-blocker'),
ga_title='Featires Adblocker',
image_url='img/firefox/more/firefox-adblocker.jpg',
desc=ftl('so-many-ads'),
link_url=url('firefox.features.adblocker')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Features Private Browsing',
image_url='img/firefox/more/private-browsing.jpg',
desc=ftl('were-obsessed-with'),
link_url=url('firefox.features.private-browsing')
)}}
{{ card(
title=ftl('take-the-stress'),
ga_title='Features Safe Browser',
image_url='img/firefox/more/safe-browser.jpg',
desc=ftl('building-a-safe'),
link_url=url('firefox.features.safebrowser')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Features Safe Browser',
image_url='img/firefox/more/firefox-sync.jpg',
desc=ftl('<API key>'),
link_url=url('firefox.sync')
)}}
</div>
<div class="mzp-l-card-third">
{{ card(
title=ftl('seven-of-the'),
ga_title='Compare',
image_url='img/firefox/more/compare-browsers.jpg',
desc=ftl('we-compare-firefox'),
link_url=url('firefox.browsers.compare.index')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Compare Chrome',
image_url='img/firefox/more/firefox-chrome.jpg',
desc=ftl('big-isnt-always'),
link_url=url('firefox.browsers.compare.chrome')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Compare Brave',
image_url='img/firefox/more/firefox-brave.jpg',
desc=ftl('be-bold-and'),
link_url=url('firefox.browsers.compare.brave')
)}}
</div>
<div class="mzp-l-card-quarter">
{{ card(
title=ftl('<API key>'),
ga_title='Compare Edge',
image_url='img/firefox/more/firefox-edge.jpg',
desc=ftl('youll-never-guess'),
link_url=url('firefox.browsers.compare.edge')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Compare IE',
image_url='img/firefox/more/firefox-ie.jpg',
desc=ftl('old-habits-that'),
link_url=url('firefox.browsers.compare.ie')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Compare Safari',
desc=ftl('you-dont-have'),
image_url='img/firefox/more/firefox-safari.jpg',
link_url=url('firefox.browsers.compare.safari')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Compare Opera',
image_url='img/firefox/more/firefox-opera.jpg',
desc=ftl('be-free-to'),
link_url=url('firefox.browsers.compare.opera')
)}}
</div>
<div class="mzp-l-card-third">
{{ card(
title=ftl('<API key>'),
ga_title='Fingerprinter Blocking',
image_url='img/firefox/more/fingerprint.png',
desc=ftl('<API key>'),
link_url=url('firefox.features.fingerprinting')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Translate',
image_url='img/firefox/more/firefox-all.jpg',
desc=ftl('<API key>'),
link_url=url('firefox.features.translate')
)}}
{{ card(
title=ftl('<API key>'),
ga_title='Safe Passwords',
desc=ftl('<API key>'),
image_url='img/firefox/more/passwords.png',
link_url=url('firefox.privacy.passwords')
)}}
</div>
<div class="mzp-l-card-quarter">
{{ card(
title=ftl('<API key>'),
ga_title='Avoid Misinformation',
image_url='img/firefox/more/<API key>.jpg',
desc=ftl('<API key>'),
link_url=url('firefox.more.misinformation')
)}}
</div>
</div>
</main>
{% endblock %}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `MAX_VIEWPORT_DIMS` constant in crate `gleam`.">
<meta name="keywords" content="rust, rustlang, rust-lang, MAX_VIEWPORT_DIMS">
<title>gleam::ffi::MAX_VIEWPORT_DIMS - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<nav class="sidebar">
<p class='location'><a href='../index.html'>gleam</a>::<wbr><a href='index.html'>ffi</a></p><script>window.sidebarCurrent = {name: 'MAX_VIEWPORT_DIMS', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content constant">
<h1 class='fqn'><span class='in-band'><a href='../index.html'>gleam</a>::<wbr><a href='index.html'>ffi</a>::<wbr><a class='constant' href=''>MAX_VIEWPORT_DIMS</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-1365' class='srclink' href='../../src/gleam/home/servo/buildbot/slave/doc/build/target/debug/build/<API key>/out/gl_bindings.rs.html#805' title='goto source code'>[src]</a></span></h1>
<pre class='rust const'>pub const MAX_VIEWPORT_DIMS: <a class='type' href='../../gleam/gl/types/type.GLenum.html' title='gleam::gl::types::GLenum'>GLenum</a><code> = </code><code>3386</code></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "gleam";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>
|
#include "jspin.h"
#include "jspininfo.h" // auto-generated
#include "jsinteractive.h"
#include "jshardware.h"
#if defined(PICO) || defined(NUCLEOF401RE) || defined(NUCLEOF411RE)
#define PIN_NAMES_DIRECT // work out pin names directly from port + pin in pinInfo
#endif
bool jshIsPinValid(Pin pin) {
// Note, PIN_UNDEFINED is always > JSH_PIN_COUNT
return pin < JSH_PIN_COUNT && pinInfo[pin].port!=JSH_PORT_NONE;
}
Pin jshGetPinFromString(const char *s) {
// built in constants
if (s[0]=='B' && s[1]=='T' && s[2]=='N') {
#ifdef BTN1_PININDEX
if (!s[3]) return BTN1_PININDEX;
if (s[3]=='1' && !s[4]) return BTN1_PININDEX;
#endif
#ifdef BTN2_PININDEX
if (s[3]=='2' && !s[4]) return BTN2_PININDEX;
#endif
#ifdef BTN3_PININDEX
if (s[3]=='3' && !s[4]) return BTN3_PININDEX;
#endif
#ifdef BTN4_PININDEX
if (s[3]=='4' && !s[4]) return BTN4_PININDEX;
#endif
}
if (s[0]=='L' && s[1]=='E' && s[2]=='D') {
#ifdef LED1_PININDEX
if (!s[3]) return LED1_PININDEX;
if (s[3]=='1' && !s[4]) return LED1_PININDEX;
#endif
#ifdef LED2_PININDEX
if (s[3]=='2' && !s[4]) return LED2_PININDEX;
#endif
#ifdef LED3_PININDEX
if (s[3]=='3' && !s[4]) return LED3_PININDEX;
#endif
#ifdef LED4_PININDEX
if (s[3]=='4' && !s[4]) return LED4_PININDEX;
#endif
#ifdef LED5_PININDEX
if (s[3]=='5' && !s[4]) return LED5_PININDEX;
#endif
#ifdef LED6_PININDEX
if (s[3]=='6' && !s[4]) return LED6_PININDEX;
#endif
#ifdef LED7_PININDEX
if (s[3]=='7' && !s[4]) return LED7_PININDEX;
#endif
#ifdef LED8_PININDEX
if (s[3]=='8' && !s[4]) return LED8_PININDEX;
#endif
}
if ((s[0]>='A' && s[0]<='H') && s[1]) {
int port = JSH_PORTA+s[0]-'A';
int pin = -1;
if (s[1]>='0' && s[1]<='9') {
if (!s[2]) { // D0-D9
pin = (s[1]-'0');
} else if (s[2]>='0' && s[2]<='9') {
if (!s[3]) {
pin = ((s[1]-'0')*10 + (s[2]-'0'));
} else if (!s[4] && s[3]>='0' && s[3]<='9') {
pin = ((s[1]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0'));
}
}
}
if (pin>=0) {
#ifdef PIN_NAMES_DIRECT
int i;
for (i=0;i<JSH_PIN_COUNT;i++)
if (pinInfo[i].port == port && pinInfo[i].pin==pin)
return (Pin)i;
#else
if (port == JSH_PORTA) {
if (pin<JSH_PORTA_COUNT) return (Pin)(JSH_PORTA_OFFSET + pin);
} else if (port == JSH_PORTB) {
if (pin<JSH_PORTB_COUNT) return (Pin)(JSH_PORTB_OFFSET + pin);
} else if (port == JSH_PORTC) {
if (pin<JSH_PORTC_COUNT) return (Pin)(JSH_PORTC_OFFSET + pin);
} else if (port == JSH_PORTD) {
if (pin<JSH_PORTD_COUNT) return (Pin)(JSH_PORTD_OFFSET + pin);
#if JSH_PORTE_OFFSET!=-1
} else if (port == JSH_PORTE) {
if (pin<JSH_PORTE_COUNT) return (Pin)(JSH_PORTE_OFFSET + pin);
#endif
#if JSH_PORTF_OFFSET!=-1
} else if (port == JSH_PORTF) {
if (pin<JSH_PORTF_COUNT) return (Pin)(JSH_PORTF_OFFSET + pin);
#endif
#if JSH_PORTG_OFFSET!=-1
} else if (port == JSH_PORTG) {
if (pin<JSH_PORTG_COUNT) return (Pin)(JSH_PORTG_OFFSET + pin);
#endif
#if JSH_PORTH_OFFSET!=-1
} else if (port == JSH_PORTH) {
if (pin<JSH_PORTH_COUNT) return (Pin)(JSH_PORTH_OFFSET + pin);
#endif
}
#endif
}
}
return PIN_UNDEFINED;
}
/** Write the pin name to a string. String must have at least 8 characters (to be safe) */
void jshGetPinString(char *result, Pin pin) {
result[0] = 0; // just in case
#ifdef PIN_NAMES_DIRECT
if (jshIsPinValid(pin)) {
result[0] = (char)('A'+pinInfo[pin].port-JSH_PORTA);
itostr(pinInfo[pin].pin-JSH_PIN0,&result[1],10);
#else
if (
#if JSH_PORTA_OFFSET!=0
pin>=JSH_PORTA_OFFSET &&
#endif
pin<JSH_PORTA_OFFSET+JSH_PORTA_COUNT) {
result[0]='A';
itostr(<API key>,&result[1],10);
} else if (pin>=JSH_PORTB_OFFSET && pin<JSH_PORTB_OFFSET+JSH_PORTB_COUNT) {
result[0]='B';
itostr(<API key>,&result[1],10);
} else if (pin>=JSH_PORTC_OFFSET && pin<JSH_PORTC_OFFSET+JSH_PORTC_COUNT) {
result[0]='C';
itostr(<API key>,&result[1],10);
} else if (pin>=JSH_PORTD_OFFSET && pin<JSH_PORTD_OFFSET+JSH_PORTD_COUNT) {
result[0]='D';
itostr(<API key>,&result[1],10);
#if JSH_PORTE_OFFSET!=-1
} else if (pin>=JSH_PORTE_OFFSET && pin<JSH_PORTE_OFFSET+JSH_PORTE_COUNT) {
result[0]='E';
itostr(<API key>,&result[1],10);
#endif
#if JSH_PORTF_OFFSET!=-1
} else if (pin>=JSH_PORTF_OFFSET && pin<JSH_PORTF_OFFSET+JSH_PORTF_COUNT) {
result[0]='F';
itostr(<API key>,&result[1],10);
#endif
#if JSH_PORTG_OFFSET!=-1
} else if (pin>=JSH_PORTG_OFFSET && pin<JSH_PORTG_OFFSET+JSH_PORTG_COUNT) {
result[0]='G';
itostr(<API key>,&result[1],10);
#endif
#if JSH_PORTH_OFFSET!=-1
} else if (pin>=JSH_PORTH_OFFSET && pin<JSH_PORTH_OFFSET+JSH_PORTH_COUNT) {
result[0]='H';
itostr(<API key>,&result[1],10);
#endif
#endif
} else {
strncpy(result, "UNKNOWN", 8);
}
}
Given a var, convert it to a pin ID (or -1 if it doesn't exist). safe for undefined!
Pin jshGetPinFromVar(JsVar *pinv) {
if (jsvIsString(pinv) && pinv->varData.str[5]==0/*should never be more than 4 chars!*/) {
return jshGetPinFromString(&pinv->varData.str[0]);
} else if (jsvIsInt(pinv) /* This also tests for the Pin datatype */) {
return (Pin)jsvGetInteger(pinv);
} else return PIN_UNDEFINED;
}
Pin <API key>(JsVar *pinv) {
Pin pin = jshGetPinFromVar(pinv);
jsvUnLock(pinv);
return pin;
}
// Whether a pin's state has been set manually or not
BITFIELD_DECL(jshPinStateIsManual, JSH_PIN_COUNT); // TODO: This should be set to all 0
bool <API key>(Pin pin) {
return BITFIELD_GET(jshPinStateIsManual, pin);
}
void <API key>(Pin pin, bool manual) {
BITFIELD_SET(jshPinStateIsManual, pin, manual);
}
bool jshPinInput(Pin pin) {
bool value = false;
if (jshIsPinValid(pin)) {
if (!<API key>(pin))
jshPinSetState(pin, JSHPINSTATE_GPIO_IN);
value = jshPinGetValue(pin);
} else jsExceptionHere(JSET_ERROR, "Invalid pin!");
return value;
}
void jshPinOutput(Pin pin, bool value) {
if (jshIsPinValid(pin)) {
if (!<API key>(pin))
jshPinSetState(pin, <API key>);
jshPinSetValue(pin, value);
} else jsExceptionHere(JSET_ERROR, "Invalid pin!");
}
// Convert an event type flag into a jshPinFunction for an actual hardware device
JshPinFunction <API key>(IOEventFlags device) {
switch (device) {
case EV_SERIAL1 : return JSH_USART1;
case EV_SERIAL2 : return JSH_USART2;
case EV_SERIAL3 : return JSH_USART3;
case EV_SERIAL4 : return JSH_USART4;
case EV_SERIAL5 : return JSH_USART5;
case EV_SERIAL6 : return JSH_USART6;
case EV_SPI1 : return JSH_SPI1;
case EV_SPI2 : return JSH_SPI2;
case EV_SPI3 : return JSH_SPI3;
case EV_I2C1 : return JSH_I2C1;
case EV_I2C2 : return JSH_I2C2;
case EV_I2C3 : return JSH_I2C3;
default: return 0;
}
}
/** Try and find a specific type of function for the given pin. Can be given an invalid pin and will return 0. */
JshPinFunction NO_INLINE <API key>(Pin pin, JshPinFunction functionType) {
if (!jshIsPinValid(pin)) return 0;
int i;
for (i=0;i<<API key>;i++) {
if ((pinInfo[pin].functions[i]&JSH_MASK_TYPE) == functionType)
return pinInfo[pin].functions[i];
}
return 0;
}
/** Try and find the best pin suitable for the given function. Can return -1. */
Pin NO_INLINE <API key>(JshPinFunction functionType, JshPinFunction functionInfo) {
#ifdef OLIMEXINO_STM32
/** Hack, as you can't mix AFs on the STM32F1, and Olimexino reordered the pins
* such that D4(AF1) is before D11(AF0) - and there are no SCK/MISO for AF1! */
if (functionType == JSH_SPI1 && functionInfo==JSH_SPI_MOSI) return JSH_PORTD_OFFSET+11;
#endif
#ifdef PICO
/* On the Pico, A9 is used for sensing when USB power is applied. Is someone types in
* Serial1.setup(9600) it'll get chosen as it's the first pin, but setting it to an output
* totally messes up the STM32 as it's fed with 5V. This ensures that it won't get chosen
* UNLESS it is explicitly selected.
*
* TODO: better way of doing this? A JSH_DONT_DEFAULT flag for pin functions? */
if (functionType == JSH_USART1) {
if (functionInfo==JSH_USART_TX) return JSH_PORTB_OFFSET+6;
if (functionInfo==JSH_USART_RX) return JSH_PORTB_OFFSET+7;
}
#endif
Pin i;
int j;
// first, try and find the pin with an AF of 0 - this is usually the 'default'
for (i=0;i<JSH_PIN_COUNT;i++)
for (j=0;j<<API key>;j++)
if ((pinInfo[i].functions[j]&JSH_MASK_AF) == JSH_AF0 &&
(pinInfo[i].functions[j]&JSH_MASK_TYPE) == functionType &&
(pinInfo[i].functions[j]&JSH_MASK_INFO) == functionInfo)
return i;
// otherwise just try and find anything
for (i=0;i<JSH_PIN_COUNT;i++)
for (j=0;j<<API key>;j++)
if ((pinInfo[i].functions[j]&JSH_MASK_TYPE) == functionType &&
(pinInfo[i].functions[j]&JSH_MASK_INFO) == functionInfo)
return i;
return PIN_UNDEFINED;
}
Given a full pin function, return a string describing it depending of what's in the flags enum
void <API key>(JshPinFunction pinFunc, <API key> flags, char *buf, size_t bufSize) {
const char *devStr = "";
JshPinFunction info = JSH_MASK_INFO & pinFunc;
JshPinFunction firstDevice = 0;
const char *infoStr = 0;
buf[0]=0;
if (<API key>(pinFunc)) {
devStr="USART";
firstDevice=JSH_USART1;
if (info==JSH_USART_RX) infoStr="RX";
else if (info==JSH_USART_TX) infoStr="TX";
else if (info==JSH_USART_CK) infoStr="CK";
} else if (<API key>(pinFunc)) {
devStr="SPI";
firstDevice=JSH_SPI1;
if (info==JSH_SPI_MISO) infoStr="MISO";
else if (info==JSH_SPI_MOSI) infoStr="MOSI";
else if (info==JSH_SPI_SCK) infoStr="SCK";
} else if (<API key>(pinFunc)) {
devStr="I2C";
firstDevice=JSH_I2C1;
if (info==JSH_I2C_SCL) infoStr="SCL";
else if (info==JSH_I2C_SDA) infoStr="SDA";
} else if (<API key>(pinFunc)) {
devStr="DAC";
firstDevice=JSH_DAC;
if (info==JSH_DAC_CH1) infoStr="CH1";
else if (info==JSH_DAC_CH2) infoStr="CH2";
} else if (<API key>(pinFunc)) {
devStr="TIM";
firstDevice=JSH_TIMER1;
char infoStrBuf[5];
infoStr = &infoStrBuf[0];
infoStrBuf[0] = 'C';
infoStrBuf[1] = 'H';
infoStrBuf[2] = (char)('1' + ((info&JSH_MASK_TIMER_CH)>>JSH_SHIFT_INFO));
if (info & JSH_TIMER_NEGATED) {
infoStrBuf[3]='N';
infoStrBuf[4] = 0;
} else {
infoStrBuf[3] = 0;
}
}
int devIdx = 1 + ((((pinFunc&JSH_MASK_TYPE) - firstDevice) >> JSH_SHIFT_TYPE));
if (!devStr) {
jsiConsolePrintf("Couldn't convert pin function %d\n", pinFunc);
return;
}
if (flags & JSPFTS_DEVICE) strncat(buf, devStr, bufSize);
if (flags & <API key>) itostr(devIdx, &buf[strlen(buf)], 10);
if (flags & JSPFTS_SPACE) strncat(buf, " ", bufSize);
if (infoStr && (flags & JSPFTS_TYPE)) strncat(buf, infoStr, bufSize);
}
/** Prints a list of capable pins, eg:
jshPrintCapablePins(..., "PWM", JSH_TIMER1, JSH_TIMERMAX, 0,0, false)
jshPrintCapablePins(..., "SPI", JSH_SPI1, JSH_SPIMAX, JSH_MASK_INFO,JSH_SPI_SCK, false)
jshPrintCapablePins(..., "Analog Input", 0,0,0,0, true) - for analogs */
void NO_INLINE jshPrintCapablePins(Pin existingPin, const char *functionName, JshPinFunction typeMin, JshPinFunction typeMax, JshPinFunction pMask, JshPinFunction pData, bool printAnalogs) {
if (functionName) {
jsError("Pin %p is not capable of %s\nSuitable pins are:", existingPin, functionName);
}
Pin pin;
int i,n=0;
for (pin=0;pin<JSH_PIN_COUNT;pin++) {
bool has = false;
#ifdef STM32F1
int af = 0;
#endif
if (printAnalogs) {
has = pinInfo[pin].analog!=JSH_ANALOG_NONE;
} else {
for (i=0;i<<API key>;i++) {
JshPinFunction type = pinInfo[pin].functions[i] & JSH_MASK_TYPE;
if (type>=typeMin && type<=typeMax && ((pinInfo[pin].functions[i]&pMask)==pData)) {
has = true;
#ifdef STM32F1
af = pinInfo[pin].functions[i] & JSH_MASK_AF;
#endif
}
}
}
if (has) {
jsiConsolePrintf("%p",pin);
#ifdef STM32F1
if (af!=JSH_AF0) jsiConsolePrint("(AF)");
#endif
jsiConsolePrint(" ");
if (n++==8) { n=0; jsiConsolePrint("\n"); }
}
}
jsiConsolePrint("\n");
}
|
using Microsoft.EntityFrameworkCore;
using Anabi.DataAccess.Ef.DbModels;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Anabi.DataAccess.Ef.EntityConfigurators
{
public class AssetConfig : BaseEntityConfig<AssetDb>
{
public override void Configure(EntityTypeBuilder<AssetDb> builder)
{
builder.HasOne(a => a.Address)
.WithMany(b => b.Assets)
.HasForeignKey(k => k.AddressId)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_Assets_Addresses");
builder.HasOne(k => k.Category)
.WithMany(b => b.Assets)
.HasForeignKey(k => k.CategoryId)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("<API key>")
.IsRequired();
builder.HasOne(d => d.CurrentDecision)
.WithMany(b => b.Assets)
.HasForeignKey(k => k.DecisionId)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_Assets_Decisions");
base.Configure(builder);
}
}
}
|
import { Mongo } from 'meteor/mongo';
const SurveyCaches = new Mongo.Collection('SurveyCaches');
SimpleSchema.debug = true;
SurveyCaches.schema = new SimpleSchema({
title: {
type: String,
},
version: {
type: Number,
optional: true,
autoValue() {
return 2;
},
},
createdAt: {
type: Date,
label: 'Created At',
optional: true,
autoValue() {
let val;
if (this.isInsert) {
val = new Date();
} else if (this.isUpsert) {
val = { $setOnInsert: new Date() };
} else {
this.unset(); // Prevent user from supplying their own value
}
return val;
},
},
updatedAt: {
type: Date,
label: 'Updated At',
optional: true,
autoValue() {
let val;
if (this.isUpdate) {
val = new Date();
}
return val;
},
},
});
SurveyCaches.attachSchema(SurveyCaches.schema);
export default SurveyCaches;
|
using Alex.Blocks.Materials;
namespace Alex.Blocks.Minecraft
{
public class BlueOrchid : FlowerBase
{
public BlueOrchid()
{
Solid = false;
Transparent = true;
IsFullCube = false;
BlockMaterial = Material.Plants;
}
}
}
|
/* Storage Host Tree */
#storage-tree {
min-width: 220px;
max-width: 500px;
overflow: auto;
}
#storage-tree {
background: var(--<API key>);
}
#storage-tree .tree-widget-item[type="store"]:after {
background-image: url(chrome://devtools/skin/images/tool-storage.svg);
background-size: 18px 18px;
background-position: -1px 0;
}
/* Columns with date should have a min width so that date is visible */
#expires, #lastAccessed, #creationTime {
min-width: 150px;
}
/* Variables View Sidebar */
#storage-sidebar {
max-width: 500px;
min-width: 250px;
}
/* Responsive sidebar */
@media (max-width: 700px) {
#storage-tree,
#storage-sidebar {
max-width: 100%;
}
#storage-table #path {
display: none;
}
#storage-table .table-widget-cell {
min-width: 100px;
}
}
|
export interface TimeZones {
name: string;
abbrev: string;
offset: string;
}
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_45) on Fri Dec 27 12:52:52 CST 2013 -->
<title>Cassandra.AsyncProcessor.<API key> (apache-cassandra API)</title>
<meta name="date" content="2013-12-27">
<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="Cassandra.AsyncProcessor.<API key> (apache-cassandra API)";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<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 class="navBarCell1Rev">Class</li>
<li><a href="class-use/Cassandra.AsyncProcessor.<API key>.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_ring.html" title="class in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_snitch.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html" target="_top">Frames</a></li>
<li><a href="Cassandra.AsyncProcessor.<API key>.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<div class="subTitle">org.apache.cassandra.thrift</div>
<h2 title="Class Cassandra.AsyncProcessor.<API key>" class="title">Class Cassandra.AsyncProcessor.<API key><I extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>></h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.thrift.<API key><I,<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a>,java.util.Map<java.lang.String,java.util.List<java.lang.String>>></li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.thrift.Cassandra.AsyncProcessor.<API key><I></li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.html" title="class in org.apache.cassandra.thrift">Cassandra.AsyncProcessor</a><<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.html" title="type parameter in Cassandra.AsyncProcessor">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>></dd>
</dl>
<hr>
<br>
<pre>public static class <span class="strong">Cassandra.AsyncProcessor.<API key><I extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>></span>
extends org.apache.thrift.<API key><I,<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a>,java.util.Map<java.lang.String,java.util.List<java.lang.String>>></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html#Cassandra.AsyncProcessor.<API key>()">Cassandra.AsyncProcessor.<API key></a></strong>()</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_summary">
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</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>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html#<API key>()"><API key></a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>org.apache.thrift.async.AsyncMethodCallback<java.util.Map<java.lang.String,java.util.List<java.lang.String>>></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html#getResultHandler(org.apache.thrift.server.<API key>.AsyncFrameBuffer, int)">getResultHandler</a></strong>(org.apache.thrift.server.<API key>.AsyncFrameBuffer fb,
int seqid)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html#isOneway()">isOneway</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html#start(I, org.apache.cassandra.thrift.Cassandra.<API key>, org.apache.thrift.async.AsyncMethodCallback)">start</a></strong>(<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html" title="type parameter in Cassandra.AsyncProcessor.<API key>">I</a> iface,
<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a> args,
org.apache.thrift.async.AsyncMethodCallback<java.util.Map<java.lang.String,java.util.List<java.lang.String>>> resultHandler)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="<API key>.apache.thrift.<API key>">
</a>
<h3>Methods inherited from class org.apache.thrift.<API key></h3>
<code>getMethodName, sendResponse</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="<API key>.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
</a>
<h3>Constructor Detail</h3>
<a name="Cassandra.AsyncProcessor.<API key>()">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Cassandra.AsyncProcessor.<API key></h4>
<pre>public Cassandra.AsyncProcessor.<API key>()</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_detail">
</a>
<h3>Method Detail</h3>
<a name="<API key>()">
</a>
<ul class="blockList">
<li class="blockList">
<h4><API key></h4>
<pre>public <a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a> <API key>()</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><API key></code> in class <code>org.apache.thrift.<API key><<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html" title="type parameter in Cassandra.AsyncProcessor.<API key>">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a>,java.util.Map<java.lang.String,java.util.List<java.lang.String>>></code></dd>
</dl>
</li>
</ul>
<a name="getResultHandler(org.apache.thrift.server.<API key>.AsyncFrameBuffer, int)">
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResultHandler</h4>
<pre>public org.apache.thrift.async.AsyncMethodCallback<java.util.Map<java.lang.String,java.util.List<java.lang.String>>> getResultHandler(org.apache.thrift.server.<API key>.AsyncFrameBuffer fb,
int seqid)</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>getResultHandler</code> in class <code>org.apache.thrift.<API key><<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html" title="type parameter in Cassandra.AsyncProcessor.<API key>">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a>,java.util.Map<java.lang.String,java.util.List<java.lang.String>>></code></dd>
</dl>
</li>
</ul>
<a name="isOneway()">
</a>
<ul class="blockList">
<li class="blockList">
<h4>isOneway</h4>
<pre>protected boolean isOneway()</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>isOneway</code> in class <code>org.apache.thrift.<API key><<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html" title="type parameter in Cassandra.AsyncProcessor.<API key>">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a>,java.util.Map<java.lang.String,java.util.List<java.lang.String>>></code></dd>
</dl>
</li>
</ul>
<a name="start(org.apache.cassandra.thrift.Cassandra.AsyncIface,org.apache.cassandra.thrift.Cassandra.<API key>,org.apache.thrift.async.AsyncMethodCallback)">
</a><a name="start(I, org.apache.cassandra.thrift.Cassandra.<API key>, org.apache.thrift.async.AsyncMethodCallback)">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>start</h4>
<pre>public void start(<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html" title="type parameter in Cassandra.AsyncProcessor.<API key>">I</a> iface,
<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a> args,
org.apache.thrift.async.AsyncMethodCallback<java.util.Map<java.lang.String,java.util.List<java.lang.String>>> resultHandler)
throws org.apache.thrift.TException</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>start</code> in class <code>org.apache.thrift.<API key><<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html" title="type parameter in Cassandra.AsyncProcessor.<API key>">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.<API key>.html" title="class in org.apache.cassandra.thrift">Cassandra.<API key></a>,java.util.Map<java.lang.String,java.util.List<java.lang.String>>></code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>org.apache.thrift.TException</code></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Cassandra.AsyncProcessor.<API key>.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_ring.html" title="class in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_snitch.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.AsyncProcessor.<API key>.html" target="_top">Frames</a></li>
<li><a href="Cassandra.AsyncProcessor.<API key>.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>Copyright © 2013 The Apache Software Foundation</small></p>
</body>
</html>
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `Struct_Unnamed7` struct in crate `x11`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Struct_Unnamed7">
<title>x11::xinput2::Struct_Unnamed7 - Rust</title>
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<section class="sidebar">
<p class='location'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>xinput2</a></p><script>window.sidebarCurrent = {name: 'Struct_Unnamed7', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>x11</a>::<wbr><a href='index.html'>xinput2</a>::<wbr><a class='struct' href=''>Struct_Unnamed7</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-11156' class='srclink' href='../../src/x11/xinput2.rs.html#328-331' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Struct_Unnamed7 {
pub mask_len: <a class='type' href='../../libc/types/os/arch/c95/type.c_int.html' title='libc::types::os::arch::c95::c_int'>c_int</a>,
pub mask: <a href='../../std/primitive.pointer.html'>*mut <a class='type' href='../../libc/types/os/arch/c95/type.c_uchar.html' title='libc::types::os::arch::c95::c_uchar'>c_uchar</a></a>,
}</pre><h2 class='fields'>Fields</h2>
<table><tr class='stab '>
<td id='structfield.mask_len'><code>mask_len</code></td><td></td></tr><tr class='stab '>
<td id='structfield.mask'><code>mask</code></td><td></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../../x11/xinput2/struct.Struct_Unnamed7.html' title='x11::xinput2::Struct_Unnamed7'>Struct_Unnamed7</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='../../core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> Self</code></h4>
<h4 id='method.clone_from' class='method'><code>fn <a href='../../core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='../../core/default/trait.Default.html' title='core::default::Default'>Default</a> for <a class='struct' href='../../x11/xinput2/struct.Struct_Unnamed7.html' title='x11::xinput2::Struct_Unnamed7'>Struct_Unnamed7</a></code></h3><div class='impl-items'><h4 id='method.default' class='method'><code>fn <a href='../../core/default/trait.Default.html#method.default' class='fnname'>default</a>() -> Self</code></h4>
</div><h3 id='<API key>'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='../../core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='struct' href='../../x11/xinput2/struct.Struct_Unnamed7.html' title='x11::xinput2::Struct_Unnamed7'>Struct_Unnamed7</a></code></h3><div class='impl-items'></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div>
<div class="shortcuts">
<h1>Keyboard Shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search Tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code>)
</p>
</div>
</div>
</div>
<script>
window.rootPath = "../../";
window.currentCrate = "x11";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script async src="../../search-index.js"></script>
</body>
</html>
|
/*jslint unparam: true, browser: true, indent: 2 */
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.dropdown = {
name : 'dropdown',
version : '4.3.2',
settings : {
activeClass: 'open',
is_hover: false,
opened: function(){},
closed: function(){}
},
init : function (scope, method, options) {
this.scope = scope || this.scope;
Foundation.inherit(this, 'throttle scrollLeft data_options');
if (typeof method === 'object') {
$.extend(true, this.settings, method);
}
if (typeof method !== 'string') {
if (!this.settings.init) {
this.events();
}
return this.settings.init;
} else {
return this[method].call(this, options);
}
},
events : function () {
var self = this;
$(this.scope)
.on('click.fndtn.dropdown', '[data-dropdown]', function (e) {
var settings = $.extend({}, self.settings, self.data_options($(this)));
e.preventDefault();
if (!settings.is_hover) self.toggle($(this));
})
.on('mouseenter', '[data-dropdown]', function (e) {
var settings = $.extend({}, self.settings, self.data_options($(this)));
if (settings.is_hover) self.toggle($(this));
})
.on('mouseleave', '[<API key>]', function (e) {
var target = $('[data-dropdown="' + $(this).attr('id') + '"]'),
settings = $.extend({}, self.settings, self.data_options(target));
if (settings.is_hover) self.close.call(self, $(this));
})
.on('opened.fndtn.dropdown', '[<API key>]', this.settings.opened)
.on('closed.fndtn.dropdown', '[<API key>]', this.settings.closed);
$(document).on('click.fndtn.dropdown touchstart.fndtn.dropdown', function (e) {
var parent = $(e.target).closest('[<API key>]');
if ($(e.target).data('dropdown') || $(e.target).parent().data('dropdown')) {
return;
}
if (!($(e.target).data('revealId')) &&
(parent.length > 0 && ($(e.target).is('[<API key>]') ||
$.contains(parent.first()[0], e.target)))) {
e.stopPropagation();
return;
}
self.close.call(self, $('[<API key>]'));
});
$(window).on('resize.fndtn.dropdown', self.throttle(function () {
self.resize.call(self);
}, 50)).trigger('resize');
this.settings.init = true;
},
close: function (dropdown) {
var self = this;
dropdown.each(function () {
if ($(this).hasClass(self.settings.activeClass)) {
$(this)
.css(Foundation.rtl ? 'right':'left', '-99999px')
.removeClass(self.settings.activeClass)
.prev('[data-dropdown]')
.removeClass(self.settings.activeClass);
$(this).trigger('closed');
}
});
},
open: function (dropdown, target) {
this
.css(dropdown
.addClass(this.settings.activeClass), target);
dropdown.prev('[data-dropdown]').addClass(this.settings.activeClass);
dropdown.trigger('opened');
},
toggle : function (target) {
var dropdown = $('#' + target.data('dropdown'));
if (dropdown.length === 0) {
// No dropdown found, not continuing
return;
}
this.close.call(this, $('[<API key>]').not(dropdown));
if (dropdown.hasClass(this.settings.activeClass)) {
this.close.call(this, dropdown);
} else {
this.close.call(this, $('[<API key>]'))
this.open.call(this, dropdown, target);
}
},
resize : function () {
var dropdown = $('[<API key>].open'),
target = $("[data-dropdown='" + dropdown.attr('id') + "']");
if (dropdown.length && target.length) {
this.css(dropdown, target);
}
},
css : function (dropdown, target) {
var offset_parent = dropdown.offsetParent();
// if (offset_parent.length > 0 && /body/i.test(dropdown.offsetParent()[0].nodeName)) {
var position = target.offset();
position.top -= offset_parent.offset().top;
position.left -= offset_parent.offset().left;
// } else {
// var position = target.position();
if (this.small()) {
dropdown.css({
position : 'absolute',
width: '95%',
'max-width': 'none',
top: position.top + this.outerHeight(target)
});
dropdown.css(Foundation.rtl ? 'right':'left', '2.5%');
} else {
if (!Foundation.rtl && $(window).width() > this.outerWidth(dropdown) + target.offset().left && !this.data_options(target).align_right) {
var left = position.left;
if (dropdown.hasClass('right')) {
dropdown.removeClass('right');
}
} else {
if (!dropdown.hasClass('right')) {
dropdown.addClass('right');
}
var left = position.left - (this.outerWidth(dropdown) - this.outerWidth(target));
}
dropdown.attr('style', '').css({
position : 'absolute',
top: position.top + this.outerHeight(target),
left: left
});
}
return dropdown;
},
small : function () {
return $(window).width() < 768 || $('html').hasClass('lt-ie9');
},
off: function () {
$(this.scope).off('.fndtn.dropdown');
$('html, body').off('.fndtn.dropdown');
$(window).off('.fndtn.dropdown');
$('[<API key>]').off('.fndtn.dropdown');
this.settings.init = false;
},
reflow : function () {}
};
}(Foundation.zj, this, this.document));
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `is_loaded` fn in crate `gleam`.">
<meta name="keywords" content="rust, rustlang, rust-lang, is_loaded">
<title>gleam::gl::Uniform1fv::is_loaded - Rust</title>
<link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<nav class="sidebar">
<p class='location'><a href='../../index.html'>gleam</a>::<wbr><a href='../index.html'>gl</a>::<wbr><a href='index.html'>Uniform1fv</a></p><script>window.sidebarCurrent = {name: 'is_loaded', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'>Function <a href='../../index.html'>gleam</a>::<wbr><a href='../index.html'>gl</a>::<wbr><a href='index.html'>Uniform1fv</a>::<wbr><a class='fn' href=''>is_loaded</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-6731' class='srclink' href='../../../src/gleam/home/servo/buildbot/slave/doc/build/target/debug/build/<API key>/out/gl_bindings.rs.html#9249-9251' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'>pub fn is_loaded() -> <a class='primitive' href='../../../std/primitive.bool.html'>bool</a></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../../";
window.currentCrate = "gleam";
window.playgroundUrl = "";
</script>
<script src="../../../jquery.js"></script>
<script src="../../../main.js"></script>
<script defer src="../../../search-index.js"></script>
</body>
</html>
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#ifndef <API key>
#define <API key>
#include "TextLeafAccessible.h"
namespace mozilla {
namespace a11y {
typedef class TextLeafAccessible <API key>;
} // namespace a11y
} // namespace mozilla
#endif
|
'use strict';
var inheritance = require('./../../helpers/inheritance'),
Field = require('./field');
var FilterField = function(){};
inheritance.inherits(Field,FilterField);
FilterField.prototype.isOpen = function(){
return this.world.helper.elementGetter(this._root,this._data.elements.body).isDisplayed();
};
FilterField.prototype.accordionSelf = function(status){
var _this=this;
switch(status){
case 'open':
return _this.isOpen()
.then(function(is){
if(!is){
return _this._root.scrollIntoView()
.then(function(){
return _this._root.element(by.css('span.filter__sub-title')).click();
})
.then(function(){
return _this.world.helper.elementGetter(_this._root,_this._data.elements.body).<API key>();
});
}
});
case 'close':
return _this.isOpen()
.then(function(is){
if(is){
return _this._root.scrollIntoView()
.then(function(){
return _this._root.element(by.css('span.filter__sub-title')).click();
})
.then(function(){
return _this.world.helper.elementGetter(_this._root,_this._data.elements.body).waitToBeHidden();
});
}
});
default:
throw new Error('Wrong status of slider: '+status);
}
};
module.exports = FilterField;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.