repo_name
stringlengths 4
116
| path
stringlengths 3
942
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
---|---|---|---|---|
Wargus/stargus | scripts/protoss/unit-protoss-forge.lua | 1726 | --
-- -- unit-protoss-forge
--
DefineAnimations("animations-protoss-forge", {
Still = {
"frame 0", "wait 125",
},
Train = {
"frame 0", "wait 125",
},
})
DefineConstruction("construction-protoss-forge", {
Files = {
File = "terran/units/building construction large.png",
Size = {160, 128}},
ShadowFiles = {
File = "terran/units/building construction large shadow.png",
Size = {128, 128}},
Constructions = {
{Percent = 0,
File = "construction",
Frame = 0},
{Percent = 20,
File = "construction",
Frame = 1},
{Percent = 40,
File = "construction",
Frame = 2},
{Percent = 60,
File = "main",
Frame = 1}}
})
DefineUnitType("unit-protoss-forge", { Name = "Forge",
Image = {"file", "protoss/units/forge.png", "size", {160, 128}},
Shadow = {"file", "protoss/units/pgashad.png", "size", {128, 160}},
Animations = "animations-protoss-forge", Icon = "icon-protoss-forge",
Costs = {"time", 200, "minerals", 150},
RepairHp = 4,
RepairCosts = {"minerals", 1, "gas", 1},
Construction = "construction-protoss-forge",
Speed = 0,
HitPoints = 1100,
DrawLevel = 50,
TileSize = {3, 2}, BoxSize = {95, 63},
SightRange = 1,
Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
Priority = 30, AnnoyComputerFactor = 35,
Points = 160,
BuilderOutside = true,
AutoBuildRate = 2,
Type = "land",
Building = true, VisibleUnderFog = true,
BuildingRules = { { "distance", { Distance = 3, DistanceType = "<", Type = "unit-protoss-pylon"} } },
Sounds = {
"selected", "protoss-forge-selected",
"ready", "protoss-building-done",
"help", "protoss-base-attacked",
"dead", "protoss-explosion-large"} } )
| gpl-2.0 |
ephox-gcc-plugins/gcc-plugins_linux-next | include/linux/timekeeping.h | 8038 | #ifndef _LINUX_TIMEKEEPING_H
#define _LINUX_TIMEKEEPING_H
#include <asm-generic/errno-base.h>
/* Included from linux/ktime.h */
void timekeeping_init(void);
extern int timekeeping_suspended;
/*
* Get and set timeofday
*/
extern void do_gettimeofday(struct timeval *tv);
extern int do_settimeofday64(const struct timespec64 *ts);
extern int do_sys_settimeofday64(const struct timespec64 *tv,
const struct timezone *tz);
static inline int do_sys_settimeofday(const struct timespec *tv,
const struct timezone *tz)
{
struct timespec64 ts64;
if (!tv)
return -EINVAL;
ts64 = timespec_to_timespec64(*tv);
return do_sys_settimeofday64(&ts64, tz);
}
/*
* Kernel time accessors
*/
unsigned long get_seconds(void);
struct timespec64 current_kernel_time64(void);
/* does not take xtime_lock */
struct timespec __current_kernel_time(void);
static inline struct timespec current_kernel_time(void)
{
struct timespec64 now = current_kernel_time64();
return timespec64_to_timespec(now);
}
/*
* timespec based interfaces
*/
struct timespec64 get_monotonic_coarse64(void);
extern void getrawmonotonic64(struct timespec64 *ts);
extern void ktime_get_ts64(struct timespec64 *ts);
extern time64_t ktime_get_seconds(void);
extern time64_t ktime_get_real_seconds(void);
extern int __getnstimeofday64(struct timespec64 *tv);
extern void getnstimeofday64(struct timespec64 *tv);
extern void getboottime64(struct timespec64 *ts);
#if BITS_PER_LONG == 64
/**
* Deprecated. Use do_settimeofday64().
*/
static inline int do_settimeofday(const struct timespec *ts)
{
return do_settimeofday64(ts);
}
static inline int __getnstimeofday(struct timespec *ts)
{
return __getnstimeofday64(ts);
}
static inline void getnstimeofday(struct timespec *ts)
{
getnstimeofday64(ts);
}
static inline void ktime_get_ts(struct timespec *ts)
{
ktime_get_ts64(ts);
}
static inline void ktime_get_real_ts(struct timespec *ts)
{
getnstimeofday64(ts);
}
static inline void getrawmonotonic(struct timespec *ts)
{
getrawmonotonic64(ts);
}
static inline struct timespec get_monotonic_coarse(void)
{
return get_monotonic_coarse64();
}
static inline void getboottime(struct timespec *ts)
{
return getboottime64(ts);
}
#else
/**
* Deprecated. Use do_settimeofday64().
*/
static inline int do_settimeofday(const struct timespec *ts)
{
struct timespec64 ts64;
ts64 = timespec_to_timespec64(*ts);
return do_settimeofday64(&ts64);
}
static inline int __getnstimeofday(struct timespec *ts)
{
struct timespec64 ts64;
int ret = __getnstimeofday64(&ts64);
*ts = timespec64_to_timespec(ts64);
return ret;
}
static inline void getnstimeofday(struct timespec *ts)
{
struct timespec64 ts64;
getnstimeofday64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
static inline void ktime_get_ts(struct timespec *ts)
{
struct timespec64 ts64;
ktime_get_ts64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
static inline void ktime_get_real_ts(struct timespec *ts)
{
struct timespec64 ts64;
getnstimeofday64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
static inline void getrawmonotonic(struct timespec *ts)
{
struct timespec64 ts64;
getrawmonotonic64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
static inline struct timespec get_monotonic_coarse(void)
{
return timespec64_to_timespec(get_monotonic_coarse64());
}
static inline void getboottime(struct timespec *ts)
{
struct timespec64 ts64;
getboottime64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
#endif
#define ktime_get_real_ts64(ts) getnstimeofday64(ts)
/*
* ktime_t based interfaces
*/
enum tk_offsets {
TK_OFFS_REAL,
TK_OFFS_BOOT,
TK_OFFS_TAI,
TK_OFFS_MAX,
};
extern ktime_t ktime_get(void);
extern ktime_t ktime_get_with_offset(enum tk_offsets offs);
extern ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs);
extern ktime_t ktime_get_raw(void);
extern u32 ktime_get_resolution_ns(void);
/**
* ktime_get_real - get the real (wall-) time in ktime_t format
*/
static inline ktime_t ktime_get_real(void)
{
return ktime_get_with_offset(TK_OFFS_REAL);
}
/**
* ktime_get_boottime - Returns monotonic time since boot in ktime_t format
*
* This is similar to CLOCK_MONTONIC/ktime_get, but also includes the
* time spent in suspend.
*/
static inline ktime_t ktime_get_boottime(void)
{
return ktime_get_with_offset(TK_OFFS_BOOT);
}
/**
* ktime_get_clocktai - Returns the TAI time of day in ktime_t format
*/
static inline ktime_t ktime_get_clocktai(void)
{
return ktime_get_with_offset(TK_OFFS_TAI);
}
/**
* ktime_mono_to_real - Convert monotonic time to clock realtime
*/
static inline ktime_t ktime_mono_to_real(ktime_t mono)
{
return ktime_mono_to_any(mono, TK_OFFS_REAL);
}
static inline u64 ktime_get_ns(void)
{
return ktime_to_ns(ktime_get());
}
static inline u64 ktime_get_real_ns(void)
{
return ktime_to_ns(ktime_get_real());
}
static inline u64 ktime_get_boot_ns(void)
{
return ktime_to_ns(ktime_get_boottime());
}
static inline u64 ktime_get_tai_ns(void)
{
return ktime_to_ns(ktime_get_clocktai());
}
static inline u64 ktime_get_raw_ns(void)
{
return ktime_to_ns(ktime_get_raw());
}
extern u64 ktime_get_mono_fast_ns(void);
extern u64 ktime_get_raw_fast_ns(void);
extern u64 ktime_get_log_ts(u64 *offset_real);
/*
* Timespec interfaces utilizing the ktime based ones
*/
static inline void get_monotonic_boottime(struct timespec *ts)
{
*ts = ktime_to_timespec(ktime_get_boottime());
}
static inline void get_monotonic_boottime64(struct timespec64 *ts)
{
*ts = ktime_to_timespec64(ktime_get_boottime());
}
static inline void timekeeping_clocktai(struct timespec *ts)
{
*ts = ktime_to_timespec(ktime_get_clocktai());
}
/*
* RTC specific
*/
extern bool timekeeping_rtc_skipsuspend(void);
extern bool timekeeping_rtc_skipresume(void);
extern void timekeeping_inject_sleeptime64(struct timespec64 *delta);
/*
* PPS accessor
*/
extern void ktime_get_raw_and_real_ts64(struct timespec64 *ts_raw,
struct timespec64 *ts_real);
/*
* struct system_time_snapshot - simultaneous raw/real time capture with
* counter value
* @cycles: Clocksource counter value to produce the system times
* @real: Realtime system time
* @raw: Monotonic raw system time
* @clock_was_set_seq: The sequence number of clock was set events
* @cs_was_changed_seq: The sequence number of clocksource change events
*/
struct system_time_snapshot {
cycle_t cycles;
ktime_t real;
ktime_t raw;
unsigned int clock_was_set_seq;
u8 cs_was_changed_seq;
};
/*
* struct system_device_crosststamp - system/device cross-timestamp
* (syncronized capture)
* @device: Device time
* @sys_realtime: Realtime simultaneous with device time
* @sys_monoraw: Monotonic raw simultaneous with device time
*/
struct system_device_crosststamp {
ktime_t device;
ktime_t sys_realtime;
ktime_t sys_monoraw;
};
/*
* struct system_counterval_t - system counter value with the pointer to the
* corresponding clocksource
* @cycles: System counter value
* @cs: Clocksource corresponding to system counter value. Used by
* timekeeping code to verify comparibility of two cycle values
*/
struct system_counterval_t {
cycle_t cycles;
struct clocksource *cs;
};
/*
* Get cross timestamp between system clock and device clock
*/
extern int get_device_system_crosststamp(
int (*get_time_fn)(ktime_t *device_time,
struct system_counterval_t *system_counterval,
void *ctx),
void *ctx,
struct system_time_snapshot *history,
struct system_device_crosststamp *xtstamp);
/*
* Simultaneously snapshot realtime and monotonic raw clocks
*/
extern void ktime_get_snapshot(struct system_time_snapshot *systime_snapshot);
/*
* Persistent clock related interfaces
*/
extern int persistent_clock_is_local;
extern void read_persistent_clock(struct timespec *ts);
extern void read_persistent_clock64(struct timespec64 *ts);
extern void read_boot_clock64(struct timespec64 *ts);
extern int update_persistent_clock(struct timespec now);
extern int update_persistent_clock64(struct timespec64 now);
#endif
| gpl-2.0 |
bloomberg/ocamlscript | jscomp/main/astdump_main.md | 143 | current Ast format (10/10/2020)
-- input_binary_int ic (size)
module,
module,
...
--- seek_in ic (pos_in ic + size)
fname
marshalled ast
| gpl-2.0 |
scs/uclinux | lib/boost/boost_1_38_0/libs/interprocess/example/doc_windows_shared_memory2.cpp | 1665 | //////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>
#ifdef BOOST_WINDOWS
//[doc_windows_shared_memory2
#include <boost/interprocess/windows_shared_memory.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <iostream>
#include <cstring>
int main ()
{
using namespace boost::interprocess;
try{
//Open already created shared memory object.
windows_shared_memory shm(open_only, "shared_memory", read_only);
//Map the whole shared memory in this process
mapped_region region (shm, read_only);
//Check that memory was initialized to 1
const char *mem = static_cast<char*>(region.get_address());
for(std::size_t i = 0; i < 1000; ++i){
if(*mem++ != 1){
std::cout << "Error checking memory!" << std::endl;
return 1;
}
}
std::cout << "Test successful!" << std::endl;
}
catch(interprocess_exception &ex){
std::cout << "Unexpected exception: " << ex.what() << std::endl;
return 1;
}
return 0;
}
//]
#else //#ifdef BOOST_WINDOWS
int main()
{ return 0; }
#endif//#ifdef BOOST_WINDOWS
#include <boost/interprocess/detail/config_end.hpp>
| gpl-2.0 |
mvanvu/joomla-cms | administrator/components/com_privacy/views/request/tmpl/default.php | 2937 | <?php
/**
* @package Joomla.Administrator
* @subpackage com_privacy
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var PrivacyViewRequest $this */
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
$js = <<< JS
Joomla.submitbutton = function(task) {
if (task === 'request.cancel' || document.formvalidator.isValid(document.getElementById('item-form'))) {
Joomla.submitform(task, document.getElementById('item-form'));
}
};
JS;
JFactory::getDocument()->addScriptDeclaration($js);
?>
<form action="<?php echo JRoute::_('index.php?option=com_privacy&view=request&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">
<div class="row-fluid">
<div class="span6">
<h3><?php echo JText::_('COM_PRIVACY_HEADING_REQUEST_INFORMATION'); ?></h3>
<dl class="dl-horizontal">
<dt><?php echo JText::_('JGLOBAL_EMAIL'); ?>:</dt>
<dd><?php echo $this->item->email; ?></dd>
<dt><?php echo JText::_('JSTATUS'); ?>:</dt>
<dd><?php echo JHtml::_('PrivacyHtml.helper.statusLabel', $this->item->status); ?></dd>
<dt><?php echo JText::_('COM_PRIVACY_FIELD_REQUEST_TYPE_LABEL'); ?>:</dt>
<dd><?php echo JText::_('COM_PRIVACY_HEADING_REQUEST_TYPE_TYPE_' . $this->item->request_type); ?></dd>
<dt><?php echo JText::_('COM_PRIVACY_FIELD_REQUESTED_AT_LABEL'); ?>:</dt>
<dd><?php echo JHtml::_('date', $this->item->requested_at, JText::_('DATE_FORMAT_LC6')); ?></dd>
</dl>
</div>
<div class="span6">
<h3><?php echo JText::_('COM_PRIVACY_HEADING_ACTION_LOG'); ?></h3>
<?php if (empty($this->actionlogs)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped table-hover">
<thead>
<th>
<?php echo JText::_('COM_ACTIONLOGS_ACTION'); ?>
</th>
<th>
<?php echo JText::_('COM_ACTIONLOGS_DATE'); ?>
</th>
<th>
<?php echo JText::_('COM_ACTIONLOGS_NAME'); ?>
</th>
</thead>
<tbody>
<?php foreach ($this->actionlogs as $i => $item) : ?>
<tr class="row<?php echo $i % 2; ?>">
<td>
<?php echo ActionlogsHelper::getHumanReadableLogMessage($item); ?>
</td>
<td>
<?php echo JHtml::_('date', $item->log_date, JText::_('DATE_FORMAT_LC6')); ?>
</td>
<td>
<?php echo $item->name; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif;?>
</div>
</div>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
| gpl-2.0 |
famelo/TYPO3-Base | typo3conf/ext/flux/Tests/Unit/Transformation/FormDataTransformerTest.php | 2629 | <?php
namespace FluidTYPO3\Flux\Tests\Unit\Transformation;
/*
* This file is part of the FluidTYPO3/Flux project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use FluidTYPO3\Flux\Form;
use FluidTYPO3\Flux\Tests\Unit\AbstractTestCase;
use FluidTYPO3\Flux\Transformation\FormDataTransformer;
/**
* Transforms data according to settings defined in the Form instance.
*
* @package FluidTYPO3\Flux
*/
class FormDataTransformerTest extends AbstractTestCase {
/**
* @test
* @dataProvider getValuesAndTransformations
* @param mixed $value
* @param string $transformation
* @param mixed $expected
*/
public function testTransformation($value, $transformation, $expected) {
$instance = $this->getMock('FluidTYPO3\\Flux\\Transformation\\FormDataTransformer', array('loadObjectsFromRepository'));
$instance->expects($this->any())->method('loadObjectsFromRepository')->willReturn(array());
$instance->injectObjectManager($this->objectManager);
$form = Form::create();
$form->createField('Input', 'field')->setTransform($transformation);
$transformed = $instance->transformAccordingToConfiguration(array('field' => $value), $form);
$this->assertTrue($transformed !== $expected, 'Transformation type ' . $transformation . ' failed; values are still identical');
}
/**
* @return array
*/
public function getValuesAndTransformations() {
return array(
array(array('1', '2', '3'), 'integer', array(1, 2, 3)),
array('0', 'integer', 0),
array('0.12', 'float', 0.12),
array('1,2,3', 'array', array(1, 2, 3)),
array('123,321', 'InvalidClass', '123'),
array(date('Ymd'), 'DateTime', new \DateTime(date('Ymd'))),
array('1', 'TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUser', NULL),
array('1,2', 'TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage<TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUser>', NULL),
array('1,2', 'TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage<\\Invalid>', NULL),
);
}
/**
* @test
*/
public function supportsFindByIdentifiers() {
$instance = new FormDataTransformer();
$identifiers = array('foobar', 'foobar2');
$repository = $this->getMock('TYPO3\\CMS\\Extbase\\Domain\\Repository\\FrontendUserGroupRepository', array('findByUid'),
array(), '', FALSE);
$repository->expects($this->exactly(2))->method('findByUid')->will($this->returnArgument(0));
$result = $this->callInaccessibleMethod($instance, 'loadObjectsFromRepository', $repository, $identifiers);
$this->assertEquals($result, array('foobar', 'foobar2'));
}
}
| gpl-2.0 |
ysleu/RTL8685 | uClinux-dist/user/dropbear-0.48.1/libtomcrypt/src/mac/pmac/pmac_init.c | 3802 | /* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, [email protected], http://libtomcrypt.org
*/
#include "tomcrypt.h"
/**
@file pmac_init.c
PMAC implementation, initialize state, by Tom St Denis
*/
#ifdef PMAC
static const struct {
int len;
unsigned char poly_div[MAXBLOCKSIZE],
poly_mul[MAXBLOCKSIZE];
} polys[] = {
{
8,
{ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B }
}, {
16,
{ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87 }
}
};
/**
Initialize a PMAC state
@param pmac The PMAC state to initialize
@param cipher The index of the desired cipher
@param key The secret key
@param keylen The length of the secret key (octets)
@return CRYPT_OK if successful
*/
int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned long keylen)
{
int poly, x, y, m, err;
unsigned char *L;
LTC_ARGCHK(pmac != NULL);
LTC_ARGCHK(key != NULL);
/* valid cipher? */
if ((err = cipher_is_valid(cipher)) != CRYPT_OK) {
return err;
}
/* determine which polys to use */
pmac->block_len = cipher_descriptor[cipher].block_length;
for (poly = 0; poly < (int)(sizeof(polys)/sizeof(polys[0])); poly++) {
if (polys[poly].len == pmac->block_len) {
break;
}
}
if (polys[poly].len != pmac->block_len) {
return CRYPT_INVALID_ARG;
}
#ifdef LTC_FAST
if (pmac->block_len % sizeof(LTC_FAST_TYPE)) {
return CRYPT_INVALID_ARG;
}
#endif
/* schedule the key */
if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &pmac->key)) != CRYPT_OK) {
return err;
}
/* allocate L */
L = XMALLOC(pmac->block_len);
if (L == NULL) {
return CRYPT_MEM;
}
/* find L = E[0] */
zeromem(L, pmac->block_len);
cipher_descriptor[cipher].ecb_encrypt(L, L, &pmac->key);
/* find Ls[i] = L << i for i == 0..31 */
XMEMCPY(pmac->Ls[0], L, pmac->block_len);
for (x = 1; x < 32; x++) {
m = pmac->Ls[x-1][0] >> 7;
for (y = 0; y < pmac->block_len-1; y++) {
pmac->Ls[x][y] = ((pmac->Ls[x-1][y] << 1) | (pmac->Ls[x-1][y+1] >> 7)) & 255;
}
pmac->Ls[x][pmac->block_len-1] = (pmac->Ls[x-1][pmac->block_len-1] << 1) & 255;
if (m == 1) {
for (y = 0; y < pmac->block_len; y++) {
pmac->Ls[x][y] ^= polys[poly].poly_mul[y];
}
}
}
/* find Lr = L / x */
m = L[pmac->block_len-1] & 1;
/* shift right */
for (x = pmac->block_len - 1; x > 0; x--) {
pmac->Lr[x] = ((L[x] >> 1) | (L[x-1] << 7)) & 255;
}
pmac->Lr[0] = L[0] >> 1;
if (m == 1) {
for (x = 0; x < pmac->block_len; x++) {
pmac->Lr[x] ^= polys[poly].poly_div[x];
}
}
/* zero buffer, counters, etc... */
pmac->block_index = 1;
pmac->cipher_idx = cipher;
pmac->buflen = 0;
zeromem(pmac->block, sizeof(pmac->block));
zeromem(pmac->Li, sizeof(pmac->Li));
zeromem(pmac->checksum, sizeof(pmac->checksum));
#ifdef LTC_CLEAN_STACK
zeromem(L, pmac->block_len);
#endif
XFREE(L);
return CRYPT_OK;
}
#endif
/* $Source: /usr/local/dslrepos/uClinux-dist/user/dropbear-0.48.1/libtomcrypt/src/mac/pmac/pmac_init.c,v $ */
/* $Revision: 1.1 $ */
/* $Date: 2006/06/08 13:43:46 $ */
| gpl-2.0 |
cnxsoft/telechips-linux | drivers/video/tcc/Makefile | 1216 | obj-$(CONFIG_FB_TCC_OVERLAY) += tcc_overlay.o
obj-$(CONFIG_FB_TCC_OVERLAY_EXT) += tcc_overlay1.o
obj-$(CONFIG_TCC_LCDC_CONTROLLER) += tccfb.o tccfb_interface.o tca_display_config.o ddi/
obj-$(CONFIG_TCC_VIOC_CONTROLLER) += viqe.o tcc_ccfb.o tcc_vioc_fb.o tcc_vioc_interface.o tca_display_config.o vioc/
obj-$(CONFIG_LCD_HDMI1280X720) += hdmi_1280x720.o
obj-$(CONFIG_LCD_LMS350DF01) += lcd_lms350df01.o
obj-$(CONFIG_LCD_LMS480KF01) += lcd_lms480kf01.o
obj-$(CONFIG_LCD_DX08D11VM0AAA) += lcd_dx08d11vm0aaa.o
obj-$(CONFIG_LCD_LB070WV6) += lcd_lb070wv6.o
obj-$(CONFIG_LCD_CLAA104XA01CW) += lcd_claa104xa01cw.o
obj-$(CONFIG_LCD_HT121WX2) += lcd_ht121wx2.o
obj-$(CONFIG_LCD_TD043MGEB1) += lcd_td043mgeb1.o
obj-$(CONFIG_LCD_AT070TN93) += lcd_at070tn93.o
obj-$(CONFIG_LCD_TD070RDH) += lcd_td070rdh.o
obj-$(CONFIG_LCD_N101L6) += lcd_n101l6.o
obj-$(CONFIG_LCD_TW8816) += lcd_tw8816.o
obj-$(CONFIG_LCD_CLAA102NA0DCW) += lcd_claa102na0dcw.o
obj-$(CONFIG_LCD_ED090NA) += lcd_ED090NA.o
obj-$(CONFIG_LCD_KR080PA2S) += lcd_kr080pa2s.o
obj-$(CONFIG_LCD_CLAA070NP01) += lcd_claa070np01.o
obj-$(CONFIG_LCD_HV070WSA) += lcd_hv070wsa.o
obj-$(CONFIG_TCC_VIDEO_DISPLAY_DEINTERLACE_MODE) += viqe/
EXTRA_CFLAGS += -Idrivers/video/tcc/viqe
| gpl-2.0 |
jb68/zeroshell-ui | scripts/acctEntries.pl | 1695 | #!/usr/bin/perl
use strict;
use warnings;
my $FILTER="";
exists($ARGV[0]) and $FILTER=$ARGV[0];
my $CONFIG='/var/register/system/acct/entries';
chdir $CONFIG;
open FILE,"/var/register/system/acct/Decimals"; ;my $DECIMALS=<FILE>; chomp($DECIMALS); close FILE;
my $FLOAT="%.${DECIMALS}f";
my $LST="ls -d *$FILTER*";
my $OUT=`$LST`;
my @ENTRIES=split("\n",$OUT);
my $E;
my $TIME;
my $MB;
my $COST;
my $CREDIT;
my $LAST;
foreach $E (@ENTRIES) {
open FILE,"$E/Time" and $TIME=<FILE> and close FILE or $TIME=0;
$TIME=~/[0123456789]+/ or $TIME=0;
$TIME/=60;
$TIME=sprintf("%2d:%02d",$TIME/60,$TIME%60);
open FILE,"$E/MB" and $MB=<FILE> and close FILE or $MB=0;
$MB=~/[0123456789]+/ or $MB=0;
$MB=sprintf("%.2f",$MB/1048576);
open FILE,"$E/Cost" and $COST=<FILE> and close FILE or $COST=0;
$COST=sprintf($FLOAT,$COST);
open FILE,"/var/register/system/acct/credits/$E/Credit" and $CREDIT=<FILE> and close FILE or $CREDIT=0;
$CREDIT=sprintf($FLOAT,$CREDIT);
open FILE,"$E/Last" and $LAST=<FILE> and close FILE or $LAST=0;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($LAST);
$LAST=sprintf("%d-%02d-%02d %02d:%02d",$year+1900,$mon+1,$mday,$hour,$min);
print "<tr align=center style='color: #404040;'><td><input type=radio name=CLT value='$E'></td><td class=Smaller1 nowrap><a href='#' onclick='OpenDetails(\"$E\")'>$E</a></td><td class=Smaller1 nowrap>$MB</td><td class=Smaller1 nowrap>$TIME</td><td class=Smaller1 nowrap>$COST</td><td class=Smaller1 nowrap>$CREDIT</td><td class=Smaller1 nowrap> $LAST </td></tr>\n"
}
my $NUMCONN=@ENTRIES;
print "<script>parent.document.getElementById('NumConn').innerHTML=$NUMCONN;</script>\n";
| gpl-2.0 |
yuyuyu101/VirtualBox-NetBSD | src/VBox/Main/src-client/KeyboardImpl.cpp | 12529 | /* $Id: KeyboardImpl.cpp $ */
/** @file
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "KeyboardImpl.h"
#include "ConsoleImpl.h"
#include "AutoCaller.h"
#include "Logging.h"
#include <VBox/com/array.h>
#include <VBox/vmm/pdmdrv.h>
#include <iprt/asm.h>
#include <iprt/cpp/utils.h>
// defines
////////////////////////////////////////////////////////////////////////////////
// globals
////////////////////////////////////////////////////////////////////////////////
/** @name Keyboard device capabilities bitfield
* @{ */
enum
{
/** The keyboard device does not wish to receive keystrokes. */
KEYBOARD_DEVCAP_DISABLED = 0,
/** The keyboard device does wishes to receive keystrokes. */
KEYBOARD_DEVCAP_ENABLED = 1
};
/**
* Keyboard driver instance data.
*/
typedef struct DRVMAINKEYBOARD
{
/** Pointer to the keyboard object. */
Keyboard *pKeyboard;
/** Pointer to the driver instance structure. */
PPDMDRVINS pDrvIns;
/** Pointer to the keyboard port interface of the driver/device above us. */
PPDMIKEYBOARDPORT pUpPort;
/** Our keyboard connector interface. */
PDMIKEYBOARDCONNECTOR IConnector;
/** The capabilities of this device. */
uint32_t u32DevCaps;
} DRVMAINKEYBOARD, *PDRVMAINKEYBOARD;
/** Converts PDMIVMMDEVCONNECTOR pointer to a DRVMAINVMMDEV pointer. */
#define PPDMIKEYBOARDCONNECTOR_2_MAINKEYBOARD(pInterface) ( (PDRVMAINKEYBOARD) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINKEYBOARD, IConnector)) )
// constructor / destructor
////////////////////////////////////////////////////////////////////////////////
Keyboard::Keyboard()
: mParent(NULL)
{
}
Keyboard::~Keyboard()
{
}
HRESULT Keyboard::FinalConstruct()
{
RT_ZERO(mpDrv);
mpVMMDev = NULL;
mfVMMDevInited = false;
return BaseFinalConstruct();
}
void Keyboard::FinalRelease()
{
uninit();
BaseFinalRelease();
}
// public methods
////////////////////////////////////////////////////////////////////////////////
/**
* Initializes the keyboard object.
*
* @returns COM result indicator
* @param parent handle of our parent object
*/
HRESULT Keyboard::init(Console *aParent)
{
LogFlowThisFunc(("aParent=%p\n", aParent));
ComAssertRet(aParent, E_INVALIDARG);
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan(this);
AssertReturn(autoInitSpan.isOk(), E_FAIL);
unconst(mParent) = aParent;
unconst(mEventSource).createObject();
HRESULT rc = mEventSource->init(static_cast<IKeyboard*>(this));
AssertComRCReturnRC(rc);
/* Confirm a successful initialization */
autoInitSpan.setSucceeded();
return S_OK;
}
/**
* Uninitializes the instance and sets the ready flag to FALSE.
* Called either from FinalRelease() or by the parent when it gets destroyed.
*/
void Keyboard::uninit()
{
LogFlowThisFunc(("\n"));
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan(this);
if (autoUninitSpan.uninitDone())
return;
for (unsigned i = 0; i < KEYBOARD_MAX_DEVICES; ++i)
{
if (mpDrv[i])
mpDrv[i]->pKeyboard = NULL;
mpDrv[i] = NULL;
}
mpVMMDev = NULL;
mfVMMDevInited = true;
unconst(mParent) = NULL;
unconst(mEventSource).setNull();
}
/**
* Sends a scancode to the keyboard.
*
* @returns COM status code
* @param scancode The scancode to send
*/
STDMETHODIMP Keyboard::PutScancode(LONG scancode)
{
com::SafeArray<LONG> scancodes(1);
scancodes[0] = scancode;
return PutScancodes(ComSafeArrayAsInParam(scancodes), NULL);
}
/**
* Sends a list of scancodes to the keyboard.
*
* @returns COM status code
* @param scancodes Pointer to the first scancode
* @param count Number of scancodes
* @param codesStored Address of variable to store the number
* of scancodes that were sent to the keyboard.
This value can be NULL.
*/
STDMETHODIMP Keyboard::PutScancodes(ComSafeArrayIn(LONG, scancodes),
ULONG *codesStored)
{
if (ComSafeArrayInIsNull(scancodes))
return E_INVALIDARG;
AutoCaller autoCaller(this);
if (FAILED(autoCaller.rc())) return autoCaller.rc();
com::SafeArray<LONG> keys(ComSafeArrayInArg(scancodes));
AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
CHECK_CONSOLE_DRV(mpDrv[0]);
/* Send input to the last enabled device. Relies on the fact that
* the USB keyboard is always initialized after the PS/2 keyboard.
*/
PPDMIKEYBOARDPORT pUpPort = NULL;
for (int i = KEYBOARD_MAX_DEVICES - 1; i >= 0 ; --i)
{
if (mpDrv[i] && (mpDrv[i]->u32DevCaps & KEYBOARD_DEVCAP_ENABLED))
{
pUpPort = mpDrv[i]->pUpPort;
break;
}
}
/* No enabled keyboard - throw the input away. */
if (!pUpPort)
{
if (codesStored)
*codesStored = (uint32_t)keys.size();
return S_OK;
}
int vrc = VINF_SUCCESS;
uint32_t sent;
for (sent = 0; (sent < keys.size()) && RT_SUCCESS(vrc); sent++)
vrc = pUpPort->pfnPutEvent(pUpPort, (uint8_t)keys[sent]);
if (codesStored)
*codesStored = sent;
/* Only signal the keys in the event which have been actually sent. */
com::SafeArray<LONG> keysSent(sent);
memcpy(keysSent.raw(), keys.raw(), sent*sizeof(LONG));
VBoxEventDesc evDesc;
evDesc.init(mEventSource, VBoxEventType_OnGuestKeyboard, ComSafeArrayAsInParam(keys));
evDesc.fire(0);
if (RT_FAILURE(vrc))
return setError(VBOX_E_IPRT_ERROR,
tr("Could not send all scan codes to the virtual keyboard (%Rrc)"),
vrc);
return S_OK;
}
/**
* Sends Control-Alt-Delete to the keyboard. This could be done otherwise
* but it's so common that we'll be nice and supply a convenience API.
*
* @returns COM status code
*
*/
STDMETHODIMP Keyboard::PutCAD()
{
static com::SafeArray<LONG> cadSequence(8);
cadSequence[0] = 0x1d; // Ctrl down
cadSequence[1] = 0x38; // Alt down
cadSequence[2] = 0xe0; // Del down 1
cadSequence[3] = 0x53; // Del down 2
cadSequence[4] = 0xe0; // Del up 1
cadSequence[5] = 0xd3; // Del up 2
cadSequence[6] = 0xb8; // Alt up
cadSequence[7] = 0x9d; // Ctrl up
return PutScancodes(ComSafeArrayAsInParam(cadSequence), NULL);
}
STDMETHODIMP Keyboard::COMGETTER(EventSource)(IEventSource ** aEventSource)
{
CheckComArgOutPointerValid(aEventSource);
AutoCaller autoCaller(this);
if (FAILED(autoCaller.rc())) return autoCaller.rc();
// no need to lock - lifetime constant
mEventSource.queryInterfaceTo(aEventSource);
return S_OK;
}
//
// private methods
//
/**
* @interface_method_impl{PDMIBASE,pfnQueryInterface}
*/
DECLCALLBACK(void *) Keyboard::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
{
PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
PDRVMAINKEYBOARD pDrv = PDMINS_2_DATA(pDrvIns, PDRVMAINKEYBOARD);
PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
PDMIBASE_RETURN_INTERFACE(pszIID, PDMIKEYBOARDCONNECTOR, &pDrv->IConnector);
return NULL;
}
/**
* Destruct a keyboard driver instance.
*
* @returns VBox status.
* @param pDrvIns The driver instance data.
*/
DECLCALLBACK(void) Keyboard::drvDestruct(PPDMDRVINS pDrvIns)
{
PDRVMAINKEYBOARD pData = PDMINS_2_DATA(pDrvIns, PDRVMAINKEYBOARD);
LogFlow(("Keyboard::drvDestruct: iInstance=%d\n", pDrvIns->iInstance));
PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
if (pData->pKeyboard)
{
AutoWriteLock kbdLock(pData->pKeyboard COMMA_LOCKVAL_SRC_POS);
for (unsigned cDev = 0; cDev < KEYBOARD_MAX_DEVICES; ++cDev)
if (pData->pKeyboard->mpDrv[cDev] == pData)
{
pData->pKeyboard->mpDrv[cDev] = NULL;
break;
}
pData->pKeyboard->mpVMMDev = NULL;
}
}
DECLCALLBACK(void) keyboardLedStatusChange(PPDMIKEYBOARDCONNECTOR pInterface,
PDMKEYBLEDS enmLeds)
{
PDRVMAINKEYBOARD pDrv = PPDMIKEYBOARDCONNECTOR_2_MAINKEYBOARD(pInterface);
pDrv->pKeyboard->getParent()->onKeyboardLedsChange(!!(enmLeds & PDMKEYBLEDS_NUMLOCK),
!!(enmLeds & PDMKEYBLEDS_CAPSLOCK),
!!(enmLeds & PDMKEYBLEDS_SCROLLLOCK));
}
/**
* @interface_method_impl{PDMIKEYBOARDCONNECTOR,pfnSetActive}
*/
DECLCALLBACK(void) Keyboard::keyboardSetActive(PPDMIKEYBOARDCONNECTOR pInterface, bool fActive)
{
PDRVMAINKEYBOARD pDrv = PPDMIKEYBOARDCONNECTOR_2_MAINKEYBOARD(pInterface);
if (fActive)
pDrv->u32DevCaps |= KEYBOARD_DEVCAP_ENABLED;
else
pDrv->u32DevCaps &= ~KEYBOARD_DEVCAP_ENABLED;
}
/**
* Construct a keyboard driver instance.
*
* @copydoc FNPDMDRVCONSTRUCT
*/
DECLCALLBACK(int) Keyboard::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg,
uint32_t fFlags)
{
PDRVMAINKEYBOARD pData = PDMINS_2_DATA(pDrvIns, PDRVMAINKEYBOARD);
LogFlow(("Keyboard::drvConstruct: iInstance=%d\n", pDrvIns->iInstance));
PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
/*
* Validate configuration.
*/
if (!CFGMR3AreValuesValid(pCfg, "Object\0"))
return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
("Configuration error: Not possible to attach anything to this driver!\n"),
VERR_PDM_DRVINS_NO_ATTACH);
/*
* IBase.
*/
pDrvIns->IBase.pfnQueryInterface = Keyboard::drvQueryInterface;
pData->IConnector.pfnLedStatusChange = keyboardLedStatusChange;
pData->IConnector.pfnSetActive = keyboardSetActive;
/*
* Get the IKeyboardPort interface of the above driver/device.
*/
pData->pUpPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIKEYBOARDPORT);
if (!pData->pUpPort)
{
AssertMsgFailed(("Configuration error: No keyboard port interface above!\n"));
return VERR_PDM_MISSING_INTERFACE_ABOVE;
}
/*
* Get the Keyboard object pointer and update the mpDrv member.
*/
void *pv;
int rc = CFGMR3QueryPtr(pCfg, "Object", &pv);
if (RT_FAILURE(rc))
{
AssertMsgFailed(("Configuration error: No/bad \"Object\" value! rc=%Rrc\n", rc));
return rc;
}
pData->pKeyboard = (Keyboard *)pv; /** @todo Check this cast! */
unsigned cDev;
for (cDev = 0; cDev < KEYBOARD_MAX_DEVICES; ++cDev)
if (!pData->pKeyboard->mpDrv[cDev])
{
pData->pKeyboard->mpDrv[cDev] = pData;
break;
}
if (cDev == KEYBOARD_MAX_DEVICES)
return VERR_NO_MORE_HANDLES;
return VINF_SUCCESS;
}
/**
* Keyboard driver registration record.
*/
const PDMDRVREG Keyboard::DrvReg =
{
/* u32Version */
PDM_DRVREG_VERSION,
/* szName */
"MainKeyboard",
/* szRCMod */
"",
/* szR0Mod */
"",
/* pszDescription */
"Main keyboard driver (Main as in the API).",
/* fFlags */
PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
/* fClass. */
PDM_DRVREG_CLASS_KEYBOARD,
/* cMaxInstances */
~0U,
/* cbInstance */
sizeof(DRVMAINKEYBOARD),
/* pfnConstruct */
Keyboard::drvConstruct,
/* pfnDestruct */
Keyboard::drvDestruct,
/* pfnRelocate */
NULL,
/* pfnIOCtl */
NULL,
/* pfnPowerOn */
NULL,
/* pfnReset */
NULL,
/* pfnSuspend */
NULL,
/* pfnResume */
NULL,
/* pfnAttach */
NULL,
/* pfnDetach */
NULL,
/* pfnPowerOff */
NULL,
/* pfnSoftReset */
NULL,
/* u32EndVersion */
PDM_DRVREG_VERSION
};
/* vi: set tabstop=4 shiftwidth=4 expandtab: */
| gpl-2.0 |
mangosone/server | src/game/WorldHandlers/AccountMgr.h | 2290 | /**
* MaNGOS is a full featured server for World of Warcraft, supporting
* the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8
*
* Copyright (C) 2005-2022 MaNGOS <https://getmangos.eu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* World of Warcraft, and all World of Warcraft or Warcraft art, images,
* and lore are copyrighted by Blizzard Entertainment, Inc.
*/
#ifndef MANGOS_H_ACCMGR
#define MANGOS_H_ACCMGR
#include "Common.h"
enum AccountOpResult
{
AOR_OK,
AOR_NAME_TOO_LONG,
AOR_PASS_TOO_LONG,
AOR_NAME_ALREADY_EXIST,
AOR_NAME_NOT_EXIST,
AOR_DB_INTERNAL_ERROR
};
#define MAX_ACCOUNT_STR 32
class AccountMgr
{
public:
AccountMgr();
~AccountMgr();
AccountOpResult CreateAccount(std::string username, std::string password);
AccountOpResult CreateAccount(std::string username, std::string password, uint32 expansion);
AccountOpResult DeleteAccount(uint32 accid);
AccountOpResult ChangeUsername(uint32 accid, std::string new_uname, std::string new_passwd);
AccountOpResult ChangePassword(uint32 accid, std::string new_passwd);
bool CheckPassword(uint32 accid, std::string passwd);
uint32 GetId(std::string username);
AccountTypes GetSecurity(uint32 acc_id);
bool GetName(uint32 acc_id, std::string& name);
uint32 GetCharactersCount(uint32 acc_id);
std::string CalculateShaPassHash(std::string& name, std::string& password);
static bool normalizeString(std::string& utf8str);
};
#define sAccountMgr MaNGOS::Singleton<AccountMgr>::Instance()
#endif
| gpl-2.0 |
jocelynmass/nrf51 | toolchain/deprecated/arm_cm0_4.9/share/doc/gcc-arm-none-eabi/html/gcc/MIPS-Options.html | 51209 | <html lang="en">
<head>
<title>MIPS Options - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Submodel-Options.html#Submodel-Options" title="Submodel Options">
<link rel="prev" href="MicroBlaze-Options.html#MicroBlaze-Options" title="MicroBlaze Options">
<link rel="next" href="MMIX-Options.html#MMIX-Options" title="MMIX Options">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="MIPS-Options"></a>
Next: <a rel="next" accesskey="n" href="MMIX-Options.html#MMIX-Options">MMIX Options</a>,
Previous: <a rel="previous" accesskey="p" href="MicroBlaze-Options.html#MicroBlaze-Options">MicroBlaze Options</a>,
Up: <a rel="up" accesskey="u" href="Submodel-Options.html#Submodel-Options">Submodel Options</a>
<hr>
</div>
<h4 class="subsection">3.17.27 MIPS Options</h4>
<p><a name="index-MIPS-options-1879"></a>
<dl>
<dt><code>-EB</code><dd><a name="index-EB-1880"></a>Generate big-endian code.
<br><dt><code>-EL</code><dd><a name="index-EL-1881"></a>Generate little-endian code. This is the default for `<samp><span class="samp">mips*el-*-*</span></samp>'
configurations.
<br><dt><code>-march=</code><var>arch</var><dd><a name="index-march-1882"></a>Generate code that runs on <var>arch</var>, which can be the name of a
generic MIPS ISA, or the name of a particular processor.
The ISA names are:
`<samp><span class="samp">mips1</span></samp>', `<samp><span class="samp">mips2</span></samp>', `<samp><span class="samp">mips3</span></samp>', `<samp><span class="samp">mips4</span></samp>',
`<samp><span class="samp">mips32</span></samp>', `<samp><span class="samp">mips32r2</span></samp>', `<samp><span class="samp">mips64</span></samp>' and `<samp><span class="samp">mips64r2</span></samp>'.
The processor names are:
`<samp><span class="samp">4kc</span></samp>', `<samp><span class="samp">4km</span></samp>', `<samp><span class="samp">4kp</span></samp>', `<samp><span class="samp">4ksc</span></samp>',
`<samp><span class="samp">4kec</span></samp>', `<samp><span class="samp">4kem</span></samp>', `<samp><span class="samp">4kep</span></samp>', `<samp><span class="samp">4ksd</span></samp>',
`<samp><span class="samp">5kc</span></samp>', `<samp><span class="samp">5kf</span></samp>',
`<samp><span class="samp">20kc</span></samp>',
`<samp><span class="samp">24kc</span></samp>', `<samp><span class="samp">24kf2_1</span></samp>', `<samp><span class="samp">24kf1_1</span></samp>',
`<samp><span class="samp">24kec</span></samp>', `<samp><span class="samp">24kef2_1</span></samp>', `<samp><span class="samp">24kef1_1</span></samp>',
`<samp><span class="samp">34kc</span></samp>', `<samp><span class="samp">34kf2_1</span></samp>', `<samp><span class="samp">34kf1_1</span></samp>', `<samp><span class="samp">34kn</span></samp>',
`<samp><span class="samp">74kc</span></samp>', `<samp><span class="samp">74kf2_1</span></samp>', `<samp><span class="samp">74kf1_1</span></samp>', `<samp><span class="samp">74kf3_2</span></samp>',
`<samp><span class="samp">1004kc</span></samp>', `<samp><span class="samp">1004kf2_1</span></samp>', `<samp><span class="samp">1004kf1_1</span></samp>',
`<samp><span class="samp">loongson2e</span></samp>', `<samp><span class="samp">loongson2f</span></samp>', `<samp><span class="samp">loongson3a</span></samp>',
`<samp><span class="samp">m4k</span></samp>',
`<samp><span class="samp">m14k</span></samp>', `<samp><span class="samp">m14kc</span></samp>', `<samp><span class="samp">m14ke</span></samp>', `<samp><span class="samp">m14kec</span></samp>',
`<samp><span class="samp">octeon</span></samp>', `<samp><span class="samp">octeon+</span></samp>', `<samp><span class="samp">octeon2</span></samp>',
`<samp><span class="samp">orion</span></samp>',
`<samp><span class="samp">r2000</span></samp>', `<samp><span class="samp">r3000</span></samp>', `<samp><span class="samp">r3900</span></samp>', `<samp><span class="samp">r4000</span></samp>', `<samp><span class="samp">r4400</span></samp>',
`<samp><span class="samp">r4600</span></samp>', `<samp><span class="samp">r4650</span></samp>', `<samp><span class="samp">r4700</span></samp>', `<samp><span class="samp">r6000</span></samp>', `<samp><span class="samp">r8000</span></samp>',
`<samp><span class="samp">rm7000</span></samp>', `<samp><span class="samp">rm9000</span></samp>',
`<samp><span class="samp">r10000</span></samp>', `<samp><span class="samp">r12000</span></samp>', `<samp><span class="samp">r14000</span></samp>', `<samp><span class="samp">r16000</span></samp>',
`<samp><span class="samp">sb1</span></samp>',
`<samp><span class="samp">sr71000</span></samp>',
`<samp><span class="samp">vr4100</span></samp>', `<samp><span class="samp">vr4111</span></samp>', `<samp><span class="samp">vr4120</span></samp>', `<samp><span class="samp">vr4130</span></samp>', `<samp><span class="samp">vr4300</span></samp>',
`<samp><span class="samp">vr5000</span></samp>', `<samp><span class="samp">vr5400</span></samp>', `<samp><span class="samp">vr5500</span></samp>',
`<samp><span class="samp">xlr</span></samp>' and `<samp><span class="samp">xlp</span></samp>'.
The special value `<samp><span class="samp">from-abi</span></samp>' selects the
most compatible architecture for the selected ABI (that is,
`<samp><span class="samp">mips1</span></samp>' for 32-bit ABIs and `<samp><span class="samp">mips3</span></samp>' for 64-bit ABIs).
<p>The native Linux/GNU toolchain also supports the value `<samp><span class="samp">native</span></samp>',
which selects the best architecture option for the host processor.
<samp><span class="option">-march=native</span></samp> has no effect if GCC does not recognize
the processor.
<p>In processor names, a final `<samp><span class="samp">000</span></samp>' can be abbreviated as `<samp><span class="samp">k</span></samp>'
(for example, <samp><span class="option">-march=r2k</span></samp>). Prefixes are optional, and
`<samp><span class="samp">vr</span></samp>' may be written `<samp><span class="samp">r</span></samp>'.
<p>Names of the form `<samp><var>n</var><span class="samp">f2_1</span></samp>' refer to processors with
FPUs clocked at half the rate of the core, names of the form
`<samp><var>n</var><span class="samp">f1_1</span></samp>' refer to processors with FPUs clocked at the same
rate as the core, and names of the form `<samp><var>n</var><span class="samp">f3_2</span></samp>' refer to
processors with FPUs clocked a ratio of 3:2 with respect to the core.
For compatibility reasons, `<samp><var>n</var><span class="samp">f</span></samp>' is accepted as a synonym
for `<samp><var>n</var><span class="samp">f2_1</span></samp>' while `<samp><var>n</var><span class="samp">x</span></samp>' and `<samp><var>b</var><span class="samp">fx</span></samp>' are
accepted as synonyms for `<samp><var>n</var><span class="samp">f1_1</span></samp>'.
<p>GCC defines two macros based on the value of this option. The first
is `<samp><span class="samp">_MIPS_ARCH</span></samp>', which gives the name of target architecture, as
a string. The second has the form `<samp><span class="samp">_MIPS_ARCH_</span><var>foo</var></samp>',
where <var>foo</var> is the capitalized value of `<samp><span class="samp">_MIPS_ARCH</span></samp>'.
For example, <samp><span class="option">-march=r2000</span></samp> sets `<samp><span class="samp">_MIPS_ARCH</span></samp>'
to `<samp><span class="samp">"r2000"</span></samp>' and defines the macro `<samp><span class="samp">_MIPS_ARCH_R2000</span></samp>'.
<p>Note that the `<samp><span class="samp">_MIPS_ARCH</span></samp>' macro uses the processor names given
above. In other words, it has the full prefix and does not
abbreviate `<samp><span class="samp">000</span></samp>' as `<samp><span class="samp">k</span></samp>'. In the case of `<samp><span class="samp">from-abi</span></samp>',
the macro names the resolved architecture (either `<samp><span class="samp">"mips1"</span></samp>' or
`<samp><span class="samp">"mips3"</span></samp>'). It names the default architecture when no
<samp><span class="option">-march</span></samp> option is given.
<br><dt><code>-mtune=</code><var>arch</var><dd><a name="index-mtune-1883"></a>Optimize for <var>arch</var>. Among other things, this option controls
the way instructions are scheduled, and the perceived cost of arithmetic
operations. The list of <var>arch</var> values is the same as for
<samp><span class="option">-march</span></samp>.
<p>When this option is not used, GCC optimizes for the processor
specified by <samp><span class="option">-march</span></samp>. By using <samp><span class="option">-march</span></samp> and
<samp><span class="option">-mtune</span></samp> together, it is possible to generate code that
runs on a family of processors, but optimize the code for one
particular member of that family.
<p><samp><span class="option">-mtune</span></samp> defines the macros `<samp><span class="samp">_MIPS_TUNE</span></samp>' and
`<samp><span class="samp">_MIPS_TUNE_</span><var>foo</var></samp>', which work in the same way as the
<samp><span class="option">-march</span></samp> ones described above.
<br><dt><code>-mips1</code><dd><a name="index-mips1-1884"></a>Equivalent to <samp><span class="option">-march=mips1</span></samp>.
<br><dt><code>-mips2</code><dd><a name="index-mips2-1885"></a>Equivalent to <samp><span class="option">-march=mips2</span></samp>.
<br><dt><code>-mips3</code><dd><a name="index-mips3-1886"></a>Equivalent to <samp><span class="option">-march=mips3</span></samp>.
<br><dt><code>-mips4</code><dd><a name="index-mips4-1887"></a>Equivalent to <samp><span class="option">-march=mips4</span></samp>.
<br><dt><code>-mips32</code><dd><a name="index-mips32-1888"></a>Equivalent to <samp><span class="option">-march=mips32</span></samp>.
<br><dt><code>-mips32r2</code><dd><a name="index-mips32r2-1889"></a>Equivalent to <samp><span class="option">-march=mips32r2</span></samp>.
<br><dt><code>-mips64</code><dd><a name="index-mips64-1890"></a>Equivalent to <samp><span class="option">-march=mips64</span></samp>.
<br><dt><code>-mips64r2</code><dd><a name="index-mips64r2-1891"></a>Equivalent to <samp><span class="option">-march=mips64r2</span></samp>.
<br><dt><code>-mips16</code><dt><code>-mno-mips16</code><dd><a name="index-mips16-1892"></a><a name="index-mno_002dmips16-1893"></a>Generate (do not generate) MIPS16 code. If GCC is targeting a
MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE.
<p>MIPS16 code generation can also be controlled on a per-function basis
by means of <code>mips16</code> and <code>nomips16</code> attributes.
See <a href="Function-Attributes.html#Function-Attributes">Function Attributes</a>, for more information.
<br><dt><code>-mflip-mips16</code><dd><a name="index-mflip_002dmips16-1894"></a>Generate MIPS16 code on alternating functions. This option is provided
for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
not intended for ordinary use in compiling user code.
<br><dt><code>-minterlink-compressed</code><br><dt><code>-mno-interlink-compressed</code><dd><a name="index-minterlink_002dcompressed-1895"></a><a name="index-mno_002dinterlink_002dcompressed-1896"></a>Require (do not require) that code using the standard (uncompressed) MIPS ISA
be link-compatible with MIPS16 and microMIPS code, and vice versa.
<p>For example, code using the standard ISA encoding cannot jump directly
to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
<samp><span class="option">-minterlink-compressed</span></samp> therefore disables direct jumps unless GCC
knows that the target of the jump is not compressed.
<br><dt><code>-minterlink-mips16</code><dt><code>-mno-interlink-mips16</code><dd><a name="index-minterlink_002dmips16-1897"></a><a name="index-mno_002dinterlink_002dmips16-1898"></a>Aliases of <samp><span class="option">-minterlink-compressed</span></samp> and
<samp><span class="option">-mno-interlink-compressed</span></samp>. These options predate the microMIPS ASE
and are retained for backwards compatibility.
<br><dt><code>-mabi=32</code><dt><code>-mabi=o64</code><dt><code>-mabi=n32</code><dt><code>-mabi=64</code><dt><code>-mabi=eabi</code><dd><a name="index-mabi_003d32-1899"></a><a name="index-mabi_003do64-1900"></a><a name="index-mabi_003dn32-1901"></a><a name="index-mabi_003d64-1902"></a><a name="index-mabi_003deabi-1903"></a>Generate code for the given ABI.
<p>Note that the EABI has a 32-bit and a 64-bit variant. GCC normally
generates 64-bit code when you select a 64-bit architecture, but you
can use <samp><span class="option">-mgp32</span></samp> to get 32-bit code instead.
<p>For information about the O64 ABI, see
<a href="http://gcc.gnu.org/projects/mipso64-abi.html">http://gcc.gnu.org/projects/mipso64-abi.html</a>.
<p>GCC supports a variant of the o32 ABI in which floating-point registers
are 64 rather than 32 bits wide. You can select this combination with
<samp><span class="option">-mabi=32</span></samp> <samp><span class="option">-mfp64</span></samp>. This ABI relies on the <code>mthc1</code>
and <code>mfhc1</code> instructions and is therefore only supported for
MIPS32R2 processors.
<p>The register assignments for arguments and return values remain the
same, but each scalar value is passed in a single 64-bit register
rather than a pair of 32-bit registers. For example, scalar
floating-point values are returned in `<samp><span class="samp">$f0</span></samp>' only, not a
`<samp><span class="samp">$f0</span></samp>'/`<samp><span class="samp">$f1</span></samp>' pair. The set of call-saved registers also
remains the same, but all 64 bits are saved.
<br><dt><code>-mabicalls</code><dt><code>-mno-abicalls</code><dd><a name="index-mabicalls-1904"></a><a name="index-mno_002dabicalls-1905"></a>Generate (do not generate) code that is suitable for SVR4-style
dynamic objects. <samp><span class="option">-mabicalls</span></samp> is the default for SVR4-based
systems.
<br><dt><code>-mshared</code><dt><code>-mno-shared</code><dd>Generate (do not generate) code that is fully position-independent,
and that can therefore be linked into shared libraries. This option
only affects <samp><span class="option">-mabicalls</span></samp>.
<p>All <samp><span class="option">-mabicalls</span></samp> code has traditionally been position-independent,
regardless of options like <samp><span class="option">-fPIC</span></samp> and <samp><span class="option">-fpic</span></samp>. However,
as an extension, the GNU toolchain allows executables to use absolute
accesses for locally-binding symbols. It can also use shorter GP
initialization sequences and generate direct calls to locally-defined
functions. This mode is selected by <samp><span class="option">-mno-shared</span></samp>.
<p><samp><span class="option">-mno-shared</span></samp> depends on binutils 2.16 or higher and generates
objects that can only be linked by the GNU linker. However, the option
does not affect the ABI of the final executable; it only affects the ABI
of relocatable objects. Using <samp><span class="option">-mno-shared</span></samp> generally makes
executables both smaller and quicker.
<p><samp><span class="option">-mshared</span></samp> is the default.
<br><dt><code>-mplt</code><dt><code>-mno-plt</code><dd><a name="index-mplt-1906"></a><a name="index-mno_002dplt-1907"></a>Assume (do not assume) that the static and dynamic linkers
support PLTs and copy relocations. This option only affects
<samp><span class="option">-mno-shared -mabicalls</span></samp>. For the n64 ABI, this option
has no effect without <samp><span class="option">-msym32</span></samp>.
<p>You can make <samp><span class="option">-mplt</span></samp> the default by configuring
GCC with <samp><span class="option">--with-mips-plt</span></samp>. The default is
<samp><span class="option">-mno-plt</span></samp> otherwise.
<br><dt><code>-mxgot</code><dt><code>-mno-xgot</code><dd><a name="index-mxgot-1908"></a><a name="index-mno_002dxgot-1909"></a>Lift (do not lift) the usual restrictions on the size of the global
offset table.
<p>GCC normally uses a single instruction to load values from the GOT.
While this is relatively efficient, it only works if the GOT
is smaller than about 64k. Anything larger causes the linker
to report an error such as:
<p><a name="index-relocation-truncated-to-fit-_0028MIPS_0029-1910"></a>
<pre class="smallexample"> relocation truncated to fit: R_MIPS_GOT16 foobar
</pre>
<p>If this happens, you should recompile your code with <samp><span class="option">-mxgot</span></samp>.
This works with very large GOTs, although the code is also
less efficient, since it takes three instructions to fetch the
value of a global symbol.
<p>Note that some linkers can create multiple GOTs. If you have such a
linker, you should only need to use <samp><span class="option">-mxgot</span></samp> when a single object
file accesses more than 64k's worth of GOT entries. Very few do.
<p>These options have no effect unless GCC is generating position
independent code.
<br><dt><code>-mgp32</code><dd><a name="index-mgp32-1911"></a>Assume that general-purpose registers are 32 bits wide.
<br><dt><code>-mgp64</code><dd><a name="index-mgp64-1912"></a>Assume that general-purpose registers are 64 bits wide.
<br><dt><code>-mfp32</code><dd><a name="index-mfp32-1913"></a>Assume that floating-point registers are 32 bits wide.
<br><dt><code>-mfp64</code><dd><a name="index-mfp64-1914"></a>Assume that floating-point registers are 64 bits wide.
<br><dt><code>-mhard-float</code><dd><a name="index-mhard_002dfloat-1915"></a>Use floating-point coprocessor instructions.
<br><dt><code>-msoft-float</code><dd><a name="index-msoft_002dfloat-1916"></a>Do not use floating-point coprocessor instructions. Implement
floating-point calculations using library calls instead.
<br><dt><code>-mno-float</code><dd><a name="index-mno_002dfloat-1917"></a>Equivalent to <samp><span class="option">-msoft-float</span></samp>, but additionally asserts that the
program being compiled does not perform any floating-point operations.
This option is presently supported only by some bare-metal MIPS
configurations, where it may select a special set of libraries
that lack all floating-point support (including, for example, the
floating-point <code>printf</code> formats).
If code compiled with <code>-mno-float</code> accidentally contains
floating-point operations, it is likely to suffer a link-time
or run-time failure.
<br><dt><code>-msingle-float</code><dd><a name="index-msingle_002dfloat-1918"></a>Assume that the floating-point coprocessor only supports single-precision
operations.
<br><dt><code>-mdouble-float</code><dd><a name="index-mdouble_002dfloat-1919"></a>Assume that the floating-point coprocessor supports double-precision
operations. This is the default.
<br><dt><code>-mabs=2008</code><dt><code>-mabs=legacy</code><dd><a name="index-mabs_003d2008-1920"></a><a name="index-mabs_003dlegacy-1921"></a>These options control the treatment of the special not-a-number (NaN)
IEEE 754 floating-point data with the <code>abs.</code><i>fmt</i> and
<code>neg.</code><i>fmt</i> machine instructions.
<p>By default or when the <samp><span class="option">-mabs=legacy</span></samp> is used the legacy
treatment is selected. In this case these instructions are considered
arithmetic and avoided where correct operation is required and the
input operand might be a NaN. A longer sequence of instructions that
manipulate the sign bit of floating-point datum manually is used
instead unless the <samp><span class="option">-ffinite-math-only</span></samp> option has also been
specified.
<p>The <samp><span class="option">-mabs=2008</span></samp> option selects the IEEE 754-2008 treatment. In
this case these instructions are considered non-arithmetic and therefore
operating correctly in all cases, including in particular where the
input operand is a NaN. These instructions are therefore always used
for the respective operations.
<br><dt><code>-mnan=2008</code><dt><code>-mnan=legacy</code><dd><a name="index-mnan_003d2008-1922"></a><a name="index-mnan_003dlegacy-1923"></a>These options control the encoding of the special not-a-number (NaN)
IEEE 754 floating-point data.
<p>The <samp><span class="option">-mnan=legacy</span></samp> option selects the legacy encoding. In this
case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
significand field being 0, whereas signalling NaNs (sNaNs) are denoted
by the first bit of their trailing significand field being 1.
<p>The <samp><span class="option">-mnan=2008</span></samp> option selects the IEEE 754-2008 encoding. In
this case qNaNs are denoted by the first bit of their trailing
significand field being 1, whereas sNaNs are denoted by the first bit of
their trailing significand field being 0.
<p>The default is <samp><span class="option">-mnan=legacy</span></samp> unless GCC has been configured with
<samp><span class="option">--with-nan=2008</span></samp>.
<br><dt><code>-mllsc</code><dt><code>-mno-llsc</code><dd><a name="index-mllsc-1924"></a><a name="index-mno_002dllsc-1925"></a>Use (do not use) `<samp><span class="samp">ll</span></samp>', `<samp><span class="samp">sc</span></samp>', and `<samp><span class="samp">sync</span></samp>' instructions to
implement atomic memory built-in functions. When neither option is
specified, GCC uses the instructions if the target architecture
supports them.
<p><samp><span class="option">-mllsc</span></samp> is useful if the runtime environment can emulate the
instructions and <samp><span class="option">-mno-llsc</span></samp> can be useful when compiling for
nonstandard ISAs. You can make either option the default by
configuring GCC with <samp><span class="option">--with-llsc</span></samp> and <samp><span class="option">--without-llsc</span></samp>
respectively. <samp><span class="option">--with-llsc</span></samp> is the default for some
configurations; see the installation documentation for details.
<br><dt><code>-mdsp</code><dt><code>-mno-dsp</code><dd><a name="index-mdsp-1926"></a><a name="index-mno_002ddsp-1927"></a>Use (do not use) revision 1 of the MIPS DSP ASE.
See <a href="MIPS-DSP-Built_002din-Functions.html#MIPS-DSP-Built_002din-Functions">MIPS DSP Built-in Functions</a>. This option defines the
preprocessor macro `<samp><span class="samp">__mips_dsp</span></samp>'. It also defines
`<samp><span class="samp">__mips_dsp_rev</span></samp>' to 1.
<br><dt><code>-mdspr2</code><dt><code>-mno-dspr2</code><dd><a name="index-mdspr2-1928"></a><a name="index-mno_002ddspr2-1929"></a>Use (do not use) revision 2 of the MIPS DSP ASE.
See <a href="MIPS-DSP-Built_002din-Functions.html#MIPS-DSP-Built_002din-Functions">MIPS DSP Built-in Functions</a>. This option defines the
preprocessor macros `<samp><span class="samp">__mips_dsp</span></samp>' and `<samp><span class="samp">__mips_dspr2</span></samp>'.
It also defines `<samp><span class="samp">__mips_dsp_rev</span></samp>' to 2.
<br><dt><code>-msmartmips</code><dt><code>-mno-smartmips</code><dd><a name="index-msmartmips-1930"></a><a name="index-mno_002dsmartmips-1931"></a>Use (do not use) the MIPS SmartMIPS ASE.
<br><dt><code>-mpaired-single</code><dt><code>-mno-paired-single</code><dd><a name="index-mpaired_002dsingle-1932"></a><a name="index-mno_002dpaired_002dsingle-1933"></a>Use (do not use) paired-single floating-point instructions.
See <a href="MIPS-Paired_002dSingle-Support.html#MIPS-Paired_002dSingle-Support">MIPS Paired-Single Support</a>. This option requires
hardware floating-point support to be enabled.
<br><dt><code>-mdmx</code><dt><code>-mno-mdmx</code><dd><a name="index-mdmx-1934"></a><a name="index-mno_002dmdmx-1935"></a>Use (do not use) MIPS Digital Media Extension instructions.
This option can only be used when generating 64-bit code and requires
hardware floating-point support to be enabled.
<br><dt><code>-mips3d</code><dt><code>-mno-mips3d</code><dd><a name="index-mips3d-1936"></a><a name="index-mno_002dmips3d-1937"></a>Use (do not use) the MIPS-3D ASE. See <a href="MIPS_002d3D-Built_002din-Functions.html#MIPS_002d3D-Built_002din-Functions">MIPS-3D Built-in Functions</a>.
The option <samp><span class="option">-mips3d</span></samp> implies <samp><span class="option">-mpaired-single</span></samp>.
<br><dt><code>-mmicromips</code><dt><code>-mno-micromips</code><dd><a name="index-mmicromips-1938"></a><a name="index-mno_002dmmicromips-1939"></a>Generate (do not generate) microMIPS code.
<p>MicroMIPS code generation can also be controlled on a per-function basis
by means of <code>micromips</code> and <code>nomicromips</code> attributes.
See <a href="Function-Attributes.html#Function-Attributes">Function Attributes</a>, for more information.
<br><dt><code>-mmt</code><dt><code>-mno-mt</code><dd><a name="index-mmt-1940"></a><a name="index-mno_002dmt-1941"></a>Use (do not use) MT Multithreading instructions.
<br><dt><code>-mmcu</code><dt><code>-mno-mcu</code><dd><a name="index-mmcu-1942"></a><a name="index-mno_002dmcu-1943"></a>Use (do not use) the MIPS MCU ASE instructions.
<br><dt><code>-meva</code><dt><code>-mno-eva</code><dd><a name="index-meva-1944"></a><a name="index-mno_002deva-1945"></a>Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
<br><dt><code>-mvirt</code><dt><code>-mno-virt</code><dd><a name="index-mvirt-1946"></a><a name="index-mno_002dvirt-1947"></a>Use (do not use) the MIPS Virtualization Application Specific instructions.
<br><dt><code>-mlong64</code><dd><a name="index-mlong64-1948"></a>Force <code>long</code> types to be 64 bits wide. See <samp><span class="option">-mlong32</span></samp> for
an explanation of the default and the way that the pointer size is
determined.
<br><dt><code>-mlong32</code><dd><a name="index-mlong32-1949"></a>Force <code>long</code>, <code>int</code>, and pointer types to be 32 bits wide.
<p>The default size of <code>int</code>s, <code>long</code>s and pointers depends on
the ABI. All the supported ABIs use 32-bit <code>int</code>s. The n64 ABI
uses 64-bit <code>long</code>s, as does the 64-bit EABI; the others use
32-bit <code>long</code>s. Pointers are the same size as <code>long</code>s,
or the same size as integer registers, whichever is smaller.
<br><dt><code>-msym32</code><dt><code>-mno-sym32</code><dd><a name="index-msym32-1950"></a><a name="index-mno_002dsym32-1951"></a>Assume (do not assume) that all symbols have 32-bit values, regardless
of the selected ABI. This option is useful in combination with
<samp><span class="option">-mabi=64</span></samp> and <samp><span class="option">-mno-abicalls</span></samp> because it allows GCC
to generate shorter and faster references to symbolic addresses.
<br><dt><code>-G </code><var>num</var><dd><a name="index-G-1952"></a>Put definitions of externally-visible data in a small data section
if that data is no bigger than <var>num</var> bytes. GCC can then generate
more efficient accesses to the data; see <samp><span class="option">-mgpopt</span></samp> for details.
<p>The default <samp><span class="option">-G</span></samp> option depends on the configuration.
<br><dt><code>-mlocal-sdata</code><dt><code>-mno-local-sdata</code><dd><a name="index-mlocal_002dsdata-1953"></a><a name="index-mno_002dlocal_002dsdata-1954"></a>Extend (do not extend) the <samp><span class="option">-G</span></samp> behavior to local data too,
such as to static variables in C. <samp><span class="option">-mlocal-sdata</span></samp> is the
default for all configurations.
<p>If the linker complains that an application is using too much small data,
you might want to try rebuilding the less performance-critical parts with
<samp><span class="option">-mno-local-sdata</span></samp>. You might also want to build large
libraries with <samp><span class="option">-mno-local-sdata</span></samp>, so that the libraries leave
more room for the main program.
<br><dt><code>-mextern-sdata</code><dt><code>-mno-extern-sdata</code><dd><a name="index-mextern_002dsdata-1955"></a><a name="index-mno_002dextern_002dsdata-1956"></a>Assume (do not assume) that externally-defined data is in
a small data section if the size of that data is within the <samp><span class="option">-G</span></samp> limit.
<samp><span class="option">-mextern-sdata</span></samp> is the default for all configurations.
<p>If you compile a module <var>Mod</var> with <samp><span class="option">-mextern-sdata</span></samp> <samp><span class="option">-G
</span><var>num</var></samp> <samp><span class="option">-mgpopt</span></samp>, and <var>Mod</var> references a variable <var>Var</var>
that is no bigger than <var>num</var> bytes, you must make sure that <var>Var</var>
is placed in a small data section. If <var>Var</var> is defined by another
module, you must either compile that module with a high-enough
<samp><span class="option">-G</span></samp> setting or attach a <code>section</code> attribute to <var>Var</var>'s
definition. If <var>Var</var> is common, you must link the application
with a high-enough <samp><span class="option">-G</span></samp> setting.
<p>The easiest way of satisfying these restrictions is to compile
and link every module with the same <samp><span class="option">-G</span></samp> option. However,
you may wish to build a library that supports several different
small data limits. You can do this by compiling the library with
the highest supported <samp><span class="option">-G</span></samp> setting and additionally using
<samp><span class="option">-mno-extern-sdata</span></samp> to stop the library from making assumptions
about externally-defined data.
<br><dt><code>-mgpopt</code><dt><code>-mno-gpopt</code><dd><a name="index-mgpopt-1957"></a><a name="index-mno_002dgpopt-1958"></a>Use (do not use) GP-relative accesses for symbols that are known to be
in a small data section; see <samp><span class="option">-G</span></samp>, <samp><span class="option">-mlocal-sdata</span></samp> and
<samp><span class="option">-mextern-sdata</span></samp>. <samp><span class="option">-mgpopt</span></samp> is the default for all
configurations.
<p><samp><span class="option">-mno-gpopt</span></samp> is useful for cases where the <code>$gp</code> register
might not hold the value of <code>_gp</code>. For example, if the code is
part of a library that might be used in a boot monitor, programs that
call boot monitor routines pass an unknown value in <code>$gp</code>.
(In such situations, the boot monitor itself is usually compiled
with <samp><span class="option">-G0</span></samp>.)
<p><samp><span class="option">-mno-gpopt</span></samp> implies <samp><span class="option">-mno-local-sdata</span></samp> and
<samp><span class="option">-mno-extern-sdata</span></samp>.
<br><dt><code>-membedded-data</code><dt><code>-mno-embedded-data</code><dd><a name="index-membedded_002ddata-1959"></a><a name="index-mno_002dembedded_002ddata-1960"></a>Allocate variables to the read-only data section first if possible, then
next in the small data section if possible, otherwise in data. This gives
slightly slower code than the default, but reduces the amount of RAM required
when executing, and thus may be preferred for some embedded systems.
<br><dt><code>-muninit-const-in-rodata</code><dt><code>-mno-uninit-const-in-rodata</code><dd><a name="index-muninit_002dconst_002din_002drodata-1961"></a><a name="index-mno_002duninit_002dconst_002din_002drodata-1962"></a>Put uninitialized <code>const</code> variables in the read-only data section.
This option is only meaningful in conjunction with <samp><span class="option">-membedded-data</span></samp>.
<br><dt><code>-mcode-readable=</code><var>setting</var><dd><a name="index-mcode_002dreadable-1963"></a>Specify whether GCC may generate code that reads from executable sections.
There are three possible settings:
<dl>
<dt><code>-mcode-readable=yes</code><dd>Instructions may freely access executable sections. This is the
default setting.
<br><dt><code>-mcode-readable=pcrel</code><dd>MIPS16 PC-relative load instructions can access executable sections,
but other instructions must not do so. This option is useful on 4KSc
and 4KSd processors when the code TLBs have the Read Inhibit bit set.
It is also useful on processors that can be configured to have a dual
instruction/data SRAM interface and that, like the M4K, automatically
redirect PC-relative loads to the instruction RAM.
<br><dt><code>-mcode-readable=no</code><dd>Instructions must not access executable sections. This option can be
useful on targets that are configured to have a dual instruction/data
SRAM interface but that (unlike the M4K) do not automatically redirect
PC-relative loads to the instruction RAM.
</dl>
<br><dt><code>-msplit-addresses</code><dt><code>-mno-split-addresses</code><dd><a name="index-msplit_002daddresses-1964"></a><a name="index-mno_002dsplit_002daddresses-1965"></a>Enable (disable) use of the <code>%hi()</code> and <code>%lo()</code> assembler
relocation operators. This option has been superseded by
<samp><span class="option">-mexplicit-relocs</span></samp> but is retained for backwards compatibility.
<br><dt><code>-mexplicit-relocs</code><dt><code>-mno-explicit-relocs</code><dd><a name="index-mexplicit_002drelocs-1966"></a><a name="index-mno_002dexplicit_002drelocs-1967"></a>Use (do not use) assembler relocation operators when dealing with symbolic
addresses. The alternative, selected by <samp><span class="option">-mno-explicit-relocs</span></samp>,
is to use assembler macros instead.
<p><samp><span class="option">-mexplicit-relocs</span></samp> is the default if GCC was configured
to use an assembler that supports relocation operators.
<br><dt><code>-mcheck-zero-division</code><dt><code>-mno-check-zero-division</code><dd><a name="index-mcheck_002dzero_002ddivision-1968"></a><a name="index-mno_002dcheck_002dzero_002ddivision-1969"></a>Trap (do not trap) on integer division by zero.
<p>The default is <samp><span class="option">-mcheck-zero-division</span></samp>.
<br><dt><code>-mdivide-traps</code><dt><code>-mdivide-breaks</code><dd><a name="index-mdivide_002dtraps-1970"></a><a name="index-mdivide_002dbreaks-1971"></a>MIPS systems check for division by zero by generating either a
conditional trap or a break instruction. Using traps results in
smaller code, but is only supported on MIPS II and later. Also, some
versions of the Linux kernel have a bug that prevents trap from
generating the proper signal (<code>SIGFPE</code>). Use <samp><span class="option">-mdivide-traps</span></samp> to
allow conditional traps on architectures that support them and
<samp><span class="option">-mdivide-breaks</span></samp> to force the use of breaks.
<p>The default is usually <samp><span class="option">-mdivide-traps</span></samp>, but this can be
overridden at configure time using <samp><span class="option">--with-divide=breaks</span></samp>.
Divide-by-zero checks can be completely disabled using
<samp><span class="option">-mno-check-zero-division</span></samp>.
<br><dt><code>-mmemcpy</code><dt><code>-mno-memcpy</code><dd><a name="index-mmemcpy-1972"></a><a name="index-mno_002dmemcpy-1973"></a>Force (do not force) the use of <code>memcpy()</code> for non-trivial block
moves. The default is <samp><span class="option">-mno-memcpy</span></samp>, which allows GCC to inline
most constant-sized copies.
<br><dt><code>-mlong-calls</code><dt><code>-mno-long-calls</code><dd><a name="index-mlong_002dcalls-1974"></a><a name="index-mno_002dlong_002dcalls-1975"></a>Disable (do not disable) use of the <code>jal</code> instruction. Calling
functions using <code>jal</code> is more efficient but requires the caller
and callee to be in the same 256 megabyte segment.
<p>This option has no effect on abicalls code. The default is
<samp><span class="option">-mno-long-calls</span></samp>.
<br><dt><code>-mmad</code><dt><code>-mno-mad</code><dd><a name="index-mmad-1976"></a><a name="index-mno_002dmad-1977"></a>Enable (disable) use of the <code>mad</code>, <code>madu</code> and <code>mul</code>
instructions, as provided by the R4650 ISA.
<br><dt><code>-mimadd</code><dt><code>-mno-imadd</code><dd><a name="index-mimadd-1978"></a><a name="index-mno_002dimadd-1979"></a>Enable (disable) use of the <code>madd</code> and <code>msub</code> integer
instructions. The default is <samp><span class="option">-mimadd</span></samp> on architectures
that support <code>madd</code> and <code>msub</code> except for the 74k
architecture where it was found to generate slower code.
<br><dt><code>-mfused-madd</code><dt><code>-mno-fused-madd</code><dd><a name="index-mfused_002dmadd-1980"></a><a name="index-mno_002dfused_002dmadd-1981"></a>Enable (disable) use of the floating-point multiply-accumulate
instructions, when they are available. The default is
<samp><span class="option">-mfused-madd</span></samp>.
<p>On the R8000 CPU when multiply-accumulate instructions are used,
the intermediate product is calculated to infinite precision
and is not subject to the FCSR Flush to Zero bit. This may be
undesirable in some circumstances. On other processors the result
is numerically identical to the equivalent computation using
separate multiply, add, subtract and negate instructions.
<br><dt><code>-nocpp</code><dd><a name="index-nocpp-1982"></a>Tell the MIPS assembler to not run its preprocessor over user
assembler files (with a `<samp><span class="samp">.s</span></samp>' suffix) when assembling them.
<br><dt><code>-mfix-24k</code><br><dt><code>-mno-fix-24k</code><dd><a name="index-mfix_002d24k-1983"></a><a name="index-mno_002dfix_002d24k-1984"></a>Work around the 24K E48 (lost data on stores during refill) errata.
The workarounds are implemented by the assembler rather than by GCC.
<br><dt><code>-mfix-r4000</code><dt><code>-mno-fix-r4000</code><dd><a name="index-mfix_002dr4000-1985"></a><a name="index-mno_002dfix_002dr4000-1986"></a>Work around certain R4000 CPU errata:
<ul>
<li>A double-word or a variable shift may give an incorrect result if executed
immediately after starting an integer division.
<li>A double-word or a variable shift may give an incorrect result if executed
while an integer multiplication is in progress.
<li>An integer division may give an incorrect result if started in a delay slot
of a taken branch or a jump.
</ul>
<br><dt><code>-mfix-r4400</code><dt><code>-mno-fix-r4400</code><dd><a name="index-mfix_002dr4400-1987"></a><a name="index-mno_002dfix_002dr4400-1988"></a>Work around certain R4400 CPU errata:
<ul>
<li>A double-word or a variable shift may give an incorrect result if executed
immediately after starting an integer division.
</ul>
<br><dt><code>-mfix-r10000</code><dt><code>-mno-fix-r10000</code><dd><a name="index-mfix_002dr10000-1989"></a><a name="index-mno_002dfix_002dr10000-1990"></a>Work around certain R10000 errata:
<ul>
<li><code>ll</code>/<code>sc</code> sequences may not behave atomically on revisions
prior to 3.0. They may deadlock on revisions 2.6 and earlier.
</ul>
<p>This option can only be used if the target architecture supports
branch-likely instructions. <samp><span class="option">-mfix-r10000</span></samp> is the default when
<samp><span class="option">-march=r10000</span></samp> is used; <samp><span class="option">-mno-fix-r10000</span></samp> is the default
otherwise.
<br><dt><code>-mfix-rm7000</code><dt><code>-mno-fix-rm7000</code><dd><a name="index-mfix_002drm7000-1991"></a>Work around the RM7000 <code>dmult</code>/<code>dmultu</code> errata. The
workarounds are implemented by the assembler rather than by GCC.
<br><dt><code>-mfix-vr4120</code><dt><code>-mno-fix-vr4120</code><dd><a name="index-mfix_002dvr4120-1992"></a>Work around certain VR4120 errata:
<ul>
<li><code>dmultu</code> does not always produce the correct result.
<li><code>div</code> and <code>ddiv</code> do not always produce the correct result if one
of the operands is negative.
</ul>
The workarounds for the division errata rely on special functions in
<samp><span class="file">libgcc.a</span></samp>. At present, these functions are only provided by
the <code>mips64vr*-elf</code> configurations.
<p>Other VR4120 errata require a NOP to be inserted between certain pairs of
instructions. These errata are handled by the assembler, not by GCC itself.
<br><dt><code>-mfix-vr4130</code><dd><a name="index-mfix_002dvr4130-1993"></a>Work around the VR4130 <code>mflo</code>/<code>mfhi</code> errata. The
workarounds are implemented by the assembler rather than by GCC,
although GCC avoids using <code>mflo</code> and <code>mfhi</code> if the
VR4130 <code>macc</code>, <code>macchi</code>, <code>dmacc</code> and <code>dmacchi</code>
instructions are available instead.
<br><dt><code>-mfix-sb1</code><dt><code>-mno-fix-sb1</code><dd><a name="index-mfix_002dsb1-1994"></a>Work around certain SB-1 CPU core errata.
(This flag currently works around the SB-1 revision 2
“F1” and “F2” floating-point errata.)
<br><dt><code>-mr10k-cache-barrier=</code><var>setting</var><dd><a name="index-mr10k_002dcache_002dbarrier-1995"></a>Specify whether GCC should insert cache barriers to avoid the
side-effects of speculation on R10K processors.
<p>In common with many processors, the R10K tries to predict the outcome
of a conditional branch and speculatively executes instructions from
the “taken” branch. It later aborts these instructions if the
predicted outcome is wrong. However, on the R10K, even aborted
instructions can have side effects.
<p>This problem only affects kernel stores and, depending on the system,
kernel loads. As an example, a speculatively-executed store may load
the target memory into cache and mark the cache line as dirty, even if
the store itself is later aborted. If a DMA operation writes to the
same area of memory before the “dirty” line is flushed, the cached
data overwrites the DMA-ed data. See the R10K processor manual
for a full description, including other potential problems.
<p>One workaround is to insert cache barrier instructions before every memory
access that might be speculatively executed and that might have side
effects even if aborted. <samp><span class="option">-mr10k-cache-barrier=</span><var>setting</var></samp>
controls GCC's implementation of this workaround. It assumes that
aborted accesses to any byte in the following regions does not have
side effects:
<ol type=1 start=1>
<li>the memory occupied by the current function's stack frame;
<li>the memory occupied by an incoming stack argument;
<li>the memory occupied by an object with a link-time-constant address.
</ol>
<p>It is the kernel's responsibility to ensure that speculative
accesses to these regions are indeed safe.
<p>If the input program contains a function declaration such as:
<pre class="smallexample"> void foo (void);
</pre>
<p>then the implementation of <code>foo</code> must allow <code>j foo</code> and
<code>jal foo</code> to be executed speculatively. GCC honors this
restriction for functions it compiles itself. It expects non-GCC
functions (such as hand-written assembly code) to do the same.
<p>The option has three forms:
<dl>
<dt><code>-mr10k-cache-barrier=load-store</code><dd>Insert a cache barrier before a load or store that might be
speculatively executed and that might have side effects even
if aborted.
<br><dt><code>-mr10k-cache-barrier=store</code><dd>Insert a cache barrier before a store that might be speculatively
executed and that might have side effects even if aborted.
<br><dt><code>-mr10k-cache-barrier=none</code><dd>Disable the insertion of cache barriers. This is the default setting.
</dl>
<br><dt><code>-mflush-func=</code><var>func</var><dt><code>-mno-flush-func</code><dd><a name="index-mflush_002dfunc-1996"></a>Specifies the function to call to flush the I and D caches, or to not
call any such function. If called, the function must take the same
arguments as the common <code>_flush_func()</code>, that is, the address of the
memory range for which the cache is being flushed, the size of the
memory range, and the number 3 (to flush both caches). The default
depends on the target GCC was configured for, but commonly is either
`<samp><span class="samp">_flush_func</span></samp>' or `<samp><span class="samp">__cpu_flush</span></samp>'.
<br><dt><code>mbranch-cost=</code><var>num</var><dd><a name="index-mbranch_002dcost-1997"></a>Set the cost of branches to roughly <var>num</var> “simple” instructions.
This cost is only a heuristic and is not guaranteed to produce
consistent results across releases. A zero cost redundantly selects
the default, which is based on the <samp><span class="option">-mtune</span></samp> setting.
<br><dt><code>-mbranch-likely</code><dt><code>-mno-branch-likely</code><dd><a name="index-mbranch_002dlikely-1998"></a><a name="index-mno_002dbranch_002dlikely-1999"></a>Enable or disable use of Branch Likely instructions, regardless of the
default for the selected architecture. By default, Branch Likely
instructions may be generated if they are supported by the selected
architecture. An exception is for the MIPS32 and MIPS64 architectures
and processors that implement those architectures; for those, Branch
Likely instructions are not be generated by default because the MIPS32
and MIPS64 architectures specifically deprecate their use.
<br><dt><code>-mfp-exceptions</code><dt><code>-mno-fp-exceptions</code><dd><a name="index-mfp_002dexceptions-2000"></a>Specifies whether FP exceptions are enabled. This affects how
FP instructions are scheduled for some processors.
The default is that FP exceptions are
enabled.
<p>For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
64-bit code, then we can use both FP pipes. Otherwise, we can only use one
FP pipe.
<br><dt><code>-mvr4130-align</code><dt><code>-mno-vr4130-align</code><dd><a name="index-mvr4130_002dalign-2001"></a>The VR4130 pipeline is two-way superscalar, but can only issue two
instructions together if the first one is 8-byte aligned. When this
option is enabled, GCC aligns pairs of instructions that it
thinks should execute in parallel.
<p>This option only has an effect when optimizing for the VR4130.
It normally makes code faster, but at the expense of making it bigger.
It is enabled by default at optimization level <samp><span class="option">-O3</span></samp>.
<br><dt><code>-msynci</code><dt><code>-mno-synci</code><dd><a name="index-msynci-2002"></a>Enable (disable) generation of <code>synci</code> instructions on
architectures that support it. The <code>synci</code> instructions (if
enabled) are generated when <code>__builtin___clear_cache()</code> is
compiled.
<p>This option defaults to <code>-mno-synci</code>, but the default can be
overridden by configuring with <code>--with-synci</code>.
<p>When compiling code for single processor systems, it is generally safe
to use <code>synci</code>. However, on many multi-core (SMP) systems, it
does not invalidate the instruction caches on all cores and may lead
to undefined behavior.
<br><dt><code>-mrelax-pic-calls</code><dt><code>-mno-relax-pic-calls</code><dd><a name="index-mrelax_002dpic_002dcalls-2003"></a>Try to turn PIC calls that are normally dispatched via register
<code>$25</code> into direct calls. This is only possible if the linker can
resolve the destination at link-time and if the destination is within
range for a direct call.
<p><samp><span class="option">-mrelax-pic-calls</span></samp> is the default if GCC was configured to use
an assembler and a linker that support the <code>.reloc</code> assembly
directive and <code>-mexplicit-relocs</code> is in effect. With
<code>-mno-explicit-relocs</code>, this optimization can be performed by the
assembler and the linker alone without help from the compiler.
<br><dt><code>-mmcount-ra-address</code><dt><code>-mno-mcount-ra-address</code><dd><a name="index-mmcount_002dra_002daddress-2004"></a><a name="index-mno_002dmcount_002dra_002daddress-2005"></a>Emit (do not emit) code that allows <code>_mcount</code> to modify the
calling function's return address. When enabled, this option extends
the usual <code>_mcount</code> interface with a new <var>ra-address</var>
parameter, which has type <code>intptr_t *</code> and is passed in register
<code>$12</code>. <code>_mcount</code> can then modify the return address by
doing both of the following:
<ul>
<li>Returning the new address in register <code>$31</code>.
<li>Storing the new address in <code>*</code><var>ra-address</var>,
if <var>ra-address</var> is nonnull.
</ul>
<p>The default is <samp><span class="option">-mno-mcount-ra-address</span></samp>.
</dl>
</body></html>
| gpl-2.0 |
acassis/xap-gcc | gcc/config/xtensa/xtensa.h | 64089 | /* Definitions of Tensilica's Xtensa target machine for GNU compiler.
Copyright 2001,2002,2003 Free Software Foundation, Inc.
Contributed by Bob Wilson ([email protected]) at Tensilica.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* Get Xtensa configuration settings */
#include "xtensa/xtensa-config.h"
/* Standard GCC variables that we reference. */
extern int current_function_calls_alloca;
extern int target_flags;
extern int optimize;
/* External variables defined in xtensa.c. */
/* comparison type */
enum cmp_type {
CMP_SI, /* four byte integers */
CMP_DI, /* eight byte integers */
CMP_SF, /* single precision floats */
CMP_DF, /* double precision floats */
CMP_MAX /* max comparison type */
};
extern struct rtx_def * branch_cmp[2]; /* operands for compare */
extern enum cmp_type branch_type; /* what type of branch to use */
extern unsigned xtensa_current_frame_size;
/* Run-time compilation parameters selecting different hardware subsets. */
#define MASK_BIG_ENDIAN 0x00000001 /* big or little endian */
#define MASK_DENSITY 0x00000002 /* code density option */
#define MASK_MAC16 0x00000004 /* MAC16 option */
#define MASK_MUL16 0x00000008 /* 16-bit integer multiply */
#define MASK_MUL32 0x00000010 /* integer multiply/divide */
#define MASK_DIV32 0x00000020 /* integer multiply/divide */
#define MASK_NSA 0x00000040 /* nsa instruction option */
#define MASK_MINMAX 0x00000080 /* min/max instructions */
#define MASK_SEXT 0x00000100 /* sign extend insn option */
#define MASK_BOOLEANS 0x00000200 /* boolean register option */
#define MASK_HARD_FLOAT 0x00000400 /* floating-point option */
#define MASK_HARD_FLOAT_DIV 0x00000800 /* floating-point divide */
#define MASK_HARD_FLOAT_RECIP 0x00001000 /* floating-point reciprocal */
#define MASK_HARD_FLOAT_SQRT 0x00002000 /* floating-point sqrt */
#define MASK_HARD_FLOAT_RSQRT 0x00004000 /* floating-point recip sqrt */
#define MASK_NO_FUSED_MADD 0x00008000 /* avoid f-p mul/add */
#define MASK_SERIALIZE_VOLATILE 0x00010000 /* serialize volatile refs */
/* Macros used in the machine description to test the flags. */
#define TARGET_BIG_ENDIAN (target_flags & MASK_BIG_ENDIAN)
#define TARGET_DENSITY (target_flags & MASK_DENSITY)
#define TARGET_MAC16 (target_flags & MASK_MAC16)
#define TARGET_MUL16 (target_flags & MASK_MUL16)
#define TARGET_MUL32 (target_flags & MASK_MUL32)
#define TARGET_DIV32 (target_flags & MASK_DIV32)
#define TARGET_NSA (target_flags & MASK_NSA)
#define TARGET_MINMAX (target_flags & MASK_MINMAX)
#define TARGET_SEXT (target_flags & MASK_SEXT)
#define TARGET_BOOLEANS (target_flags & MASK_BOOLEANS)
#define TARGET_HARD_FLOAT (target_flags & MASK_HARD_FLOAT)
#define TARGET_HARD_FLOAT_DIV (target_flags & MASK_HARD_FLOAT_DIV)
#define TARGET_HARD_FLOAT_RECIP (target_flags & MASK_HARD_FLOAT_RECIP)
#define TARGET_HARD_FLOAT_SQRT (target_flags & MASK_HARD_FLOAT_SQRT)
#define TARGET_HARD_FLOAT_RSQRT (target_flags & MASK_HARD_FLOAT_RSQRT)
#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD)
#define TARGET_SERIALIZE_VOLATILE (target_flags & MASK_SERIALIZE_VOLATILE)
/* Default target_flags if no switches are specified */
#define TARGET_DEFAULT ( \
(XCHAL_HAVE_BE ? MASK_BIG_ENDIAN : 0) | \
(XCHAL_HAVE_DENSITY ? MASK_DENSITY : 0) | \
(XCHAL_HAVE_MAC16 ? MASK_MAC16 : 0) | \
(XCHAL_HAVE_MUL16 ? MASK_MUL16 : 0) | \
(XCHAL_HAVE_MUL32 ? MASK_MUL32 : 0) | \
(XCHAL_HAVE_DIV32 ? MASK_DIV32 : 0) | \
(XCHAL_HAVE_NSA ? MASK_NSA : 0) | \
(XCHAL_HAVE_MINMAX ? MASK_MINMAX : 0) | \
(XCHAL_HAVE_SEXT ? MASK_SEXT : 0) | \
(XCHAL_HAVE_BOOLEANS ? MASK_BOOLEANS : 0) | \
(XCHAL_HAVE_FP ? MASK_HARD_FLOAT : 0) | \
(XCHAL_HAVE_FP_DIV ? MASK_HARD_FLOAT_DIV : 0) | \
(XCHAL_HAVE_FP_RECIP ? MASK_HARD_FLOAT_RECIP : 0) | \
(XCHAL_HAVE_FP_SQRT ? MASK_HARD_FLOAT_SQRT : 0) | \
(XCHAL_HAVE_FP_RSQRT ? MASK_HARD_FLOAT_RSQRT : 0) | \
MASK_SERIALIZE_VOLATILE)
/* Macro to define tables used to set the flags. */
#define TARGET_SWITCHES \
{ \
{"big-endian", MASK_BIG_ENDIAN, \
N_("Use big-endian byte order")}, \
{"little-endian", -MASK_BIG_ENDIAN, \
N_("Use little-endian byte order")}, \
{"density", MASK_DENSITY, \
N_("Use the Xtensa code density option")}, \
{"no-density", -MASK_DENSITY, \
N_("Do not use the Xtensa code density option")}, \
{"mac16", MASK_MAC16, \
N_("Use the Xtensa MAC16 option")}, \
{"no-mac16", -MASK_MAC16, \
N_("Do not use the Xtensa MAC16 option")}, \
{"mul16", MASK_MUL16, \
N_("Use the Xtensa MUL16 option")}, \
{"no-mul16", -MASK_MUL16, \
N_("Do not use the Xtensa MUL16 option")}, \
{"mul32", MASK_MUL32, \
N_("Use the Xtensa MUL32 option")}, \
{"no-mul32", -MASK_MUL32, \
N_("Do not use the Xtensa MUL32 option")}, \
{"div32", MASK_DIV32, \
0 /* undocumented */}, \
{"no-div32", -MASK_DIV32, \
0 /* undocumented */}, \
{"nsa", MASK_NSA, \
N_("Use the Xtensa NSA option")}, \
{"no-nsa", -MASK_NSA, \
N_("Do not use the Xtensa NSA option")}, \
{"minmax", MASK_MINMAX, \
N_("Use the Xtensa MIN/MAX option")}, \
{"no-minmax", -MASK_MINMAX, \
N_("Do not use the Xtensa MIN/MAX option")}, \
{"sext", MASK_SEXT, \
N_("Use the Xtensa SEXT option")}, \
{"no-sext", -MASK_SEXT, \
N_("Do not use the Xtensa SEXT option")}, \
{"booleans", MASK_BOOLEANS, \
N_("Use the Xtensa boolean register option")}, \
{"no-booleans", -MASK_BOOLEANS, \
N_("Do not use the Xtensa boolean register option")}, \
{"hard-float", MASK_HARD_FLOAT, \
N_("Use the Xtensa floating-point unit")}, \
{"soft-float", -MASK_HARD_FLOAT, \
N_("Do not use the Xtensa floating-point unit")}, \
{"hard-float-div", MASK_HARD_FLOAT_DIV, \
0 /* undocumented */}, \
{"no-hard-float-div", -MASK_HARD_FLOAT_DIV, \
0 /* undocumented */}, \
{"hard-float-recip", MASK_HARD_FLOAT_RECIP, \
0 /* undocumented */}, \
{"no-hard-float-recip", -MASK_HARD_FLOAT_RECIP, \
0 /* undocumented */}, \
{"hard-float-sqrt", MASK_HARD_FLOAT_SQRT, \
0 /* undocumented */}, \
{"no-hard-float-sqrt", -MASK_HARD_FLOAT_SQRT, \
0 /* undocumented */}, \
{"hard-float-rsqrt", MASK_HARD_FLOAT_RSQRT, \
0 /* undocumented */}, \
{"no-hard-float-rsqrt", -MASK_HARD_FLOAT_RSQRT, \
0 /* undocumented */}, \
{"no-fused-madd", MASK_NO_FUSED_MADD, \
N_("Disable fused multiply/add and multiply/subtract FP instructions")}, \
{"fused-madd", -MASK_NO_FUSED_MADD, \
N_("Enable fused multiply/add and multiply/subtract FP instructions")}, \
{"serialize-volatile", MASK_SERIALIZE_VOLATILE, \
N_("Serialize volatile memory references with MEMW instructions")}, \
{"no-serialize-volatile", -MASK_SERIALIZE_VOLATILE, \
N_("Do not serialize volatile memory references with MEMW instructions")},\
{"text-section-literals", 0, \
N_("Intersperse literal pools with code in the text section")}, \
{"no-text-section-literals", 0, \
N_("Put literal pools in a separate literal section")}, \
{"target-align", 0, \
N_("Automatically align branch targets to reduce branch penalties")}, \
{"no-target-align", 0, \
N_("Do not automatically align branch targets")}, \
{"longcalls", 0, \
N_("Use indirect CALLXn instructions for large programs")}, \
{"no-longcalls", 0, \
N_("Use direct CALLn instructions for fast calls")}, \
{"", TARGET_DEFAULT, 0} \
}
#define OVERRIDE_OPTIONS override_options ()
/* Target CPU builtins. */
#define TARGET_CPU_CPP_BUILTINS() \
do { \
builtin_assert ("cpu=xtensa"); \
builtin_assert ("machine=xtensa"); \
builtin_define ("__XTENSA__"); \
builtin_define (TARGET_BIG_ENDIAN ? "__XTENSA_EB__" : "__XTENSA_EL__"); \
if (!TARGET_HARD_FLOAT) \
builtin_define ("__XTENSA_SOFT_FLOAT__"); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
builtin_define ("__pic__"); \
} \
} while (0)
#define CPP_SPEC " %(subtarget_cpp_spec) "
#ifndef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC ""
#endif
#define EXTRA_SPECS \
{ "subtarget_cpp_spec", SUBTARGET_CPP_SPEC },
/* Define this to set the endianness to use in libgcc2.c, which can
not depend on target_flags. */
#define LIBGCC2_WORDS_BIG_ENDIAN XCHAL_HAVE_BE
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
/* Target machine storage layout */
/* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields. */
#define BITS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
/* Define this if most significant byte of a word is the lowest numbered. */
#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
/* Define this if most significant word of a multiword number is the lowest. */
#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
#define MAX_BITS_PER_WORD 32
/* Width of a word, in units (bytes). */
#define UNITS_PER_WORD 4
#define MIN_UNITS_PER_WORD 4
/* Width of a floating point register. */
#define UNITS_PER_FPREG 4
/* Size in bits of various types on the target machine. */
#define INT_TYPE_SIZE 32
#define SHORT_TYPE_SIZE 16
#define LONG_TYPE_SIZE 32
#define MAX_LONG_TYPE_SIZE 32
#define LONG_LONG_TYPE_SIZE 64
#define FLOAT_TYPE_SIZE 32
#define DOUBLE_TYPE_SIZE 64
#define LONG_DOUBLE_TYPE_SIZE 64
/* Allocation boundary (in *bits*) for storing pointers in memory. */
#define POINTER_BOUNDARY 32
/* Allocation boundary (in *bits*) for storing arguments in argument list. */
#define PARM_BOUNDARY 32
/* Allocation boundary (in *bits*) for the code of a function. */
#define FUNCTION_BOUNDARY 32
/* Alignment of field after 'int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 32
/* Every structure's size must be a multiple of this. */
#define STRUCTURE_SIZE_BOUNDARY 8
/* There is no point aligning anything to a rounder boundary than this. */
#define BIGGEST_ALIGNMENT 128
/* Set this nonzero if move instructions will actually fail to work
when given unaligned data. */
#define STRICT_ALIGNMENT 1
/* Promote integer modes smaller than a word to SImode. Set UNSIGNEDP
for QImode, because there is no 8-bit load from memory with sign
extension. Otherwise, leave UNSIGNEDP alone, since Xtensa has 16-bit
loads both with and without sign extension. */
#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
do { \
if (GET_MODE_CLASS (MODE) == MODE_INT \
&& GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
{ \
if ((MODE) == QImode) \
(UNSIGNEDP) = 1; \
(MODE) = SImode; \
} \
} while (0)
/* The promotion described by `PROMOTE_MODE' should also be done for
outgoing function arguments. */
#define PROMOTE_FUNCTION_ARGS
/* The promotion described by `PROMOTE_MODE' should also be done for
the return value of functions. Note: `FUNCTION_VALUE' must perform
the same promotions done by `PROMOTE_MODE'. */
#define PROMOTE_FUNCTION_RETURN
/* Imitate the way many other C compilers handle alignment of
bitfields and the structures that contain them. */
#define PCC_BITFIELD_TYPE_MATTERS 1
/* Align string constants and constructors to at least a word boundary.
The typical use of this macro is to increase alignment for string
constants to be word aligned so that 'strcpy' calls that copy
constants can be done inline. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
((TREE_CODE (EXP) == STRING_CST || TREE_CODE (EXP) == CONSTRUCTOR) \
&& (ALIGN) < BITS_PER_WORD \
? BITS_PER_WORD \
: (ALIGN))
/* Align arrays, unions and records to at least a word boundary.
One use of this macro is to increase alignment of medium-size
data to make it all fit in fewer cache lines. Another is to
cause character arrays to be word-aligned so that 'strcpy' calls
that copy constants to character arrays can be done inline. */
#undef DATA_ALIGNMENT
#define DATA_ALIGNMENT(TYPE, ALIGN) \
((((ALIGN) < BITS_PER_WORD) \
&& (TREE_CODE (TYPE) == ARRAY_TYPE \
|| TREE_CODE (TYPE) == UNION_TYPE \
|| TREE_CODE (TYPE) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))
/* An argument declared as 'char' or 'short' in a prototype should
actually be passed as an 'int'. */
#define PROMOTE_PROTOTYPES 1
/* Operations between registers always perform the operation
on the full register even if a narrower mode is specified. */
#define WORD_REGISTER_OPERATIONS
/* Xtensa loads are zero-extended by default. */
#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
/* Standard register usage. */
/* Number of actual hardware registers.
The hardware registers are assigned numbers for the compiler
from 0 to just below FIRST_PSEUDO_REGISTER.
All registers that the compiler knows about must be given numbers,
even those that are not normally considered general registers.
The fake frame pointer and argument pointer will never appear in
the generated code, since they will always be eliminated and replaced
by either the stack pointer or the hard frame pointer.
0 - 15 AR[0] - AR[15]
16 FRAME_POINTER (fake = initial sp)
17 ARG_POINTER (fake = initial sp + framesize)
18 BR[0] for floating-point CC
19 - 34 FR[0] - FR[15]
35 MAC16 accumulator */
#define FIRST_PSEUDO_REGISTER 36
/* Return the stabs register number to use for REGNO. */
#define DBX_REGISTER_NUMBER(REGNO) xtensa_dbx_register_number (REGNO)
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator. */
#define FIXED_REGISTERS \
{ \
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
1, 1, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, \
}
/* 1 for registers not available across function calls.
These must include the FIXED_REGISTERS and also any
registers that can be used without being saved.
The latter must include the registers where values are returned
and the register where structure-value addresses are passed.
Aside from that, you can include as many other registers as you like. */
#define CALL_USED_REGISTERS \
{ \
1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, \
}
/* For non-leaf procedures on Xtensa processors, the allocation order
is as specified below by REG_ALLOC_ORDER. For leaf procedures, we
want to use the lowest numbered registers first to minimize
register window overflows. However, local-alloc is not smart
enough to consider conflicts with incoming arguments. If an
incoming argument in a2 is live throughout the function and
local-alloc decides to use a2, then the incoming argument must
either be spilled or copied to another register. To get around
this, we define ORDER_REGS_FOR_LOCAL_ALLOC to redefine
reg_alloc_order for leaf functions such that lowest numbered
registers are used first with the exception that the incoming
argument registers are not used until after other register choices
have been exhausted. */
#define REG_ALLOC_ORDER \
{ 8, 9, 10, 11, 12, 13, 14, 15, 7, 6, 5, 4, 3, 2, \
18, \
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, \
0, 1, 16, 17, \
35, \
}
#define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
/* For Xtensa, the only point of this is to prevent GCC from otherwise
giving preference to call-used registers. To minimize window
overflows for the AR registers, we want to give preference to the
lower-numbered AR registers. For other register files, which are
not windowed, we still prefer call-used registers, if there are any. */
extern const char xtensa_leaf_regs[FIRST_PSEUDO_REGISTER];
#define LEAF_REGISTERS xtensa_leaf_regs
/* For Xtensa, no remapping is necessary, but this macro must be
defined if LEAF_REGISTERS is defined. */
#define LEAF_REG_REMAP(REGNO) (REGNO)
/* this must be declared if LEAF_REGISTERS is set */
extern int leaf_function;
/* Internal macros to classify a register number. */
/* 16 address registers + fake registers */
#define GP_REG_FIRST 0
#define GP_REG_LAST 17
#define GP_REG_NUM (GP_REG_LAST - GP_REG_FIRST + 1)
/* Coprocessor registers */
#define BR_REG_FIRST 18
#define BR_REG_LAST 18
#define BR_REG_NUM (BR_REG_LAST - BR_REG_FIRST + 1)
/* 16 floating-point registers */
#define FP_REG_FIRST 19
#define FP_REG_LAST 34
#define FP_REG_NUM (FP_REG_LAST - FP_REG_FIRST + 1)
/* MAC16 accumulator */
#define ACC_REG_FIRST 35
#define ACC_REG_LAST 35
#define ACC_REG_NUM (ACC_REG_LAST - ACC_REG_FIRST + 1)
#define GP_REG_P(REGNO) ((unsigned) ((REGNO) - GP_REG_FIRST) < GP_REG_NUM)
#define BR_REG_P(REGNO) ((unsigned) ((REGNO) - BR_REG_FIRST) < BR_REG_NUM)
#define FP_REG_P(REGNO) ((unsigned) ((REGNO) - FP_REG_FIRST) < FP_REG_NUM)
#define ACC_REG_P(REGNO) ((unsigned) ((REGNO) - ACC_REG_FIRST) < ACC_REG_NUM)
/* Return number of consecutive hard regs needed starting at reg REGNO
to hold something of mode MODE. */
#define HARD_REGNO_NREGS(REGNO, MODE) \
(FP_REG_P (REGNO) ? \
((GET_MODE_SIZE (MODE) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG) : \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
/* Value is 1 if hard register REGNO can hold a value of machine-mode
MODE. */
extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
xtensa_hard_regno_mode_ok[(int) (MODE)][(REGNO)]
/* Value is 1 if it is a good idea to tie two pseudo registers
when one has mode MODE1 and one has mode MODE2.
If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
for any hard reg, then this must be 0 for correct output. */
#define MODES_TIEABLE_P(MODE1, MODE2) \
((GET_MODE_CLASS (MODE1) == MODE_FLOAT || \
GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \
== (GET_MODE_CLASS (MODE2) == MODE_FLOAT || \
GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT))
/* Register to use for pushing function arguments. */
#define STACK_POINTER_REGNUM (GP_REG_FIRST + 1)
/* Base register for access to local variables of the function. */
#define HARD_FRAME_POINTER_REGNUM (GP_REG_FIRST + 7)
/* The register number of the frame pointer register, which is used to
access automatic variables in the stack frame. For Xtensa, this
register never appears in the output. It is always eliminated to
either the stack pointer or the hard frame pointer. */
#define FRAME_POINTER_REGNUM (GP_REG_FIRST + 16)
/* Value should be nonzero if functions must have frame pointers.
Zero means the frame pointer need not be set up (and parms
may be accessed via the stack pointer) in functions that seem suitable.
This is computed in 'reload', in reload1.c. */
#define FRAME_POINTER_REQUIRED xtensa_frame_pointer_required ()
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM (GP_REG_FIRST + 17)
/* If the static chain is passed in memory, these macros provide rtx
giving 'mem' expressions that denote where they are stored.
'STATIC_CHAIN' and 'STATIC_CHAIN_INCOMING' give the locations as
seen by the calling and called functions, respectively. */
#define STATIC_CHAIN \
gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -5 * UNITS_PER_WORD))
#define STATIC_CHAIN_INCOMING \
gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -5 * UNITS_PER_WORD))
/* For now we don't try to use the full set of boolean registers. Without
software pipelining of FP operations, there's not much to gain and it's
a real pain to get them reloaded. */
#define FPCC_REGNUM (BR_REG_FIRST + 0)
/* Pass structure value address as an "invisible" first argument. */
#define STRUCT_VALUE 0
/* It is as good or better to call a constant function address than to
call an address kept in a register. */
#define NO_FUNCTION_CSE 1
/* It is as good or better for a function to call itself with an
explicit address than to call an address kept in a register. */
#define NO_RECURSIVE_FUNCTION_CSE 1
/* Xtensa processors have "register windows". GCC does not currently
take advantage of the possibility for variable-sized windows; instead,
we use a fixed window size of 8. */
#define INCOMING_REGNO(OUT) \
((GP_REG_P (OUT) && \
((unsigned) ((OUT) - GP_REG_FIRST) >= WINDOW_SIZE)) ? \
(OUT) - WINDOW_SIZE : (OUT))
#define OUTGOING_REGNO(IN) \
((GP_REG_P (IN) && \
((unsigned) ((IN) - GP_REG_FIRST) < WINDOW_SIZE)) ? \
(IN) + WINDOW_SIZE : (IN))
/* Define the classes of registers for register constraints in the
machine description. */
enum reg_class
{
NO_REGS, /* no registers in set */
BR_REGS, /* coprocessor boolean registers */
FP_REGS, /* floating point registers */
ACC_REG, /* MAC16 accumulator */
SP_REG, /* sp register (aka a1) */
RL_REGS, /* preferred reload regs (not sp or fp) */
GR_REGS, /* integer registers except sp */
AR_REGS, /* all integer registers */
ALL_REGS, /* all registers */
LIM_REG_CLASSES /* max value + 1 */
};
#define N_REG_CLASSES (int) LIM_REG_CLASSES
#define GENERAL_REGS AR_REGS
/* An initializer containing the names of the register classes as C
string constants. These names are used in writing some of the
debugging dumps. */
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
"BR_REGS", \
"FP_REGS", \
"ACC_REG", \
"SP_REG", \
"RL_REGS", \
"GR_REGS", \
"AR_REGS", \
"ALL_REGS" \
}
/* Contents of the register classes. The Nth integer specifies the
contents of class N. The way the integer MASK is interpreted is
that register R is in the class if 'MASK & (1 << R)' is 1. */
#define REG_CLASS_CONTENTS \
{ \
{ 0x00000000, 0x00000000 }, /* no registers */ \
{ 0x00040000, 0x00000000 }, /* coprocessor boolean registers */ \
{ 0xfff80000, 0x00000007 }, /* floating-point registers */ \
{ 0x00000000, 0x00000008 }, /* MAC16 accumulator */ \
{ 0x00000002, 0x00000000 }, /* stack pointer register */ \
{ 0x0000ff7d, 0x00000000 }, /* preferred reload registers */ \
{ 0x0000fffd, 0x00000000 }, /* general-purpose registers */ \
{ 0x0003ffff, 0x00000000 }, /* integer registers */ \
{ 0xffffffff, 0x0000000f } /* all registers */ \
}
/* A C expression whose value is a register class containing hard
register REGNO. In general there is more that one such class;
choose a class which is "minimal", meaning that no smaller class
also contains the register. */
extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER];
#define REGNO_REG_CLASS(REGNO) xtensa_regno_to_class[ (REGNO) ]
/* Use the Xtensa AR register file for base registers.
No index registers. */
#define BASE_REG_CLASS AR_REGS
#define INDEX_REG_CLASS NO_REGS
/* SMALL_REGISTER_CLASSES is required for Xtensa, because all of the
16 AR registers may be explicitly used in the RTL, as either
incoming or outgoing arguments. */
#define SMALL_REGISTER_CLASSES 1
/* REGISTER AND CONSTANT CLASSES */
/* Get reg_class from a letter such as appears in the machine
description.
Available letters: a-f,h,j-l,q,t-z,A-D,W,Y-Z
DEFINED REGISTER CLASSES:
'a' general-purpose registers except sp
'q' sp (aka a1)
'D' general-purpose registers (only if density option enabled)
'd' general-purpose registers, including sp (only if density enabled)
'A' MAC16 accumulator (only if MAC16 option enabled)
'B' general-purpose registers (only if sext instruction enabled)
'C' general-purpose registers (only if mul16 option enabled)
'b' coprocessor boolean registers
'f' floating-point registers
*/
extern enum reg_class xtensa_char_to_class[256];
#define REG_CLASS_FROM_LETTER(C) xtensa_char_to_class[ (int) (C) ]
/* The letters I, J, K, L, M, N, O, and P in a register constraint
string can be used to stand for particular ranges of immediate
operands. This macro defines what the ranges are. C is the
letter, and VALUE is a constant value. Return 1 if VALUE is
in the range specified by C.
For Xtensa:
I = 12-bit signed immediate for movi
J = 8-bit signed immediate for addi
K = 4-bit value in (b4const U {0})
L = 4-bit value in b4constu
M = 7-bit value in simm7
N = 8-bit unsigned immediate shifted left by 8 bits for addmi
O = 4-bit value in ai4const
P = valid immediate mask value for extui */
#define CONST_OK_FOR_LETTER_P(VALUE, C) \
((C) == 'I' ? (xtensa_simm12b (VALUE)) \
: (C) == 'J' ? (xtensa_simm8 (VALUE)) \
: (C) == 'K' ? (((VALUE) == 0) || xtensa_b4const (VALUE)) \
: (C) == 'L' ? (xtensa_b4constu (VALUE)) \
: (C) == 'M' ? (xtensa_simm7 (VALUE)) \
: (C) == 'N' ? (xtensa_simm8x256 (VALUE)) \
: (C) == 'O' ? (xtensa_ai4const (VALUE)) \
: (C) == 'P' ? (xtensa_mask_immediate (VALUE)) \
: FALSE)
/* Similar, but for floating constants, and defining letters G and H.
Here VALUE is the CONST_DOUBLE rtx itself. */
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) (0)
/* Other letters can be defined in a machine-dependent fashion to
stand for particular classes of registers or other arbitrary
operand types.
R = memory that can be accessed with a 4-bit unsigned offset
S = memory where the second word can be addressed with a 4-bit offset
T = memory in a constant pool (addressable with a pc-relative load)
U = memory *NOT* in a constant pool
The offset range should not be checked here (except to distinguish
denser versions of the instructions for which more general versions
are available). Doing so leads to problems in reloading: an
argptr-relative address may become invalid when the phony argptr is
eliminated in favor of the stack pointer (the offset becomes too
large to fit in the instruction's immediate field); a reload is
generated to fix this but the RTL is not immediately updated; in
the meantime, the constraints are checked and none match. The
solution seems to be to simply skip the offset check here. The
address will be checked anyway because of the code in
GO_IF_LEGITIMATE_ADDRESS. */
#define EXTRA_CONSTRAINT(OP, CODE) \
((GET_CODE (OP) != MEM) ? \
((CODE) >= 'R' && (CODE) <= 'U' \
&& reload_in_progress && GET_CODE (OP) == REG \
&& REGNO (OP) >= FIRST_PSEUDO_REGISTER) \
: ((CODE) == 'R') ? smalloffset_mem_p (OP) \
: ((CODE) == 'S') ? smalloffset_double_mem_p (OP) \
: ((CODE) == 'T') ? constantpool_mem_p (OP) \
: ((CODE) == 'U') ? !constantpool_mem_p (OP) \
: FALSE)
#define PREFERRED_RELOAD_CLASS(X, CLASS) \
xtensa_preferred_reload_class (X, CLASS, 0)
#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \
xtensa_preferred_reload_class (X, CLASS, 1)
#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
xtensa_secondary_reload_class (CLASS, MODE, X, 0)
#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
xtensa_secondary_reload_class (CLASS, MODE, X, 1)
/* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS. */
#define CLASS_UNITS(mode, size) \
((GET_MODE_SIZE (mode) + (size) - 1) / (size))
#define CLASS_MAX_NREGS(CLASS, MODE) \
(CLASS_UNITS (MODE, UNITS_PER_WORD))
/* Stack layout; function entry, exit and calling. */
#define STACK_GROWS_DOWNWARD
/* Offset within stack frame to start allocating local variables at. */
#define STARTING_FRAME_OFFSET \
current_function_outgoing_args_size
/* The ARG_POINTER and FRAME_POINTER are not real Xtensa registers, so
they are eliminated to either the stack pointer or hard frame pointer. */
#define ELIMINABLE_REGS \
{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
#define CAN_ELIMINATE(FROM, TO) 1
/* Specify the initial difference between the specified pair of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
do { \
compute_frame_size (get_frame_size ()); \
if ((FROM) == FRAME_POINTER_REGNUM) \
(OFFSET) = 0; \
else if ((FROM) == ARG_POINTER_REGNUM) \
(OFFSET) = xtensa_current_frame_size; \
else \
abort (); \
} while (0)
/* If defined, the maximum amount of space required for outgoing
arguments will be computed and placed into the variable
'current_function_outgoing_args_size'. No space will be pushed
onto the stack for each call; instead, the function prologue
should increase the stack frame size by this amount. */
#define ACCUMULATE_OUTGOING_ARGS 1
/* Offset from the argument pointer register to the first argument's
address. On some machines it may depend on the data type of the
function. If 'ARGS_GROW_DOWNWARD', this is the offset to the
location above the first argument's address. */
#define FIRST_PARM_OFFSET(FNDECL) 0
/* Align stack frames on 128 bits for Xtensa. This is necessary for
128-bit datatypes defined in TIE (e.g., for Vectra). */
#define STACK_BOUNDARY 128
/* Functions do not pop arguments off the stack. */
#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
/* Use a fixed register window size of 8. */
#define WINDOW_SIZE 8
/* Symbolic macros for the registers used to return integer, floating
point, and values of coprocessor and user-defined modes. */
#define GP_RETURN (GP_REG_FIRST + 2 + WINDOW_SIZE)
#define GP_OUTGOING_RETURN (GP_REG_FIRST + 2)
/* Symbolic macros for the first/last argument registers. */
#define GP_ARG_FIRST (GP_REG_FIRST + 2)
#define GP_ARG_LAST (GP_REG_FIRST + 7)
#define GP_OUTGOING_ARG_FIRST (GP_REG_FIRST + 2 + WINDOW_SIZE)
#define GP_OUTGOING_ARG_LAST (GP_REG_FIRST + 7 + WINDOW_SIZE)
#define MAX_ARGS_IN_REGISTERS 6
/* Don't worry about compatibility with PCC. */
#define DEFAULT_PCC_STRUCT_RETURN 0
/* For Xtensa, up to 4 words can be returned in registers. (It would
have been nice to allow up to 6 words in registers but GCC cannot
support that. The return value must be given one of the standard
MODE_INT modes, and there is no 6 word mode. Instead, if we try to
return a 6 word structure, GCC selects the next biggest mode
(OImode, 8 words) and then the register allocator fails because
there is no 8-register group beginning with a10.) */
#define RETURN_IN_MEMORY(TYPE) \
((unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) > 4 * UNITS_PER_WORD)
/* Define how to find the value returned by a library function
assuming the value has mode MODE. Because we have defined
PROMOTE_FUNCTION_RETURN, we have to perform the same promotions as
PROMOTE_MODE. */
#define XTENSA_LIBCALL_VALUE(MODE, OUTGOINGP) \
gen_rtx_REG ((GET_MODE_CLASS (MODE) == MODE_INT \
&& GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
? SImode : (MODE), \
OUTGOINGP ? GP_OUTGOING_RETURN : GP_RETURN)
#define LIBCALL_VALUE(MODE) \
XTENSA_LIBCALL_VALUE ((MODE), 0)
#define LIBCALL_OUTGOING_VALUE(MODE) \
XTENSA_LIBCALL_VALUE ((MODE), 1)
/* Define how to find the value returned by a function.
VALTYPE is the data type of the value (as a tree).
If the precise function being called is known, FUNC is its FUNCTION_DECL;
otherwise, FUNC is 0. */
#define XTENSA_FUNCTION_VALUE(VALTYPE, FUNC, OUTGOINGP) \
gen_rtx_REG ((INTEGRAL_TYPE_P (VALTYPE) \
&& TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \
? SImode: TYPE_MODE (VALTYPE), \
OUTGOINGP ? GP_OUTGOING_RETURN : GP_RETURN)
#define FUNCTION_VALUE(VALTYPE, FUNC) \
XTENSA_FUNCTION_VALUE (VALTYPE, FUNC, 0)
#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
XTENSA_FUNCTION_VALUE (VALTYPE, FUNC, 1)
/* A C expression that is nonzero if REGNO is the number of a hard
register in which the values of called function may come back. A
register whose use for returning values is limited to serving as
the second of a pair (for a value of type 'double', say) need not
be recognized by this macro. If the machine has register windows,
so that the caller and the called function use different registers
for the return value, this macro should recognize only the caller's
register numbers. */
#define FUNCTION_VALUE_REGNO_P(N) \
((N) == GP_RETURN)
/* A C expression that is nonzero if REGNO is the number of a hard
register in which function arguments are sometimes passed. This
does *not* include implicit arguments such as the static chain and
the structure-value address. On many machines, no registers can be
used for this purpose since all function arguments are pushed on
the stack. */
#define FUNCTION_ARG_REGNO_P(N) \
((N) >= GP_OUTGOING_ARG_FIRST && (N) <= GP_OUTGOING_ARG_LAST)
/* Define a data type for recording info about an argument list
during the scan of that argument list. This data type should
hold all necessary information about the function itself
and about the args processed so far, enough to enable macros
such as FUNCTION_ARG to determine where the next arg should go. */
typedef struct xtensa_args {
int arg_words; /* # total words the arguments take */
} CUMULATIVE_ARGS;
/* Initialize a variable CUM of type CUMULATIVE_ARGS
for a call to a function whose data type is FNTYPE.
For a library call, FNTYPE is 0. */
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
init_cumulative_args (&CUM, FNTYPE, LIBNAME)
#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
init_cumulative_args (&CUM, FNTYPE, LIBNAME)
/* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE.
(TYPE is null for libcalls where that information may not be available.) */
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
function_arg_advance (&CUM, MODE, TYPE)
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, FALSE)
#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, TRUE)
/* Arguments are never passed partly in memory and partly in registers. */
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) (0)
/* Specify function argument alignment. */
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
((TYPE) != 0 \
? (TYPE_ALIGN (TYPE) <= PARM_BOUNDARY \
? PARM_BOUNDARY \
: TYPE_ALIGN (TYPE)) \
: (GET_MODE_ALIGNMENT (MODE) <= PARM_BOUNDARY \
? PARM_BOUNDARY \
: GET_MODE_ALIGNMENT (MODE)))
/* Nonzero if we do not know how to pass TYPE solely in registers.
We cannot do so in the following cases:
- if the type has variable size
- if the type is marked as addressable (it is required to be constructed
into the stack)
This differs from the default in that it does not check if the padding
and mode of the type are such that a copy into a register would put it
into the wrong part of the register. */
#define MUST_PASS_IN_STACK(MODE, TYPE) \
((TYPE) != 0 \
&& (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
|| TREE_ADDRESSABLE (TYPE)))
/* Profiling Xtensa code is typically done with the built-in profiling
feature of Tensilica's instruction set simulator, which does not
require any compiler support. Profiling code on a real (i.e.,
non-simulated) Xtensa processor is currently only supported by
GNU/Linux with glibc. The glibc version of _mcount doesn't require
counter variables. The _mcount function needs the current PC and
the current return address to identify an arc in the call graph.
Pass the current return address as the first argument; the current
PC is available as a0 in _mcount's register window. Both of these
values contain window size information in the two most significant
bits; we assume that _mcount will mask off those bits. The call to
_mcount uses a window size of 8 to make sure that it doesn't clobber
any incoming argument values. */
#define NO_PROFILE_COUNTERS
#define FUNCTION_PROFILER(FILE, LABELNO) \
do { \
fprintf (FILE, "\t%s\ta10, a0\n", TARGET_DENSITY ? "mov.n" : "mov"); \
if (flag_pic) \
{ \
fprintf (FILE, "\tmovi\ta8, _mcount@PLT\n"); \
fprintf (FILE, "\tcallx8\ta8\n"); \
} \
else \
fprintf (FILE, "\tcall8\t_mcount\n"); \
} while (0)
/* Stack pointer value doesn't matter at exit. */
#define EXIT_IGNORE_STACK 1
/* A C statement to output, on the stream FILE, assembler code for a
block of data that contains the constant parts of a trampoline.
This code should not include a label--the label is taken care of
automatically.
For Xtensa, the trampoline must perform an entry instruction with a
minimal stack frame in order to get some free registers. Once the
actual call target is known, the proper stack frame size is extracted
from the entry instruction at the target and the current frame is
adjusted to match. The trampoline then transfers control to the
instruction following the entry at the target. Note: this assumes
that the target begins with an entry instruction. */
/* minimum frame = reg save area (4 words) plus static chain (1 word)
and the total number of words must be a multiple of 128 bits */
#define MIN_FRAME_SIZE (8 * UNITS_PER_WORD)
#define TRAMPOLINE_TEMPLATE(STREAM) \
do { \
fprintf (STREAM, "\t.begin no-generics\n"); \
fprintf (STREAM, "\tentry\tsp, %d\n", MIN_FRAME_SIZE); \
\
/* GCC isn't prepared to deal with data at the beginning of the \
trampoline, and the Xtensa l32r instruction requires that the \
constant pool be located before the code. We put the constant \
pool in the middle of the trampoline and jump around it. */ \
\
fprintf (STREAM, "\tj\t.Lskipconsts\n"); \
fprintf (STREAM, "\t.align\t4\n"); \
fprintf (STREAM, ".Lfnaddr:%s0\n", integer_asm_op (4, TRUE)); \
fprintf (STREAM, ".Lchainval:%s0\n", integer_asm_op (4, TRUE)); \
fprintf (STREAM, ".Lskipconsts:\n"); \
\
/* store the static chain */ \
fprintf (STREAM, "\tl32r\ta8, .Lchainval\n"); \
fprintf (STREAM, "\ts32i\ta8, sp, %d\n", \
MIN_FRAME_SIZE - (5 * UNITS_PER_WORD)); \
\
/* set the proper stack pointer value */ \
fprintf (STREAM, "\tl32r\ta8, .Lfnaddr\n"); \
fprintf (STREAM, "\tl32i\ta9, a8, 0\n"); \
fprintf (STREAM, "\textui\ta9, a9, %d, 12\n", \
TARGET_BIG_ENDIAN ? 8 : 12); \
fprintf (STREAM, "\tslli\ta9, a9, 3\n"); \
fprintf (STREAM, "\taddi\ta9, a9, %d\n", -MIN_FRAME_SIZE); \
fprintf (STREAM, "\tsub\ta9, sp, a9\n"); \
fprintf (STREAM, "\tmovsp\tsp, a9\n"); \
\
/* jump to the instruction following the entry */ \
fprintf (STREAM, "\taddi\ta8, a8, 3\n"); \
fprintf (STREAM, "\tjx\ta8\n"); \
fprintf (STREAM, "\t.end no-generics\n"); \
} while (0)
/* Size in bytes of the trampoline, as an integer. */
#define TRAMPOLINE_SIZE 49
/* Alignment required for trampolines, in bits. */
#define TRAMPOLINE_ALIGNMENT (32)
/* A C statement to initialize the variable parts of a trampoline. */
#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
do { \
rtx addr = ADDR; \
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 8)), FUNC); \
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 12)), CHAIN); \
emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__xtensa_sync_caches"), \
0, VOIDmode, 1, addr, Pmode); \
} while (0)
/* Define the `__builtin_va_list' type for the ABI. */
#define BUILD_VA_LIST_TYPE(VALIST) \
(VALIST) = xtensa_build_va_list ()
/* If defined, is a C expression that produces the machine-specific
code for a call to '__builtin_saveregs'. This code will be moved
to the very beginning of the function, before any parameter access
are made. The return value of this function should be an RTX that
contains the value to use as the return of '__builtin_saveregs'. */
#define EXPAND_BUILTIN_SAVEREGS \
xtensa_builtin_saveregs
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
xtensa_va_start (valist, nextarg)
/* Implement `va_arg'. */
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
xtensa_va_arg (valist, type)
/* If defined, a C expression that produces the machine-specific code
to setup the stack so that arbitrary frames can be accessed.
On Xtensa, a stack back-trace must always begin from the stack pointer,
so that the register overflow save area can be located. However, the
stack-walking code in GCC always begins from the hard_frame_pointer
register, not the stack pointer. The frame pointer is usually equal
to the stack pointer, but the __builtin_return_address and
__builtin_frame_address functions will not work if count > 0 and
they are called from a routine that uses alloca. These functions
are not guaranteed to work at all if count > 0 so maybe that is OK.
A nicer solution would be to allow the architecture-specific files to
specify whether to start from the stack pointer or frame pointer. That
would also allow us to skip the machine->accesses_prev_frame stuff that
we currently need to ensure that there is a frame pointer when these
builtin functions are used. */
#define SETUP_FRAME_ADDRESSES xtensa_setup_frame_addresses
/* A C expression whose value is RTL representing the address in a
stack frame where the pointer to the caller's frame is stored.
Assume that FRAMEADDR is an RTL expression for the address of the
stack frame itself.
For Xtensa, there is no easy way to get the frame pointer if it is
not equivalent to the stack pointer. Moreover, the result of this
macro is used for continuing to walk back up the stack, so it must
return the stack pointer address. Thus, there is some inconsistency
here in that __builtin_frame_address will return the frame pointer
when count == 0 and the stack pointer when count > 0. */
#define DYNAMIC_CHAIN_ADDRESS(frame) \
gen_rtx (PLUS, Pmode, frame, \
gen_rtx_CONST_INT (VOIDmode, -3 * UNITS_PER_WORD))
/* Define this if the return address of a particular stack frame is
accessed from the frame pointer of the previous stack frame. */
#define RETURN_ADDR_IN_PREVIOUS_FRAME
/* A C expression whose value is RTL representing the value of the
return address for the frame COUNT steps up from the current
frame, after the prologue. */
#define RETURN_ADDR_RTX xtensa_return_addr
/* Addressing modes, and classification of registers for them. */
/* C expressions which are nonzero if register number NUM is suitable
for use as a base or index register in operand addresses. It may
be either a suitable hard register or a pseudo register that has
been allocated such a hard register. The difference between an
index register and a base register is that the index register may
be scaled. */
#define REGNO_OK_FOR_BASE_P(NUM) \
(GP_REG_P (NUM) || GP_REG_P ((unsigned) reg_renumber[NUM]))
#define REGNO_OK_FOR_INDEX_P(NUM) 0
/* C expressions that are nonzero if X (assumed to be a `reg' RTX) is
valid for use as a base or index register. For hard registers, it
should always accept those which the hardware permits and reject
the others. Whether the macro accepts or rejects pseudo registers
must be controlled by `REG_OK_STRICT'. This usually requires two
variant definitions, of which `REG_OK_STRICT' controls the one
actually used. The difference between an index register and a base
register is that the index register may be scaled. */
#ifdef REG_OK_STRICT
#define REG_OK_FOR_INDEX_P(X) 0
#define REG_OK_FOR_BASE_P(X) \
REGNO_OK_FOR_BASE_P (REGNO (X))
#else /* !REG_OK_STRICT */
#define REG_OK_FOR_INDEX_P(X) 0
#define REG_OK_FOR_BASE_P(X) \
((REGNO (X) >= FIRST_PSEUDO_REGISTER) || (GP_REG_P (REGNO (X))))
#endif /* !REG_OK_STRICT */
/* Maximum number of registers that can appear in a valid memory address. */
#define MAX_REGS_PER_ADDRESS 1
/* Identify valid Xtensa addresses. */
#define GO_IF_LEGITIMATE_ADDRESS(MODE, ADDR, LABEL) \
do { \
rtx xinsn = (ADDR); \
\
/* allow constant pool addresses */ \
if ((MODE) != BLKmode && GET_MODE_SIZE (MODE) >= UNITS_PER_WORD \
&& constantpool_address_p (xinsn)) \
goto LABEL; \
\
while (GET_CODE (xinsn) == SUBREG) \
xinsn = SUBREG_REG (xinsn); \
\
/* allow base registers */ \
if (GET_CODE (xinsn) == REG && REG_OK_FOR_BASE_P (xinsn)) \
goto LABEL; \
\
/* check for "register + offset" addressing */ \
if (GET_CODE (xinsn) == PLUS) \
{ \
rtx xplus0 = XEXP (xinsn, 0); \
rtx xplus1 = XEXP (xinsn, 1); \
enum rtx_code code0; \
enum rtx_code code1; \
\
while (GET_CODE (xplus0) == SUBREG) \
xplus0 = SUBREG_REG (xplus0); \
code0 = GET_CODE (xplus0); \
\
while (GET_CODE (xplus1) == SUBREG) \
xplus1 = SUBREG_REG (xplus1); \
code1 = GET_CODE (xplus1); \
\
/* swap operands if necessary so the register is first */ \
if (code0 != REG && code1 == REG) \
{ \
xplus0 = XEXP (xinsn, 1); \
xplus1 = XEXP (xinsn, 0); \
code0 = GET_CODE (xplus0); \
code1 = GET_CODE (xplus1); \
} \
\
if (code0 == REG && REG_OK_FOR_BASE_P (xplus0) \
&& code1 == CONST_INT \
&& xtensa_mem_offset (INTVAL (xplus1), (MODE))) \
{ \
goto LABEL; \
} \
} \
} while (0)
/* A C expression that is 1 if the RTX X is a constant which is a
valid address. This is defined to be the same as 'CONSTANT_P (X)',
but rejecting CONST_DOUBLE. */
#define CONSTANT_ADDRESS_P(X) \
((GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
|| GET_CODE (X) == CONST_INT || GET_CODE (X) == HIGH \
|| (GET_CODE (X) == CONST)))
/* Nonzero if the constant value X is a legitimate general operand.
It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
#define LEGITIMATE_CONSTANT_P(X) 1
/* A C expression that is nonzero if X is a legitimate immediate
operand on the target machine when generating position independent
code. */
#define LEGITIMATE_PIC_OPERAND_P(X) \
((GET_CODE (X) != SYMBOL_REF || SYMBOL_REF_FLAG (X)) \
&& GET_CODE (X) != LABEL_REF \
&& GET_CODE (X) != CONST)
/* Tell GCC how to use ADDMI to generate addresses. */
#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
do { \
rtx xinsn = (X); \
if (GET_CODE (xinsn) == PLUS) \
{ \
rtx plus0 = XEXP (xinsn, 0); \
rtx plus1 = XEXP (xinsn, 1); \
\
if (GET_CODE (plus0) != REG && GET_CODE (plus1) == REG) \
{ \
plus0 = XEXP (xinsn, 1); \
plus1 = XEXP (xinsn, 0); \
} \
\
if (GET_CODE (plus0) == REG \
&& GET_CODE (plus1) == CONST_INT \
&& !xtensa_mem_offset (INTVAL (plus1), MODE) \
&& !xtensa_simm8 (INTVAL (plus1)) \
&& xtensa_mem_offset (INTVAL (plus1) & 0xff, MODE) \
&& xtensa_simm8x256 (INTVAL (plus1) & ~0xff)) \
{ \
rtx temp = gen_reg_rtx (Pmode); \
emit_insn (gen_rtx (SET, Pmode, temp, \
gen_rtx (PLUS, Pmode, plus0, \
GEN_INT (INTVAL (plus1) & ~0xff)))); \
(X) = gen_rtx (PLUS, Pmode, temp, \
GEN_INT (INTVAL (plus1) & 0xff)); \
goto WIN; \
} \
} \
} while (0)
/* Treat constant-pool references as "mode dependent" since they can
only be accessed with SImode loads. This works around a bug in the
combiner where a constant pool reference is temporarily converted
to an HImode load, which is then assumed to zero-extend based on
our definition of LOAD_EXTEND_OP. This is wrong because the high
bits of a 16-bit value in the constant pool are now sign-extended
by default. */
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
do { \
if (constantpool_address_p (ADDR)) \
goto LABEL; \
} while (0)
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
#define CASE_VECTOR_MODE (SImode)
/* Define this if the tablejump instruction expects the table
to contain offsets from the address of the table.
Do not define this if the table should contain absolute addresses. */
/* #define CASE_VECTOR_PC_RELATIVE */
/* Define this as 1 if 'char' should by default be signed; else as 0. */
#define DEFAULT_SIGNED_CHAR 0
/* Max number of bytes we can move from memory to memory
in one reasonably fast instruction. */
#define MOVE_MAX 4
#define MAX_MOVE_MAX 4
/* Prefer word-sized loads. */
#define SLOW_BYTE_ACCESS 1
/* Xtensa doesn't have any instructions that set integer values based on the
results of comparisons, but the simplification code in the combiner also
uses this macro. The value should be either 1 or -1 to enable some
optimizations in the combiner; I'm not sure which is better for us.
Since we've been using 1 for a while, it should probably stay that way for
compatibility. */
#define STORE_FLAG_VALUE 1
/* Shift instructions ignore all but the low-order few bits. */
#define SHIFT_COUNT_TRUNCATED 1
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
/* Specify the machine mode that pointers have.
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */
#define Pmode SImode
/* A function address in a call instruction is a word address (for
indexing purposes) so give the MEM rtx a words's mode. */
#define FUNCTION_MODE SImode
/* A C expression that evaluates to true if it is ok to perform a
sibling call to DECL. */
/* TODO: fix this up to allow at least some sibcalls */
#define FUNCTION_OK_FOR_SIBCALL(DECL) 0
/* Xtensa constant costs. */
#define CONST_COSTS(X, CODE, OUTER_CODE) \
case CONST_INT: \
switch (OUTER_CODE) \
{ \
case SET: \
if (xtensa_simm12b (INTVAL (X))) return 4; \
break; \
case PLUS: \
if (xtensa_simm8 (INTVAL (X))) return 0; \
if (xtensa_simm8x256 (INTVAL (X))) return 0; \
break; \
case AND: \
if (xtensa_mask_immediate (INTVAL (X))) return 0; \
break; \
case COMPARE: \
if ((INTVAL (X) == 0) || xtensa_b4const (INTVAL (X))) return 0; \
break; \
case ASHIFT: \
case ASHIFTRT: \
case LSHIFTRT: \
case ROTATE: \
case ROTATERT: \
/* no way to tell if X is the 2nd operand so be conservative */ \
default: break; \
} \
if (xtensa_simm12b (INTVAL (X))) return 5; \
return 6; \
case CONST: \
case LABEL_REF: \
case SYMBOL_REF: \
return 5; \
case CONST_DOUBLE: \
return 7;
/* Costs of various Xtensa operations. */
#define RTX_COSTS(X, CODE, OUTER_CODE) \
case MEM: \
{ \
int num_words = \
(GET_MODE_SIZE (GET_MODE (X)) > UNITS_PER_WORD) ? 2 : 1; \
if (memory_address_p (GET_MODE (X), XEXP ((X), 0))) \
return COSTS_N_INSNS (num_words); \
\
return COSTS_N_INSNS (2*num_words); \
} \
\
case FFS: \
return COSTS_N_INSNS (TARGET_NSA ? 5 : 50); \
\
case NOT: \
return COSTS_N_INSNS ((GET_MODE (X) == DImode) ? 3 : 2); \
\
case AND: \
case IOR: \
case XOR: \
if (GET_MODE (X) == DImode) return COSTS_N_INSNS (2); \
return COSTS_N_INSNS (1); \
\
case ASHIFT: \
case ASHIFTRT: \
case LSHIFTRT: \
if (GET_MODE (X) == DImode) return COSTS_N_INSNS (50); \
return COSTS_N_INSNS (1); \
\
case ABS: \
{ \
enum machine_mode xmode = GET_MODE (X); \
if (xmode == SFmode) \
return COSTS_N_INSNS (TARGET_HARD_FLOAT ? 1 : 50); \
if (xmode == DFmode) \
return COSTS_N_INSNS (50); \
return COSTS_N_INSNS (4); \
} \
\
case PLUS: \
case MINUS: \
{ \
enum machine_mode xmode = GET_MODE (X); \
if (xmode == SFmode) \
return COSTS_N_INSNS (TARGET_HARD_FLOAT ? 1 : 50); \
if (xmode == DFmode || xmode == DImode) \
return COSTS_N_INSNS (50); \
return COSTS_N_INSNS (1); \
} \
\
case NEG: \
return COSTS_N_INSNS ((GET_MODE (X) == DImode) ? 4 : 2); \
\
case MULT: \
{ \
enum machine_mode xmode = GET_MODE (X); \
if (xmode == SFmode) \
return COSTS_N_INSNS (TARGET_HARD_FLOAT ? 4 : 50); \
if (xmode == DFmode || xmode == DImode) \
return COSTS_N_INSNS (50); \
if (TARGET_MUL32) \
return COSTS_N_INSNS (4); \
if (TARGET_MAC16) \
return COSTS_N_INSNS (16); \
if (TARGET_MUL16) \
return COSTS_N_INSNS (12); \
return COSTS_N_INSNS (50); \
} \
\
case DIV: \
case MOD: \
{ \
enum machine_mode xmode = GET_MODE (X); \
if (xmode == SFmode) \
return COSTS_N_INSNS (TARGET_HARD_FLOAT_DIV ? 8 : 50); \
if (xmode == DFmode) \
return COSTS_N_INSNS (50); \
} \
/* fall through */ \
\
case UDIV: \
case UMOD: \
{ \
enum machine_mode xmode = GET_MODE (X); \
if (xmode == DImode) \
return COSTS_N_INSNS (50); \
if (TARGET_DIV32) \
return COSTS_N_INSNS (32); \
return COSTS_N_INSNS (50); \
} \
\
case SQRT: \
if (GET_MODE (X) == SFmode) \
return COSTS_N_INSNS (TARGET_HARD_FLOAT_SQRT ? 8 : 50); \
return COSTS_N_INSNS (50); \
\
case SMIN: \
case UMIN: \
case SMAX: \
case UMAX: \
return COSTS_N_INSNS (TARGET_MINMAX ? 1 : 50); \
\
case SIGN_EXTRACT: \
case SIGN_EXTEND: \
return COSTS_N_INSNS (TARGET_SEXT ? 1 : 2); \
\
case ZERO_EXTRACT: \
case ZERO_EXTEND: \
return COSTS_N_INSNS (1);
/* An expression giving the cost of an addressing mode that
contains ADDRESS. */
#define ADDRESS_COST(ADDR) 1
/* A C expression for the cost of moving data from a register in
class FROM to one in class TO. The classes are expressed using
the enumeration values such as 'GENERAL_REGS'. A value of 2 is
the default; other values are interpreted relative to that. */
#define REGISTER_MOVE_COST(MODE, FROM, TO) \
(((FROM) == (TO) && (FROM) != BR_REGS && (TO) != BR_REGS) \
? 2 \
: (reg_class_subset_p ((FROM), AR_REGS) \
&& reg_class_subset_p ((TO), AR_REGS) \
? 2 \
: (reg_class_subset_p ((FROM), AR_REGS) \
&& (TO) == ACC_REG \
? 3 \
: ((FROM) == ACC_REG \
&& reg_class_subset_p ((TO), AR_REGS) \
? 3 \
: 10))))
#define MEMORY_MOVE_COST(MODE, CLASS, IN) 4
#define BRANCH_COST 3
/* Optionally define this if you have added predicates to
'MACHINE.c'. This macro is called within an initializer of an
array of structures. The first field in the structure is the
name of a predicate and the second field is an array of rtl
codes. For each predicate, list all rtl codes that can be in
expressions matched by the predicate. The list should have a
trailing comma. */
#define PREDICATE_CODES \
{"add_operand", { REG, CONST_INT, SUBREG }}, \
{"arith_operand", { REG, CONST_INT, SUBREG }}, \
{"nonimmed_operand", { REG, SUBREG, MEM }}, \
{"mem_operand", { MEM }}, \
{"mask_operand", { REG, CONST_INT, SUBREG }}, \
{"extui_fldsz_operand", { CONST_INT }}, \
{"sext_fldsz_operand", { CONST_INT }}, \
{"lsbitnum_operand", { CONST_INT }}, \
{"fpmem_offset_operand", { CONST_INT }}, \
{"sext_operand", { REG, SUBREG, MEM }}, \
{"branch_operand", { REG, CONST_INT, SUBREG }}, \
{"ubranch_operand", { REG, CONST_INT, SUBREG }}, \
{"call_insn_operand", { CONST_INT, CONST, SYMBOL_REF, REG }}, \
{"move_operand", { REG, SUBREG, MEM, CONST_INT, CONST_DOUBLE, \
CONST, SYMBOL_REF, LABEL_REF }}, \
{"non_const_move_operand", { REG, SUBREG, MEM }}, \
{"const_float_1_operand", { CONST_DOUBLE }}, \
{"branch_operator", { EQ, NE, LT, GE }}, \
{"ubranch_operator", { LTU, GEU }}, \
{"boolean_operator", { EQ, NE }},
/* Control the assembler format that we output. */
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
#define REGISTER_NAMES \
{ \
"a0", "sp", "a2", "a3", "a4", "a5", "a6", "a7", \
"a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", \
"fp", "argp", "b0", \
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
"acc" \
}
/* If defined, a C initializer for an array of structures containing a
name and a register number. This macro defines additional names
for hard registers, thus allowing the 'asm' option in declarations
to refer to registers using alternate names. */
#define ADDITIONAL_REGISTER_NAMES \
{ \
{ "a1", 1 + GP_REG_FIRST } \
}
#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
/* Recognize machine-specific patterns that may appear within
constants. Used for PIC-specific UNSPECs. */
#define OUTPUT_ADDR_CONST_EXTRA(STREAM, X, FAIL) \
do { \
if (flag_pic && GET_CODE (X) == UNSPEC && XVECLEN ((X), 0) == 1) \
{ \
switch (XINT ((X), 1)) \
{ \
case UNSPEC_PLT: \
output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
fputs ("@PLT", (STREAM)); \
break; \
default: \
goto FAIL; \
} \
break; \
} \
else \
goto FAIL; \
} while (0)
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.global\t"
/* Declare an uninitialized external linkage data object. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
fprintf (STREAM, "%s%sL%u\n", integer_asm_op (4, TRUE), \
LOCAL_LABEL_PREFIX, VALUE)
/* This is how to output an element of a case-vector that is relative.
This is used for pc-relative code. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
do { \
fprintf (STREAM, "%s%sL%u-%sL%u\n", integer_asm_op (4, TRUE), \
LOCAL_LABEL_PREFIX, (VALUE), \
LOCAL_LABEL_PREFIX, (REL)); \
} while (0)
/* This is how to output an assembler line that says to advance the
location counter to a multiple of 2**LOG bytes. */
#define ASM_OUTPUT_ALIGN(STREAM, LOG) \
do { \
if ((LOG) != 0) \
fprintf (STREAM, "\t.align\t%d\n", 1 << (LOG)); \
} while (0)
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
/* Define this macro for the rare case where the RTL needs some sort of
machine-dependent fixup immediately before register allocation is done.
If the stack frame size is too big to fit in the immediate field of
the ENTRY instruction, we need to store the frame size in the
constant pool. However, the code in xtensa_function_prologue runs too
late to be able to add anything to the constant pool. Since the
final frame size isn't known until reload is complete, this seems
like the best place to do it.
There may also be some fixup required if there is an incoming argument
in a7 and the function requires a frame pointer. */
#define MACHINE_DEPENDENT_REORG(INSN) xtensa_reorg (INSN)
/* Define the strings to put out for each section in the object file. */
#define TEXT_SECTION_ASM_OP "\t.text"
#define DATA_SECTION_ASM_OP "\t.data"
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
/* Define output to appear before the constant pool. If the function
has been assigned to a specific ELF section, or if it goes into a
unique section, set the name of that section to be the literal
prefix. */
#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, FUNDECL, SIZE) \
do { \
tree fnsection; \
resolve_unique_section ((FUNDECL), 0, flag_function_sections); \
fnsection = DECL_SECTION_NAME (FUNDECL); \
if (fnsection != NULL_TREE) \
{ \
const char *fnsectname = TREE_STRING_POINTER (fnsection); \
fprintf (FILE, "\t.begin\tliteral_prefix %s\n", \
strcmp (fnsectname, ".text") ? fnsectname : ""); \
} \
if ((SIZE) > 0) \
{ \
function_section (FUNDECL); \
fprintf (FILE, "\t.literal_position\n"); \
} \
} while (0)
/* Define code to write out the ".end literal_prefix" directive for a
function in a special section. This is appended to the standard ELF
code for ASM_DECLARE_FUNCTION_SIZE. */
#define XTENSA_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
if (DECL_SECTION_NAME (DECL) != NULL_TREE) \
fprintf (FILE, "\t.end\tliteral_prefix\n")
/* A C statement (with or without semicolon) to output a constant in
the constant pool, if it needs special treatment. */
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, JUMPTO) \
do { \
xtensa_output_literal (FILE, X, MODE, LABELNO); \
goto JUMPTO; \
} while (0)
/* Store in OUTPUT a string (made with alloca) containing
an assembler-name for a local static variable named NAME.
LABELNO is an integer which is different for each call. */
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
do { \
(OUTPUT) = (char *) alloca (strlen (NAME) + 10); \
sprintf ((OUTPUT), "%s.%u", (NAME), (LABELNO)); \
} while (0)
/* How to start an assembler comment. */
#define ASM_COMMENT_START "#"
/* Exception handling TODO!! */
#define DWARF_UNWIND_INFO 0
| gpl-2.0 |
JoeyLeeuwinga/Firemox | src/main/java/net/sf/firemox/clickable/ability/TriggeredAbilitySet.java | 3258 | /*
* Firemox is a turn based strategy simulator
* Copyright (C) 2003-2007 Fabrice Daugan
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package net.sf.firemox.clickable.ability;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.sf.firemox.clickable.target.card.MCard;
import net.sf.firemox.event.MEventListener;
import net.sf.firemox.test.And;
import net.sf.firemox.test.InZone;
import net.sf.firemox.test.Test;
import net.sf.firemox.test.TestFactory;
import net.sf.firemox.test.TestOn;
import net.sf.firemox.token.TrueFalseAuto;
/**
* @author <a href="mailto:[email protected]">Fabrice Daugan </a>
* @since 0.93
*/
public class TriggeredAbilitySet extends TriggeredAbility {
/**
* Create a new instance of this class.
* <ul>
* Structure of InputStream : Data[size]
* <li>super [ActivatedAbility]</li>
* <li>when [Test]</li>
* </ul>
*
* @param input
* file containing this ability
* @param card
* referenced card
* @throws IOException
* if error occurred during the reading process from the specified
* input stream
*/
public TriggeredAbilitySet(InputStream input, MCard card) throws IOException {
super(input, card);
final Test when = TestFactory.readNextTest(input);
final List<MEventListener> events = new ArrayList<MEventListener>();
when.extractTriggeredEvents(events, card, And.append(new InZone(eventComing
.getIdPlace(), TestOn.THIS), when));
linkedAbilities = new ArrayList<Ability>(events.size());
for (MEventListener event : events) {
linkedAbilities.add(new NestedAbility(event));
}
}
/**
*
*/
private class NestedAbility extends TriggeredAbility {
/**
* Create a new instance of this class.
*
* @param event
*/
protected NestedAbility(MEventListener event) {
super(TriggeredAbilitySet.this, event);
this.playAsSpell = TrueFalseAuto.FALSE;
}
}
@Override
public Ability clone(MCard container) {
final Collection<Ability> linkedAbilities = new ArrayList<Ability>(
this.linkedAbilities.size());
for (Ability ability : linkedAbilities) {
linkedAbilities.add(ability.clone(container));
}
final TriggeredAbility clone = new TriggeredAbility(this, eventComing
.clone(container));
clone.playAsSpell = TrueFalseAuto.FALSE;
clone.linkedAbilities = linkedAbilities;
return clone;
}
}
| gpl-2.0 |
ysleu/RTL8685 | uClinux-dist/user/ssh/acconfig.h | 9514 | /* $Id: acconfig.h,v 1.1.1.1 2003/08/18 05:40:18 kaohj Exp $ */
#ifndef _CONFIG_H
#define _CONFIG_H
/* Generated automatically from acconfig.h by autoheader. */
/* Please make your changes there */
@TOP@
/* Define to a Set Process Title type if your system is */
/* supported by bsd-setproctitle.c */
#undef SPT_TYPE
/* setgroups() NOOP allowed */
#undef SETGROUPS_NOOP
/* SCO workaround */
#undef BROKEN_SYS_TERMIO_H
/* Define if you have SecureWare-based protected password database */
#undef HAVE_SECUREWARE
/* If your header files don't define LOGIN_PROGRAM, then use this (detected) */
/* from environment and PATH */
#undef LOGIN_PROGRAM_FALLBACK
/* Define if your password has a pw_class field */
#undef HAVE_PW_CLASS_IN_PASSWD
/* Define if your password has a pw_expire field */
#undef HAVE_PW_EXPIRE_IN_PASSWD
/* Define if your password has a pw_change field */
#undef HAVE_PW_CHANGE_IN_PASSWD
/* Define if your system uses access rights style file descriptor passing */
#undef HAVE_ACCRIGHTS_IN_MSGHDR
/* Define if your system uses ancillary data style file descriptor passing */
#undef HAVE_CONTROL_IN_MSGHDR
/* Define if you system's inet_ntoa is busted (e.g. Irix gcc issue) */
#undef BROKEN_INET_NTOA
/* Define if your system defines sys_errlist[] */
#undef HAVE_SYS_ERRLIST
/* Define if your system defines sys_nerr */
#undef HAVE_SYS_NERR
/* Define if your system choked on IP TOS setting */
#undef IP_TOS_IS_BROKEN
/* Define if you have the getuserattr function. */
#undef HAVE_GETUSERATTR
/* Work around problematic Linux PAM modules handling of PAM_TTY */
#undef PAM_TTY_KLUDGE
/* Use PIPES instead of a socketpair() */
#define USE_PIPES 1
/* Define if your snprintf is busted */
#undef BROKEN_SNPRINTF
/* Define if you are on Cygwin */
#undef HAVE_CYGWIN
/* Define if you have a broken realpath. */
#undef BROKEN_REALPATH
/* Define if you are on NeXT */
#undef HAVE_NEXT
/* Define if you are on NEWS-OS */
#undef HAVE_NEWS4
/* Define if you want to enable PAM support */
#undef USE_PAM
/* Define if you want to enable AIX4's authenticate function */
#undef WITH_AIXAUTHENTICATE
/* Define if you have/want arrays (cluster-wide session managment, not C arrays) */
#undef WITH_IRIX_ARRAY
/* Define if you want IRIX project management */
#undef WITH_IRIX_PROJECT
/* Define if you want IRIX audit trails */
#undef WITH_IRIX_AUDIT
/* Define if you want IRIX kernel jobs */
#undef WITH_IRIX_JOBS
/* Location of PRNGD/EGD random number socket */
#undef PRNGD_SOCKET
/* Port number of PRNGD/EGD random number socket */
#undef PRNGD_PORT
/* Builtin PRNG command timeout */
#undef ENTROPY_TIMEOUT_MSEC
/* non-privileged user for privilege separation */
#undef SSH_PRIVSEP_USER
/* Define if you want to install preformatted manpages.*/
#undef MANTYPE
/* Define if your ssl headers are included with #include <openssl/header.h> */
#undef HAVE_OPENSSL
/* Define if you are linking against RSAref. Used only to print the right
* message at run-time. */
#undef RSAREF
/* struct timeval */
#undef HAVE_STRUCT_TIMEVAL
/* struct utmp and struct utmpx fields */
#undef HAVE_HOST_IN_UTMP
#undef HAVE_HOST_IN_UTMPX
#undef HAVE_ADDR_IN_UTMP
#undef HAVE_ADDR_IN_UTMPX
#undef HAVE_ADDR_V6_IN_UTMP
#undef HAVE_ADDR_V6_IN_UTMPX
#undef HAVE_SYSLEN_IN_UTMPX
#undef HAVE_PID_IN_UTMP
#undef HAVE_TYPE_IN_UTMP
#undef HAVE_TYPE_IN_UTMPX
#undef HAVE_TV_IN_UTMP
#undef HAVE_TV_IN_UTMPX
#undef HAVE_ID_IN_UTMP
#undef HAVE_ID_IN_UTMPX
#undef HAVE_EXIT_IN_UTMP
#undef HAVE_TIME_IN_UTMP
#undef HAVE_TIME_IN_UTMPX
/* Define if you don't want to use your system's login() call */
#undef DISABLE_LOGIN
/* Define if you don't want to use pututline() etc. to write [uw]tmp */
#undef DISABLE_PUTUTLINE
/* Define if you don't want to use pututxline() etc. to write [uw]tmpx */
#undef DISABLE_PUTUTXLINE
/* Define if you don't want to use lastlog */
#undef DISABLE_LASTLOG
/* Define if you don't want to use lastlog in session.c */
#undef NO_SSH_LASTLOG
/* Define if you don't want to use utmp */
#undef DISABLE_UTMP
/* Define if you don't want to use utmpx */
#undef DISABLE_UTMPX
/* Define if you don't want to use wtmp */
#undef DISABLE_WTMP
/* Define if you don't want to use wtmpx */
#undef DISABLE_WTMPX
/* Some systems need a utmpx entry for /bin/login to work */
#undef LOGIN_NEEDS_UTMPX
/* Some versions of /bin/login need the TERM supplied on the commandline */
#undef LOGIN_NEEDS_TERM
/* Define if your login program cannot handle end of options ("--") */
#undef LOGIN_NO_ENDOPT
/* Define if you want to specify the path to your lastlog file */
#undef CONF_LASTLOG_FILE
/* Define if you want to specify the path to your utmp file */
#undef CONF_UTMP_FILE
/* Define if you want to specify the path to your wtmp file */
#undef CONF_WTMP_FILE
/* Define if you want to specify the path to your utmpx file */
#undef CONF_UTMPX_FILE
/* Define if you want to specify the path to your wtmpx file */
#undef CONF_WTMPX_FILE
/* Define if you want external askpass support */
#undef USE_EXTERNAL_ASKPASS
/* Define if libc defines __progname */
#undef HAVE___PROGNAME
/* Define if compiler implements __FUNCTION__ */
#undef HAVE___FUNCTION__
/* Define if compiler implements __func__ */
#undef HAVE___func__
/* Define if you want Kerberos 5 support */
#undef KRB5
/* Define this if you are using the Heimdal version of Kerberos V5 */
#undef HEIMDAL
/* Define if you want Kerberos 4 support */
#undef KRB4
/* Define if you want AFS support */
#undef AFS
/* Define if you want S/Key support */
#undef SKEY
/* Define if you want TCP Wrappers support */
#undef LIBWRAP
/* Define if your libraries define login() */
#undef HAVE_LOGIN
/* Define if your libraries define daemon() */
#undef HAVE_DAEMON
/* Define if your libraries define getpagesize() */
#undef HAVE_GETPAGESIZE
/* Define if xauth is found in your path */
#undef XAUTH_PATH
/* Define if you want to allow MD5 passwords */
#undef HAVE_MD5_PASSWORDS
/* Define if you want to disable shadow passwords */
#undef DISABLE_SHADOW
/* Define if you want to use shadow password expire field */
#undef HAS_SHADOW_EXPIRE
/* Define if you have Digital Unix Security Integration Architecture */
#undef HAVE_OSF_SIA
/* Define if you have getpwanam(3) [SunOS 4.x] */
#undef HAVE_GETPWANAM
/* Define if you have an old version of PAM which takes only one argument */
/* to pam_strerror */
#undef HAVE_OLD_PAM
/* Define if you are using Solaris-derived PAM which passes pam_messages */
/* to the conversation function with an extra level of indirection */
#undef PAM_SUN_CODEBASE
/* Set this to your mail directory if you don't have maillock.h */
#undef MAIL_DIRECTORY
/* Data types */
#undef HAVE_U_INT
#undef HAVE_INTXX_T
#undef HAVE_U_INTXX_T
#undef HAVE_UINTXX_T
#undef HAVE_INT64_T
#undef HAVE_U_INT64_T
#undef HAVE_U_CHAR
#undef HAVE_SIZE_T
#undef HAVE_SSIZE_T
#undef HAVE_CLOCK_T
#undef HAVE_MODE_T
#undef HAVE_PID_T
#undef HAVE_SA_FAMILY_T
#undef HAVE_STRUCT_SOCKADDR_STORAGE
#undef HAVE_STRUCT_ADDRINFO
#undef HAVE_STRUCT_IN6_ADDR
#undef HAVE_STRUCT_SOCKADDR_IN6
/* Fields in struct sockaddr_storage */
#undef HAVE_SS_FAMILY_IN_SS
#undef HAVE___SS_FAMILY_IN_SS
/* Define if you have /dev/ptmx */
#undef HAVE_DEV_PTMX
/* Define if you have /dev/ptc */
#undef HAVE_DEV_PTS_AND_PTC
/* Define if you need to use IP address instead of hostname in $DISPLAY */
#undef IPADDR_IN_DISPLAY
/* Specify default $PATH */
#undef USER_PATH
/* Specify location of ssh.pid */
#undef _PATH_SSH_PIDDIR
/* Use IPv4 for connection by default, IPv6 can still if explicity asked */
#undef IPV4_DEFAULT
/* getaddrinfo is broken (if present) */
#undef BROKEN_GETADDRINFO
/* Workaround more Linux IPv6 quirks */
#undef DONT_TRY_OTHER_AF
/* Detect IPv4 in IPv6 mapped addresses and treat as IPv4 */
#undef IPV4_IN_IPV6
/* Define if you have BSD auth support */
#undef BSD_AUTH
/* Define if X11 doesn't support AF_UNIX sockets on that system */
#undef NO_X11_UNIX_SOCKETS
/* Define if the concept of ports only accessible to superusers isn't known */
#undef NO_IPPORT_RESERVED_CONCEPT
/* Needed for SCO and NeXT */
#undef BROKEN_SAVED_UIDS
/* Define if your system glob() function has the GLOB_ALTDIRFUNC extension */
#undef GLOB_HAS_ALTDIRFUNC
/* Define if your system glob() function has gl_matchc options in glob_t */
#undef GLOB_HAS_GL_MATCHC
/* Define in your struct dirent expects you to allocate extra space for d_name */
#undef BROKEN_ONE_BYTE_DIRENT_D_NAME
/* Define if your getopt(3) defines and uses optreset */
#undef HAVE_GETOPT_OPTRESET
/* Define on *nto-qnx systems */
#undef MISSING_NFDBITS
/* Define on *nto-qnx systems */
#undef MISSING_HOWMANY
/* Define on *nto-qnx systems */
#undef MISSING_FD_MASK
/* Define if you want smartcard support */
#undef SMARTCARD
/* Define if you want smartcard support using sectok */
#undef USE_SECTOK
/* Define if you want smartcard support using OpenSC */
#undef USE_OPENSC
/* Define if you want to use OpenSSL's internally seeded PRNG only */
#undef OPENSSL_PRNG_ONLY
/* Define if you shouldn't strip 'tty' from your ttyname in [uw]tmp */
#undef WITH_ABBREV_NO_TTY
/* Define if you want a different $PATH for the superuser */
#undef SUPERUSER_PATH
/* Path that unprivileged child will chroot() to in privep mode */
#undef PRIVSEP_PATH
/* Define if your platform needs to skip post auth file descriptor passing */
#undef DISABLE_FD_PASSING
@BOTTOM@
/* ******************* Shouldn't need to edit below this line ************** */
#endif /* _CONFIG_H */
| gpl-2.0 |
smartanthill/smartanthill2_0-embedded | firmware/src/platforms/void/hal_time_provider.c | 1088 | /*******************************************************************************
Copyright (C) 2015 OLogN Technologies AG
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*******************************************************************************/
#include <hal_time_provider.h>
void sa_get_time(sa_time_val* t)
{
}
uint32_t getTime()
{
return 0;
}
void mcu_sleep( uint16_t sec, uint8_t transmitter_state_on_exit )
{
}
void just_sleep( sa_time_val* timeval )
{
}
| gpl-2.0 |
nitdroid/kernel-ng | arch/arm/plat-omap/include/dspbridge/cod.h | 11618 | /*
* cod.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Code management module for DSPs. This module provides an interface
* interface for loading both static and dynamic code objects onto DSP
* systems.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef COD_
#define COD_
#include <dspbridge/dblldefs.h>
#define COD_MAXPATHLENGTH 255
#define COD_TRACEBEG "SYS_PUTCBEG"
#define COD_TRACEEND "SYS_PUTCEND"
#define COD_TRACESECT "trace"
#define COD_TRACEBEGOLD "PUTCBEG"
#define COD_TRACEENDOLD "PUTCEND"
#define COD_NOLOAD DBLL_NOLOAD
#define COD_SYMB DBLL_SYMB
/* Flags passed to cod_open */
typedef dbll_flags cod_flags;
/* COD code manager handle */
struct cod_manager;
/* COD library handle */
struct cod_libraryobj;
/* COD attributes */
struct cod_attrs {
u32 ul_reserved;
};
/*
* Function prototypes for writing memory to a DSP system, allocating
* and freeing DSP memory.
*/
typedef u32(*cod_writefxn) (void *priv_ref, u32 ulDspAddr,
void *pbuf, u32 ul_num_bytes, u32 nMemSpace);
/*
* ======== cod_close ========
* Purpose:
* Close a library opened with cod_open().
* Parameters:
* lib - Library handle returned by cod_open().
* Returns:
* None.
* Requires:
* COD module initialized.
* valid lib.
* Ensures:
*
*/
extern void cod_close(struct cod_libraryobj *lib);
/*
* ======== cod_create ========
* Purpose:
* Create an object to manage code on a DSP system. This object can be
* used to load an initial program image with arguments that can later
* be expanded with dynamically loaded object files.
* Symbol table information is managed by this object and can be retrieved
* using the cod_get_sym_value() function.
* Parameters:
* phManager: created manager object
* pstrZLFile: ZL DLL filename, of length < COD_MAXPATHLENGTH.
* attrs: attributes to be used by this object. A NULL value
* will cause default attrs to be used.
* Returns:
* DSP_SOK: Success.
* COD_E_NOZLFUNCTIONS: Could not initialize ZL functions.
* COD_E_ZLCREATEFAILED: ZL_Create failed.
* DSP_ENOTIMPL: attrs was not NULL. We don't yet support
* non default values of attrs.
* Requires:
* COD module initialized.
* pstrZLFile != NULL
* Ensures:
*/
extern dsp_status cod_create(OUT struct cod_manager **phManager,
char *pstrZLFile,
IN OPTIONAL CONST struct cod_attrs *attrs);
/*
* ======== cod_delete ========
* Purpose:
* Delete a code manager object.
* Parameters:
* cod_mgr_obj: handle of manager to be deleted
* Returns:
* None.
* Requires:
* COD module initialized.
* valid cod_mgr_obj.
* Ensures:
*/
extern void cod_delete(struct cod_manager *cod_mgr_obj);
/*
* ======== cod_exit ========
* Purpose:
* Discontinue usage of the COD module.
* Parameters:
* None.
* Returns:
* None.
* Requires:
* COD initialized.
* Ensures:
* Resources acquired in cod_init(void) are freed.
*/
extern void cod_exit(void);
/*
* ======== cod_get_base_lib ========
* Purpose:
* Get handle to the base image DBL library.
* Parameters:
* cod_mgr_obj: handle of manager to be deleted
* plib: location to store library handle on output.
* Returns:
* DSP_SOK: Success.
* Requires:
* COD module initialized.
* valid cod_mgr_obj.
* plib != NULL.
* Ensures:
*/
extern dsp_status cod_get_base_lib(struct cod_manager *cod_mgr_obj,
struct dbll_library_obj **plib);
/*
* ======== cod_get_base_name ========
* Purpose:
* Get the name of the base image DBL library.
* Parameters:
* cod_mgr_obj: handle of manager to be deleted
* pszName: location to store library name on output.
* usize: size of name buffer.
* Returns:
* DSP_SOK: Success.
* DSP_EFAIL: Buffer too small.
* Requires:
* COD module initialized.
* valid cod_mgr_obj.
* pszName != NULL.
* Ensures:
*/
extern dsp_status cod_get_base_name(struct cod_manager *cod_mgr_obj,
char *pszName, u32 usize);
/*
* ======== cod_get_entry ========
* Purpose:
* Retrieve the entry point of a loaded DSP program image
* Parameters:
* cod_mgr_obj: handle of manager to be deleted
* pulEntry: pointer to location for entry point
* Returns:
* DSP_SOK: Success.
* Requires:
* COD module initialized.
* valid cod_mgr_obj.
* pulEntry != NULL.
* Ensures:
*/
extern dsp_status cod_get_entry(struct cod_manager *cod_mgr_obj,
u32 *pulEntry);
/*
* ======== cod_get_loader ========
* Purpose:
* Get handle to the DBL loader.
* Parameters:
* cod_mgr_obj: handle of manager to be deleted
* phLoader: location to store loader handle on output.
* Returns:
* DSP_SOK: Success.
* Requires:
* COD module initialized.
* valid cod_mgr_obj.
* phLoader != NULL.
* Ensures:
*/
extern dsp_status cod_get_loader(struct cod_manager *cod_mgr_obj,
struct dbll_tar_obj **phLoader);
/*
* ======== cod_get_section ========
* Purpose:
* Retrieve the starting address and length of a section in the COFF file
* given the section name.
* Parameters:
* lib Library handle returned from cod_open().
* pstrSect: name of the section, with or without leading "."
* puAddr: Location to store address.
* puLen: Location to store length.
* Returns:
* DSP_SOK: Success
* COD_E_NOSYMBOLSLOADED: Symbols have not been loaded onto the board.
* COD_E_SYMBOLNOTFOUND: The symbol could not be found.
* Requires:
* COD module initialized.
* valid cod_mgr_obj.
* pstrSect != NULL;
* puAddr != NULL;
* puLen != NULL;
* Ensures:
* DSP_SOK: *puAddr and *puLen contain the address and length of the
* section.
* else: *puAddr == 0 and *puLen == 0;
*
*/
extern dsp_status cod_get_section(struct cod_libraryobj *lib,
IN char *pstrSect,
OUT u32 *puAddr, OUT u32 *puLen);
/*
* ======== cod_get_sym_value ========
* Purpose:
* Retrieve the value for the specified symbol. The symbol is first
* searched for literally and then, if not found, searched for as a
* C symbol.
* Parameters:
* lib: library handle returned from cod_open().
* pstrSymbol: name of the symbol
* value: value of the symbol
* Returns:
* DSP_SOK: Success.
* COD_E_NOSYMBOLSLOADED: Symbols have not been loaded onto the board.
* COD_E_SYMBOLNOTFOUND: The symbol could not be found.
* Requires:
* COD module initialized.
* Valid cod_mgr_obj.
* pstrSym != NULL.
* pul_value != NULL.
* Ensures:
*/
extern dsp_status cod_get_sym_value(struct cod_manager *cod_mgr_obj,
IN char *pstrSym, OUT u32 * pul_value);
/*
* ======== cod_init ========
* Purpose:
* Initialize the COD module's private state.
* Parameters:
* None.
* Returns:
* TRUE if initialized; FALSE if error occured.
* Requires:
* Ensures:
* A requirement for each of the other public COD functions.
*/
extern bool cod_init(void);
/*
* ======== cod_load_base ========
* Purpose:
* Load the initial program image, optionally with command-line arguments,
* on the DSP system managed by the supplied handle. The program to be
* loaded must be the first element of the args array and must be a fully
* qualified pathname.
* Parameters:
* hmgr: manager to load the code with
* nArgc: number of arguments in the args array
* args: array of strings for arguments to DSP program
* write_fxn: board-specific function to write data to DSP system
* pArb: arbitrary pointer to be passed as first arg to write_fxn
* envp: array of environment strings for DSP exec.
* Returns:
* DSP_SOK: Success.
* COD_E_OPENFAILED: Failed to open target code.
* COD_E_LOADFAILED: Failed to load code onto target.
* Requires:
* COD module initialized.
* hmgr is valid.
* nArgc > 0.
* aArgs != NULL.
* aArgs[0] != NULL.
* pfn_write != NULL.
* Ensures:
*/
extern dsp_status cod_load_base(struct cod_manager *cod_mgr_obj,
u32 nArgc, char *aArgs[],
cod_writefxn pfn_write, void *pArb,
char *envp[]);
/*
* ======== cod_open ========
* Purpose:
* Open a library for reading sections. Does not load or set the base.
* Parameters:
* hmgr: manager to load the code with
* pszCoffPath: Coff file to open.
* flags: COD_NOLOAD (don't load symbols) or COD_SYMB (load
* symbols).
* pLib: Handle returned that can be used in calls to cod_close
* and cod_get_section.
* Returns:
* S_OK: Success.
* COD_E_OPENFAILED: Failed to open target code.
* Requires:
* COD module initialized.
* hmgr is valid.
* flags == COD_NOLOAD || flags == COD_SYMB.
* pszCoffPath != NULL.
* Ensures:
*/
extern dsp_status cod_open(struct cod_manager *hmgr,
IN char *pszCoffPath,
cod_flags flags, OUT struct cod_libraryobj **pLib);
/*
* ======== cod_open_base ========
* Purpose:
* Open base image for reading sections. Does not load the base.
* Parameters:
* hmgr: manager to load the code with
* pszCoffPath: Coff file to open.
* flags: Specifies whether to load symbols.
* Returns:
* DSP_SOK: Success.
* COD_E_OPENFAILED: Failed to open target code.
* Requires:
* COD module initialized.
* hmgr is valid.
* pszCoffPath != NULL.
* Ensures:
*/
extern dsp_status cod_open_base(struct cod_manager *hmgr, IN char *pszCoffPath,
dbll_flags flags);
/*
* ======== cod_read_section ========
* Purpose:
* Retrieve the content of a code section given the section name.
* Parameters:
* cod_mgr_obj - manager in which to search for the symbol
* pstrSect - name of the section, with or without leading "."
* pstrContent - buffer to store content of the section.
* Returns:
* DSP_SOK: on success, error code on failure
* COD_E_NOSYMBOLSLOADED: Symbols have not been loaded onto the board.
* COD_E_READFAILED: Failed to read content of code section.
* Requires:
* COD module initialized.
* valid cod_mgr_obj.
* pstrSect != NULL;
* pstrContent != NULL;
* Ensures:
* DSP_SOK: *pstrContent stores the content of the named section.
*/
extern dsp_status cod_read_section(struct cod_libraryobj *lib,
IN char *pstrSect,
OUT char *pstrContent, IN u32 cContentSize);
#endif /* COD_ */
| gpl-2.0 |
Simpler1/ZoneMinder | web/skins/classic/views/js/montage.js | 16321 | var requestQueue = new Request.Queue({
concurrent: monitorData.length,
stopOnFailure: false
});
function Monitor(monitorData) {
this.id = monitorData.id;
this.connKey = monitorData.connKey;
this.url = monitorData.url;
this.status = null;
this.alarmState = STATE_IDLE;
this.lastAlarmState = STATE_IDLE;
this.streamCmdParms = 'view=request&request=stream&connkey='+this.connKey;
if ( auth_hash ) {
this.streamCmdParms += '&auth='+auth_hash;
}
this.streamCmdTimer = null;
this.type = monitorData.type;
this.refresh = monitorData.refresh;
this.start = function(delay) {
if ( this.streamCmdQuery ) {
this.streamCmdTimer = this.streamCmdQuery.delay(delay, this);
} else {
console.log("No streamCmdQuery");
}
};
this.eventHandler = function(event) {
console.log(event);
};
this.onclick = function(evt) {
var el = evt.currentTarget;
var tag = 'watch';
var id = el.getAttribute("data-monitor-id");
var width = el.getAttribute("data-width");
var height = el.getAttribute("data-height");
var url = '?view=watch&mid='+id;
var name = 'zmWatch'+id;
evt.preventDefault();
createPopup(url, name, tag, width, height);
};
this.setup_onclick = function() {
var el = document.getElementById('imageFeed'+this.id);
if ( el ) el.addEventListener('click', this.onclick, false);
};
this.disable_onclick = function() {
document.getElementById('imageFeed'+this.id).removeEventListener('click', this.onclick );
};
this.setStateClass = function(element, stateClass) {
if ( !element.hasClass( stateClass ) ) {
if ( stateClass != 'alarm' ) {
element.removeClass('alarm');
}
if ( stateClass != 'alert' ) {
element.removeClass('alert');
}
if ( stateClass != 'idle' ) {
element.removeClass('idle');
}
element.addClass(stateClass);
}
};
this.onError = function(text, error) {
console.log('onerror: ' + text + ' error:'+error);
// Requeue, but want to wait a while.
var streamCmdTimeout = 10*statusRefreshTimeout;
this.streamCmdTimer = this.streamCmdQuery.delay(streamCmdTimeout, this);
};
this.onFailure = function(xhr) {
console.log('onFailure: ' + this.connKey);
console.log(xhr);
if ( ! requestQueue.hasNext("cmdReq"+this.id) ) {
console.log("Not requeuing because there is one already");
requestQueue.addRequest("cmdReq"+this.id, this.streamCmdReq);
}
if ( 0 ) {
// Requeue, but want to wait a while.
if ( this.streamCmdTimer ) {
this.streamCmdTimer = clearTimeout( this.streamCmdTimer );
}
var streamCmdTimeout = 1000*statusRefreshTimeout;
this.streamCmdTimer = this.streamCmdQuery.delay( streamCmdTimeout, this, true );
requestQueue.resume();
}
console.log("done failure");
};
this.getStreamCmdResponse = function(respObj, respText) {
if ( this.streamCmdTimer ) {
this.streamCmdTimer = clearTimeout( this.streamCmdTimer );
}
var stream = $j('#liveStream'+this.id)[0];
if ( respObj.result == 'Ok' ) {
if ( respObj.status ) {
this.status = respObj.status;
this.alarmState = this.status.state;
var stateClass = "";
if ( this.alarmState == STATE_ALARM ) {
stateClass = "alarm";
} else if ( this.alarmState == STATE_ALERT ) {
stateClass = "alert";
} else {
stateClass = "idle";
}
if ( (!COMPACT_MONTAGE) && (this.type != 'WebSite') ) {
$('fpsValue'+this.id).set('text', this.status.fps);
$('stateValue'+this.id).set('text', stateStrings[this.alarmState]);
this.setStateClass($('monitorState'+this.id), stateClass);
}
this.setStateClass($('monitor'+this.id), stateClass);
/*Stream could be an applet so can't use moo tools*/
stream.className = stateClass;
var isAlarmed = ( this.alarmState == STATE_ALARM || this.alarmState == STATE_ALERT );
var wasAlarmed = ( this.lastAlarmState == STATE_ALARM || this.lastAlarmState == STATE_ALERT );
var newAlarm = ( isAlarmed && !wasAlarmed );
var oldAlarm = ( !isAlarmed && wasAlarmed );
if ( newAlarm ) {
if ( false && SOUND_ON_ALARM ) {
// Enable the alarm sound
$('alarmSound').removeClass('hidden');
}
if ( POPUP_ON_ALARM ) {
windowToFront();
}
}
if ( false && SOUND_ON_ALARM ) {
if ( oldAlarm ) {
// Disable alarm sound
$('alarmSound').addClass('hidden');
}
}
if ( this.status.auth ) {
if ( this.status.auth != auth_hash ) {
// Try to reload the image stream.
if ( stream ) {
stream.src = stream.src.replace(/auth=\w+/i, 'auth='+this.status.auth);
}
console.log("Changed auth from " + auth_hash + " to " + this.status.auth);
auth_hash = this.status.auth;
}
} // end if have a new auth hash
} // end if has state
} else {
console.error(respObj.message);
// Try to reload the image stream.
if ( stream ) {
if ( stream.src ) {
console.log('Reloading stream: ' + stream.src);
stream.src = stream.src.replace(/rand=\d+/i, 'rand='+Math.floor((Math.random() * 1000000) ));
} else {
}
} else {
console.log('No stream to reload?');
}
} // end if Ok or not
var streamCmdTimeout = statusRefreshTimeout;
// The idea here is if we are alarmed, do updates faster.
// However, there is a timeout in the php side which isn't getting modified,
// so this may cause a problem. Also the server may only be able to update so fast.
//if ( this.alarmState == STATE_ALARM || this.alarmState == STATE_ALERT ) {
//streamCmdTimeout = streamCmdTimeout/5;
//}
this.streamCmdTimer = this.streamCmdQuery.delay(streamCmdTimeout, this);
this.lastAlarmState = this.alarmState;
};
this.streamCmdQuery = function(resent) {
if ( resent ) {
console.log(this.connKey+": timeout: Resending");
this.streamCmdReq.cancel();
}
//console.log("Starting CmdQuery for " + this.connKey );
if ( this.type != 'WebSite' ) {
this.streamCmdReq.send(this.streamCmdParms+"&command="+CMD_QUERY);
}
};
if ( this.type != 'WebSite' ) {
this.streamCmdReq = new Request.JSON( {
url: this.url,
method: 'get',
timeout: AJAX_TIMEOUT,
onSuccess: this.getStreamCmdResponse.bind(this),
onTimeout: this.streamCmdQuery.bind(this, true),
onError: this.onError.bind(this),
onFailure: this.onFailure.bind(this),
link: 'cancel'
} );
console.log("queueing for " + this.id + " " + this.connKey + " timeout is: " + AJAX_TIMEOUT);
requestQueue.addRequest("cmdReq"+this.id, this.streamCmdReq);
}
} // end function Monitor
/**
* called when the layoutControl select element is changed, or the page
* is rendered
* @param {*} element - the event data passed by onchange callback
*/
function selectLayout(element) {
console.log(element);
layout = $j(element).val();
if ( layout_id = parseInt(layout) ) {
layout = layouts[layout];
for ( var i = 0, length = monitors.length; i < length; i++ ) {
monitor = monitors[i];
// Need to clear the current positioning, and apply the new
monitor_frame = $j('#monitorFrame'+monitor.id);
if ( ! monitor_frame ) {
console.log("Error finding frame for " + monitor.id);
continue;
}
// Apply default layout options, like float left
if ( layout.Positions['default'] ) {
styles = layout.Positions['default'];
for ( style in styles ) {
monitor_frame.css(style, styles[style]);
}
} else {
console.log("No default styles to apply" + layout.Positions);
} // end if default styles
if ( layout.Positions['mId'+monitor.id] ) {
styles = layout.Positions['mId'+monitor.id];
for ( style in styles ) {
monitor_frame.css(style, styles[style]);
console.log("Applying " + style + ' : ' + styles[style]);
}
} else {
console.log("No Monitor styles to apply");
} // end if specific monitor style
} // end foreach monitor
} // end if a stored layout
if ( ! layout ) {
return;
}
Cookie.write('zmMontageLayout', layout_id, {duration: 10*365});
if ( layouts[layout_id].Name != 'Freeform' ) { // 'montage_freeform.css' ) {
Cookie.write( 'zmMontageScale', '', {duration: 10*365} );
$('scale').set('value', '');
$('width').set('value', 'auto');
for ( var i = 0, length = monitors.length; i < length; i++ ) {
var monitor = monitors[i];
var streamImg = $('liveStream'+monitor.id);
if ( streamImg ) {
if ( streamImg.nodeName == 'IMG' ) {
var src = streamImg.src;
src = src.replace(/width=[\.\d]+/i, 'width=0' );
if ( src != streamImg.src ) {
streamImg.src = '';
streamImg.src = src;
}
} else if ( streamImg.nodeName == 'APPLET' || streamImg.nodeName == 'OBJECT' ) {
// APPLET's and OBJECTS need to be re-initialized
}
streamImg.style.width = '100%';
}
} // end foreach monitor
}
} // end function selectLayout(element)
/**
* called when the widthControl|heightControl select elements are changed
*/
function changeSize() {
var width = $('width').get('value');
var height = $('height').get('value');
for ( var i = 0, length = monitors.length; i < length; i++ ) {
var monitor = monitors[i];
// Scale the frame
monitor_frame = $j('#monitorFrame'+monitor.id);
if ( !monitor_frame ) {
console.log("Error finding frame for " + monitor.id);
continue;
}
if ( width ) {
monitor_frame.css('width', width);
}
if ( height ) {
monitor_frame.css('height', height);
}
/*Stream could be an applet so can't use moo tools*/
var streamImg = $('liveStream'+monitor.id);
if ( streamImg ) {
if ( streamImg.nodeName == 'IMG' ) {
var src = streamImg.src;
streamImg.src = '';
src = src.replace(/width=[\.\d]+/i, 'width='+width);
src = src.replace(/height=[\.\d]+/i, 'height='+height);
src = src.replace(/rand=\d+/i, 'rand='+Math.floor((Math.random() * 1000000) ));
streamImg.src = src;
}
streamImg.style.width = width ? width : null;
streamImg.style.height = height ? height : null;
//streamImg.style.height = '';
}
}
$('scale').set('value', '');
Cookie.write('zmMontageScale', '', {duration: 10*365});
Cookie.write('zmMontageWidth', width, {duration: 10*365});
Cookie.write('zmMontageHeight', height, {duration: 10*365});
//selectLayout('#zmMontageLayout');
} // end function changeSize()
/**
* called when the scaleControl select element is changed
*/
function changeScale() {
var scale = $('scale').get('value');
$('width').set('value', 'auto');
$('height').set('value', 'auto');
Cookie.write('zmMontageScale', scale, {duration: 10*365});
Cookie.write('zmMontageWidth', '', {duration: 10*365});
Cookie.write('zmMontageHeight', '', {duration: 10*365});
if ( !scale ) {
selectLayout('#zmMontageLayout');
return;
}
for ( var i = 0, length = monitors.length; i < length; i++ ) {
var monitor = monitors[i];
var newWidth = ( monitorData[i].width * scale ) / SCALE_BASE;
var newHeight = ( monitorData[i].height * scale ) / SCALE_BASE;
// Scale the frame
monitor_frame = $j('#monitorFrame'+monitor.id);
if ( !monitor_frame ) {
console.log("Error finding frame for " + monitor.id);
continue;
}
if ( newWidth ) {
monitor_frame.css('width', newWidth);
}
// We don't set the frame height because it has the status bar as well
//if ( height ) {
////monitor_frame.css('height', height+'px');
//}
/*Stream could be an applet so can't use moo tools*/
var streamImg = $j('#liveStream'+monitor.id)[0];
if ( streamImg ) {
if ( streamImg.nodeName == 'IMG' ) {
var src = streamImg.src;
streamImg.src = '';
//src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) ));
src = src.replace(/scale=[\.\d]+/i, 'scale='+scale);
src = src.replace(/width=[\.\d]+/i, 'width='+newWidth);
src = src.replace(/height=[\.\d]+/i, 'height='+newHeight);
streamImg.src = src;
}
streamImg.style.width = newWidth + "px";
streamImg.style.height = newHeight + "px";
}
}
}
function toGrid(value) {
return Math.round(value / 80) * 80;
}
// Makes monitorFrames draggable.
function edit_layout(button) {
// Turn off the onclick on the image.
for ( var i = 0, length = monitors.length; i < length; i++ ) {
var monitor = monitors[i];
monitor.disable_onclick();
};
$j('#monitors .monitorFrame').draggable({
cursor: 'crosshair',
//revert: 'invalid'
});
$j('#SaveLayout').show();
$j('#EditLayout').hide();
} // end function edit_layout
function save_layout(button) {
var form = button.form;
var name = form.elements['Name'].value;
if ( !name ) {
name = form.elements['zmMontageLayout'].options[form.elements['zmMontageLayout'].selectedIndex].text;
}
if ( name=='Freeform' || name=='2 Wide' || name=='3 Wide' || name=='4 Wide' || name=='5 Wide' ) {
alert('You cannot edit the built in layouts. Please give the layout a new name.');
return;
}
// In fixed positioning, order doesn't matter. In floating positioning, it does.
var Positions = {};
for ( var i = 0, length = monitors.length; i < length; i++ ) {
var monitor = monitors[i];
monitor_frame = $j('#monitorFrame'+monitor.id);
Positions['mId'+monitor.id] = {
width: monitor_frame.css('width'),
height: monitor_frame.css('height'),
top: monitor_frame.css('top'),
bottom: monitor_frame.css('bottom'),
left: monitor_frame.css('left'),
right: monitor_frame.css('right'),
position: monitor_frame.css('position'),
float: monitor_frame.css('float'),
};
} // end foreach monitor
form.Positions.value = JSON.stringify(Positions);
form.submit();
} // end function save_layout
function cancel_layout(button) {
$j('#SaveLayout').hide();
$j('#EditLayout').show();
for ( var i = 0, length = monitors.length; i < length; i++ ) {
var monitor = monitors[i];
monitor.setup_onclick();
//monitor_feed = $j('#imageFeed'+monitor.id);
//monitor_feed.click(monitor.onclick);
};
selectLayout('#zmMontageLayout');
}
function reloadWebSite(ndx) {
document.getElementById('imageFeed'+ndx).innerHTML = document.getElementById('imageFeed'+ndx).innerHTML;
}
var monitors = new Array();
function initPage() {
jQuery(document).ready(function() {
jQuery("#hdrbutton").click(function() {
jQuery("#flipMontageHeader").slideToggle("slow");
jQuery("#hdrbutton").toggleClass('glyphicon-menu-down').toggleClass('glyphicon-menu-up');
Cookie.write( 'zmMontageHeaderFlip', jQuery('#hdrbutton').hasClass('glyphicon-menu-up') ? 'up' : 'down', {duration: 10*365} );
});
});
if ( Cookie.read('zmMontageHeaderFlip') == 'down' ) {
// The chosen dropdowns require the selects to be visible, so once chosen has initialized, we can hide the header
jQuery("#flipMontageHeader").slideToggle("fast");
jQuery("#hdrbutton").toggleClass('glyphicon-menu-down').toggleClass('glyphicon-menu-up');
}
for ( var i = 0, length = monitorData.length; i < length; i++ ) {
monitors[i] = new Monitor(monitorData[i]);
// Start the fps and status updates. give a random delay so that we don't assault the server
var delay = Math.round( (Math.random()+0.5)*statusRefreshTimeout );
monitors[i].start(delay);
var interval = monitors[i].refresh;
if ( monitors[i].type == 'WebSite' && interval > 0 ) {
setInterval(reloadWebSite, interval*1000, i);
}
monitors[i].setup_onclick();
}
selectLayout('#zmMontageLayout');
}
// Kick everything off
window.addEventListener('DOMContentLoaded', initPage);
| gpl-2.0 |
sTeeLM/MINIME | toolkit/srpm/SOURCES/cde-2.2.4/programs/dtudcexch/udcexp.c | 5753 | /*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: udcexp.c /main/5 1996/10/14 14:45:34 barstow $ */
/*
* (c) Copyright 1995 FUJITSU LIMITED
* This is source code modified by FUJITSU LIMITED under the Joint
* Development Agreement for the CDEnext PST.
* This is unpublished proprietary source code of FUJITSU LIMITED
*/
#include "excutil.h"
#include <Xm/MessageB.h>
#include <Xm/RowColumn.h>
#include <Xm/List.h>
#include <Xm/Form.h>
#include <Xm/Label.h>
void setselectedcode();
extern char *maintitle;
void udcexp(Exc_data * ed)
{
ed->function = EXPORT;
strcpy(ed->bdfmode,"w");
PopupSelectXLFD(ed->toplevel);
}
void createbdf(Exc_data * ed)
{
int i = 0;
char *comment_list[] = {""};
int comment_num = 0;
char *msg;
int ans;
msg = GETMESSAGE(10, 2, "Failed to make the BDF file");
i = ExpGpftoBDF(ed->fontfile, ed->bdffile,
ed->code_num, ed->gpf_code_list,
comment_num, comment_list, 0);
if (i != 0) {
AskUser(ed->toplevel, ed, msg, &ans, "error");
}
excterminate(ed);
}
void selcharokCB(Widget widget, ListData * ld, XtPointer call_data)
{
int num;
Exc_data *ed;
int ans;
char *msg;
msg = GETMESSAGE(10, 4, "No indexes are selected");
XtVaGetValues(ld->list, XmNselectedItemCount, &num, NULL);
if (num == 0) {
/* AskUser(widget, ld->ed, msg, &ans, "error");*/
return;
} else {
setselectedcode(ld);
XtUnmanageChild(XtParent(widget));
ed = ld->ed;
freeld(ld);
getbdffn(ed);
}
}
void selcharcancelCB(Widget widget, ListData * ld, XtPointer call_data)
{
Exc_data *ed;
ed = ld->ed;
freeld(ld);
excterminate(ed);
}
XmString * setxmslist(ListData * ld)
{
char **cp;
XmString *xmslist, *xmsp;
int i;
if ((xmslist = (XmString *) calloc(ld->existcode_num, sizeof(XmString *)))
== NULL) {
excerror(ld->ed, EXCERRMALLOC, "setxmslist", "exit");
}
cp = ld->existcode_c;
xmsp = xmslist;
for (i = 0; i < ld->existcode_num; i++) {
*xmsp = XmStringCreateLocalized(*cp);
xmsp++;
cp++;
}
return (xmslist);
}
void freexmslist(ListData * ld, XmString * xmslist)
{
XmString *xmsp;
int i;
if (xmslist != NULL) {
xmsp = xmslist;
for (i = 0; i < ld->existcode_num; i++) {
XmStringFree(*xmsp);
xmsp++;
}
free(xmslist);
}
}
void selcharcd(Exc_data * ed)
{
Widget mainw, selcd, ok, cancel;
Widget slctLabel, form;
Arg args[20];
Cardinal n;
char *oklabel;
char *cancellabel;
XmString *xmslist;
extern ListData *ld;
char *p;
oklabel = GETMESSAGE(10, 6, "OK");
cancellabel = GETMESSAGE(10, 8, "Cancel");
n = 0;
XtSetArg(args[n], XmNautoUnmanage, False); n++;
XtSetArg(args[n], XmNtitle, maintitle); n++;
mainw = XmCreateTemplateDialog(ed->toplevel, "mainw", args, n);
n = 0;
form = XmCreateForm( mainw, "form", args, n);
XtManageChild(form);
p = GETMESSAGE(10, 10, "glyph indexes");
n = 0;
XtSetArg( args[n], XmNx, 20 ) ; n++;
XtSetArg( args[n], XmNheight, 20 ) ; n++ ;
XtSetArg( args[n], XmNtopAttachment, XmATTACH_FORM ) ; n++ ;
XtSetArg( args[n], XmNtopOffset, 10 ) ; n++ ;
slctLabel = XmCreateLabel( form, p, args, n);
XtManageChild(slctLabel);
n = 0;
xmslist = setxmslist(ld);
XtSetArg( args[n], XmNleftAttachment, XmATTACH_FORM ) ; n++ ;
XtSetArg( args[n], XmNleftOffset, 20 ) ; n++ ;
XtSetArg( args[n], XmNtopAttachment, XmATTACH_WIDGET ); n++ ;
XtSetArg( args[n], XmNtopOffset, 5 ) ; n++ ;
XtSetArg( args[n], XmNwidth, 200 ) ; n++ ;
XtSetArg (args[n], XmNtopWidget, slctLabel ); n++;
XtSetArg(args[n], XmNitems, xmslist); n++;
XtSetArg(args[n], XmNitemCount, ld->existcode_num); n++;
XtSetArg(args[n], XmNvisibleItemCount, 10); n++;
XtSetArg(args[n], XmNlistSizePolicy, XmCONSTANT); n++;
XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmAS_NEEDED); n++;
XtSetArg(args[n], XmNselectionPolicy, XmEXTENDED_SELECT); n++;
selcd = XmCreateScrolledList(form, "Select codes", args, n);
freexmslist(ld, xmslist);
XtManageChild(selcd);
ld->list = selcd;
ok = excCreatePushButton(mainw, "ok", oklabel,
(XtCallbackProc) selcharokCB, (XtPointer) ld);
cancel = excCreatePushButton(mainw, "cancel", cancellabel,
(XtCallbackProc) selcharcancelCB,
(XtPointer) ld);
XtManageChild(mainw);
}
void setselectedcode(ListData *ld)
{
int *position_list;
int position_count;
int i;
int *codep;
XmListGetSelectedPos(ld->list, &position_list, &position_count);
ld->ed->code_num = position_count;
ld->ed->gpf_code_list = (int *) calloc(position_count, sizeof(int));
codep = ld->ed->gpf_code_list;
for (i = 0; i < position_count; i++) {
*codep = *((ld->existcode)+(position_list[i]-1));
codep++;
}
}
| gpl-2.0 |
ammarshadiq/stellarium-0.11.4 | landscapes/ocean/cmake_install.cmake | 2495 | # Install script for directory: /opt/stellarium-0.11.4/landscapes/ocean
# Set the install prefix
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local")
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
IF(BUILD_TYPE)
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
ELSE(BUILD_TYPE)
SET(CMAKE_INSTALL_CONFIG_NAME "Release")
ENDIF(BUILD_TYPE)
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
# Set the component getting installed.
IF(NOT CMAKE_INSTALL_COMPONENT)
IF(COMPONENT)
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
ELSE(COMPONENT)
SET(CMAKE_INSTALL_COMPONENT)
ENDIF(COMPONENT)
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
# Install shared libraries without execute permission?
IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
SET(CMAKE_INSTALL_SO_NO_EXE "1")
ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/stellarium/landscapes/ocean" TYPE FILE FILES
"/opt/stellarium-0.11.4/landscapes/ocean/landscape.ini"
"/opt/stellarium-0.11.4/landscapes/ocean/description.ar.utf8"
"/opt/stellarium-0.11.4/landscapes/ocean/description.be.utf8"
"/opt/stellarium-0.11.4/landscapes/ocean/description.bg.utf8"
"/opt/stellarium-0.11.4/landscapes/ocean/description.nb.utf8"
"/opt/stellarium-0.11.4/landscapes/ocean/description.pt_BR.utf8"
"/opt/stellarium-0.11.4/landscapes/ocean/description.en.utf8"
"/opt/stellarium-0.11.4/landscapes/ocean/description.ru.utf8"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean1.png"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean2.png"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean3.png"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean4.png"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean5.png"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean6.png"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean7.png"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean8.png"
"/opt/stellarium-0.11.4/landscapes/ocean/ocean9.png"
)
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
| gpl-2.0 |
stephengroat/miasm | miasm2/arch/aarch64/disasm.py | 731 | from miasm2.core.asmblock import disasmEngine
from miasm2.arch.aarch64.arch import mn_aarch64
cb_aarch64_funcs = []
def cb_aarch64_disasm(*args, **kwargs):
for func in cb_aarch64_funcs:
func(*args, **kwargs)
class dis_aarch64b(disasmEngine):
attrib = "b"
def __init__(self, bs=None, **kwargs):
super(dis_aarch64b, self).__init__(
mn_aarch64, self.attrib, bs,
dis_bloc_callback = cb_aarch64_disasm,
**kwargs)
class dis_aarch64l(disasmEngine):
attrib = "l"
def __init__(self, bs=None, **kwargs):
super(dis_aarch64l, self).__init__(
mn_aarch64, self.attrib, bs,
dis_bloc_callback = cb_aarch64_disasm,
**kwargs)
| gpl-2.0 |
facebookexperimental/eden | common/logging/logging.h | 451 | /*
* Copyright (c) 2004-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
// TODO: actually implement this
#ifndef VLOG_EVERY_MS
#define VLOG_EVERY_MS(verboselevel, ms) VLOG(verboselevel)
#endif
| gpl-2.0 |
jbjonesjr/geoproponis | external/odfdom-java-0.8.10-incubating-sources/org/odftoolkit/odfdom/dom/attribute/table/TableScriptAttribute.java | 2957 | /************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
*
* Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
*
* Use is subject to license terms.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
* obtain a copy of the License at http://odftoolkit.org/docs/license.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
************************************************************************/
/*
* This file is automatically generated.
* Don't edit manually.
*/
package org.odftoolkit.odfdom.dom.attribute.table;
import org.odftoolkit.odfdom.dom.OdfDocumentNamespace;
import org.odftoolkit.odfdom.pkg.OdfAttribute;
import org.odftoolkit.odfdom.pkg.OdfFileDom;
import org.odftoolkit.odfdom.pkg.OdfName;
/**
* DOM implementation of OpenDocument attribute {@odf.attribute table:script}.
*
*/
public class TableScriptAttribute extends OdfAttribute {
public static final OdfName ATTRIBUTE_NAME = OdfName.newName(OdfDocumentNamespace.TABLE, "script");
/**
* Create the instance of OpenDocument attribute {@odf.attribute table:script}.
*
* @param ownerDocument The type is <code>OdfFileDom</code>
*/
public TableScriptAttribute(OdfFileDom ownerDocument) {
super(ownerDocument, ATTRIBUTE_NAME);
}
/**
* Returns the attribute name.
*
* @return the <code>OdfName</code> for {@odf.attribute table:script}.
*/
@Override
public OdfName getOdfName() {
return ATTRIBUTE_NAME;
}
/**
* @return Returns the name of this attribute.
*/
@Override
public String getName() {
return ATTRIBUTE_NAME.getLocalName();
}
/**
* Returns the default value of {@odf.attribute table:script}.
*
* @return the default value as <code>String</code> dependent of its element name
* return <code>null</code> if the default value does not exist
*/
@Override
public String getDefault() {
return null;
}
/**
* Default value indicator. As the attribute default value is dependent from its element, the attribute has only a default, when a parent element exists.
*
* @return <code>true</code> if {@odf.attribute table:script} has an element parent
* otherwise return <code>false</code> as undefined.
*/
@Override
public boolean hasDefault() {
return false;
}
/**
* @return Returns whether this attribute is known to be of type ID (i.e. xml:id ?)
*/
@Override
public boolean isId() {
return false;
}
}
| gpl-2.0 |
shakalaca/ASUS_ZenFone_ZE601KL | kernel/include/linux/kernel.h | 26620 | #ifndef _LINUX_KERNEL_H
#define _LINUX_KERNEL_H
#include <stdarg.h>
#include <linux/linkage.h>
#include <linux/stddef.h>
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/bitops.h>
#include <linux/log2.h>
#include <linux/typecheck.h>
#include <linux/printk.h>
#include <linux/dynamic_debug.h>
#include <asm/byteorder.h>
#include <uapi/linux/kernel.h>
#include <linux/asusdebug.h>
//++++ [email protected] add "support laser sensor 2nd source"
extern int g_ASUS_laserID;
//---- [email protected] add "support laser sensor 2nd source"
#define USHRT_MAX ((u16)(~0U))
#define SHRT_MAX ((s16)(USHRT_MAX>>1))
#define SHRT_MIN ((s16)(-SHRT_MAX - 1))
#define INT_MAX ((int)(~0U>>1))
#define INT_MIN (-INT_MAX - 1)
#define UINT_MAX (~0U)
#define LONG_MAX ((long)(~0UL>>1))
#define LONG_MIN (-LONG_MAX - 1)
#define ULONG_MAX (~0UL)
#define LLONG_MAX ((long long)(~0ULL>>1))
#define LLONG_MIN (-LLONG_MAX - 1)
#define ULLONG_MAX (~0ULL)
#define SIZE_MAX (~(size_t)0)
#define STACK_MAGIC 0xdeadbeef
#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
/*
* This looks more complex than it should be. But we need to
* get the type for the ~ right in round_down (it needs to be
* as wide as the result!), and we want to evaluate the macro
* arguments just once each.
*/
#define __round_mask(x, y) ((__typeof__(x))((y)-1))
#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
#define round_down(x, y) ((x) & ~__round_mask(x, y))
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define DIV_ROUND_UP_ULL(ll,d) \
({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
#if BITS_PER_LONG == 32
# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
#else
# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d)
#endif
/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
#define roundup(x, y) ( \
{ \
const typeof(y) __y = y; \
(((x) + (__y - 1)) / __y) * __y; \
} \
)
#define rounddown(x, y) ( \
{ \
typeof(x) __x = (x); \
__x - (__x % (y)); \
} \
)
/*
* Divide positive or negative dividend by positive divisor and round
* to closest integer. Result is undefined for negative divisors and
* for negative dividends if the divisor variable type is unsigned.
*/
#define DIV_ROUND_CLOSEST(x, divisor)( \
{ \
typeof(x) __x = x; \
typeof(divisor) __d = divisor; \
(((typeof(x))-1) > 0 || \
((typeof(divisor))-1) > 0 || (__x) > 0) ? \
(((__x) + ((__d) / 2)) / (__d)) : \
(((__x) - ((__d) / 2)) / (__d)); \
} \
)
/*
* Multiplies an integer by a fraction, while avoiding unnecessary
* overflow or loss of precision.
*/
#define mult_frac(x, numer, denom)( \
{ \
typeof(x) quot = (x) / (denom); \
typeof(x) rem = (x) % (denom); \
(quot * (numer)) + ((rem * (numer)) / (denom)); \
} \
)
#define _RET_IP_ (unsigned long)__builtin_return_address(0)
#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
#ifdef CONFIG_LBDAF
# include <asm/div64.h>
# define sector_div(a, b) do_div(a, b)
#else
# define sector_div(n, b)( \
{ \
int _res; \
_res = (n) % (b); \
(n) /= (b); \
_res; \
} \
)
#endif
/**
* upper_32_bits - return bits 32-63 of a number
* @n: the number we're accessing
*
* A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
* the "right shift count >= width of type" warning when that quantity is
* 32-bits.
*/
#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
/**
* lower_32_bits - return bits 0-31 of a number
* @n: the number we're accessing
*/
#define lower_32_bits(n) ((u32)(n))
struct completion;
struct pt_regs;
struct user;
#ifdef CONFIG_PREEMPT_VOLUNTARY
extern int _cond_resched(void);
# define might_resched() _cond_resched()
#else
# define might_resched() do { } while (0)
#endif
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
void __might_sleep(const char *file, int line, int preempt_offset);
/**
* might_sleep - annotation for functions that can sleep
*
* this macro will print a stack trace if it is executed in an atomic
* context (spinlock, irq-handler, ...).
*
* This is a useful debugging help to be able to catch problems early and not
* be bitten later when the calling function happens to sleep when it is not
* supposed to.
*/
# define might_sleep() \
do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
#else
static inline void __might_sleep(const char *file, int line,
int preempt_offset) { }
# define might_sleep() do { might_resched(); } while (0)
#endif
#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
/*
* abs() handles unsigned and signed longs, ints, shorts and chars. For all
* input types abs() returns a signed long.
* abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()
* for those.
*/
#define abs(x) ({ \
long ret; \
if (sizeof(x) == sizeof(long)) { \
long __x = (x); \
ret = (__x < 0) ? -__x : __x; \
} else { \
int __x = (x); \
ret = (__x < 0) ? -__x : __x; \
} \
ret; \
})
#define abs64(x) ({ \
s64 __x = (x); \
(__x < 0) ? -__x : __x; \
})
#if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)
void might_fault(void);
#else
static inline void might_fault(void) { }
#endif
extern struct atomic_notifier_head panic_notifier_list;
extern long (*panic_blink)(int state);
__printf(1, 2)
void panic(const char *fmt, ...)
__noreturn __cold;
extern void oops_enter(void);
extern void oops_exit(void);
void print_oops_end_marker(void);
extern int oops_may_print(void);
void do_exit(long error_code)
__noreturn;
void complete_and_exit(struct completion *, long)
__noreturn;
/* Internal, do not use. */
int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
int __must_check _kstrtol(const char *s, unsigned int base, long *res);
int __must_check kstrtoull(const char *s, unsigned int base, unsigned long long *res);
int __must_check kstrtoll(const char *s, unsigned int base, long long *res);
/**
* kstrtoul - convert a string to an unsigned long
* @s: The start of the string. The string must be null-terminated, and may also
* include a single newline before its terminating null. The first character
* may also be a plus sign, but not a minus sign.
* @base: The number base to use. The maximum supported base is 16. If base is
* given as 0, then the base of the string is automatically detected with the
* conventional semantics - If it begins with 0x the number will be parsed as a
* hexadecimal (case insensitive), if it otherwise begins with 0, it will be
* parsed as an octal number. Otherwise it will be parsed as a decimal.
* @res: Where to write the result of the conversion on success.
*
* Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
* Used as a replacement for the obsolete simple_strtoull. Return code must
* be checked.
*/
static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
{
/*
* We want to shortcut function call, but
* __builtin_types_compatible_p(unsigned long, unsigned long long) = 0.
*/
if (sizeof(unsigned long) == sizeof(unsigned long long) &&
__alignof__(unsigned long) == __alignof__(unsigned long long))
return kstrtoull(s, base, (unsigned long long *)res);
else
return _kstrtoul(s, base, res);
}
/**
* kstrtol - convert a string to a long
* @s: The start of the string. The string must be null-terminated, and may also
* include a single newline before its terminating null. The first character
* may also be a plus sign or a minus sign.
* @base: The number base to use. The maximum supported base is 16. If base is
* given as 0, then the base of the string is automatically detected with the
* conventional semantics - If it begins with 0x the number will be parsed as a
* hexadecimal (case insensitive), if it otherwise begins with 0, it will be
* parsed as an octal number. Otherwise it will be parsed as a decimal.
* @res: Where to write the result of the conversion on success.
*
* Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
* Used as a replacement for the obsolete simple_strtoull. Return code must
* be checked.
*/
static inline int __must_check kstrtol(const char *s, unsigned int base, long *res)
{
/*
* We want to shortcut function call, but
* __builtin_types_compatible_p(long, long long) = 0.
*/
if (sizeof(long) == sizeof(long long) &&
__alignof__(long) == __alignof__(long long))
return kstrtoll(s, base, (long long *)res);
else
return _kstrtol(s, base, res);
}
int __must_check kstrtouint(const char *s, unsigned int base, unsigned int *res);
int __must_check kstrtoint(const char *s, unsigned int base, int *res);
static inline int __must_check kstrtou64(const char *s, unsigned int base, u64 *res)
{
return kstrtoull(s, base, res);
}
static inline int __must_check kstrtos64(const char *s, unsigned int base, s64 *res)
{
return kstrtoll(s, base, res);
}
static inline int __must_check kstrtou32(const char *s, unsigned int base, u32 *res)
{
return kstrtouint(s, base, res);
}
static inline int __must_check kstrtos32(const char *s, unsigned int base, s32 *res)
{
return kstrtoint(s, base, res);
}
int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
int __must_check kstrtos16(const char *s, unsigned int base, s16 *res);
int __must_check kstrtou8(const char *s, unsigned int base, u8 *res);
int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res);
int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res);
int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res);
int __must_check kstrtol_from_user(const char __user *s, size_t count, unsigned int base, long *res);
int __must_check kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, unsigned int *res);
int __must_check kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, int *res);
int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigned int base, u16 *res);
int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res);
int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res);
int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res);
static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res)
{
return kstrtoull_from_user(s, count, base, res);
}
static inline int __must_check kstrtos64_from_user(const char __user *s, size_t count, unsigned int base, s64 *res)
{
return kstrtoll_from_user(s, count, base, res);
}
static inline int __must_check kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, u32 *res)
{
return kstrtouint_from_user(s, count, base, res);
}
static inline int __must_check kstrtos32_from_user(const char __user *s, size_t count, unsigned int base, s32 *res)
{
return kstrtoint_from_user(s, count, base, res);
}
/* Obsolete, do not use. Use kstrto<foo> instead */
extern unsigned long simple_strtoul(const char *,char **,unsigned int);
extern long simple_strtol(const char *,char **,unsigned int);
extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
extern long long simple_strtoll(const char *,char **,unsigned int);
#define strict_strtoul kstrtoul
#define strict_strtol kstrtol
#define strict_strtoull kstrtoull
#define strict_strtoll kstrtoll
extern int num_to_str(char *buf, int size, unsigned long long num);
/* lib/printf utilities */
extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...);
extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
extern __printf(3, 4)
int snprintf(char *buf, size_t size, const char *fmt, ...);
extern __printf(3, 0)
int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
extern __printf(3, 4)
int scnprintf(char *buf, size_t size, const char *fmt, ...);
extern __printf(3, 0)
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
extern __printf(2, 3)
char *kasprintf(gfp_t gfp, const char *fmt, ...);
extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
extern __scanf(2, 3)
int sscanf(const char *, const char *, ...);
extern __scanf(2, 0)
int vsscanf(const char *, const char *, va_list);
extern int get_option(char **str, int *pint);
extern char *get_options(const char *str, int nints, int *ints);
extern unsigned long long memparse(const char *ptr, char **retptr);
extern int core_kernel_text(unsigned long addr);
extern int core_kernel_data(unsigned long addr);
extern int __kernel_text_address(unsigned long addr);
extern int kernel_text_address(unsigned long addr);
extern int func_ptr_is_kernel_text(void *ptr);
struct pid;
extern struct pid *session_of_pgrp(struct pid *pgrp);
unsigned long int_sqrt(unsigned long);
extern void bust_spinlocks(int yes);
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
extern int panic_timeout;
extern int panic_on_oops;
extern int panic_on_unrecovered_nmi;
extern int panic_on_io_nmi;
extern int sysctl_panic_on_stackoverflow;
extern const char *print_tainted(void);
enum lockdep_ok {
LOCKDEP_STILL_OK,
LOCKDEP_NOW_UNRELIABLE
};
extern void add_taint(unsigned flag, enum lockdep_ok);
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
extern int root_mountflags;
extern bool early_boot_irqs_disabled;
/* Values used for system_state */
extern enum system_states {
SYSTEM_BOOTING,
SYSTEM_RUNNING,
SYSTEM_HALT,
SYSTEM_POWER_OFF,
SYSTEM_RESTART,
} system_state;
#define TAINT_PROPRIETARY_MODULE 0
#define TAINT_FORCED_MODULE 1
#define TAINT_UNSAFE_SMP 2
#define TAINT_FORCED_RMMOD 3
#define TAINT_MACHINE_CHECK 4
#define TAINT_BAD_PAGE 5
#define TAINT_USER 6
#define TAINT_DIE 7
#define TAINT_OVERRIDDEN_ACPI_TABLE 8
#define TAINT_WARN 9
#define TAINT_CRAP 10
#define TAINT_FIRMWARE_WORKAROUND 11
#define TAINT_OOT_MODULE 12
extern const char hex_asc[];
#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
#define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4]
static inline char *hex_byte_pack(char *buf, u8 byte)
{
*buf++ = hex_asc_hi(byte);
*buf++ = hex_asc_lo(byte);
return buf;
}
static inline char * __deprecated pack_hex_byte(char *buf, u8 byte)
{
return hex_byte_pack(buf, byte);
}
extern int hex_to_bin(char ch);
extern int __must_check hex2bin(u8 *dst, const char *src, size_t count);
/*
* General tracing related utility functions - trace_printk(),
* tracing_on/tracing_off and tracing_start()/tracing_stop
*
* Use tracing_on/tracing_off when you want to quickly turn on or off
* tracing. It simply enables or disables the recording of the trace events.
* This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on
* file, which gives a means for the kernel and userspace to interact.
* Place a tracing_off() in the kernel where you want tracing to end.
* From user space, examine the trace, and then echo 1 > tracing_on
* to continue tracing.
*
* tracing_stop/tracing_start has slightly more overhead. It is used
* by things like suspend to ram where disabling the recording of the
* trace is not enough, but tracing must actually stop because things
* like calling smp_processor_id() may crash the system.
*
* Most likely, you want to use tracing_on/tracing_off.
*/
#ifdef CONFIG_RING_BUFFER
/* trace_off_permanent stops recording with no way to bring it back */
void tracing_off_permanent(void);
#else
static inline void tracing_off_permanent(void) { }
#endif
enum ftrace_dump_mode {
DUMP_NONE,
DUMP_ALL,
DUMP_ORIG,
};
extern int asus_PRJ_ID;
extern char asus_project_RFsku[2];
extern char asus_project_lte[2];
extern char asus_project_stage[2];
extern char asus_project_mem[4];
extern char asus_project_hd[2];
enum project_pcbid {
ASUS_ZE550KL,
ASUS_ZE600KL,
ASUS_ZX550KL,
ASUS_ZD550KL,
};
enum project_stage {
ASUS_SR1 = 7,
ASUS_SR2 = 6,
ASUS_ER = 5,
};
#ifdef CONFIG_TRACING
void tracing_on(void);
void tracing_off(void);
int tracing_is_on(void);
void tracing_snapshot(void);
void tracing_snapshot_alloc(void);
extern void tracing_start(void);
extern void tracing_stop(void);
extern void ftrace_off_permanent(void);
static inline __printf(1, 2)
void ____trace_printk_check_format(const char *fmt, ...)
{
}
#define __trace_printk_check_format(fmt, args...) \
do { \
if (0) \
____trace_printk_check_format(fmt, ##args); \
} while (0)
/**
* trace_printk - printf formatting in the ftrace buffer
* @fmt: the printf format for printing
*
* Note: __trace_printk is an internal function for trace_printk and
* the @ip is passed in via the trace_printk macro.
*
* This function allows a kernel developer to debug fast path sections
* that printk is not appropriate for. By scattering in various
* printk like tracing in the code, a developer can quickly see
* where problems are occurring.
*
* This is intended as a debugging tool for the developer only.
* Please refrain from leaving trace_printks scattered around in
* your code. (Extra memory is used for special buffers that are
* allocated when trace_printk() is used)
*
* A little optization trick is done here. If there's only one
* argument, there's no need to scan the string for printf formats.
* The trace_puts() will suffice. But how can we take advantage of
* using trace_puts() when trace_printk() has only one argument?
* By stringifying the args and checking the size we can tell
* whether or not there are args. __stringify((__VA_ARGS__)) will
* turn into "()\0" with a size of 3 when there are no args, anything
* else will be bigger. All we need to do is define a string to this,
* and then take its size and compare to 3. If it's bigger, use
* do_trace_printk() otherwise, optimize it to trace_puts(). Then just
* let gcc optimize the rest.
*/
#define trace_printk(fmt, ...) \
do { \
char _______STR[] = __stringify((__VA_ARGS__)); \
if (sizeof(_______STR) > 3) \
do_trace_printk(fmt, ##__VA_ARGS__); \
else \
trace_puts(fmt); \
} while (0)
#define do_trace_printk(fmt, args...) \
do { \
static const char *trace_printk_fmt \
__attribute__((section("__trace_printk_fmt"))) = \
__builtin_constant_p(fmt) ? fmt : NULL; \
\
__trace_printk_check_format(fmt, ##args); \
\
if (__builtin_constant_p(fmt)) \
__trace_printk(_THIS_IP_, trace_printk_fmt, ##args); \
else \
__trace_printk(_THIS_IP_, fmt, ##args); \
} while (0)
extern __printf(2, 3)
int __trace_bprintk(unsigned long ip, const char *fmt, ...);
extern __printf(2, 3)
int __trace_printk(unsigned long ip, const char *fmt, ...);
extern int __trace_bputs(unsigned long ip, const char *str);
extern int __trace_puts(unsigned long ip, const char *str, int size);
/**
* trace_puts - write a string into the ftrace buffer
* @str: the string to record
*
* Note: __trace_bputs is an internal function for trace_puts and
* the @ip is passed in via the trace_puts macro.
*
* This is similar to trace_printk() but is made for those really fast
* paths that a developer wants the least amount of "Heisenbug" affects,
* where the processing of the print format is still too much.
*
* This function allows a kernel developer to debug fast path sections
* that printk is not appropriate for. By scattering in various
* printk like tracing in the code, a developer can quickly see
* where problems are occurring.
*
* This is intended as a debugging tool for the developer only.
* Please refrain from leaving trace_puts scattered around in
* your code. (Extra memory is used for special buffers that are
* allocated when trace_puts() is used)
*
* Returns: 0 if nothing was written, positive # if string was.
* (1 when __trace_bputs is used, strlen(str) when __trace_puts is used)
*/
#define trace_puts(str) ({ \
static const char *trace_printk_fmt \
__attribute__((section("__trace_printk_fmt"))) = \
__builtin_constant_p(str) ? str : NULL; \
\
if (__builtin_constant_p(str)) \
__trace_bputs(_THIS_IP_, trace_printk_fmt); \
else \
__trace_puts(_THIS_IP_, str, strlen(str)); \
})
extern void trace_dump_stack(int skip);
/*
* The double __builtin_constant_p is because gcc will give us an error
* if we try to allocate the static variable to fmt if it is not a
* constant. Even with the outer if statement.
*/
#define ftrace_vprintk(fmt, vargs) \
do { \
if (__builtin_constant_p(fmt)) { \
static const char *trace_printk_fmt \
__attribute__((section("__trace_printk_fmt"))) = \
__builtin_constant_p(fmt) ? fmt : NULL; \
\
__ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \
} else \
__ftrace_vprintk(_THIS_IP_, fmt, vargs); \
} while (0)
extern int
__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
extern int
__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
#else
static inline void tracing_start(void) { }
static inline void tracing_stop(void) { }
static inline void ftrace_off_permanent(void) { }
static inline void trace_dump_stack(void) { }
static inline void tracing_on(void) { }
static inline void tracing_off(void) { }
static inline int tracing_is_on(void) { return 0; }
static inline void tracing_snapshot(void) { }
static inline void tracing_snapshot_alloc(void) { }
static inline __printf(1, 2)
int trace_printk(const char *fmt, ...)
{
return 0;
}
static inline int
ftrace_vprintk(const char *fmt, va_list ap)
{
return 0;
}
static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
#endif /* CONFIG_TRACING */
/*
* min()/max()/clamp() macros that also do
* strict type-checking.. See the
* "unnecessary" pointer comparison.
*/
#define min(x, y) ({ \
typeof(x) _min1 = (x); \
typeof(y) _min2 = (y); \
(void) (&_min1 == &_min2); \
_min1 < _min2 ? _min1 : _min2; })
#define max(x, y) ({ \
typeof(x) _max1 = (x); \
typeof(y) _max2 = (y); \
(void) (&_max1 == &_max2); \
_max1 > _max2 ? _max1 : _max2; })
#define min3(x, y, z) ({ \
typeof(x) _min1 = (x); \
typeof(y) _min2 = (y); \
typeof(z) _min3 = (z); \
(void) (&_min1 == &_min2); \
(void) (&_min1 == &_min3); \
_min1 < _min2 ? (_min1 < _min3 ? _min1 : _min3) : \
(_min2 < _min3 ? _min2 : _min3); })
#define max3(x, y, z) ({ \
typeof(x) _max1 = (x); \
typeof(y) _max2 = (y); \
typeof(z) _max3 = (z); \
(void) (&_max1 == &_max2); \
(void) (&_max1 == &_max3); \
_max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \
(_max2 > _max3 ? _max2 : _max3); })
/**
* min_not_zero - return the minimum that is _not_ zero, unless both are zero
* @x: value1
* @y: value2
*/
#define min_not_zero(x, y) ({ \
typeof(x) __x = (x); \
typeof(y) __y = (y); \
__x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
/**
* clamp - return a value clamped to a given range with strict typechecking
* @val: current value
* @min: minimum allowable value
* @max: maximum allowable value
*
* This macro does strict typechecking of min/max to make sure they are of the
* same type as val. See the unnecessary pointer comparisons.
*/
#define clamp(val, min, max) ({ \
typeof(val) __val = (val); \
typeof(min) __min = (min); \
typeof(max) __max = (max); \
(void) (&__val == &__min); \
(void) (&__val == &__max); \
__val = __val < __min ? __min: __val; \
__val > __max ? __max: __val; })
/*
* ..and if you can't take the strict
* types, you can specify one yourself.
*
* Or not use min/max/clamp at all, of course.
*/
#define min_t(type, x, y) ({ \
type __min1 = (x); \
type __min2 = (y); \
__min1 < __min2 ? __min1: __min2; })
#define max_t(type, x, y) ({ \
type __max1 = (x); \
type __max2 = (y); \
__max1 > __max2 ? __max1: __max2; })
/**
* clamp_t - return a value clamped to a given range using a given type
* @type: the type of variable to use
* @val: current value
* @min: minimum allowable value
* @max: maximum allowable value
*
* This macro does no typechecking and uses temporary variables of type
* 'type' to make all the comparisons.
*/
#define clamp_t(type, val, min, max) ({ \
type __val = (val); \
type __min = (min); \
type __max = (max); \
__val = __val < __min ? __min: __val; \
__val > __max ? __max: __val; })
/**
* clamp_val - return a value clamped to a given range using val's type
* @val: current value
* @min: minimum allowable value
* @max: maximum allowable value
*
* This macro does no typechecking and uses temporary variables of whatever
* type the input argument 'val' is. This is useful when val is an unsigned
* type and min and max are literals that will otherwise be assigned a signed
* integer type.
*/
#define clamp_val(val, min, max) ({ \
typeof(val) __val = (val); \
typeof(val) __min = (min); \
typeof(val) __max = (max); \
__val = __val < __min ? __min: __val; \
__val > __max ? __max: __val; })
/*
* swap - swap value of @a and @b
*/
#define swap(a, b) \
do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*
*/
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
/* Trap pasters of __FUNCTION__ at compile-time */
#define __FUNCTION__ (__func__)
/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
#ifdef CONFIG_FTRACE_MCOUNT_RECORD
# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
#endif
/* To identify board information in panic logs, set this */
extern char *mach_panic_string;
#endif
| gpl-2.0 |
nurulimamnotes/sistem-informasi-sekolah | jibas/infosiswa/buletin/galerifoto/galerifoto_ss.php | 7300 | <?
/**[N]**
* JIBAS Education Community
* Jaringan Informasi Bersama Antar Sekolah
*
* @version: 3.2 (September 03, 2013)
* @notes: JIBAS Education Community will be managed by Yayasan Indonesia Membaca (http://www.indonesiamembaca.net)
*
* Copyright (C) 2009 Yayasan Indonesia Membaca (http://www.indonesiamembaca.net)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
**[N]**/ ?>
<?
require_once('../../include/sessionchecker.php');
require_once('../../include/common.php');
require_once('../../include/sessioninfo.php');
require_once('../../include/config.php');
require_once('../../include/db_functions.php');
$op="";
if (isset($_REQUEST[op]))
$op=$_REQUEST[op];
$page='t';
if (isset($_REQUEST[page]))
$page = $_REQUEST[page];
OpenDb();
$sql="SELECT * FROM jbsvcr.galerifoto WHERE idguru='".SI_USER_ID()."'";
$result=QueryDb($sql);
$num=@mysql_num_rows($result);
$cnt=1;
while ($row=@mysql_fetch_array($result))
{
$ket[$cnt]=$row[keterangan];
$nama[$cnt]=$row[nama];
$fn[$cnt]=$row[filename];
$rep[$cnt]=$row[replid];
$cnt++;
}
CloseDb();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" href="../../script/TinySlideshow/style.css" />
<link href="../../style/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../script/contentslider.css" />
<script type="text/javascript" language="javascript" src="../../style/lytebox.js"></script>
<script type="text/javascript" language="javascript" src="../../script/tools.js"></script>
<link rel="stylesheet" href="../../style/lytebox.css" type="text/css" media="screen" />
<script type="text/javascript" src="../../script/contentslider.js"></script>
<script language="javascript" src="../../script/ajax.js"></script>
<script src="SpryTabbedPanels.js" type="text/javascript"></script>
<script language="javascript" >
function get_fresh(){
document.location.href="galerifoto_ss.php";
}
function over(id){
var actmenu = document.getElementById('actmenu').value;
if (actmenu==id)
return false;
if (actmenu=='t')
document.getElementById('tabimages').src='../../images/s_over.png';
else
document.getElementById('tabimages').src='../../images/t_over.png';
}
function out(id){
var actmenu = document.getElementById('actmenu').value;
if (actmenu==id)
return false;
if (actmenu=='t')
document.getElementById('tabimages').src='../../images/t.png';
else
document.getElementById('tabimages').src='../../images/s.png';
}
function show(id){
if (id=='t'){
document.getElementById('actmenu').value='t';
document.getElementById('tabimages').src='../../images/t.png';
document.getElementById('slice_t').style.display='';
document.getElementById('salideshow').style.display='none';
} else {
document.getElementById('actmenu').value='s';
document.getElementById('tabimages').src='../../images/s.png';
document.getElementById('slice_t').style.display='none';
document.getElementById('salideshow').style.display='';
}
}
</script>
<style type="text/css">
<!--
.style1 {
font-size: 0.7px;
font-family: Verdana;
}
.style3 {font-size: 12px}
-->
</style>
<link href="SpryTabbedPanels.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="5">
<tr>
<td align="left"><font size="4" style="background-color:#ffcc66"> </font> <font size="4" color="Gray">Galeri Foto</font><br />
<a href="../../home.php" target="framecenter">Home</a> > <strong>Galeri Foto</strong><br />
<br /></td>
<td align="right" valign="bottom">
<a href="galerifoto.php"><img src="../../images/ico/thumbnail.gif" border="0"> Thumbnails</a>
<a href="#" onClick="newWindow('tambahfoto.php?pagesource=ss','TambahFoto','550','207','resizable=1,scrollbars=0,status=0,toolbar=0');"><img src="../../images/ico/tambah.png" border="0" /> Tambah Foto</a><br>
</td>
</tr>
<tr>
<td align="left" colspan='2'>
<table border='0' width='100%'>
<tr>
<td width='25%'> </td>
<td width='*'>
<? if ($num>0)
{ ?>
<ul id="slideshow">
<? for ($i = 1; $i <= $num; $i++)
{
$fphoto = "$FILESHARE_ADDR/galeriguru/photos/".$fn[$i];
$fthumb = "$FILESHARE_ADDR/galeriguru/thumbnails/".$fn[$i]; ?>
<li>
<h3><?=$nama[$i]?></h3>
<span><?=$fphoto?></span>
<p><?=$ket[$i]?></p>
<a href="#"><img src="<?=$fthumb?>" height="480" alt="" /></a>
</li>
<? } ?>
</ul>
<div id="wrapper" >
<div id="fullsize" style="width: 800px; height: 600px;">
<div id="imgprev" class="imgnav" title="Previous Image"></div>
<div id="imglink"></div>
<div id="imgnext" class="imgnav" title="Next Image"></div>
<div id="image"></div>
<div id="information">
<h3></h3>
<p></p>
</div>
</div>
<div id="thumbnails" style="visibility: hidden;">
<div id="slideleft" title="Slide Left"></div>
<div id="slidearea">
<div id="slider"></div>
</div>
<div id="slideright" title="Slide Right"></div>
</div>
</div>
<script type="text/javascript" src="../../script/TinySlideshow/compressed.js"></script>
<script type="text/javascript">
$('slideshow').style.display='none';
$('wrapper').style.display='block';
var slideshow=new TINY.slideshow("slideshow");
window.onload=function(){
slideshow.auto=true;
slideshow.speed=5;
slideshow.link="linkhover";
slideshow.info="information";
slideshow.thumbs="slider";
slideshow.left="slideleft";
slideshow.right="slideright";
slideshow.scrollSpeed=4;
slideshow.height=480;
slideshow.spacing=5;
slideshow.active="#fff";
slideshow.init("slideshow","image","imgprev","imgnext","imglink");
}
</script>
<? } else { ?>
<table width="100%" border="0" cellspacing="0" align="center">
<tr>
<td><div align="center"><em>Tidak ada foto</em></div></td>
</tr>
</table>
<? } ?>
</td>
<td width='25%'> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html> | gpl-2.0 |
MrDunne/myblockchain | storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/OperationImpl.java | 13552 | /*
Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package com.myblockchain.clusterj.tie;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.myblockchain.clusterj.ClusterJUserException;
import com.myblockchain.clusterj.core.store.Blob;
import com.myblockchain.clusterj.core.store.Column;
import com.myblockchain.clusterj.core.store.Operation;
import com.myblockchain.clusterj.core.store.ResultData;
import com.myblockchain.clusterj.core.store.Table;
import com.myblockchain.clusterj.core.util.I18NHelper;
import com.myblockchain.clusterj.core.util.Logger;
import com.myblockchain.clusterj.core.util.LoggerFactoryService;
import com.myblockchain.clusterj.tie.DbImpl.BufferManager;
import com.myblockchain.ndbjtie.ndbapi.NdbBlob;
import com.myblockchain.ndbjtie.ndbapi.NdbOperation;
/**
*
*/
class OperationImpl implements Operation {
/** My message translator */
static final I18NHelper local = I18NHelper
.getInstance(OperationImpl.class);
/** My logger */
static final Logger logger = LoggerFactoryService.getFactory()
.getInstance(OperationImpl.class);
private NdbOperation ndbOperation;
protected List<Column> storeColumns = new ArrayList<Column>();
protected ClusterTransactionImpl clusterTransaction;
/** The size of the receive buffer for this operation (may be zero for non-read operations) */
protected int bufferSize;
/** The maximum column id for this operation (may be zero for non-read operations) */
protected int maximumColumnId;
/** The offsets into the buffer for each column (may be null for non-read operations) */
protected int[] offsets;
/** The lengths of fields in the buffer for each column (may be null for non-read operations) */
protected int[] lengths;
/** The maximum length of any column in this operation */
protected int maximumColumnLength;
protected BufferManager bufferManager;
/** Constructor used for insert and delete operations that do not need to read data.
*
* @param operation the operation
* @param transaction the transaction
*/
public OperationImpl(NdbOperation operation, ClusterTransactionImpl transaction) {
this.ndbOperation = operation;
this.clusterTransaction = transaction;
this.bufferManager = clusterTransaction.getBufferManager();
}
/** Constructor used for read operations. The table is used to obtain data used
* to lay out memory for the result.
* @param storeTable the table
* @param operation the operation
* @param transaction the transaction
*/
public OperationImpl(Table storeTable, NdbOperation operation, ClusterTransactionImpl transaction) {
this(operation, transaction);
TableImpl tableImpl = (TableImpl)storeTable;
this.maximumColumnId = tableImpl.getMaximumColumnId();
this.bufferSize = tableImpl.getBufferSize();
this.offsets = tableImpl.getOffsets();
this.lengths = tableImpl.getLengths();
this.maximumColumnLength = tableImpl.getMaximumColumnLength();
}
public void equalBigInteger(Column storeColumn, BigInteger value) {
ByteBuffer buffer = Utility.convertValue(storeColumn, value);
int returnCode = ndbOperation.equal(storeColumn.getName(), buffer);
handleError(returnCode, ndbOperation);
}
public void equalBoolean(Column storeColumn, boolean booleanValue) {
byte value = (booleanValue?(byte)0x01:(byte)0x00);
int returnCode = ndbOperation.equal(storeColumn.getName(), value);
handleError(returnCode, ndbOperation);
}
public void equalByte(Column storeColumn, byte value) {
int storeValue = Utility.convertByteValueForStorage(storeColumn, value);
int returnCode = ndbOperation.equal(storeColumn.getName(), storeValue);
handleError(returnCode, ndbOperation);
}
public void equalBytes(Column storeColumn, byte[] value) {
if (logger.isDetailEnabled()) logger.detail("Column: " + storeColumn.getName() + " columnId: " + storeColumn.getColumnId() + " data length: " + value.length);
ByteBuffer buffer = Utility.convertValue(storeColumn, value);
int returnCode = ndbOperation.equal(storeColumn.getName(), buffer);
handleError(returnCode, ndbOperation);
}
public void equalDecimal(Column storeColumn, BigDecimal value) {
ByteBuffer buffer = Utility.convertValue(storeColumn, value);
int returnCode = ndbOperation.equal(storeColumn.getName(), buffer);
handleError(returnCode, ndbOperation);
}
public void equalDouble(Column storeColumn, double value) {
ByteBuffer buffer = Utility.convertValue(storeColumn, value);
int returnCode = ndbOperation.equal(storeColumn.getName(), buffer);
handleError(returnCode, ndbOperation);
}
public void equalFloat(Column storeColumn, float value) {
ByteBuffer buffer = Utility.convertValue(storeColumn, value);
int returnCode = ndbOperation.equal(storeColumn.getName(), buffer);
handleError(returnCode, ndbOperation);
}
public void equalInt(Column storeColumn, int value) {
int returnCode = ndbOperation.equal(storeColumn.getName(), value);
handleError(returnCode, ndbOperation);
}
public void equalShort(Column storeColumn, short value) {
int storeValue = Utility.convertShortValueForStorage(storeColumn, value);
int returnCode = ndbOperation.equal(storeColumn.getName(), storeValue);
handleError(returnCode, ndbOperation);
}
public void equalLong(Column storeColumn, long value) {
long storeValue = Utility.convertLongValueForStorage(storeColumn, value);
int returnCode = ndbOperation.equal(storeColumn.getName(), storeValue);
handleError(returnCode, ndbOperation);
}
public void equalString(Column storeColumn, String value) {
ByteBuffer stringStorageBuffer = Utility.encode(value, storeColumn, bufferManager);
int returnCode = ndbOperation.equal(storeColumn.getName(), stringStorageBuffer);
bufferManager.clearStringStorageBuffer();
handleError(returnCode, ndbOperation);
}
public void getBlob(Column storeColumn) {
NdbBlob ndbBlob = ndbOperation.getBlobHandleM(storeColumn.getColumnId());
handleError(ndbBlob, ndbOperation);
}
public Blob getBlobHandle(Column storeColumn) {
NdbBlob blobHandle = ndbOperation.getBlobHandleM(storeColumn.getColumnId());
handleError(blobHandle, ndbOperation);
return new BlobImpl(blobHandle);
}
/** Specify the columns to be used for the operation.
* For now, just save the columns. When resultData is called, pass the columns
* to the ResultData constructor and then execute the operation.
*
*/
public void getValue(Column storeColumn) {
storeColumns.add(storeColumn);
}
public void postExecuteCallback(Runnable callback) {
clusterTransaction.postExecuteCallback(callback);
}
/** Construct a new ResultData using the saved column data and then execute the operation.
*
*/
public ResultData resultData() {
return resultData(true);
}
/** Construct a new ResultData and if requested, execute the operation.
*
*/
public ResultData resultData(boolean execute) {
if (logger.isDetailEnabled()) logger.detail("storeColumns: " + Arrays.toString(storeColumns.toArray()));
ResultDataImpl result;
if (execute) {
result = new ResultDataImpl(ndbOperation, storeColumns, maximumColumnId, bufferSize,
offsets, lengths, bufferManager, false);
clusterTransaction.executeNoCommit(false, true);
} else {
result = new ResultDataImpl(ndbOperation, storeColumns, maximumColumnId, bufferSize,
offsets, lengths, bufferManager, true);
}
return result;
}
public void setBigInteger(Column storeColumn, BigInteger value) {
ByteBuffer buffer = Utility.convertValue(storeColumn, value);
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), buffer);
handleError(returnCode, ndbOperation);
}
public void setBoolean(Column storeColumn, Boolean value) {
byte byteValue = (value?(byte)0x01:(byte)0x00);
setByte(storeColumn, byteValue);
}
public void setByte(Column storeColumn, byte value) {
int storeValue = Utility.convertByteValueForStorage(storeColumn, value);
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), storeValue);
handleError(returnCode, ndbOperation);
}
public void setBytes(Column storeColumn, byte[] value) {
// TODO use the string storage buffer instead of allocating a new buffer for each value
int length = value.length;
if (length > storeColumn.getLength()) {
throw new ClusterJUserException(local.message("ERR_Data_Too_Long",
storeColumn.getName(), storeColumn.getLength(), length));
}
ByteBuffer buffer = Utility.convertValue(storeColumn, value);
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), buffer);
handleError(returnCode, ndbOperation);
}
public void setDecimal(Column storeColumn, BigDecimal value) {
ByteBuffer buffer = Utility.convertValue(storeColumn, value);
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), buffer);
handleError(returnCode, ndbOperation);
}
public void setDouble(Column storeColumn, Double value) {
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), value);
handleError(returnCode, ndbOperation);
}
public void setFloat(Column storeColumn, Float value) {
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), value);
handleError(returnCode, ndbOperation);
}
public void setInt(Column storeColumn, Integer value) {
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), value);
handleError(returnCode, ndbOperation);
}
public void setLong(Column storeColumn, long value) {
long storeValue = Utility.convertLongValueForStorage(storeColumn, value);
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), storeValue);
handleError(returnCode, ndbOperation);
}
public void setNull(Column storeColumn) {
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), null);
handleError(returnCode, ndbOperation);
}
public void setShort(Column storeColumn, Short value) {
int storeValue = Utility.convertShortValueForStorage(storeColumn, value);
int returnCode = ndbOperation.setValue(storeColumn.getName(), storeValue);
handleError(returnCode, ndbOperation);
}
public void setString(Column storeColumn, String value) {
ByteBuffer stringStorageBuffer = Utility.encode(value, storeColumn, bufferManager);
int length = stringStorageBuffer.remaining() - storeColumn.getPrefixLength();
if (length > storeColumn.getLength()) {
throw new ClusterJUserException(local.message("ERR_Data_Too_Long",
storeColumn.getName(), storeColumn.getLength(), length));
}
int returnCode = ndbOperation.setValue(storeColumn.getColumnId(), stringStorageBuffer);
bufferManager.clearStringStorageBuffer();
handleError(returnCode, ndbOperation);
}
public int errorCode() {
return ndbOperation.getNdbError().code();
}
protected void handleError(int returnCode, NdbOperation ndbOperation) {
if (returnCode == 0) {
return;
} else {
Utility.throwError(returnCode, ndbOperation.getNdbError());
}
}
protected static void handleError(Object object, NdbOperation ndbOperation) {
if (object != null) {
return;
} else {
Utility.throwError(null, ndbOperation.getNdbError());
}
}
public void beginDefinition() {
// nothing to do
}
public void endDefinition() {
// nothing to do
}
public int getErrorCode() {
return ndbOperation.getNdbError().code();
}
public int getClassification() {
return ndbOperation.getNdbError().classification();
}
public int getMysqlCode() {
return ndbOperation.getNdbError().myblockchain_code();
}
public int getStatus() {
return ndbOperation.getNdbError().status();
}
public void freeResourcesAfterExecute() {
}
}
| gpl-2.0 |
jameslz/MICA | link_to_compressed.go | 843 | package mica
import "fmt"
// LinkToCompressed represents a link from a reference sequence to a
// compressed original sequence. It serves as a bridge from a BLAST hit in
// the coarse database to the corresponding original sequence that is
// redundant to the specified residue range in the reference sequence.
type LinkToCompressed struct {
OrgSeqId uint32
CoarseStart, CoarseEnd uint16
Next *LinkToCompressed
}
func NewLinkToCompressed(
orgSeqId uint32, coarseStart, coarseEnd uint16) *LinkToCompressed {
return &LinkToCompressed{
OrgSeqId: orgSeqId,
CoarseStart: coarseStart,
CoarseEnd: coarseEnd,
Next: nil,
}
}
func (lk LinkToCompressed) String() string {
return fmt.Sprintf("original sequence id: %d, coarse range: (%d, %d)",
lk.OrgSeqId, lk.CoarseStart, lk.CoarseEnd)
}
| gpl-2.0 |
burstas/context-free | src-common/renderimpl.cpp | 35325 | // renderimpl.cpp
// this file is part of Context Free
// ---------------------
// Copyright (C) 2006-2008 Mark Lentczner - [email protected]
// Copyright (C) 2006-2014 John Horigan - [email protected]
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// John Horigan can be contacted at [email protected] or at
// John Horigan, 1209 Villa St., Mountain View, CA 94041-1123, USA
//
// Mark Lentczner can be contacted at [email protected] or at
// Mark Lentczner, 1209 Villa St., Mountain View, CA 94041-1123, USA
//
//
#include "renderimpl.h"
#include <iterator>
#include <string>
#include <algorithm>
#include <stack>
#include <cassert>
#include <functional>
#ifdef _WIN32
#include <float.h>
#include <math.h>
#define isfinite _finite
#else
#include <math.h>
#endif
#include "shapeSTL.h"
#include "primShape.h"
#include "builder.h"
#include "astreplacement.h"
#include "CmdInfo.h"
#include "tiledCanvas.h"
using namespace std;
using namespace AST;
//#define DEBUG_SIZES
unsigned int RendererImpl::MoveFinishedAt = 0; // when this many, move to file
unsigned int RendererImpl::MoveUnfinishedAt = 0; // when this many, move to files
unsigned int RendererImpl::MaxMergeFiles = 0; // maximum number of files to merge at once
const double SHAPE_BORDER = 1.0; // multiplier of shape size when calculating bounding box
const double FIXED_BORDER = 8.0; // fixed extra border, in pixels
RendererImpl::RendererImpl(CFDGImpl* cfdg,
int width, int height, double minSize,
int variation, double border)
: RendererAST(width, height), m_cfdg(cfdg), m_canvas(nullptr), mColorConflict(false),
m_maxShapes(500000000), mVariation(variation), m_border(border),
mScaleArea(0.0), mScale(0.0), m_currScale(0.0), m_currArea(0.0),
m_minSize(minSize), mFrameTimeBounds(1.0, -Renderer::Infinity, Renderer::Infinity),
circleCopy(primShape::circle), squareCopy(primShape::square), triangleCopy(primShape::triangle),
shapeMap{}
{
if (MoveFinishedAt == 0) {
#ifndef DEBUG_SIZES
size_t mem = m_cfdg->system()->getPhysicalMemory();
if (mem == 0) {
MoveFinishedAt = MoveUnfinishedAt = 2000000;
} else {
MoveFinishedAt = MoveUnfinishedAt = static_cast<unsigned int>(mem / (sizeof(FinishedShape) * 4));
}
MaxMergeFiles = 200; // maximum number of files to merge at once
#else
MoveFinishedAt = 1000; // when this many, move to file
MoveUnfinishedAt = 200; // when this many, move to files
MaxMergeFiles = 4; // maximum number of files to merge at once
#endif
}
mCFstack.reserve(8000);
shapeMap = { { CommandInfo(&circleCopy), CommandInfo(&squareCopy), CommandInfo(&triangleCopy)} };
m_cfdg->hasParameter(CFG::FrameTime, mCurrentTime, nullptr);
m_cfdg->hasParameter(CFG::Frame, mCurrentFrame, nullptr);
}
void
RendererImpl::colorConflict(const yy::location& w)
{
if (mColorConflict) return;
CfdgError err(w, "Conflicting color change");
system()->syntaxError(err);
mColorConflict = true;
}
void
RendererImpl::init()
{
// Performs RendererImpl initializations that are needed before rendering
// and before each frame of an animation
mCurrentSeed.seed(static_cast<unsigned long long>(mVariation));
mCurrentSeed();
Shape dummy;
for (const rep_ptr& rep: m_cfdg->mCFDGcontents.mBody) {
if (const ASTdefine* def = dynamic_cast<const ASTdefine*> (rep.get()))
def->traverse(dummy, false, this);
}
mFinishedFileCount = 0;
mUnfinishedFileCount = 0;
mFixedBorderX = mFixedBorderY = 0.0;
mShapeBorder = 1.0;
mTotalArea = 0.0;
m_minArea = 0.3;
m_outputSoFar = m_stats.shapeCount = m_stats.toDoCount = 0;
double minSize = m_minSize;
m_cfdg->hasParameter(CFG::MinimumSize, minSize, this);
minSize = (minSize <= 0.0) ? 0.3 : minSize;
m_minArea = minSize * minSize;
mFixedBorderX = FIXED_BORDER * ((m_border <= 1.0) ? m_border : 1.0);
mShapeBorder = SHAPE_BORDER * ((m_border <= 1.0) ? 1.0 : m_border);
m_cfdg->hasParameter(CFG::BorderFixed, mFixedBorderX, this);
m_cfdg->hasParameter(CFG::BorderDynamic, mShapeBorder, this);
if (2 * static_cast<int>(fabs(mFixedBorderX)) >= min(m_width, m_height))
mFixedBorderX = 0.0;
if (mShapeBorder <= 0.0)
mShapeBorder = 1.0;
if (m_cfdg->hasParameter(CFG::MaxNatural, mMaxNatural, this) &&
(mMaxNatural < 1.0 || (mMaxNatural - 1.0) == mMaxNatural))
{
const ASTexpression* max = m_cfdg->hasParameter(CFG::MaxNatural);
throw CfdgError(max->where, (mMaxNatural < 1.0) ?
"CF::MaxNatural must be >= 1" :
"CF::MaxNatural must be < 9007199254740992");
}
mCurrentPath.reset(new AST::ASTcompiledPath());
m_cfdg->getSymmetry(mSymmetryOps, this);
m_cfdg->setBackgroundColor(this);
}
void
RendererImpl::initBounds()
{
init();
double tile_x, tile_y;
m_tiled = m_cfdg->isTiled(nullptr, &tile_x, &tile_y);
m_frieze = m_cfdg->isFrieze(nullptr, &tile_x, &tile_y);
m_sized = m_cfdg->isSized(&tile_x, &tile_y);
m_timed = m_cfdg->isTimed(&mTimeBounds);
if (m_tiled || m_sized) {
mFixedBorderX = mShapeBorder = 0.0;
mBounds.mMin_X = -(mBounds.mMax_X = tile_x / 2.0);
mBounds.mMin_Y = -(mBounds.mMax_Y = tile_y / 2.0);
rescaleOutput(m_width, m_height, true);
mScaleArea = m_currArea;
}
if (m_frieze == CFDG::frieze_x)
m_frieze_size = tile_x / 2.0;
if (m_frieze == CFDG::frieze_y)
m_frieze_size = tile_y / 2.0;
if (m_frieze != CFDG::frieze_y)
mFixedBorderY = mFixedBorderX;
if (m_frieze == CFDG::frieze_x)
mFixedBorderX = 0.0;
}
void
RendererImpl::resetSize(int x, int y)
{
m_width = x;
m_height = y;
if (m_tiled || m_sized) {
m_currScale = m_currArea = 0.0;
rescaleOutput(m_width, m_height, true);
mScaleArea = m_currArea;
}
}
RendererImpl::~RendererImpl()
{
cleanup();
if (AbortEverything)
return;
#ifdef EXTREME_PARAM_DEBUG
AbstractSystem* sys = system();
for (auto &p: StackRule::ParamMap) {
if (p.second > 0)
sys->message("Parameter at %p is still alive, it is param number %d\n", p.first, p.second);
}
#endif
}
class Stopped { };
void
RendererImpl::cleanup()
{
// delete temp files before checking for abort
m_finishedFiles.clear();
m_unfinishedFiles.clear();
try {
std::function <void (const Shape& s)> releaseParam([](const Shape& s) {
if (Renderer::AbortEverything)
throw Stopped();
s.releaseParams();
});
for_each(mUnfinishedShapes.begin(), mUnfinishedShapes.end(), releaseParam);
for_each(mFinishedShapes.begin(), mFinishedShapes.end(), releaseParam);
} catch (Stopped&) {
return;
} catch (exception& e) {
system()->catastrophicError(e.what());
return;
}
mUnfinishedShapes.clear();
mFinishedShapes.clear();
unwindStack(0, m_cfdg->mCFDGcontents.mParameters);
mCurrentPath.reset();
m_cfdg->resetCachedPaths();
}
void
RendererImpl::setMaxShapes(int n)
{
m_maxShapes = n ? n : 400000000;
}
void
RendererImpl::resetBounds()
{
mBounds = Bounds();
}
void
RendererImpl::outputPrep(Canvas* canvas)
{
m_canvas = canvas;
if (canvas) {
m_width = canvas->mWidth;
m_height = canvas->mHeight;
if (m_tiled || m_frieze) {
agg::trans_affine tr;
m_cfdg->isTiled(&tr);
m_cfdg->isFrieze(&tr);
m_tiledCanvas.reset(new tiledCanvas(canvas, tr, m_frieze));
m_tiledCanvas->scale(m_currScale);
m_canvas = m_tiledCanvas.get();
}
mFrameTimeBounds.load_from(1.0, -Renderer::Infinity, Renderer::Infinity);
}
requestStop = false;
requestFinishUp = false;
requestUpdate = false;
m_stats.inOutput = false;
m_stats.animating = false;
m_stats.finalOutput = false;
}
double
RendererImpl::run(Canvas * canvas, bool partialDraw)
{
if (!m_stats.animating)
outputPrep(canvas);
int reportAt = 250;
Shape initShape = m_cfdg->getInitialShape(this);
initShape.mWorldState.mRand64Seed = mCurrentSeed;
if (!m_timed)
mTimeBounds = initShape.mWorldState.m_time;
try {
processShape(initShape);
} catch (CfdgError& e) {
requestStop = true;
system()->syntaxError(e);
} catch (exception& e) {
requestStop = true;
system()->catastrophicError(e.what());
}
for (;;) {
fileIfNecessary();
if (requestStop) break;
if (requestFinishUp) break;
if (mUnfinishedShapes.empty()) break;
if ((m_stats.shapeCount + m_stats.toDoCount) > m_maxShapes)
break;
// Get the largest unfinished shape
Shape s = mUnfinishedShapes.front();
pop_heap(mUnfinishedShapes.begin(), mUnfinishedShapes.end());
mUnfinishedShapes.pop_back();
m_stats.toDoCount--;
try {
const ASTrule* rule = m_cfdg->findRule(s.mShapeType, s.mWorldState.mRand64Seed.getDouble());
m_drawingMode = false; // shouldn't matter
rule->traverse(s, false, this);
} catch (CfdgError& e) {
requestStop = true;
system()->syntaxError(e);
break;
} catch (exception& e) {
requestStop = true;
system()->catastrophicError(e.what());
break;
}
if (requestUpdate || (m_stats.shapeCount > reportAt)) {
if (partialDraw)
outputPartial();
outputStats();
reportAt = 2 * m_stats.shapeCount;
}
}
if (!m_cfdg->usesTime && !m_timed)
mTimeBounds.load_from(1.0, 0.0, mTotalArea);
if (!requestStop) {
outputFinal();
}
if (!requestStop) {
outputStats();
if (m_canvas)
system()->message("Done.");
}
if (!m_canvas && m_frieze)
rescaleOutput(m_width, m_height, true);
return m_currScale;
}
void
RendererImpl::draw(Canvas* canvas)
{
mFrameTimeBounds.load_from(1.0, -Renderer::Infinity, Renderer::Infinity);
outputPrep(canvas);
outputFinal();
outputStats();
}
class OutputBounds
{
public:
OutputBounds(int frames, const agg::trans_affine_time& timeBounds,
int width, int height, RendererImpl& renderer);
void apply(const FinishedShape&);
const Bounds& frameBounds(int frame) { return mFrameBounds[frame]; }
int frameCount(int frame) { return mFrameCounts[frame]; }
void finalAccumulate();
// call after all the frames to compute the bounds at each frame
void backwardFilter(double framesToHalf);
void smooth(int window);
private:
agg::trans_affine_time mTimeBounds;
double mFrameScale;
vector<Bounds> mFrameBounds;
vector<int> mFrameCounts;
double mScale;
int mWidth;
int mHeight;
int mFrames;
RendererImpl& mRenderer;
OutputBounds& operator=(const OutputBounds&); // not defined
};
OutputBounds::OutputBounds(int frames, const agg::trans_affine_time& timeBounds,
int width, int height, RendererImpl& renderer)
: mTimeBounds(timeBounds), mScale(0.0),
mWidth(width), mHeight(height), mFrames(frames), mRenderer(renderer)
{
mFrameScale = static_cast<double>(frames) / (timeBounds.tend - timeBounds.tbegin);
mFrameBounds.resize(frames);
mFrameCounts.resize(frames, 0);
}
void
OutputBounds::apply(const FinishedShape& s)
{
if (mRenderer.requestStop || mRenderer.requestFinishUp) throw Stopped();
if (mScale == 0.0) {
// If we don't know the approximate scale yet then just
// make an educated guess.
mScale = (mWidth + mHeight) / sqrt(fabs(s.mWorldState.m_transform.determinant()));
}
agg::trans_affine_time frameTime(s.mWorldState.m_time);
frameTime.translate(-mTimeBounds.tbegin);
frameTime.scale(mFrameScale);
int begin = (frameTime.tbegin < mFrames) ? static_cast<int>(floor(frameTime.tbegin)) : (mFrames - 1);
int end = (frameTime.tend < mFrames) ? static_cast<int>(floor(frameTime.tend)) : (mFrames - 1);
if (begin < 0) begin = 0;
if (end < 0) end = 0;
for (int frame = begin; frame <= end; ++frame) {
mFrameBounds[frame] += s.mBounds;
}
mFrameCounts[begin] += 1;
}
void
OutputBounds::finalAccumulate()
{
return;
// Accumulation is done in the apply method
#if 0
vector<Bounds>::iterator prev, curr, end;
prev = mFrameBounds.begin();
end = mFrameBounds.end();
if (prev == end) return;
for (curr = prev + 1; curr != end; prev = curr, ++curr) {
*curr += *prev;
}
#endif
}
void
OutputBounds::backwardFilter(double framesToHalf)
{
double alpha = pow(0.5, 1.0 / framesToHalf);
vector<Bounds>::reverse_iterator prev, curr, end;
prev = mFrameBounds.rbegin();
end = mFrameBounds.rend();
if (prev == end) return;
for (curr = prev + 1; curr != end; prev = curr, ++curr) {
*curr = curr->interpolate(*prev, alpha);
}
}
void
OutputBounds::smooth(int window)
{
size_t frames = mFrameBounds.size();
if (frames == 0) return;
mFrameBounds.resize(frames + window - 1, mFrameBounds.back());
vector<Bounds>::iterator write, read, end;
read = mFrameBounds.begin();
double factor = 1.0 / window;
Bounds accum;
for (int i = 0; i < window; ++i)
accum.gather(*read++, factor);
write = mFrameBounds.begin();
end = mFrameBounds.end();
for (;;) {
Bounds old = *write;
*write++ = accum;
accum.gather(old, -factor);
if (read == end) break;
accum.gather(*read++, factor);
}
mFrameBounds.resize(frames);
}
void
RendererImpl::animate(Canvas* canvas, int frames, bool zoom)
{
outputPrep(canvas);
const bool ftime = m_cfdg->usesFrameTime;
zoom = zoom && !ftime;
if (ftime)
cleanup();
// start with a blank frame
int curr_width = m_width;
int curr_height = m_height;
rescaleOutput(curr_width, curr_height, true);
m_canvas->start(true, m_cfdg->getBackgroundColor(),
curr_width, curr_height);
m_canvas->end();
double frameInc = (mTimeBounds.tend - mTimeBounds.tbegin) / frames;
OutputBounds outputBounds(frames, mTimeBounds, curr_width, curr_height, *this);
if (zoom) {
system()->message("Computing zoom");
try {
forEachShape(true, [&](const FinishedShape& s) {
outputBounds.apply(s);
});
//outputBounds.finalAccumulate();
outputBounds.backwardFilter(10.0);
//outputBounds.smooth(3);
} catch (Stopped&) {
m_stats.animating = false;
return;
} catch (exception& e) {
system()->catastrophicError(e.what());
return;
}
}
m_stats.shapeCount = 0;
m_stats.animating = true;
mFrameTimeBounds.tend = mTimeBounds.tbegin;
Bounds saveBounds = mBounds;
for (int frameCount = 1; frameCount <= frames; ++frameCount)
{
system()->message("Generating frame %d of %d", frameCount, frames);
if (zoom) mBounds = outputBounds.frameBounds(frameCount - 1);
m_stats.shapeCount += outputBounds.frameCount(frameCount - 1);
mFrameTimeBounds.tbegin = mFrameTimeBounds.tend;
mFrameTimeBounds.tend = mTimeBounds.tbegin + frameInc * frameCount;
if (ftime) {
mCurrentTime = (mFrameTimeBounds.tbegin + mFrameTimeBounds.tend) * 0.5;
mCurrentFrame = (frameCount - 1.0)/(frames - 1.0);
try {
init();
} catch (CfdgError& err) {
system()->syntaxError(err);
cleanup();
mBounds = saveBounds;
m_stats.animating = false;
outputStats();
return;
}
run(canvas, false);
m_canvas = canvas;
} else {
outputFinal();
outputStats();
}
if (ftime)
cleanup();
if (requestStop || requestFinishUp) break;
}
mBounds = saveBounds;
m_stats.animating = false;
outputStats();
system()->message("Animation of %d frames complete", frames);
}
void
RendererImpl::processShape(const Shape& s)
{
double area = s.area();
if (!isfinite(area)) {
requestStop = true;
system()->error();
system()->message("A shape got too big.");
s.releaseParams();
return;
}
if (s.mWorldState.m_time.tbegin > s.mWorldState.m_time.tend) {
s.releaseParams();
return;
}
if (m_cfdg->getShapeType(s.mShapeType) == CFDGImpl::ruleType &&
m_cfdg->shapeHasRules(s.mShapeType))
{
// only add it if it's big enough (or if there are no finished shapes yet)
if (!mBounds.valid() || (area * mScaleArea >= m_minArea)) {
m_stats.toDoCount++;
mUnfinishedShapes.push_back(s);
push_heap(mUnfinishedShapes.begin(), mUnfinishedShapes.end());
} else {
s.releaseParams();
}
} else if (m_cfdg->getShapeType(s.mShapeType) == CFDGImpl::pathType) {
const ASTrule* rule = m_cfdg->findRule(s.mShapeType, 0.0);
processPrimShape(s, rule);
} else if (primShape::isPrimShape(s.mShapeType)) {
processPrimShape(s);
} else {
requestStop = true;
s.releaseParams();
system()->error();
system()->message("Shape with no rules encountered: %s.",
m_cfdg->decodeShapeName(s.mShapeType).c_str());
}
}
void
RendererImpl::processPrimShape(const Shape& s, const ASTrule* path)
{
size_t num = mSymmetryOps.size();
if (num == 0 || s.mShapeType == primShape::fillType) {
processPrimShapeSiblings(s, path);
} else {
for (size_t i = 0; i < num; ++i) {
Shape sym(s);
sym.mWorldState.m_transform.multiply(mSymmetryOps[i]);
processPrimShapeSiblings(sym, path);
}
}
s.releaseParams();
}
void
RendererImpl::processPrimShapeSiblings(const Shape& s, const ASTrule* path)
{
m_stats.shapeCount++;
if (mScale == 0.0) {
// If we don't know the approximate scale yet then just
// make an educated guess.
mScale = (m_width + m_height) / sqrt(fabs(s.mWorldState.m_transform.determinant()));
}
if (path || s.mShapeType != primShape::fillType) {
mCurrentCentroid.x = mCurrentCentroid.y = mCurrentArea = 0.0;
mPathBounds.invalidate();
m_drawingMode = false;
if (path) {
mOpsOnly = false;
path->traversePath(s, this);
} else {
CommandInfo* attr = nullptr;
if (s.mShapeType < 3) attr = &(shapeMap[s.mShapeType]);
processPathCommand(s, attr);
}
mTotalArea += mCurrentArea;
if (!m_tiled && !m_sized) {
mBounds.merge(mPathBounds.dilate(mShapeBorder));
if (m_frieze == CFDG::frieze_x)
mBounds.mMin_X = -(mBounds.mMax_X = m_frieze_size);
if (m_frieze == CFDG::frieze_y)
mBounds.mMin_Y = -(mBounds.mMax_Y = m_frieze_size);
mScale = mBounds.computeScale(m_width, m_height,
mFixedBorderX, mFixedBorderY, false);
mScaleArea = mScale * mScale;
}
} else {
mCurrentArea = 1.0;
}
FinishedShape fs(s, m_stats.shapeCount, mPathBounds);
fs.mWorldState.m_Z.sz = mCurrentArea;
if (!m_cfdg->usesTime) {
fs.mWorldState.m_time.tbegin = mTotalArea;
fs.mWorldState.m_time.tend = Renderer::Infinity;
}
if (fs.mWorldState.m_time.tbegin < mTimeBounds.tbegin &&
isfinite(fs.mWorldState.m_time.tbegin) && !m_timed)
{
mTimeBounds.tbegin = fs.mWorldState.m_time.tbegin;
}
if (fs.mWorldState.m_time.tbegin > mTimeBounds.tend &&
isfinite(fs.mWorldState.m_time.tbegin) && !m_timed)
{
mTimeBounds.tend = fs.mWorldState.m_time.tbegin;
}
if (fs.mWorldState.m_time.tend > mTimeBounds.tend &&
isfinite(fs.mWorldState.m_time.tend) && !m_timed)
{
mTimeBounds.tend = fs.mWorldState.m_time.tend;
}
if (fs.mWorldState.m_time.tend < mTimeBounds.tbegin &&
isfinite(fs.mWorldState.m_time.tend) && !m_timed)
{
mTimeBounds.tbegin = fs.mWorldState.m_time.tend;
}
if (!fs.mWorldState.isFinite()) {
requestStop = true;
system()->error();
system()->message("A shape got too big.");
return;
}
mFinishedShapes.push_back(fs);
if (fs.mParameters)
fs.mParameters->retain(this);
}
void
RendererImpl::processSubpath(const Shape& s, bool tr, int expectedType)
{
const ASTrule* rule = nullptr;
if (m_cfdg->getShapeType(s.mShapeType) != CFDGImpl::pathType &&
primShape::isPrimShape(s.mShapeType) && expectedType == ASTreplacement::op)
{
static const ASTrule PrimitivePaths[primShape::numTypes] = { { 0 }, { 1 }, { 2 }, { 3 } };
rule = &PrimitivePaths[s.mShapeType];
} else {
rule = m_cfdg->findRule(s.mShapeType, 0.0);
}
if (static_cast<int>(rule->mRuleBody.mRepType) != expectedType)
throw CfdgError(rule->mLocation, "Subpath is not of the expected type (path ops/commands)");
bool saveOpsOnly = mOpsOnly;
mOpsOnly = mOpsOnly || (expectedType == ASTreplacement::op);
rule->mRuleBody.traverse(s, tr, this, true);
mOpsOnly = saveOpsOnly;
}
//-------------------------------------------------------------------------////
void
RendererImpl::fileIfNecessary()
{
if (mFinishedShapes.size() > MoveFinishedAt)
moveFinishedToFile();
if (mUnfinishedShapes.size() > MoveUnfinishedAt)
moveUnfinishedToTwoFiles();
else if (mUnfinishedShapes.empty())
getUnfinishedFromFile();
}
void
RendererImpl::moveUnfinishedToTwoFiles()
{
m_unfinishedFiles.emplace_back(system(), AbstractSystem::ExpensionTemp,
"expansion", ++mUnfinishedFileCount);
unique_ptr<ostream> f1(m_unfinishedFiles.back().forWrite());
int num1 = m_unfinishedFiles.back().number();
m_unfinishedFiles.emplace_back(system(), AbstractSystem::ExpensionTemp,
"expansion", ++mUnfinishedFileCount);
unique_ptr<ostream> f2(m_unfinishedFiles.back().forWrite());
int num2 = m_unfinishedFiles.back().number();
system()->message("Writing %s temp files %d & %d",
m_unfinishedFiles.back().type().c_str(), num1, num2);
size_t count = mUnfinishedShapes.size() / 3;
UnfinishedContainer::iterator usi = mUnfinishedShapes.begin(),
use = mUnfinishedShapes.end();
usi += count;
if (f1->good() && f2->good()) {
AbstractSystem::Stats outStats = m_stats;
outStats.outputCount = static_cast<int>(count);
outStats.outputDone = 0;
*f1 << outStats.outputCount;
*f2 << outStats.outputCount;
outStats.outputCount = static_cast<int>(count * 2);
outStats.showProgress = true;
// Split the bottom 2/3 of the heap between the two files
while (usi != use) {
usi->write(*((m_unfinishedInFilesCount & 1) ? f1 : f2));
++usi;
++m_unfinishedInFilesCount;
++outStats.outputDone;
if (requestUpdate) {
system()->stats(outStats);
requestUpdate = false;
}
if (requestStop || requestFinishUp)
return;
}
} else {
system()->message("Cannot open temporary file for expansions");
requestStop = true;
return;
}
// Remove the written shapes, heap property remains intact
static const Shape neverActuallyUsed;
mUnfinishedShapes.resize(count, neverActuallyUsed);
assert(is_heap(mUnfinishedShapes.begin(), mUnfinishedShapes.end()));
}
void
RendererImpl::getUnfinishedFromFile()
{
if (m_unfinishedFiles.empty()) return;
TempFile t(std::move(m_unfinishedFiles.front()));
m_unfinishedFiles.pop_front();
unique_ptr<istream> f(t.forRead());
if (f->good()) {
AbstractSystem::Stats outStats = m_stats;
*f >> outStats.outputCount;
outStats.outputDone = 0;
outStats.showProgress = true;
istream_iterator<Shape> it(*f);
istream_iterator<Shape> eit;
back_insert_iterator< UnfinishedContainer > sendto(mUnfinishedShapes);
while (it != eit) {
*sendto = *it;
++it;
++outStats.outputDone;
if (requestUpdate) {
system()->stats(outStats);
requestUpdate = false;
}
if (requestStop || requestFinishUp)
return;
}
} else {
system()->message("Cannot open temporary file for expansions");
requestStop = true;
return;
}
system()->message("Resorting expansions");
fixupHeap();
}
void
RendererImpl::fixupHeap()
{
// Restore heap property to mUnfinishedShapes
auto first = mUnfinishedShapes.begin();
auto last = mUnfinishedShapes.end();
typedef UnfinishedContainer::iterator::difference_type difference_type;
difference_type n = last - first;
if (n < 2)
return;
AbstractSystem::Stats outStats = m_stats;
outStats.outputCount = static_cast<int>(n);
outStats.outputDone = 0;
outStats.showProgress = true;
last = first;
++last;
for (difference_type i = 1; i < n; ++i) {
push_heap(first, ++last);
++outStats.outputDone;
if (requestUpdate) {
system()->stats(outStats);
requestUpdate = false;
}
if (requestStop || requestFinishUp)
return;
}
assert(is_heap(mUnfinishedShapes.begin(), mUnfinishedShapes.end()));
}
//-------------------------------------------------------------------------////
void
RendererImpl::moveFinishedToFile()
{
m_finishedFiles.emplace_back(system(), AbstractSystem::ShapeTemp, "shapes", ++mFinishedFileCount);
unique_ptr<ostream> f(m_finishedFiles.back().forWrite());
if (f->good()) {
if (mFinishedShapes.size() > 10000)
system()->message("Sorting shapes...");
std::sort(mFinishedShapes.begin(), mFinishedShapes.end());
AbstractSystem::Stats outStats = m_stats;
outStats.outputCount = static_cast<int>(mFinishedShapes.size());
outStats.outputDone = 0;
outStats.showProgress = true;
for (const FinishedShape& fs: mFinishedShapes) {
*f << fs;
++outStats.outputDone;
if (requestUpdate) {
system()->stats(outStats);
requestUpdate = false;
}
if (requestStop)
return;
}
} else {
system()->message("Cannot open temporary file for shapes");
requestStop = true;
return;
}
mFinishedShapes.clear();
}
//-------------------------------------------------------------------------////
void RendererImpl::rescaleOutput(int& curr_width, int& curr_height, bool final)
{
agg::trans_affine trans;
double scale;
if (!mBounds.valid()) return;
scale = mBounds.computeScale(curr_width, curr_height,
mFixedBorderX, mFixedBorderY, true,
&trans, m_tiled || m_sized || m_frieze);
if (final // if final output
|| m_currScale == 0.0 // if first time, use this scale
|| (m_currScale * 0.90) > scale)// if grew by more than 10%
{
m_currScale = scale;
m_currArea = scale * scale;
if (m_tiledCanvas)
m_tiledCanvas->scale(scale);
m_currTrans = trans;
m_outputSoFar = 0;
m_stats.fullOutput = true;
}
}
void
RendererImpl::forEachShape(bool final, ShapeFunction op)
{
if (!final || m_finishedFiles.empty()) {
FinishedContainer::iterator start = mFinishedShapes.begin();
FinishedContainer::iterator last = mFinishedShapes.end();
if (!final)
start += m_outputSoFar;
for_each(start, last, op);
m_outputSoFar = static_cast<int>(mFinishedShapes.size());
} else {
deque<TempFile>::iterator begin, last, end;
while (m_finishedFiles.size() > MaxMergeFiles) {
TempFile t(system(), AbstractSystem::MergeTemp, "merge", ++mFinishedFileCount);
{
OutputMerge merger;
begin = m_finishedFiles.begin();
last = begin + (MaxMergeFiles - 1);
end = last + 1;
for (auto it = begin; it != end; ++it)
merger.addTempFile(*it);
std::unique_ptr<ostream> f(t.forWrite());
system()->message("Merging temp files %d through %d",
begin->number(), last->number());
merger.merge([&](const FinishedShape& s) {
*f << s;
});
} // end scope for merger and f
for (unsigned i = 0; i < MaxMergeFiles; ++i)
m_finishedFiles.pop_front();
m_finishedFiles.push_back(std::move(t));
}
OutputMerge merger;
begin = m_finishedFiles.begin();
end = m_finishedFiles.end();
for (auto it = begin; it != end; ++it)
merger.addTempFile(*it);
merger.addShapes(mFinishedShapes.begin(), mFinishedShapes.end());
merger.merge(op);
}
}
void
RendererImpl::drawShape(const FinishedShape& s)
{
if (requestStop) throw Stopped();
if (!mFinal && requestFinishUp) throw Stopped();
if (requestUpdate)
outputStats();
if (!s.mWorldState.m_time.overlaps(mFrameTimeBounds))
return;
m_stats.outputDone += 1;
agg::trans_affine tr = s.mWorldState.m_transform;
tr *= m_currTrans;
double a = s.mWorldState.m_Z.sz * m_currArea; //fabs(tr.determinant());
if ((!isfinite(a) && s.mShapeType != primShape::fillType) ||
a < m_minArea) return;
if (m_tiledCanvas && s.mShapeType != primShape::fillType) {
Bounds b = s.mBounds;
m_currTrans.transform(&b.mMin_X, &b.mMin_Y);
m_currTrans.transform(&b.mMax_X, &b.mMax_Y);
m_tiledCanvas->tileTransform(b);
}
if (m_cfdg->getShapeType(s.mShapeType) == CFDGImpl::pathType) {
//mRenderer.m_canvas->path(s.mColor, tr, *s.mAttributes);
const ASTrule* rule = m_cfdg->findRule(s.mShapeType, 0.0);
rule->traversePath(s, this);
} else {
RGBA8 color = m_cfdg->getColor(s.mWorldState.m_Color);
switch(s.mShapeType) {
case primShape::circleType:
m_canvas->circle(color, tr);
break;
case primShape::squareType:
m_canvas->square(color, tr);
break;
case primShape::triangleType:
m_canvas->triangle(color, tr);
break;
case primShape::fillType:
m_canvas->fill(color);
break;
default:
system()->error();
system()->message("Non drawable shape with no rules: %s",
m_cfdg->decodeShapeName(s.mShapeType).c_str());
requestStop = true;
throw Stopped();
}
}
}
void RendererImpl::output(bool final)
{
if (!m_canvas)
return;
if (!final && !m_finishedFiles.empty())
return; // don't do updates once we have temp files
m_stats.inOutput = true;
m_stats.fullOutput = final;
m_stats.finalOutput = final;
m_stats.outputCount = m_stats.shapeCount;
mFinal = final;
int curr_width = m_width;
int curr_height = m_height;
rescaleOutput(curr_width, curr_height, final);
m_stats.outputDone = m_outputSoFar;
if (final) {
if (mFinishedShapes.size() > 10000)
system()->message("Sorting shapes...");
std::sort(mFinishedShapes.begin(), mFinishedShapes.end());
}
m_canvas->start(m_outputSoFar == 0, m_cfdg->getBackgroundColor(),
curr_width, curr_height);
m_drawingMode = true;
//OutputDraw draw(*this, final);
try {
forEachShape(final, [=](const FinishedShape& s) {
this->drawShape(s);
});
}
catch (Stopped&) { }
catch (exception& e) {
system()->catastrophicError(e.what());
}
m_canvas->end();
m_stats.inOutput = false;
m_stats.outputTime = m_canvas->mTime;
}
void
RendererImpl::outputStats()
{
system()->stats(m_stats);
requestUpdate = false;
}
void
RendererImpl::processPathCommand(const Shape& s, const AST::CommandInfo* attr)
{
if (m_drawingMode) {
if (m_canvas && attr) {
RGBA8 color = m_cfdg->getColor(s.mWorldState.m_Color);
agg::trans_affine tr = s.mWorldState.m_transform;
tr *= m_currTrans;
m_canvas->path(color, tr, *attr);
}
} else {
if (attr) {
double area = 0.0;
agg::point_d cent(0.0, 0.0);
mPathBounds.update(s.mWorldState.m_transform, m_pathIter, mScale, *attr,
¢, &area);
mCurrentCentroid.x = (mCurrentCentroid.x * mCurrentArea + cent.x * area) /
(mCurrentArea + area);
mCurrentCentroid.y = (mCurrentCentroid.x * mCurrentArea + cent.y * area) /
(mCurrentArea + area);
mCurrentArea = mCurrentArea + area;
}
}
}
void
RendererImpl::storeParams(const StackRule* p)
{
p->mRefCount = StackRule::MaxRefCount;
m_cfdg->mLongLivedParams.push_back(p);
}
| gpl-2.0 |
fzqing/linux-2.6 | mvl_patches/pro-1421.c | 447 | /*
* Author: MontaVista Software, Inc. <[email protected]>
*
* 2007 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <linux/init.h>
#include <linux/mvl_patch.h>
static __init int regpatch(void)
{
return mvl_register_patch(1421);
}
module_init(regpatch);
| gpl-2.0 |
sabel83/metashell | 3rd/templight/llvm/test/tools/llvm-ml/dot_operator.asm | 1077 | # RUN: llvm-ml -m64 -filetype=s %s /Fo - | FileCheck %s
.data
FOO STRUCT
a BYTE ?
b BYTE ?
c BYTE ?
d BYTE ?
FOO ENDS
BAR STRUCT
e WORD ?
f WORD ?
BAR ENDS
var FOO <>
.code
t1:
mov al, var.a
mov al, var. b
mov al, var .c
mov al, var . d
; CHECK-LABEL: t1:
; CHECK: mov al, byte ptr [rip + var]
; CHECK: mov al, byte ptr [rip + var+1]
; CHECK: mov al, byte ptr [rip + var+2]
; CHECK: mov al, byte ptr [rip + var+3]
t2:
mov eax, FOO.a
mov ax, FOO. b
mov al, FOO .c
mov eax, FOO . d
; CHECK-LABEL: t2:
; CHECK: mov eax, 0
; CHECK: mov ax, 1
; CHECK: mov al, 2
; CHECK: mov eax, 3
t3:
mov al, BYTE PTR var[FOO.c]
; CHECK-LABEL: t3:
; CHECK: mov al, byte ptr [rip + var+2]
t4:
mov ax, var.BAR.f
mov ax, var .BAR.f
mov ax, var. BAR.f
mov ax, var.BAR .f
mov ax, var.BAR. f
mov ax, var . BAR . f
; CHECK-LABEL: t4:
; CHECK: mov ax, word ptr [rip + var+2]
; CHECK: mov ax, word ptr [rip + var+2]
; CHECK: mov ax, word ptr [rip + var+2]
; CHECK: mov ax, word ptr [rip + var+2]
; CHECK: mov ax, word ptr [rip + var+2]
; CHECK: mov ax, word ptr [rip + var+2]
END
| gpl-3.0 |
lyalls/SmartMON | monitor/other_code/ruei_cross/cross_process_bidata_dumpdata.sh | 6185 | process_id=$$
x=`ps -ef|awk '{if($2!="'$process_id'")print}'|grep "cross_process_bidata"|grep -v grep|wc -l|awk '{print $1}'`
if [[ "$x" -gt 1 ]];then
#echo "waiting for another process"
#echo "$x"
exit
fi
if [[ -f ~/.bash_profile ]];then
. ~/.bash_profile
elif [[ -f ~/.profile ]];then
. ~/.profile
fi
cd /home/oracle/dump
## Clear unfinished dump jobs with owner name uxinsight
unfinishedJobsList=unfinishedJobsList.lst
>$unfinishedJobsList
sqlplus -s '/ as sysdba' <<!
set lines 200
set pages 9999
set heading off
set feedback off
col job_name format a100
spool $unfinishedJobsList
select ''''||replace(job_name,'=','\=')||'''' JN from dba_datapump_jobs where owner_name='UXINSIGHT'
and state != 'NOT RUNNING';
spool off
!
cat $unfinishedJobsList|awk '{if(NF>0)print $1}'|while read line ; do
expdp uxinsight/oracle123 ATTACH=$line <<!
kill_job
yes
exit
!
done
rm -f $unfinishedJobsList
## Main
for table in WG__BIDATA_MASTER WG__BIDATA_PROPERTIES WG__BIDATA_USERFLOWS ; do
## Read the source table partitions
sourceTablePartsList=${table}_parts.lst
>$sourceTablePartsList
sqlplus -s 'uxinsight/oracle123' <<!
set lines 100
set pages 9999
set heading off
set feedback off
col partition_name format a30
col high_value format a10
col partition_position format 99999
spool $sourceTablePartsList
select partition_name, high_value from user_tab_partitions
where table_name='$table' order by partition_position;
spool off
!
if [[ -f $sourceTablePartsList ]] ; then
## Get the source pointer
tmpTable='POINTER_FOR_BIDATA_MASTER';
if [[ "$table" == "WG__BIDATA_PROPERTIES" ]];then
tmpTable='POINTER_FOR_BIDATA_PROPER';
elif [[ "$table" == "WG__BIDATA_USERFLOWS" ]];then
tmpTable='POINTER_FOR_BIDATA_USERFL';
fi
currPeriodID=`{
echo "set heading off";
echo "set feedback off";
echo "select period_id from $tmpTable ;";
}|sqlplus -s 'uxinsight/oracle123'|awk '{if(NF>0)print $1}'`
echo ""
echo "Current Period_ID=$currPeriodID"
echo ""
## Get the prepaired source partitions
prepairedPartsList=${sourceTablePartsList}.prepaired_parts
>$prepairedPartsList
line="";
cat $sourceTablePartsList|awk '{if(NF>0)print}'|while read line;do
part_name=`echo $line|awk '{print $1}'`
high_value=`echo $line|awk '{print $2}'`
if [[ $high_value -lt $currPeriodID && $high_value != 0 ]];then
echo $part_name >> $prepairedPartsList
fi
done
## Remove the partitions which have been done
alreadyDoneParts=${sourceTablePartsList}.already_done_parts.lst
>$alreadyDoneParts
sqlplus -s 'uxinsight/oracle123'@ls2 <<!
set lines 100
set pages 9999
set heading off
set feedback off
spool $alreadyDoneParts
select distinct partition_name from bidata_parts_status
where table_name='$table'
and (status = 'DUMPED' or status like 'DOWNLOAD%' or status like 'IMPORT%'
or status like 'ANAL%' or status like 'CLEAR%' or status='DONE');
spool off
!
line=""
inList="false"
cat $alreadyDoneParts|awk '{if(NF>0)print $1}'|while read line;do
i=1
inList="false"
lineNo=0
while [[ $i -le `cat $prepairedPartsList|wc -l|awk '{print $1}'` ]];do
tmpline=`head -$i $prepairedPartsList|tail -1|awk '{print $1}'`
if [[ "$line" == "$tmpline" ]];then
inList="true"
lineNo=$i
fi
i=`expr $i + 1`
done
if [[ "$inList" == "true" ]];then
sed "$lineNo d" $prepairedPartsList > $prepairedPartsList.tmp && mv $prepairedPartsList.tmp $prepairedPartsList
fi
done
rm -f $alreadyDoneParts
cat $prepairedPartsList
## Process prepaired parts list line by line
cat $prepairedPartsList|awk '{if(NF>0)print $1}'|while read part;do
echo ""
echo "Processing partition $part for table $table"
echo ""
exchangeTable="EX_MASTER_${part}"
if [[ $table == "WG__BIDATA_PROPERTIES" ]];then
exchangeTable="EX_PROPER_${part}"
elif [[ $table == "WG__BIDATA_USERFLOWS" ]];then
exchangeTable="EX_USERFL_${part}"
fi
high_value=`cat $sourceTablePartsList|awk '{if($1=="'$part'")print $2}'`
now=`date +"%d%H"`
dumpfile=${table}.${part}.${now}.$RANDOM.dmp
sqlplus 'uxinsight/oracle123'@ls2 <<!
insert into bidata_parts_status (job_time,host_name,table_name, partition_name, dumpfile, exchange_table, high_value, status, start_time)
values (sysdate,'$HOSTNAME','$table','$part','$dumpfile','$exchangeTable','$high_value','PROCESSING',sysdate);
commit;
exit;
!
## Create temp table for partition exchange on source database
extCnt=`{ echo "select count(1) CNT from user_tables where table_name ='$exchangeTable';" ; } |
sqlplus -s 'uxinsight/oracle123'|grep -v CNT|awk '{if(NF==1 && substr($1,1,1)!="-")print $1}'`
## Clear previously dirty data
if [[ "$extCnt" != 0 ]];then
sqlplus 'uxinsight/oracle123' <<!
drop table $exchangeTable ;
!
fi
## Exchange partition to table
sqlplus 'uxinsight/oracle123' <<!
create table $exchangeTable as select * from $table where rownum<1 ;
alter table $table exchange partition $part with table $exchangeTable ;
!
## Dump exchanged table out to directory expdump
sqlplus 'uxinsight/oracle123'@ls2 <<!
update bidata_parts_status set status='DUMPING',start_exp_time=sysdate where host_name='$HOSTNAME'
and table_name='$table' and partition_name='$part'
and dumpfile='$dumpfile' and high_value='$high_value' and exchange_table='$exchangeTable' and status='PROCESSING';
commit;
exit;
!
rm -f /home/oracle/dump/${dumpfile}*
#expdp uxinsight/oracle123 tables=uxinsight.$exchangeTable directory=expdump dumpfile=$dumpfile logfile=$dumpfile.log compression=all parallel=6
expdp uxinsight/oracle123 tables=uxinsight.$exchangeTable directory=expdump dumpfile=$dumpfile logfile=$dumpfile.log compression=all
## Inform LS2 to get the dumpfile and do the rest work
sqlplus 'uxinsight/oracle123'@ls2 <<!
update bidata_parts_status set status='DUMPED',end_exp_time=sysdate where host_name='$HOSTNAME'
and table_name='$table' and partition_name='$part'
and high_value='$high_value' and exchange_table='$exchangeTable' and (status='DUMPING' or status='PROCESSING');
commit;
exit;
!
done
## Clear work area
rm -f $prepairedPartsList
rm -f $sourceTablePartsList
fi
done
| gpl-3.0 |
christinloehner/linuxcounter.new | src/Syw/Front/ApiBundle/Tests/Controller/BaseControllerTest.php | 795 | <?php
namespace Syw\Front\ApiBundle\Tests\Controller;
use Syw\Front\MainBundle\Tests\BaseTestCase;
/**
* Class BaseControllerTest
*
* @author Christin Löhner <[email protected]>
*/
abstract class BaseControllerTest extends BaseTestCase
{
/**
* @var EntityManager
*/
public $_em;
protected $client = null;
public function setUp()
{
$kernel = static::createKernel();
$kernel->boot();
$this->_em = $kernel->getContainer()->get('doctrine.orm.entity_manager');
$this->_em->beginTransaction();
$this->client = static::createClient();
}
/**
* Rollback changes.
*/
public function tearDown()
{
$this->_em->rollback();
parent::tearDown();
$this->_em->close();
}
}
| gpl-3.0 |
PrismTech/opensplice | src/tools/idlpp/code/idl_genCxxTypedClassDefs.h | 1045 | /*
* Vortex OpenSplice
*
* This software and documentation are Copyright 2006 to TO_YEAR ADLINK
* Technology Limited, its affiliated companies and licensors. All rights
* reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef IDL_GENCXXTYPEDCLASSDEFS_H
#define IDL_GENCXXTYPEDCLASSDEFS_H
#include "idl_genCorbaCxxHelper.h"
#include "idl_program.h"
idl_program idl_genCxxTypedClassDefsProgram (CxxTypeUserData *userData);
#endif /* IDL_GENCXXTYPEDCLASSDEFS_H */
| gpl-3.0 |
PaulMcClernan/livecode | engine/src/scrolbar.cpp | 33008 | /* Copyright (C) 2003-2015 LiveCode Ltd.
This file is part of LiveCode.
LiveCode is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License v3 as published by the Free
Software Foundation.
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
#include "prefix.h"
#include "globdefs.h"
#include "filedefs.h"
#include "objdefs.h"
#include "parsedef.h"
#include "mcio.h"
#include "util.h"
#include "font.h"
#include "sellst.h"
#include "stack.h"
#include "card.h"
#include "field.h"
#include "scrolbar.h"
#include "mcerror.h"
#include "param.h"
#include "globals.h"
#include "dispatch.h"
#include "mctheme.h"
#include "exec.h"
#include "stackfileformat.h"
real8 MCScrollbar::markpos;
uint2 MCScrollbar::mode = SM_CLEARED;
////////////////////////////////////////////////////////////////////////////////
MCPropertyInfo MCScrollbar::kProperties[] =
{
DEFINE_RW_OBJ_ENUM_PROPERTY(P_STYLE, InterfaceScrollbarStyle, MCScrollbar, Style)
DEFINE_RW_OBJ_PROPERTY(P_THUMB_SIZE, Double, MCScrollbar, ThumbSize)
DEFINE_RW_OBJ_PROPERTY(P_THUMB_POS, Double, MCScrollbar, ThumbPos)
DEFINE_RW_OBJ_PROPERTY(P_LINE_INC, Double, MCScrollbar, LineInc)
DEFINE_RW_OBJ_PROPERTY(P_PAGE_INC, Double, MCScrollbar, PageInc)
DEFINE_RO_OBJ_ENUM_PROPERTY(P_ORIENTATION, InterfaceScrollbarOrientation, MCScrollbar, Orientation)
DEFINE_RW_OBJ_PROPERTY(P_NUMBER_FORMAT, String, MCScrollbar, NumberFormat)
DEFINE_RW_OBJ_PROPERTY(P_START_VALUE, String, MCScrollbar, StartValue)
DEFINE_RW_OBJ_PROPERTY(P_END_VALUE, String, MCScrollbar, EndValue)
DEFINE_RW_OBJ_PROPERTY(P_SHOW_VALUE, Bool, MCScrollbar, ShowValue)
};
MCObjectPropertyTable MCScrollbar::kPropertyTable =
{
&MCControl::kPropertyTable,
sizeof(kProperties) / sizeof(kProperties[0]),
&kProperties[0],
};
////////////////////////////////////////////////////////////////////////////////
MCScrollbar::MCScrollbar()
{
flags |= F_HORIZONTAL | F_TRAVERSAL_ON;
rect.width = rect.height = DEFAULT_SB_WIDTH;
thumbpos = 0.0;
thumbsize = 8192.0;
pageinc = thumbsize;
lineinc = 512.0;
// MW-2013-08-27: [[ UnicodifyScrollbar ]] Initialize the members to kMCEmptyString.
startstring = MCValueRetain(kMCEmptyString);
endstring = MCValueRetain(kMCEmptyString);
startvalue = 0.0;
endvalue = 65535.0;
nffw = 0;
nftrailing = 0;
nfforce = 0;
hover_part = WTHEME_PART_UNDEFINED;
linked_control = NULL;
m_embedded = false;
// MM-2014-07-31: [[ ThreadedRendering ]] Used to ensure the progress bar animate message is only posted from a single thread.
m_animate_posted = false;
}
MCScrollbar::MCScrollbar(const MCScrollbar &sref) : MCControl(sref)
{
thumbpos = sref.thumbpos;
thumbsize = sref.thumbsize;
pageinc = sref.pageinc;
lineinc = sref.lineinc;
// MW-2013-08-27: [[ UnicodifyScrollbar ]] Initialize the members to the other scrollbars values
startstring = MCValueRetain(sref . startstring);
endstring = MCValueRetain(sref . endstring);
startvalue = sref.startvalue;
endvalue = sref.endvalue;
nffw = sref.nffw;
nftrailing = sref.nftrailing;
nfforce = sref.nfforce;
hover_part = WTHEME_PART_UNDEFINED;
linked_control = NULL;
m_embedded = false;
// MM-2014-07-31: [[ ThreadedRendering ]] Used to ensure the progress bar animate message is only posted from a single thread.
m_animate_posted = false;
}
MCScrollbar::~MCScrollbar()
{
if (linked_control != NULL)
linked_control -> unlink(this);
// MW-2013-08-27: [[ UnicodifyScrollbar ]] Release the string members.
MCValueRelease(startstring);
MCValueRelease(endstring);
}
Chunk_term MCScrollbar::gettype() const
{
return CT_SCROLLBAR;
}
const char *MCScrollbar::gettypestring()
{
return MCscrollbarstring;
}
void MCScrollbar::open()
{
MCControl::open();
// MW-2011-02-03: [[ Bug 7861 ]] Should make working with large Mac progress bars better.
if (opened == 1 && !getflag(F_SB_STYLE))
{
uint2 oldwidth = MAC_SB_WIDTH;
uint2 newwidth = DEFAULT_SB_WIDTH;
if (IsMacLFAM())
{
oldwidth = DEFAULT_SB_WIDTH;
newwidth = MAC_SB_WIDTH;
}
borderwidth = DEFAULT_BORDER;
if (rect.height == oldwidth)
rect.height = newwidth;
if (rect.width == oldwidth)
rect.width = newwidth;
}
compute_barsize();
}
Boolean MCScrollbar::kdown(MCStringRef p_string, KeySym key)
{
if (!(state & CS_NO_MESSAGES))
if (MCObject::kdown(p_string, key))
return True;
Boolean done = False;
switch (key)
{
case XK_Home:
update(0.0, MCM_scrollbar_line_inc);
done = True;
break;
case XK_End:
update(endvalue, MCM_scrollbar_end);
done = True;
break;
case XK_Right:
case XK_Down:
update(thumbpos + lineinc, MCM_scrollbar_line_inc);
done = True;
break;
case XK_Left:
case XK_Up:
update(thumbpos - lineinc, MCM_scrollbar_line_dec);
done = True;
break;
case XK_Prior:
update(thumbpos - pageinc, MCM_scrollbar_page_dec);
done = True;
break;
case XK_Next:
update(thumbpos + pageinc, MCM_scrollbar_page_inc);
done = True;
break;
default:
break;
}
if (done)
message_with_valueref_args(MCM_mouse_up, MCSTR("1"));
return done;
}
Boolean MCScrollbar::mfocus(int2 x, int2 y)
{
// MW-2007-09-18: [[ Bug 1650 ]] Disabled state linked to thumb size
if (!(flags & F_VISIBLE || showinvisible())
|| (issbdisabled() && getstack()->gettool(this) == T_BROWSE))
return False;
if (state & CS_SCROLL)
{
// I.M. [[bz 9559]] disable scrolling where start value & end value are the same
if (startvalue == endvalue)
return True;
real8 newpos;
double t_thumbsize = thumbsize;
if (t_thumbsize > fabs(endvalue - startvalue))
t_thumbsize = fabs(endvalue - startvalue);
if (flags & F_SCALE)
t_thumbsize = 0;
bool t_forward;
t_forward = (endvalue > startvalue);
MCRectangle t_bar_rect, t_thumb_rect, t_thumb_start_rect, t_thumb_end_rect;
t_bar_rect = compute_bar();
t_thumb_rect = compute_thumb(markpos);
t_thumb_start_rect = compute_thumb(startvalue);
if (t_forward)
t_thumb_end_rect = compute_thumb(endvalue - t_thumbsize);
else
t_thumb_end_rect = compute_thumb(endvalue + t_thumbsize);
int32_t t_bar_start, t_bar_length, t_thumb_start, t_thumb_length;
int32_t t_movement;
if (getstyleint(flags) == F_VERTICAL)
{
t_bar_start = t_thumb_start_rect.y;
t_bar_length = t_thumb_end_rect.y + t_thumb_end_rect.height - t_bar_start;
t_thumb_start = t_thumb_rect.y;
t_thumb_length = t_thumb_rect.height;
t_movement = y - my;
}
else
{
t_bar_start = t_thumb_start_rect.x;
t_bar_length = t_thumb_end_rect.x + t_thumb_end_rect.width - t_bar_start;
t_thumb_start = t_thumb_rect.x;
t_thumb_length = t_thumb_rect.width;
t_movement = x - mx;
}
t_bar_start += t_thumb_length / 2;
t_bar_length -= t_thumb_length;
// AL-2013-07-26: [[ Bug 11044 ]] Prevent divide by zero when computing scrollbar thumbposition
if (t_bar_length == 0)
t_bar_length = 1;
int32_t t_new_position;
t_new_position = t_thumb_start + t_thumb_length / 2 + t_movement;
t_new_position = MCU_min(t_bar_start + t_bar_length, MCU_max(t_bar_start, t_new_position));
if (t_forward)
newpos = startvalue + ((t_new_position - t_bar_start) / (double)t_bar_length) * (fabs(endvalue - startvalue) - t_thumbsize);
else
newpos = startvalue - ((t_new_position - t_bar_start) / (double)t_bar_length) * (fabs(endvalue - startvalue) - t_thumbsize);
update(newpos, MCM_scrollbar_drag);
return True;
}
else if (!MCdispatcher -> isdragtarget() && MCcurtheme && MCcurtheme->getthemepropbool(WTHEME_PROP_SUPPORTHOVERING)
&& MCU_point_in_rect(rect, x, y) )
{
if (!(state & CS_MFOCUSED) && !getstate(CS_SELECTED))
{
MCWidgetInfo winfo;
winfo.type = (Widget_Type)getwidgetthemetype();
if (MCcurtheme->iswidgetsupported(winfo.type))
{
getwidgetthemeinfo(winfo);
Widget_Part wpart = MCcurtheme->hittest(winfo,mx,my,rect);
if (wpart != hover_part)
{
hover_part = wpart;
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
}
}
}
return MCControl::mfocus(x, y);
}
void MCScrollbar::munfocus()
{
if (MCcurtheme && hover_part != WTHEME_PART_UNDEFINED && MCcurtheme->getthemepropbool(WTHEME_PROP_SUPPORTHOVERING))
{
hover_part = WTHEME_PART_UNDEFINED;
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
MCControl::munfocus();
}
Boolean MCScrollbar::mdown(uint2 which)
{
if (state & CS_MFOCUSED)
return False;
if (state & CS_MENU_ATTACHED)
return MCObject::mdown(which);
state |= CS_MFOCUSED;
if (!IsMacEmulatedLF() && flags & F_TRAVERSAL_ON && !(state & CS_KFOCUSED))
getstack()->kfocusset(this);
uint2 margin;
MCRectangle brect = compute_bar();
if (flags & F_SCALE)
margin = 0;
else
if (getstyleint(flags) == F_VERTICAL)
margin = brect.width - 1;
else
margin = brect.height - 1;
Tool tool = state & CS_NO_MESSAGES ? T_BROWSE : getstack()->gettool(this);
MCWidgetInfo winfo;
winfo.type = (Widget_Type)getwidgetthemetype();
switch (which)
{
case Button1:
switch (tool)
{
case T_BROWSE:
message_with_valueref_args(MCM_mouse_down, MCSTR("1"));
if (flags & F_PROGRESS) //progress bar does not respond to mouse down event
return False;
if (MCcurtheme && MCcurtheme->iswidgetsupported(winfo.type))
{
getwidgetthemeinfo(winfo);
Widget_Part wpart = MCcurtheme->hittest(winfo,mx,my,rect);
// scrollbar needs to check first if mouse-down occured in arrows
switch (wpart)
{
case WTHEME_PART_ARROW_DEC:
if (MCmodifierstate & MS_SHIFT)
mode = SM_BEGINNING;
else
mode = SM_LINEDEC;
break;
case WTHEME_PART_ARROW_INC:
if (MCmodifierstate & MS_SHIFT)
mode = SM_END;
else
mode = SM_LINEINC;
break;
case WTHEME_PART_TRACK_DEC:
mode = SM_PAGEDEC;
break;
case WTHEME_PART_TRACK_INC:
mode = SM_PAGEINC;
break;
}
}
else
{ //Non-theme appearence stuff: for vertical scrollbar or scale
if (getstyleint(flags) == F_VERTICAL)
{
uint2 height;
if (brect.height <= margin << 1)
height = 1;
else
height = brect.height - (margin << 1);
markpos = (my - (brect.y + margin))
* fabs(endvalue - startvalue) / height;
if (my < brect.y + margin)
if (MCmodifierstate & MS_SHIFT)
mode = SM_BEGINNING;
else
mode = SM_LINEDEC;
else
if (my > brect.y + brect.height - margin)
if (MCmodifierstate & MS_SHIFT)
mode = SM_END;
else
mode = SM_LINEINC;
else
{
MCRectangle thumb = compute_thumb(thumbpos);
if (my < thumb.y)
mode = SM_PAGEDEC;
else
if (my > thumb.y + thumb.height)
mode = SM_PAGEINC;
}
}
else
{ //for Horizontal scrollbar or scale
uint2 width;
if (brect.width <= (margin << 1))
width = 1;
else
width = brect.width - (margin << 1);
markpos = (mx - (brect.x + margin))
* fabs(endvalue - startvalue) / width;
if (mx < brect.x + margin)
if (MCmodifierstate & MS_SHIFT)
mode = SM_BEGINNING;
else
mode = SM_LINEDEC;
else
if (mx > brect.x + brect.width - margin)
if (MCmodifierstate & MS_SHIFT)
mode = SM_END;
else
mode = SM_LINEINC;
else
{
MCRectangle thumb = compute_thumb(thumbpos);
if (mx < thumb.x)
mode = SM_PAGEDEC;
else
if (mx > thumb.x + thumb.width)
mode = SM_PAGEINC;
}
}
} //end of Non-MAC-Appearance Manager stuff
switch (mode)
{
case SM_BEGINNING:
update(0, MCM_scrollbar_beginning);
break;
case SM_END:
update(endvalue, MCM_scrollbar_end);
break;
case SM_LINEDEC:
case SM_LINEINC:
timer(MCM_internal, NULL);
redrawarrow(mode);
break;
case SM_PAGEDEC:
case SM_PAGEINC:
timer(MCM_internal, NULL);
break;
default:
state |= CS_SCROLL;
markpos = thumbpos;
if (IsMacEmulatedLF())
movethumb(thumbpos--);
else if (MCcurtheme)
{
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
}
break;
case T_POINTER:
case T_SCROLLBAR:
start(True);
break;
case T_HELP:
break;
default:
return False;
}
break;
case Button2:
if (message_with_valueref_args(MCM_mouse_down, MCSTR("2")) == ES_NORMAL)
return True;
state |= CS_SCROLL;
{
real8 newpos;
real8 range = endvalue - startvalue;
real8 offset = startvalue;
if (flags & F_SCALE)
margin = MOTIF_SCALE_THUMB_SIZE >> 1;
else
if (MCproportionalthumbs)
if (startvalue > endvalue)
offset += thumbsize / 2.0;
else
offset -= thumbsize / 2.0;
else
margin = FIXED_THUMB_SIZE >> 1;
if (getstyleint(flags) == F_VERTICAL)
newpos = (my - brect.y - margin) * range
/ (brect.height - (margin << 1)) + offset;
else
newpos = (mx - brect.x - margin) * range
/ (brect.width - (margin << 1)) + offset;
update(newpos, MCM_scrollbar_drag);
markpos = thumbpos;
}
break;
case Button3:
message_with_valueref_args(MCM_mouse_down, MCSTR("3"));
break;
}
return True;
}
Boolean MCScrollbar::mup(uint2 which, bool p_release)
{
if (!(state & CS_MFOCUSED))
return False;
if (state & CS_MENU_ATTACHED)
return MCObject::mup(which, p_release);
state &= ~CS_MFOCUSED;
if (state & CS_GRAB)
{
ungrab(which);
return True;
}
Tool tool = state & CS_NO_MESSAGES ? T_BROWSE : getstack()->gettool(this);
switch (which)
{
case Button1:
switch (tool)
{
case T_BROWSE:
if (state & CS_SCROLL)
{
state &= ~CS_SCROLL;
if (IsMacEmulatedLF())
movethumb(thumbpos--);
else if (MCcurtheme)
{
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
}
else
{
uint2 oldmode = mode;
mode = SM_CLEARED;
if (MCcurtheme)
{
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
else if (oldmode == SM_LINEDEC || oldmode == SM_LINEINC)
redrawarrow(oldmode);
}
if (!p_release && MCU_point_in_rect(rect, mx, my))
message_with_valueref_args(MCM_mouse_up, MCSTR("1"));
else
message_with_valueref_args(MCM_mouse_release, MCSTR("1"));
break;
case T_SCROLLBAR:
case T_POINTER:
end(true, p_release);
break;
case T_HELP:
help();
break;
default:
return False;
}
break;
case Button2:
if (state & CS_SCROLL)
{
state &= ~CS_SCROLL;
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
case Button3:
if (!p_release && MCU_point_in_rect(rect, mx, my))
message_with_args(MCM_mouse_up, which);
else
message_with_args(MCM_mouse_release, which);
break;
}
return True;
}
Boolean MCScrollbar::doubledown(uint2 which)
{
if (which == Button1 && getstack()->gettool(this) == T_BROWSE)
return mdown(which);
return MCControl::doubledown(which);
}
Boolean MCScrollbar::doubleup(uint2 which)
{
if (which == Button1 && getstack()->gettool(this) == T_BROWSE)
return mup(which, false);
return MCControl::doubleup(which);
}
void MCScrollbar::applyrect(const MCRectangle &nrect)
{
rect = nrect;
compute_barsize();
}
void MCScrollbar::timer(MCNameRef mptr, MCParameter *params)
{
if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless) ||
MCNameIsEqualTo(mptr, MCM_internal2, kMCCompareCaseless))
{
// MW-2009-06-16: [[ Bug ]] Previously this was only waiting for one
// one event (anyevent == True) this meant that it was possible for
// the critical 'mouseUp' event to be missed and an effectively
// infinite timer loop to be entered if the amount of processing
// inbetween timer invocations was too high. So, instead, we process
// all events at this point to ensure the mouseUp is handled.
// (In the future we should flush mouseUp events to the dispatch queue)
// MW-2014-04-16: [[ Bug 12183 ]] This wait does not seem to make much
// sense. It seems to be so that a mouseUp in a short space of time
// stops the scrollbar from moving. This isn't how things should be I
// don't think - so commenting it out for now.
// MCscreen->wait(MCsyncrate / 1000.0, True, False); // dispatch mup
if (state & CS_MFOCUSED && !MCbuttonstate)
{
mup(Button1, false);
return;
}
if (mode != SM_CLEARED)
{
uint2 delay = MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless) ? MCrepeatdelay : MCrepeatrate;
MCscreen->addtimer(this, MCM_internal2, delay);
MCRectangle thumb;
switch (mode)
{
case SM_LINEDEC:
update(thumbpos - lineinc, MCM_scrollbar_line_dec);
break;
case SM_LINEINC:
update(thumbpos + lineinc, MCM_scrollbar_line_inc);
break;
case SM_PAGEDEC:
if ( flags & F_SCALE )
update(thumbpos - pageinc, MCM_scrollbar_page_dec);
else
{
// TH-2008-01-23. Previously was pageinc - lineinc which appeared to be wrong
update(thumbpos - (pageinc - lineinc), MCM_scrollbar_page_dec);
}
thumb = compute_thumb(thumbpos);
if (getstyleint(flags) == F_VERTICAL)
{
if (thumb.y + thumb.height < my)
mode = SM_CLEARED;
}
else
if (thumb.x + thumb.height < mx)
mode = SM_CLEARED;
break;
case SM_PAGEINC:
if (flags & F_SCALE)
update(thumbpos + pageinc, MCM_scrollbar_page_inc);
else
{
// TH-2008-01-23. Previously was pageinc + lineinc which appeared to be wrong.
update(thumbpos + (pageinc - lineinc), MCM_scrollbar_page_inc);
}
thumb = compute_thumb(thumbpos);
if (getstyleint(flags) == F_VERTICAL)
{
if (thumb.y > my)
mode = SM_CLEARED;
}
else
if (thumb.x > mx)
mode = SM_CLEARED;
break;
}
if (parent->gettype() != CT_CARD)
{
MCControl *cptr = (MCControl *)parent;
cptr->readscrollbars();
}
}
}
else if (MCNameIsEqualTo(mptr, MCM_internal3, kMCCompareCaseless))
{
#ifdef _MAC_DESKTOP
// MW-2012-09-17: [[ Bug 9212 ]] Mac progress bars do not animate.
if (getflag(F_PROGRESS))
{
// MM-2014-07-31: [[ ThreadedRendering ]] Flag that there is no longer a progress bar animation message pending.
m_animate_posted = false;
redrawall();
}
#endif
}
else
MCControl::timer(mptr, params);
}
MCControl *MCScrollbar::clone(Boolean attach, Object_pos p, bool invisible)
{
MCScrollbar *newscrollbar = new MCScrollbar(*this);
if (attach)
newscrollbar->attach(p, invisible);
return newscrollbar;
}
void MCScrollbar::compute_barsize()
{
if (flags & F_SHOW_VALUE && (MClook == LF_MOTIF
|| getstyleint(flags) == F_VERTICAL))
{
if (getstyleint(flags) == F_VERTICAL)
{
uint2 twidth = rect.width != 0 ? rect.width : 1;
barsize = MCU_max(nffw, 1);
// MW-2013-08-27: [[ UnicodifyScrollbar ]] Use MCString primitives.
if (MCStringGetLength(startstring) > barsize)
barsize = MCStringGetLength(startstring);
if (MCStringIsEmpty(endstring))
barsize = MCU_max(barsize, 5);
else
barsize = MCU_max((uindex_t)barsize, MCStringGetLength(endstring));
// MM-2014-04-16: [[ Bug 11964 ]] Pass through the transform of the stack to make sure the measurment is correct for scaled text.
barsize *= MCFontMeasureText(m_font, MCSTR("0"), getstack() -> getdevicetransform());
barsize = twidth - (barsize + barsize * (twidth - barsize) / twidth);
}
else
{
uint2 theight = rect.height;
barsize = theight - gettextheight();
}
}
else
if (getstyleint(flags) == F_VERTICAL)
barsize = rect.width;
else
barsize = rect.height;
}
MCRectangle MCScrollbar::compute_bar()
{
MCRectangle brect = rect;
if (flags & F_SHOW_VALUE && (MClook == LF_MOTIF
|| getstyleint(flags) == F_VERTICAL))
{
if (getstyleint(flags) == F_VERTICAL)
brect.width = barsize;
else
{
brect.y += brect.height - barsize;
brect.height = barsize;
}
}
return brect;
}
MCRectangle MCScrollbar::compute_thumb(real8 pos)
{
MCRectangle thumb;
MCWidgetInfo winfo;
winfo.type = (Widget_Type)getwidgetthemetype();
thumb . width = thumb . height = thumb . x = thumb . y = 0 ; // Initialize the values.
if (MCcurtheme && MCcurtheme->iswidgetsupported(winfo.type))
{
getwidgetthemeinfo(winfo);
winfo.part = WTHEME_PART_THUMB;
((MCWidgetScrollBarInfo*)(winfo.data))->thumbpos = pos;
MCcurtheme->getwidgetrect(winfo,WTHEME_METRIC_PARTSIZE,rect,thumb);
}
else
{
MCRectangle trect = compute_bar();
real8 range = endvalue - startvalue;
if (flags & F_SHOW_BORDER && (MClook == LF_MOTIF || !(flags & F_SCALE)
|| getstyleint(flags) == F_VERTICAL))
{
if (IsMacEmulatedLF())
trect = MCU_reduce_rect(trect, 1);
else
trect = MCU_reduce_rect(trect, borderwidth);
}
if (getstyleint(flags) == F_VERTICAL)
{
if (flags & F_SCALE || (thumbsize != 0 && rect.height > rect.width * 3))
{
thumb.x = trect.x;
thumb.width = trect.width;
if (flags & F_SCALE)
{
real8 height = trect.height - MOTIF_SCALE_THUMB_SIZE;
real8 offset = height * (pos - startvalue);
thumb.y = trect.y;
if (range != 0.0)
thumb.y += (int2)(offset / range);
thumb.height = MOTIF_SCALE_THUMB_SIZE;
}
else
if (MCproportionalthumbs)
{
thumb.y = trect.y + trect.width;
real8 height = trect.height - (trect.width << 1) + 1;
if (range != 0.0 && fabs(endvalue - startvalue) != thumbsize)
{
int2 miny = thumb.y;
real8 offset = height * (pos - startvalue);
thumb.y += (int2)(offset / range);
range = fabs(range);
thumb.height = (uint2)(thumbsize * height / range);
uint2 minsize = IsMacEmulatedLF() ? trect.width : MIN_THUMB_SIZE;
if (thumb.height < minsize)
{
uint2 diff = minsize - thumb.height;
thumb.height = minsize;
thumb.y -= (int2)(diff * (pos + thumbsize - startvalue) / range);
if (thumb.y < miny)
thumb.y = miny;
}
}
else
thumb.height = (int2)height - 1;
}
else
{
real8 height = trect.height - (trect.width << 1) - FIXED_THUMB_SIZE;
real8 offset = height * (pos - startvalue);
if (range < 0)
range += thumbsize;
else
range -= thumbsize;
thumb.y = trect.y + trect.width;
if (range != 0.0)
thumb.y += (int2)(offset / range);
thumb.height = FIXED_THUMB_SIZE;
}
}
else
thumb.height = 0;
}
else
{ // horizontal
if (flags & F_SCALE || (thumbsize != 0 && rect.width > rect.height * 3))
{
thumb.y = trect.y;
thumb.height = trect.height;
if (flags & F_SCALE)
{
switch (MClook)
{
case LF_MOTIF:
thumb.width = MOTIF_SCALE_THUMB_SIZE;
break;
case LF_MAC:
thumb.width = MAC_SCALE_THUMB_SIZE;
thumb.height = 16;
trect.x += 7;
trect.width -= 11;
break;
default:
// Win95's thumb width is computed, varied depends on the height of the rect
// if rect.height < 21, scale down the width by a scale factor
// WIN_SCALE_THUMB_HEIGHT + space + 4(tic mark)
if (trect.height < WIN_SCALE_HEIGHT)
thumb.width = trect.height
* WIN_SCALE_THUMB_WIDTH / WIN_SCALE_HEIGHT;
else
thumb.width = WIN_SCALE_THUMB_WIDTH;
thumb.height = MCU_min(WIN_SCALE_HEIGHT, trect.height) - 6;
}
real8 width = trect.width - thumb.width;
real8 offset = width * (pos - startvalue);
thumb.x = trect.x;
if (range != 0.0)
thumb.x += (int2)(offset / range);
}
else
if (MCproportionalthumbs)
{
thumb.x = trect.x + trect.height;
real8 width = trect.width - (trect.height << 1) + 1;
if (range != 0.0 && fabs(endvalue - startvalue) != thumbsize)
{
int2 minx = thumb.x;
real8 offset = width * (pos - startvalue);
thumb.x += (int2)(offset / range);
range = fabs(range);
thumb.width = (uint2)(thumbsize * width / range);
uint2 minsize = IsMacEmulatedLF() ? trect.height : MIN_THUMB_SIZE;
if (thumb.width < minsize)
{
uint2 diff = minsize - thumb.width;
thumb.width = minsize;
thumb.x -= (int2)(diff * (pos + thumbsize - startvalue) / range);
if (thumb.x < minx)
thumb.x = minx;
}
}
else
thumb.width = (int2)width - 1;
}
else
{
real8 width = trect.width - (trect.height << 1) - FIXED_THUMB_SIZE;
real8 offset = width * (pos - startvalue);
thumb.x = trect.x + trect.height;
if (range < 0)
range += thumbsize;
else
range -= thumbsize;
if (range != 0.0)
thumb.x += (int2)(offset / range);
thumb.width = FIXED_THUMB_SIZE;
}
}
else
thumb.width = 0;
}
}
return thumb;
}
void MCScrollbar::update(real8 newpos, MCNameRef mess)
{
real8 oldpos = thumbpos;
real8 ts = thumbsize;
if (thumbsize > fabs(endvalue - startvalue))
ts = thumbsize = fabs(endvalue - startvalue);
if (flags & F_SB_STYLE)
ts = 0;
if (startvalue < endvalue)
if (newpos < startvalue)
thumbpos = startvalue;
else
if (newpos + ts > endvalue)
thumbpos = endvalue - ts;
else
thumbpos = newpos;
else
if (newpos > startvalue)
thumbpos = startvalue;
else
if (newpos - ts < endvalue)
thumbpos = endvalue + ts;
else
thumbpos = newpos;
if (thumbpos != oldpos)
signallisteners(P_THUMB_POS);
if ((thumbpos != oldpos || mode == SM_LINEDEC || mode == SM_LINEINC)
&& opened && (flags & F_VISIBLE || showinvisible()))
{
if (thumbpos != oldpos)
{
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
MCAutoStringRef t_data;
MCU_r8tos(thumbpos, nffw, nftrailing, nfforce, &t_data);
switch (message_with_valueref_args(mess, *t_data))
{
case ES_NOT_HANDLED:
case ES_PASS:
if (!MCNameIsEqualTo(mess, MCM_scrollbar_drag, kMCCompareCaseless))
message_with_valueref_args(MCM_scrollbar_drag, *t_data);
default:
break;
}
if (linked_control != NULL)
linked_control -> readscrollbars();
}
}
void MCScrollbar::getthumb(real8 &pos)
{
pos = thumbpos;
}
void MCScrollbar::setthumb(real8 pos, real8 size, real8 linc, real8 ev)
{
thumbpos = pos;
thumbsize = size;
pageinc = size;
lineinc = linc;
endvalue = ev;
// MW-2008-11-02: [[ Bug ]] This method is only used by scrollbars directly
// attached to controls. In this case, they are created from the templateScrollbar
// and this means 'startValue' could be anything - however we need it to be zero
// if we want to avoid strangeness.
startvalue = 0.0;
}
void MCScrollbar::movethumb(real8 pos)
{
if (thumbpos != pos)
{
thumbpos = pos;
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
}
void MCScrollbar::setborderwidth(uint1 nw)
{
int2 d = nw - borderwidth;
if (rect.width <= rect.height)
{
rect.width += d << 1;
rect.x -= d;
}
else
{
rect.height += d << 1;
rect.y -= d;
}
borderwidth = nw;
}
void MCScrollbar::reset()
{
flags &= ~F_HAS_VALUES;
startvalue = 0.0;
endvalue = 65535.0;
// MW-2013-08-27: [[ UnicodifyScrollbar ]] Reset the string values to the empty string.
MCValueAssign(startstring, kMCEmptyString);
MCValueAssign(endstring, kMCEmptyString);
}
void MCScrollbar::redrawarrow(uint2 oldmode)
{
// MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
redrawall();
}
bool MCScrollbar::issbdisabled(void) const
{
bool ret;
ret = getflag(F_DISABLED) || (MClook != LF_MOTIF && !(flags & F_SB_STYLE) && fabs(endvalue - startvalue) == thumbsize);
return ret;
}
void MCScrollbar::link(MCControl *p_control)
{
linked_control = p_control;
}
// MW-2012-09-20: [[ Bug 10395 ]] This method is invoked rather than layer_redrawall()
// to ensure that in the embedded case, the parent's layer is updated.
void MCScrollbar::redrawall(void)
{
if (!m_embedded)
{
layer_redrawall();
return;
}
((MCControl *)parent) -> layer_redrawrect(getrect());
}
// MW-2012-09-20: [[ Bug 10395 ]] This method marks the control as embedded
// thus causing it to redraw through its parent.
void MCScrollbar::setembedded(void)
{
m_embedded = true;
}
///////////////////////////////////////////////////////////////////////////////
//
// SAVING AND LOADING
//
IO_stat MCScrollbar::extendedsave(MCObjectOutputStream& p_stream, uint4 p_part, uint32_t p_version)
{
return defaultextendedsave(p_stream, p_part, p_version);
}
IO_stat MCScrollbar::extendedload(MCObjectInputStream& p_stream, uint32_t p_version, uint4 p_length)
{
return defaultextendedload(p_stream, p_version, p_length);
}
IO_stat MCScrollbar::save(IO_handle stream, uint4 p_part, bool p_force_ext, uint32_t p_version)
{
IO_stat stat;
if ((stat = IO_write_uint1(OT_SCROLLBAR, stream)) != IO_NORMAL)
return stat;
if ((stat = MCControl::save(stream, p_part, p_force_ext, p_version)) != IO_NORMAL)
return stat;
if (flags & F_SAVE_ATTS)
{
real8 range = endvalue - startvalue;
if (range != 0.0)
range = 65535.0 / range;
uint2 i2 = (uint2)((thumbpos - startvalue) * range);
if ((stat = IO_write_uint2(i2, stream)) != IO_NORMAL)
return stat;
i2 = (uint2)(thumbsize * range);
if ((stat = IO_write_uint2(i2, stream)) != IO_NORMAL)
return stat;
i2 = (uint2)(lineinc * range);
if ((stat = IO_write_uint2(i2, stream)) != IO_NORMAL)
return stat;
i2 = (uint2)(pageinc * range);
if ((stat = IO_write_uint2(i2, stream)) != IO_NORMAL)
return stat;
if (flags & F_HAS_VALUES)
{
// MW-2013-08-27: [[ UnicodifyScrollbar ]] Update to use stringref primitives.
// MW-2013-11-20: [[ UnicodeFileFormat ]] If sfv >= 7000, use unicode.
if ((stat = IO_write_stringref_new(startstring, stream, p_version >= kMCStackFileFormatVersion_7_0)) != IO_NORMAL)
return stat;
// MW-2013-11-20: [[ UnicodeFileFormat ]] If sfv >= 7000, use unicode.
if ((stat = IO_write_stringref_new(endstring, stream, p_version >= kMCStackFileFormatVersion_7_0)) != IO_NORMAL)
return stat;
if ((stat = IO_write_uint2(nffw, stream)) != IO_NORMAL)
return stat;
if ((stat = IO_write_uint2(nftrailing, stream)) != IO_NORMAL)
return stat;
if ((stat = IO_write_uint2(nfforce, stream)) != IO_NORMAL)
return stat;
}
}
return savepropsets(stream, p_version);
}
IO_stat MCScrollbar::load(IO_handle stream, uint32_t version)
{
IO_stat stat;
if ((stat = MCObject::load(stream, version)) != IO_NORMAL)
return checkloadstat(stat);
if (flags & F_SAVE_ATTS)
{
uint2 i2;
if ((stat = IO_read_uint2(&i2, stream)) != IO_NORMAL)
return checkloadstat(stat);
thumbpos = (real8)i2;
if ((stat = IO_read_uint2(&i2, stream)) != IO_NORMAL)
return checkloadstat(stat);
thumbsize = (real8)i2;
if ((stat = IO_read_uint2(&i2, stream)) != IO_NORMAL)
return checkloadstat(stat);
lineinc = (real8)i2;
if ((stat = IO_read_uint2(&i2, stream)) != IO_NORMAL)
return checkloadstat(stat);
pageinc = (real8)i2;
if (flags & F_HAS_VALUES)
{
// MW-2013-08-27: [[ UnicodifyScrollbar ]] Update to use stringref primitives.
// MW-2013-11-20: [[ UnicodeFileFormat ]] If sfv >= 7000, use unicode.
if ((stat = IO_read_stringref_new(startstring, stream, version >= kMCStackFileFormatVersion_7_0)) != IO_NORMAL)
return checkloadstat(stat);
if (!MCStringToDouble(startstring, startvalue))
startvalue = 0.0;
// MW-2013-08-27: [[ UnicodifyScrollbar ]] Update to use stringref primitives.
// MW-2013-11-20: [[ UnicodeFileFormat ]] If sfv >= 7000, use unicode.
if ((stat = IO_read_stringref_new(endstring, stream, version >= kMCStackFileFormatVersion_7_0)) != IO_NORMAL)
return checkloadstat(stat);
if (!MCStringToDouble(endstring, endvalue))
endvalue = 0.0;
real8 range = (endvalue - startvalue) / 65535.0;
thumbpos = thumbpos * range + startvalue;
thumbsize *= range;
lineinc *= range;
pageinc *= range;
if ((stat = IO_read_uint2(&nffw, stream)) != IO_NORMAL)
return checkloadstat(stat);
if ((stat = IO_read_uint2(&nftrailing, stream)) != IO_NORMAL)
return checkloadstat(stat);
if ((stat = IO_read_uint2(&nfforce, stream)) != IO_NORMAL)
return checkloadstat(stat);
}
}
if (version <= kMCStackFileFormatVersion_2_0)
{
if (flags & F_TRAVERSAL_ON)
rect = MCU_reduce_rect(rect, MCfocuswidth);
if (flags & F_SHOW_VALUE && getstyleint(flags) == F_HORIZONTAL)
rect = MCU_reduce_rect(rect, 4);
}
return loadpropsets(stream, version);
}
| gpl-3.0 |
Radarr/Radarr | src/NzbDrone.Core/ImportLists/StevenLu/StevenLuSettings.cs | 981 | using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.ImportLists.StevenLu
{
public class StevenLuSettingsValidator : AbstractValidator<StevenLuSettings>
{
public StevenLuSettingsValidator()
{
RuleFor(c => c.Link).ValidRootUrl();
}
}
public class StevenLuSettings : IProviderConfig
{
private static readonly StevenLuSettingsValidator Validator = new StevenLuSettingsValidator();
public StevenLuSettings()
{
Link = "https://s3.amazonaws.com/popular-movies/movies.json";
}
[FieldDefinition(0, Label = "URL", HelpText = "Don't change this unless you know what you are doing.")]
public string Link { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}
| gpl-3.0 |
brezerk/q4wine | src/q4wine-gui/mainwindow.h | 5787 | /***************************************************************************
* Copyright (C) 2008-2021 by Oleksii S. Malakhov <[email protected]> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
***************************************************************************/
/*!
* \defgroup q4wine-gui Q4Wine GUI
* \brief q4wine-gui package provides general GUI functions for Q4Wine.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <unistd.h>
#include <src/q4wine-gui/ui_MainWindow.h>
//Qt includes
#include <QSystemTrayIcon>
#include <QSplitter>
#include <QLocalServer>
#include <QLocalSocket>
#include <QTabWidget>
#include <QTemporaryDir>
//Global config
#include "config.h"
//Database
#include "prefix.h"
#include "dir.h"
#include "icon.h"
#ifndef _OS_DARWIN_
#include "sysmenu.h"
#endif
//Widgets
#include "loggingwidget.h"
#include "iconlistwidget.h"
#include "iconlisttoolbar.h"
#include "prefixtreewidget.h"
#include "prefixtreetoolbar.h"
#include "wineprocesswidget.h"
#include "prefixcontrolwidget.h"
#include "prefixconfigwidget.h"
#ifdef WITH_WINEAPPDB
#include "appdbwidget.h"
#endif
#ifdef WITH_DBUS
#include <QDBusInterface>
#endif
//Windows
#include "iconsview.h"
#include "wizard.h"
#include "process.h"
#include "progress.h"
#include "imagemanager.h"
#include "about.h"
#include "appsettings.h"
#include "run.h"
#include "fakedrivesettings.h"
#include "src/q4wine-gui/versions.h"
#include "winetricks.h"
//System
#include <stdlib.h>
#include <unistd.h>
#include <memory>
//q4wine lib
#include "q4wine-lib.h"
#include "src/core/registry.h"
class MainWindow : public QMainWindow, public Ui::MainWindow
{
Q_OBJECT
public:
MainWindow(const int startState,
const QString &run_binary,
QWidget * parent = nullptr,
const Qt::WindowFlags f = Qt::WindowFlags());
public slots:
void messageReceived(const QString &message);
void updateDtabaseConnectedItems(void);
void setSearchFocus(void);
void setMeVisible(const bool visible);
#ifdef WITH_WINEAPPDB
void searchRequest(const QString &search);
#endif
private slots:
void tbwGeneral_CurrentTabChange(const int tabIndex);
void changeStatusText(const QString &text);
void trayIcon_Activate(QSystemTrayIcon::ActivationReason reason);
/*
* Command buttons slots
*/
void updateIconDesc(const QString &program,
QString args,
const QString &desc,
const QString &console,
const QString &desktop);
//Main menu slots
void mainExit_Click(void);
void mainPrograms_Click(void);
void mainImageManager_Click(void);
void mainProcess_Click(void);
void mainSetup_Click(void);
void mainLogging_Click(void);
void mainPrefix_Click(void);
void mainAbout_Click(void);
void mainAboutQt_Click(void);
void mainExportIcons_Click(void);
void mainRun_Click(void);
void mainOptions_Click(void);
void mainInstall_Click(void);
void mainFirstSteps_Click(void);
void mainFAQ_Click(void);
void mainIndex_Click(void);
void mainWebsite_Click(void);
void mainDonate_Click(void);
void mainBugs_Click(void);
void mainAppDB_Click(void);
void mainHelpThisTab_Click(void);
void mainImportWineIcons_Click(void);
void mainVersionManager_Click();
void newConnection();
private:
//! Custom Widgets
//DragListWidget* lstIcons;
#ifdef WITH_WINEAPPDB
std::unique_ptr<AppDBWidget> appdbWidget;
#endif
std::unique_ptr<QLocalServer> serverSoket;
//! This is need for libq4wine-core.so import;
typedef void *CoreLibPrototype (bool);
CoreLibPrototype *CoreLibClassPointer;
std::unique_ptr<corelib> CoreLib;
QLibrary libq4wine;
//Classes
Prefix db_prefix;
Dir db_dir;
Icon db_icon;
#ifndef _OS_DARWIN_
system_menu sys_menu;
#endif
// Tray icon
std::unique_ptr<QSystemTrayIcon> trayIcon;
bool createSocket();
void showSocketError(QString message);
void createTrayIcon();
void getSettings(void);
void clearTmp();
void showNotifycation(const QString &header, const QString &message);
std::unique_ptr<QSplitter> splitter;
// void getWineMenuIcons(void);
// void parseIcons(void);
signals:
#ifdef WITH_WINEAPPDB
void appdbWidget_startSearch(short int, QString);
void setAppDBFocus();
#endif
void updateDatabaseConnections(void);
void setDefaultFocus(QString, QString);
void stopProcTimer(void);
void startProcTimer(void);
void reloadLogData(void);
void runProgramRequest(QString);
protected:
// Events
void closeEvent(QCloseEvent *event);
};
#endif
| gpl-3.0 |
grim210/defimulator | snespurify/phoenix/gtk/button.cpp | 629 | static void Button_tick(Button *self) {
if(self->onTick) self->onTick();
}
void Button::create(Window &parent, unsigned x, unsigned y, unsigned width, unsigned height, const string &text) {
object->widget = gtk_button_new_with_label(text);
widget->parent = &parent;
gtk_widget_set_size_request(object->widget, width, height);
g_signal_connect_swapped(G_OBJECT(object->widget), "clicked", G_CALLBACK(Button_tick), (gpointer)this);
if(parent.window->defaultFont) setFont(*parent.window->defaultFont);
gtk_fixed_put(GTK_FIXED(parent.object->formContainer), object->widget, x, y);
gtk_widget_show(object->widget);
}
| gpl-3.0 |
MathewWi/dop-mii | include/RuntimeIOSPatch.h | 1057 | // Copyright 2010 Joseph Jordan <[email protected]>
// This code is licensed to you under the terms of the GNU GPL, version 2;
// see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
#ifndef _IOSPATCH_H
#define _IOSPATCH_H
#include <gccore.h>
class RuntimeIOSPatch
{
public:
static u32 Apply();
private:
static void disable_memory_protection();
static u32 apply_patch(const char *name, const u8 *old, u32 old_size, const u8 *patch, u32 patch_size, u32 patch_offset);
static u32 PrintResult(u32 successful);
static void ApplyingPatch(const char* which);
static const u8 di_readlimit_old[];
static const u8 di_readlimit_patch[];
static const u8 isfs_permissions_old[];
static const u8 isfs_permissions_patch[];
static const u8 setuid_old[];
static const u8 setuid_patch[];
static const u8 es_identify_old[];
static const u8 es_identify_patch[];
static const u8 hash_old[];
static const u8 hash_patch[];
static const u8 new_hash_old[];
};
#endif /* _IOSPATCH_H */ | gpl-3.0 |
FernandoUnix/AcessoRestrito | metronic_v4.7.1/theme_rtl/admin_1_material_design/charts_highmaps.html | 183570 | <!DOCTYPE html>
<!--
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.7
Version: 4.7.1
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: [email protected]
Follow: www.twitter.com/keenthemes
Dribbble: www.dribbble.com/keenthemes
Like: www.facebook.com/keenthemes
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
Renew Support: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" dir="rtl">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>Metronic Admin RTL Theme #1 | HighMaps</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content="Preview page of Metronic Admin RTL Theme #1 for Lorem ipsum" name="description" />
<meta content="" name="author" />
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/bootstrap/css/bootstrap-rtl.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/global/plugins/bootstrap-switch/css/bootstrap-switch-rtl.min.css" rel="stylesheet" type="text/css" />
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN THEME GLOBAL STYLES -->
<link href="../assets/global/css/components-md-rtl.min.css" rel="stylesheet" id="style_components" type="text/css" />
<link href="../assets/global/css/plugins-md-rtl.min.css" rel="stylesheet" type="text/css" />
<!-- END THEME GLOBAL STYLES -->
<!-- BEGIN THEME LAYOUT STYLES -->
<link href="../assets/layouts/layout/css/layout-rtl.min.css" rel="stylesheet" type="text/css" />
<link href="../assets/layouts/layout/css/themes/darkblue-rtl.min.css" rel="stylesheet" type="text/css" id="style_color" />
<link href="../assets/layouts/layout/css/custom-rtl.min.css" rel="stylesheet" type="text/css" />
<!-- END THEME LAYOUT STYLES -->
<link rel="shortcut icon" href="favicon.ico" /> </head>
<!-- END HEAD -->
<body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white page-md">
<div class="page-wrapper">
<!-- BEGIN HEADER -->
<div class="page-header navbar navbar-fixed-top">
<!-- BEGIN HEADER INNER -->
<div class="page-header-inner ">
<!-- BEGIN LOGO -->
<div class="page-logo">
<a href="index.html">
<img src="../assets/layouts/layout/img/logo.png" alt="logo" class="logo-default" /> </a>
<div class="menu-toggler sidebar-toggler">
<span></span>
</div>
</div>
<!-- END LOGO -->
<!-- BEGIN RESPONSIVE MENU TOGGLER -->
<a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
<span></span>
</a>
<!-- END RESPONSIVE MENU TOGGLER -->
<!-- BEGIN TOP NAVIGATION MENU -->
<div class="top-menu">
<ul class="nav navbar-nav pull-right">
<!-- BEGIN NOTIFICATION DROPDOWN -->
<!-- DOC: Apply "dropdown-dark" class after "dropdown-extended" to change the dropdown styte -->
<!-- DOC: Apply "dropdown-hoverable" class after below "dropdown" and remove data-toggle="dropdown" data-hover="dropdown" data-close-others="true" attributes to enable hover dropdown mode -->
<!-- DOC: Remove "dropdown-hoverable" and add data-toggle="dropdown" data-hover="dropdown" data-close-others="true" attributes to the below A element with dropdown-toggle class -->
<li class="dropdown dropdown-extended dropdown-notification" id="header_notification_bar">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<i class="icon-bell"></i>
<span class="badge badge-default"> 7 </span>
</a>
<ul class="dropdown-menu">
<li class="external">
<h3>
<span class="bold">12 pending</span> notifications</h3>
<a href="page_user_profile_1.html">view all</a>
</li>
<li>
<ul class="dropdown-menu-list scroller" style="height: 250px;" data-handle-color="#637283">
<li>
<a href="javascript:;">
<span class="time">just now</span>
<span class="details">
<span class="label label-sm label-icon label-success">
<i class="fa fa-plus"></i>
</span> New user registered. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">3 mins</span>
<span class="details">
<span class="label label-sm label-icon label-danger">
<i class="fa fa-bolt"></i>
</span> Server #12 overloaded. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">10 mins</span>
<span class="details">
<span class="label label-sm label-icon label-warning">
<i class="fa fa-bell-o"></i>
</span> Server #2 not responding. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">14 hrs</span>
<span class="details">
<span class="label label-sm label-icon label-info">
<i class="fa fa-bullhorn"></i>
</span> Application error. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">2 days</span>
<span class="details">
<span class="label label-sm label-icon label-danger">
<i class="fa fa-bolt"></i>
</span> Database overloaded 68%. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">3 days</span>
<span class="details">
<span class="label label-sm label-icon label-danger">
<i class="fa fa-bolt"></i>
</span> A user IP blocked. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">4 days</span>
<span class="details">
<span class="label label-sm label-icon label-warning">
<i class="fa fa-bell-o"></i>
</span> Storage Server #4 not responding dfdfdfd. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">5 days</span>
<span class="details">
<span class="label label-sm label-icon label-info">
<i class="fa fa-bullhorn"></i>
</span> System Error. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">9 days</span>
<span class="details">
<span class="label label-sm label-icon label-danger">
<i class="fa fa-bolt"></i>
</span> Storage server failed. </span>
</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- END NOTIFICATION DROPDOWN -->
<!-- BEGIN INBOX DROPDOWN -->
<!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
<li class="dropdown dropdown-extended dropdown-inbox" id="header_inbox_bar">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<i class="icon-envelope-open"></i>
<span class="badge badge-default"> 4 </span>
</a>
<ul class="dropdown-menu">
<li class="external">
<h3>You have
<span class="bold">7 New</span> Messages</h3>
<a href="app_inbox.html">view all</a>
</li>
<li>
<ul class="dropdown-menu-list scroller" style="height: 275px;" data-handle-color="#637283">
<li>
<a href="#">
<span class="photo">
<img src="../assets/layouts/layout3/img/avatar2.jpg" class="img-circle" alt=""> </span>
<span class="subject">
<span class="from"> Lisa Wong </span>
<span class="time">Just Now </span>
</span>
<span class="message"> Vivamus sed auctor nibh congue nibh. auctor nibh auctor nibh... </span>
</a>
</li>
<li>
<a href="#">
<span class="photo">
<img src="../assets/layouts/layout3/img/avatar3.jpg" class="img-circle" alt=""> </span>
<span class="subject">
<span class="from"> Richard Doe </span>
<span class="time">16 mins </span>
</span>
<span class="message"> Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span>
</a>
</li>
<li>
<a href="#">
<span class="photo">
<img src="../assets/layouts/layout3/img/avatar1.jpg" class="img-circle" alt=""> </span>
<span class="subject">
<span class="from"> Bob Nilson </span>
<span class="time">2 hrs </span>
</span>
<span class="message"> Vivamus sed nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span>
</a>
</li>
<li>
<a href="#">
<span class="photo">
<img src="../assets/layouts/layout3/img/avatar2.jpg" class="img-circle" alt=""> </span>
<span class="subject">
<span class="from"> Lisa Wong </span>
<span class="time">40 mins </span>
</span>
<span class="message"> Vivamus sed auctor 40% nibh congue nibh... </span>
</a>
</li>
<li>
<a href="#">
<span class="photo">
<img src="../assets/layouts/layout3/img/avatar3.jpg" class="img-circle" alt=""> </span>
<span class="subject">
<span class="from"> Richard Doe </span>
<span class="time">46 mins </span>
</span>
<span class="message"> Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span>
</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- END INBOX DROPDOWN -->
<!-- BEGIN TODO DROPDOWN -->
<!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
<li class="dropdown dropdown-extended dropdown-tasks" id="header_task_bar">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<i class="icon-calendar"></i>
<span class="badge badge-default"> 3 </span>
</a>
<ul class="dropdown-menu extended tasks">
<li class="external">
<h3>You have
<span class="bold">12 pending</span> tasks</h3>
<a href="app_todo.html">view all</a>
</li>
<li>
<ul class="dropdown-menu-list scroller" style="height: 275px;" data-handle-color="#637283">
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">New release v1.2 </span>
<span class="percent">30%</span>
</span>
<span class="progress">
<span style="width: 40%;" class="progress-bar progress-bar-success" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">40% Complete</span>
</span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Application deployment</span>
<span class="percent">65%</span>
</span>
<span class="progress">
<span style="width: 65%;" class="progress-bar progress-bar-danger" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">65% Complete</span>
</span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Mobile app release</span>
<span class="percent">98%</span>
</span>
<span class="progress">
<span style="width: 98%;" class="progress-bar progress-bar-success" aria-valuenow="98" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">98% Complete</span>
</span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Database migration</span>
<span class="percent">10%</span>
</span>
<span class="progress">
<span style="width: 10%;" class="progress-bar progress-bar-warning" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">10% Complete</span>
</span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Web server upgrade</span>
<span class="percent">58%</span>
</span>
<span class="progress">
<span style="width: 58%;" class="progress-bar progress-bar-info" aria-valuenow="58" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">58% Complete</span>
</span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Mobile development</span>
<span class="percent">85%</span>
</span>
<span class="progress">
<span style="width: 85%;" class="progress-bar progress-bar-success" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">85% Complete</span>
</span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">New UI release</span>
<span class="percent">38%</span>
</span>
<span class="progress progress-striped">
<span style="width: 38%;" class="progress-bar progress-bar-important" aria-valuenow="18" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">38% Complete</span>
</span>
</span>
</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- END TODO DROPDOWN -->
<!-- BEGIN USER LOGIN DROPDOWN -->
<!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
<li class="dropdown dropdown-user">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<img alt="" class="img-circle" src="../assets/layouts/layout/img/avatar3_small.jpg" />
<span class="username username-hide-on-mobile"> Nick </span>
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu dropdown-menu-default">
<li>
<a href="page_user_profile_1.html">
<i class="icon-user"></i> My Profile </a>
</li>
<li>
<a href="app_calendar.html">
<i class="icon-calendar"></i> My Calendar </a>
</li>
<li>
<a href="app_inbox.html">
<i class="icon-envelope-open"></i> My Inbox
<span class="badge badge-danger"> 3 </span>
</a>
</li>
<li>
<a href="app_todo.html">
<i class="icon-rocket"></i> My Tasks
<span class="badge badge-success"> 7 </span>
</a>
</li>
<li class="divider"> </li>
<li>
<a href="page_user_lock_1.html">
<i class="icon-lock"></i> Lock Screen </a>
</li>
<li>
<a href="page_user_login_1.html">
<i class="icon-key"></i> Log Out </a>
</li>
</ul>
</li>
<!-- END USER LOGIN DROPDOWN -->
<!-- BEGIN QUICK SIDEBAR TOGGLER -->
<!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
<li class="dropdown dropdown-quick-sidebar-toggler">
<a href="javascript:;" class="dropdown-toggle">
<i class="icon-logout"></i>
</a>
</li>
<!-- END QUICK SIDEBAR TOGGLER -->
</ul>
</div>
<!-- END TOP NAVIGATION MENU -->
</div>
<!-- END HEADER INNER -->
</div>
<!-- END HEADER -->
<!-- BEGIN HEADER & CONTENT DIVIDER -->
<div class="clearfix"> </div>
<!-- END HEADER & CONTENT DIVIDER -->
<!-- BEGIN CONTAINER -->
<div class="page-container">
<!-- BEGIN SIDEBAR -->
<div class="page-sidebar-wrapper">
<!-- BEGIN SIDEBAR -->
<!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
<!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
<div class="page-sidebar navbar-collapse collapse">
<!-- BEGIN SIDEBAR MENU -->
<!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->
<!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->
<!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->
<!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
<!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->
<!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->
<ul class="page-sidebar-menu page-header-fixed " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" style="padding-top: 20px">
<!-- DOC: To remove the sidebar toggler from the sidebar you just need to completely remove the below "sidebar-toggler-wrapper" LI element -->
<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
<li class="sidebar-toggler-wrapper hide">
<div class="sidebar-toggler">
<span></span>
</div>
</li>
<!-- END SIDEBAR TOGGLER BUTTON -->
<!-- DOC: To remove the search box from the sidebar you just need to completely remove the below "sidebar-search-wrapper" LI element -->
<li class="sidebar-search-wrapper">
<!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->
<!-- DOC: Apply "sidebar-search-bordered" class the below search form to have bordered search box -->
<!-- DOC: Apply "sidebar-search-bordered sidebar-search-solid" class the below search form to have bordered & solid search box -->
<form class="sidebar-search " action="page_general_search_3.html" method="POST">
<a href="javascript:;" class="remove">
<i class="icon-close"></i>
</a>
<div class="input-group">
<input type="text" class="form-control" placeholder="Search...">
<span class="input-group-btn">
<a href="javascript:;" class="btn submit">
<i class="icon-magnifier"></i>
</a>
</span>
</div>
</form>
<!-- END RESPONSIVE QUICK SEARCH FORM -->
</li>
<li class="nav-item start ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-home"></i>
<span class="title">Dashboard</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item start ">
<a href="index.html" class="nav-link ">
<i class="icon-bar-chart"></i>
<span class="title">Dashboard 1</span>
</a>
</li>
<li class="nav-item start ">
<a href="dashboard_2.html" class="nav-link ">
<i class="icon-bulb"></i>
<span class="title">Dashboard 2</span>
<span class="badge badge-success">1</span>
</a>
</li>
<li class="nav-item start ">
<a href="dashboard_3.html" class="nav-link ">
<i class="icon-graph"></i>
<span class="title">Dashboard 3</span>
<span class="badge badge-danger">5</span>
</a>
</li>
</ul>
</li>
<li class="heading">
<h3 class="uppercase">Features</h3>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-diamond"></i>
<span class="title">UI Features</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="ui_colors.html" class="nav-link ">
<span class="title">Color Library</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_metronic_grid.html" class="nav-link ">
<span class="title">Metronic Grid System</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_general.html" class="nav-link ">
<span class="title">General Components</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_buttons.html" class="nav-link ">
<span class="title">Buttons</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_buttons_spinner.html" class="nav-link ">
<span class="title">Spinner Buttons</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_confirmations.html" class="nav-link ">
<span class="title">Popover Confirmations</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_sweetalert.html" class="nav-link ">
<span class="title">Bootstrap Sweet Alerts</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_icons.html" class="nav-link ">
<span class="title">Font Icons</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_socicons.html" class="nav-link ">
<span class="title">Social Icons</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_typography.html" class="nav-link ">
<span class="title">Typography</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_tabs_accordions_navs.html" class="nav-link ">
<span class="title">Tabs, Accordions & Navs</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_timeline.html" class="nav-link ">
<span class="title">Timeline 1</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_timeline_2.html" class="nav-link ">
<span class="title">Timeline 2</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_timeline_horizontal.html" class="nav-link ">
<span class="title">Horizontal Timeline</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_tree.html" class="nav-link ">
<span class="title">Tree View</span>
</a>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<span class="title">Page Progress Bar</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="ui_page_progress_style_1.html" class="nav-link "> Flash </a>
</li>
<li class="nav-item ">
<a href="ui_page_progress_style_2.html" class="nav-link "> Big Counter </a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="ui_blockui.html" class="nav-link ">
<span class="title">Block UI</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_bootstrap_growl.html" class="nav-link ">
<span class="title">Bootstrap Growl Notifications</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_notific8.html" class="nav-link ">
<span class="title">Notific8 Notifications</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_toastr.html" class="nav-link ">
<span class="title">Toastr Notifications</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_bootbox.html" class="nav-link ">
<span class="title">Bootbox Dialogs</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_alerts_api.html" class="nav-link ">
<span class="title">Metronic Alerts API</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_session_timeout.html" class="nav-link ">
<span class="title">Session Timeout</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_idle_timeout.html" class="nav-link ">
<span class="title">User Idle Timeout</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_modals.html" class="nav-link ">
<span class="title">Modals</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_extended_modals.html" class="nav-link ">
<span class="title">Extended Modals</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_tiles.html" class="nav-link ">
<span class="title">Tiles</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_datepaginator.html" class="nav-link ">
<span class="title">Date Paginator</span>
</a>
</li>
<li class="nav-item ">
<a href="ui_nestable.html" class="nav-link ">
<span class="title">Nestable List</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-puzzle"></i>
<span class="title">Components</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="components_date_time_pickers.html" class="nav-link ">
<span class="title">Date & Time Pickers</span>
</a>
</li>
<li class="nav-item ">
<a href="components_color_pickers.html" class="nav-link ">
<span class="title">Color Pickers</span>
<span class="badge badge-danger">2</span>
</a>
</li>
<li class="nav-item ">
<a href="components_select2.html" class="nav-link ">
<span class="title">Select2 Dropdowns</span>
</a>
</li>
<li class="nav-item ">
<a href="components_bootstrap_multiselect_dropdown.html" class="nav-link ">
<span class="title">Bootstrap Multiselect Dropdowns</span>
</a>
</li>
<li class="nav-item ">
<a href="components_bootstrap_select.html" class="nav-link ">
<span class="title">Bootstrap Select</span>
</a>
</li>
<li class="nav-item ">
<a href="components_multi_select.html" class="nav-link ">
<span class="title">Bootstrap Multiple Select</span>
</a>
</li>
<li class="nav-item ">
<a href="components_bootstrap_select_splitter.html" class="nav-link ">
<span class="title">Select Splitter</span>
</a>
</li>
<li class="nav-item ">
<a href="components_clipboard.html" class="nav-link ">
<span class="title">Clipboard</span>
</a>
</li>
<li class="nav-item ">
<a href="components_typeahead.html" class="nav-link ">
<span class="title">Typeahead Autocomplete</span>
</a>
</li>
<li class="nav-item ">
<a href="components_bootstrap_tagsinput.html" class="nav-link ">
<span class="title">Bootstrap Tagsinput</span>
</a>
</li>
<li class="nav-item ">
<a href="components_bootstrap_switch.html" class="nav-link ">
<span class="title">Bootstrap Switch</span>
<span class="badge badge-success">6</span>
</a>
</li>
<li class="nav-item ">
<a href="components_bootstrap_maxlength.html" class="nav-link ">
<span class="title">Bootstrap Maxlength</span>
</a>
</li>
<li class="nav-item ">
<a href="components_bootstrap_fileinput.html" class="nav-link ">
<span class="title">Bootstrap File Input</span>
</a>
</li>
<li class="nav-item ">
<a href="components_bootstrap_touchspin.html" class="nav-link ">
<span class="title">Bootstrap Touchspin</span>
</a>
</li>
<li class="nav-item ">
<a href="components_form_tools.html" class="nav-link ">
<span class="title">Form Widgets & Tools</span>
</a>
</li>
<li class="nav-item ">
<a href="components_context_menu.html" class="nav-link ">
<span class="title">Context Menu</span>
</a>
</li>
<li class="nav-item ">
<a href="components_editors.html" class="nav-link ">
<span class="title">Markdown & WYSIWYG Editors</span>
</a>
</li>
<li class="nav-item ">
<a href="components_code_editors.html" class="nav-link ">
<span class="title">Code Editors</span>
</a>
</li>
<li class="nav-item ">
<a href="components_ion_sliders.html" class="nav-link ">
<span class="title">Ion Range Sliders</span>
</a>
</li>
<li class="nav-item ">
<a href="components_noui_sliders.html" class="nav-link ">
<span class="title">NoUI Range Sliders</span>
</a>
</li>
<li class="nav-item ">
<a href="components_knob_dials.html" class="nav-link ">
<span class="title">Knob Circle Dials</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-settings"></i>
<span class="title">Form Stuff</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="form_controls.html" class="nav-link ">
<span class="title">Bootstrap Form
<br>Controls</span>
</a>
</li>
<li class="nav-item ">
<a href="form_controls_md.html" class="nav-link ">
<span class="title">Material Design
<br>Form Controls</span>
</a>
</li>
<li class="nav-item ">
<a href="form_validation.html" class="nav-link ">
<span class="title">Form Validation</span>
</a>
</li>
<li class="nav-item ">
<a href="form_validation_states_md.html" class="nav-link ">
<span class="title">Material Design
<br>Form Validation States</span>
</a>
</li>
<li class="nav-item ">
<a href="form_validation_md.html" class="nav-link ">
<span class="title">Material Design
<br>Form Validation</span>
</a>
</li>
<li class="nav-item ">
<a href="form_layouts.html" class="nav-link ">
<span class="title">Form Layouts</span>
</a>
</li>
<li class="nav-item ">
<a href="form_repeater.html" class="nav-link ">
<span class="title">Form Repeater</span>
</a>
</li>
<li class="nav-item ">
<a href="form_input_mask.html" class="nav-link ">
<span class="title">Form Input Mask</span>
</a>
</li>
<li class="nav-item ">
<a href="form_editable.html" class="nav-link ">
<span class="title">Form X-editable</span>
</a>
</li>
<li class="nav-item ">
<a href="form_wizard.html" class="nav-link ">
<span class="title">Form Wizard</span>
</a>
</li>
<li class="nav-item ">
<a href="form_icheck.html" class="nav-link ">
<span class="title">iCheck Controls</span>
</a>
</li>
<li class="nav-item ">
<a href="form_image_crop.html" class="nav-link ">
<span class="title">Image Cropping</span>
</a>
</li>
<li class="nav-item ">
<a href="form_fileupload.html" class="nav-link ">
<span class="title">Multiple File Upload</span>
</a>
</li>
<li class="nav-item ">
<a href="form_dropzone.html" class="nav-link ">
<span class="title">Dropzone File Upload</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-bulb"></i>
<span class="title">Elements</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="elements_steps.html" class="nav-link ">
<span class="title">Steps</span>
</a>
</li>
<li class="nav-item ">
<a href="elements_lists.html" class="nav-link ">
<span class="title">Lists</span>
</a>
</li>
<li class="nav-item ">
<a href="elements_ribbons.html" class="nav-link ">
<span class="title">Ribbons</span>
</a>
</li>
<li class="nav-item ">
<a href="elements_overlay.html" class="nav-link ">
<span class="title">Overlays</span>
</a>
</li>
<li class="nav-item ">
<a href="elements_cards.html" class="nav-link ">
<span class="title">User Cards</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-briefcase"></i>
<span class="title">Tables</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="table_static_basic.html" class="nav-link ">
<span class="title">Basic Tables</span>
</a>
</li>
<li class="nav-item ">
<a href="table_static_responsive.html" class="nav-link ">
<span class="title">Responsive Tables</span>
</a>
</li>
<li class="nav-item ">
<a href="table_bootstrap.html" class="nav-link ">
<span class="title">Bootstrap Tables</span>
</a>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<span class="title">Datatables</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="table_datatables_managed.html" class="nav-link "> Managed Datatables </a>
</li>
<li class="nav-item ">
<a href="table_datatables_buttons.html" class="nav-link "> Buttons Extension </a>
</li>
<li class="nav-item ">
<a href="table_datatables_colreorder.html" class="nav-link "> Colreorder Extension </a>
</li>
<li class="nav-item ">
<a href="table_datatables_rowreorder.html" class="nav-link "> Rowreorder Extension </a>
</li>
<li class="nav-item ">
<a href="table_datatables_scroller.html" class="nav-link "> Scroller Extension </a>
</li>
<li class="nav-item ">
<a href="table_datatables_fixedheader.html" class="nav-link "> FixedHeader Extension </a>
</li>
<li class="nav-item ">
<a href="table_datatables_responsive.html" class="nav-link "> Responsive Extension </a>
</li>
<li class="nav-item ">
<a href="table_datatables_editable.html" class="nav-link "> Editable Datatables </a>
</li>
<li class="nav-item ">
<a href="table_datatables_ajax.html" class="nav-link "> Ajax Datatables </a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="?p=" class="nav-link nav-toggle">
<i class="icon-wallet"></i>
<span class="title">Portlets</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="portlet_boxed.html" class="nav-link ">
<span class="title">Boxed Portlets</span>
</a>
</li>
<li class="nav-item ">
<a href="portlet_light.html" class="nav-link ">
<span class="title">Light Portlets</span>
</a>
</li>
<li class="nav-item ">
<a href="portlet_solid.html" class="nav-link ">
<span class="title">Solid Portlets</span>
</a>
</li>
<li class="nav-item ">
<a href="portlet_ajax.html" class="nav-link ">
<span class="title">Ajax Portlets</span>
</a>
</li>
<li class="nav-item ">
<a href="portlet_draggable.html" class="nav-link ">
<span class="title">Draggable Portlets</span>
</a>
</li>
</ul>
</li>
<li class="nav-item active open">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-bar-chart"></i>
<span class="title">Charts</span>
<span class="selected"></span>
<span class="arrow open"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="charts_amcharts.html" class="nav-link ">
<span class="title">amChart</span>
</a>
</li>
<li class="nav-item ">
<a href="charts_flotcharts.html" class="nav-link ">
<span class="title">Flot Charts</span>
</a>
</li>
<li class="nav-item ">
<a href="charts_flowchart.html" class="nav-link ">
<span class="title">Flow Charts</span>
</a>
</li>
<li class="nav-item ">
<a href="charts_google.html" class="nav-link ">
<span class="title">Google Charts</span>
</a>
</li>
<li class="nav-item ">
<a href="charts_echarts.html" class="nav-link ">
<span class="title">eCharts</span>
</a>
</li>
<li class="nav-item ">
<a href="charts_morris.html" class="nav-link ">
<span class="title">Morris Charts</span>
</a>
</li>
<li class="nav-item active open">
<a href="javascript:;" class="nav-link nav-toggle">
<span class="title">HighCharts</span>
<span class="selected"></span>
<span class="arrow open"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="charts_highcharts.html" class="nav-link "> HighCharts </a>
</li>
<li class="nav-item ">
<a href="charts_highstock.html" class="nav-link "> HighStock </a>
</li>
<li class="nav-item active open">
<a href="charts_highmaps.html" class="nav-link "> HighMaps </a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-pointer"></i>
<span class="title">Maps</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="maps_google.html" class="nav-link ">
<span class="title">Google Maps</span>
</a>
</li>
<li class="nav-item ">
<a href="maps_vector.html" class="nav-link ">
<span class="title">Vector Maps</span>
</a>
</li>
</ul>
</li>
<li class="heading">
<h3 class="uppercase">Layouts</h3>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-layers"></i>
<span class="title">Page Layouts</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="layout_blank_page.html" class="nav-link ">
<span class="title">Blank Page</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_ajax_page.html" class="nav-link ">
<span class="title">Ajax Content Layout</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_offcanvas_mobile_menu.html" class="nav-link ">
<span class="title">Off-canvas Mobile Menu</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_classic_page_head.html" class="nav-link ">
<span class="title">Classic Page Head</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_light_page_head.html" class="nav-link ">
<span class="title">Light Page Head</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_content_grey.html" class="nav-link ">
<span class="title">Grey Bg Content</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_search_on_header_1.html" class="nav-link ">
<span class="title">Search Box On Header 1</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_search_on_header_2.html" class="nav-link ">
<span class="title">Search Box On Header 2</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_language_bar.html" class="nav-link ">
<span class="title">Header Language Bar</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_footer_fixed.html" class="nav-link ">
<span class="title">Fixed Footer</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_boxed_page.html" class="nav-link ">
<span class="title">Boxed Page</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-feed"></i>
<span class="title">Sidebar Layouts</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="layout_sidebar_menu_light.html" class="nav-link ">
<span class="title">Light Sidebar Menu</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_sidebar_menu_hover.html" class="nav-link ">
<span class="title">Hover Sidebar Menu</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_sidebar_search_1.html" class="nav-link ">
<span class="title">Sidebar Search Option 1</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_sidebar_search_2.html" class="nav-link ">
<span class="title">Sidebar Search Option 2</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_toggler_on_sidebar.html" class="nav-link ">
<span class="title">Sidebar Toggler On Sidebar</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_sidebar_reversed.html" class="nav-link ">
<span class="title">Reversed Sidebar Page</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_sidebar_fixed.html" class="nav-link ">
<span class="title">Fixed Sidebar Layout</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_sidebar_closed.html" class="nav-link ">
<span class="title">Closed Sidebar Layout</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-paper-plane"></i>
<span class="title">Horizontal Menu</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="layout_mega_menu_light.html" class="nav-link ">
<span class="title">Light Mega Menu</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_mega_menu_dark.html" class="nav-link ">
<span class="title">Dark Mega Menu</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_full_width.html" class="nav-link ">
<span class="title">Full Width Layout</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class=" icon-wrench"></i>
<span class="title">Custom Layouts</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="layout_disabled_menu.html" class="nav-link ">
<span class="title">Disabled Menu Links</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_full_height_portlet.html" class="nav-link ">
<span class="title">Full Height Portlet</span>
</a>
</li>
<li class="nav-item ">
<a href="layout_full_height_content.html" class="nav-link ">
<span class="title">Full Height Content</span>
</a>
</li>
</ul>
</li>
<li class="heading">
<h3 class="uppercase">Pages</h3>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-basket"></i>
<span class="title">eCommerce</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="ecommerce_index.html" class="nav-link ">
<i class="icon-home"></i>
<span class="title">Dashboard</span>
</a>
</li>
<li class="nav-item ">
<a href="ecommerce_orders.html" class="nav-link ">
<i class="icon-basket"></i>
<span class="title">Orders</span>
</a>
</li>
<li class="nav-item ">
<a href="ecommerce_orders_view.html" class="nav-link ">
<i class="icon-tag"></i>
<span class="title">Order View</span>
</a>
</li>
<li class="nav-item ">
<a href="ecommerce_products.html" class="nav-link ">
<i class="icon-graph"></i>
<span class="title">Products</span>
</a>
</li>
<li class="nav-item ">
<a href="ecommerce_products_edit.html" class="nav-link ">
<i class="icon-graph"></i>
<span class="title">Product Edit</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-docs"></i>
<span class="title">Apps</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="app_todo.html" class="nav-link ">
<i class="icon-clock"></i>
<span class="title">Todo 1</span>
</a>
</li>
<li class="nav-item ">
<a href="app_todo_2.html" class="nav-link ">
<i class="icon-check"></i>
<span class="title">Todo 2</span>
</a>
</li>
<li class="nav-item ">
<a href="app_inbox.html" class="nav-link ">
<i class="icon-envelope"></i>
<span class="title">Inbox</span>
</a>
</li>
<li class="nav-item ">
<a href="app_calendar.html" class="nav-link ">
<i class="icon-calendar"></i>
<span class="title">Calendar</span>
</a>
</li>
<li class="nav-item ">
<a href="app_ticket.html" class="nav-link ">
<i class="icon-notebook"></i>
<span class="title">Support</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-user"></i>
<span class="title">User</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="page_user_profile_1.html" class="nav-link ">
<i class="icon-user"></i>
<span class="title">Profile 1</span>
</a>
</li>
<li class="nav-item ">
<a href="page_user_profile_1_account.html" class="nav-link ">
<i class="icon-user-female"></i>
<span class="title">Profile 1 Account</span>
</a>
</li>
<li class="nav-item ">
<a href="page_user_profile_1_help.html" class="nav-link ">
<i class="icon-user-following"></i>
<span class="title">Profile 1 Help</span>
</a>
</li>
<li class="nav-item ">
<a href="page_user_profile_2.html" class="nav-link ">
<i class="icon-users"></i>
<span class="title">Profile 2</span>
</a>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-notebook"></i>
<span class="title">Login</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="page_user_login_1.html" class="nav-link " target="_blank"> Login Page 1 </a>
</li>
<li class="nav-item ">
<a href="page_user_login_2.html" class="nav-link " target="_blank"> Login Page 2 </a>
</li>
<li class="nav-item ">
<a href="page_user_login_3.html" class="nav-link " target="_blank"> Login Page 3 </a>
</li>
<li class="nav-item ">
<a href="page_user_login_4.html" class="nav-link " target="_blank"> Login Page 4 </a>
</li>
<li class="nav-item ">
<a href="page_user_login_5.html" class="nav-link " target="_blank"> Login Page 5 </a>
</li>
<li class="nav-item ">
<a href="page_user_login_6.html" class="nav-link " target="_blank"> Login Page 6 </a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="page_user_lock_1.html" class="nav-link " target="_blank">
<i class="icon-lock"></i>
<span class="title">Lock Screen 1</span>
</a>
</li>
<li class="nav-item ">
<a href="page_user_lock_2.html" class="nav-link " target="_blank">
<i class="icon-lock-open"></i>
<span class="title">Lock Screen 2</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-social-dribbble"></i>
<span class="title">General</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="page_general_about.html" class="nav-link ">
<i class="icon-info"></i>
<span class="title">About</span>
</a>
</li>
<li class="nav-item ">
<a href="page_general_contact.html" class="nav-link ">
<i class="icon-call-end"></i>
<span class="title">Contact</span>
</a>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-notebook"></i>
<span class="title">Portfolio</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="page_general_portfolio_1.html" class="nav-link "> Portfolio 1 </a>
</li>
<li class="nav-item ">
<a href="page_general_portfolio_2.html" class="nav-link "> Portfolio 2 </a>
</li>
<li class="nav-item ">
<a href="page_general_portfolio_3.html" class="nav-link "> Portfolio 3 </a>
</li>
<li class="nav-item ">
<a href="page_general_portfolio_4.html" class="nav-link "> Portfolio 4 </a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-magnifier"></i>
<span class="title">Search</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="page_general_search.html" class="nav-link "> Search 1 </a>
</li>
<li class="nav-item ">
<a href="page_general_search_2.html" class="nav-link "> Search 2 </a>
</li>
<li class="nav-item ">
<a href="page_general_search_3.html" class="nav-link "> Search 3 </a>
</li>
<li class="nav-item ">
<a href="page_general_search_4.html" class="nav-link "> Search 4 </a>
</li>
<li class="nav-item ">
<a href="page_general_search_5.html" class="nav-link "> Search 5 </a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="page_general_pricing.html" class="nav-link ">
<i class="icon-tag"></i>
<span class="title">Pricing</span>
</a>
</li>
<li class="nav-item ">
<a href="page_general_faq.html" class="nav-link ">
<i class="icon-wrench"></i>
<span class="title">FAQ</span>
</a>
</li>
<li class="nav-item ">
<a href="page_general_blog.html" class="nav-link ">
<i class="icon-pencil"></i>
<span class="title">Blog</span>
</a>
</li>
<li class="nav-item ">
<a href="page_general_blog_post.html" class="nav-link ">
<i class="icon-note"></i>
<span class="title">Blog Post</span>
</a>
</li>
<li class="nav-item ">
<a href="page_general_invoice.html" class="nav-link ">
<i class="icon-envelope"></i>
<span class="title">Invoice</span>
</a>
</li>
<li class="nav-item ">
<a href="page_general_invoice_2.html" class="nav-link ">
<i class="icon-envelope"></i>
<span class="title">Invoice 2</span>
</a>
</li>
</ul>
</li>
<li class="nav-item ">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-settings"></i>
<span class="title">System</span>
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item ">
<a href="page_cookie_consent_1.html" class="nav-link ">
<span class="title">Cookie Consent 1</span>
</a>
</li>
<li class="nav-item ">
<a href="page_cookie_consent_2.html" class="nav-link ">
<span class="title">Cookie Consent 2</span>
</a>
</li>
<li class="nav-item ">
<a href="page_system_coming_soon.html" class="nav-link " target="_blank">
<span class="title">Coming Soon</span>
</a>
</li>
<li class="nav-item ">
<a href="page_system_404_1.html" class="nav-link ">
<span class="title">404 Page 1</span>
</a>
</li>
<li class="nav-item ">
<a href="page_system_404_2.html" class="nav-link " target="_blank">
<span class="title">404 Page 2</span>
</a>
</li>
<li class="nav-item ">
<a href="page_system_404_3.html" class="nav-link " target="_blank">
<span class="title">404 Page 3</span>
</a>
</li>
<li class="nav-item ">
<a href="page_system_500_1.html" class="nav-link ">
<span class="title">500 Page 1</span>
</a>
</li>
<li class="nav-item ">
<a href="page_system_500_2.html" class="nav-link " target="_blank">
<span class="title">500 Page 2</span>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-folder"></i>
<span class="title">Multi Level Menu</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li class="nav-item">
<a href="javascript:;" class="nav-link nav-toggle">
<i class="icon-settings"></i> Item 1
<span class="arrow"></span>
</a>
<ul class="sub-menu">
<li class="nav-item">
<a href="javascript:;" target="_blank" class="nav-link">
<i class="icon-user"></i> Arrow Toggle
<span class="arrow nav-toggle"></span>
</a>
<ul class="sub-menu">
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-power"></i> Sample Link 1</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-paper-plane"></i> Sample Link 1</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-star"></i> Sample Link 1</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-camera"></i> Sample Link 1</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-link"></i> Sample Link 2</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-pointer"></i> Sample Link 3</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="javascript:;" target="_blank" class="nav-link">
<i class="icon-globe"></i> Arrow Toggle
<span class="arrow nav-toggle"></span>
</a>
<ul class="sub-menu">
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-tag"></i> Sample Link 1</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-pencil"></i> Sample Link 1</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-graph"></i> Sample Link 1</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="icon-bar-chart"></i> Item 3 </a>
</li>
</ul>
</li>
</ul>
<!-- END SIDEBAR MENU -->
<!-- END SIDEBAR MENU -->
</div>
<!-- END SIDEBAR -->
</div>
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<!-- BEGIN CONTENT BODY -->
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<!-- BEGIN THEME PANEL -->
<div class="theme-panel hidden-xs hidden-sm">
<div class="toggler"> </div>
<div class="toggler-close"> </div>
<div class="theme-options">
<div class="theme-option theme-colors clearfix">
<span> THEME COLOR </span>
<ul>
<li class="color-default current tooltips" data-style="default" data-container="body" data-original-title="Default"> </li>
<li class="color-darkblue tooltips" data-style="darkblue" data-container="body" data-original-title="Dark Blue"> </li>
<li class="color-blue tooltips" data-style="blue" data-container="body" data-original-title="Blue"> </li>
<li class="color-grey tooltips" data-style="grey" data-container="body" data-original-title="Grey"> </li>
<li class="color-light tooltips" data-style="light" data-container="body" data-original-title="Light"> </li>
<li class="color-light2 tooltips" data-style="light2" data-container="body" data-html="true" data-original-title="Light 2"> </li>
</ul>
</div>
<div class="theme-option">
<span> Layout </span>
<select class="layout-option form-control input-sm">
<option value="fluid" selected="selected">Fluid</option>
<option value="boxed">Boxed</option>
</select>
</div>
<div class="theme-option">
<span> Header </span>
<select class="page-header-option form-control input-sm">
<option value="fixed" selected="selected">Fixed</option>
<option value="default">Default</option>
</select>
</div>
<div class="theme-option">
<span> Top Menu Dropdown</span>
<select class="page-header-top-dropdown-style-option form-control input-sm">
<option value="light" selected="selected">Light</option>
<option value="dark">Dark</option>
</select>
</div>
<div class="theme-option">
<span> Sidebar Mode</span>
<select class="sidebar-option form-control input-sm">
<option value="fixed">Fixed</option>
<option value="default" selected="selected">Default</option>
</select>
</div>
<div class="theme-option">
<span> Sidebar Menu </span>
<select class="sidebar-menu-option form-control input-sm">
<option value="accordion" selected="selected">Accordion</option>
<option value="hover">Hover</option>
</select>
</div>
<div class="theme-option">
<span> Sidebar Style </span>
<select class="sidebar-style-option form-control input-sm">
<option value="default" selected="selected">Default</option>
<option value="light">Light</option>
</select>
</div>
<div class="theme-option">
<span> Sidebar Position </span>
<select class="sidebar-pos-option form-control input-sm">
<option value="left" selected="selected">Left</option>
<option value="right">Right</option>
</select>
</div>
<div class="theme-option">
<span> Footer </span>
<select class="page-footer-option form-control input-sm">
<option value="fixed">Fixed</option>
<option value="default" selected="selected">Default</option>
</select>
</div>
</div>
</div>
<!-- END THEME PANEL -->
<!-- BEGIN PAGE BAR -->
<div class="page-bar">
<ul class="page-breadcrumb">
<li>
<a href="index.html">Home</a>
<i class="fa fa-circle"></i>
</li>
<li>
<a href="#">Charts</a>
<i class="fa fa-circle"></i>
</li>
<li>
<span>HighCharts</span>
</li>
</ul>
<div class="page-toolbar">
<div class="btn-group pull-right">
<button type="button" class="btn green btn-sm btn-outline dropdown-toggle" data-toggle="dropdown"> Actions
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right" role="menu">
<li>
<a href="#">
<i class="icon-bell"></i> Action</a>
</li>
<li>
<a href="#">
<i class="icon-shield"></i> Another action</a>
</li>
<li>
<a href="#">
<i class="icon-user"></i> Something else here</a>
</li>
<li class="divider"> </li>
<li>
<a href="#">
<i class="icon-bag"></i> Separated link</a>
</li>
</ul>
</div>
</div>
</div>
<!-- END PAGE BAR -->
<!-- BEGIN PAGE TITLE-->
<h1 class="page-title"> HighMaps
<small>Lorem ipsum</small>
</h1>
<!-- END PAGE TITLE-->
<!-- END PAGE HEADER-->
<div class="m-heading-1 border-green m-bordered">
<p> Good-looking charts shouldn't be difficult! </p>
<p> Please note, Metronic includes Highcharts plugin for demo only. For more info please check out
<a href="http://www.highcharts.com/" class="btn green btn-outline" target="_blank">the official documentation</a> and
<a href="http://www.highcharts.com/products/highcharts/#non-commercial" class="btn red btn-outline" target="_blank">the license notice</a>
</p>
</div>
<!-- BEGIN : HIGHSTOCK -->
<div class="row">
<div class="col-md-12">
<div class="portlet light portlet-fit bordered">
<div class="portlet-title">
<div class="caption">
<i class=" icon-layers font-green"></i>
<span class="caption-subject font-green bold uppercase">Map Bubble</span>
</div>
<div class="actions">
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-cloud-upload"></i>
</a>
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-wrench"></i>
</a>
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-trash"></i>
</a>
</div>
</div>
<div class="portlet-body">
<div id="highmaps_1" class="highchart-font" style="height:500px;"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="portlet light portlet-fit bordered">
<div class="portlet-title">
<div class="caption">
<i class=" icon-layers font-green"></i>
<span class="caption-subject font-green bold uppercase">Heat Map</span>
</div>
<div class="actions">
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-cloud-upload"></i>
</a>
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-wrench"></i>
</a>
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-trash"></i>
</a>
</div>
</div>
<div class="portlet-body">
<div id="highmaps_2" style="height:500px;"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="portlet light portlet-fit bordered">
<div class="portlet-title">
<div class="caption">
<i class=" icon-layers font-green"></i>
<span class="caption-subject font-green bold uppercase">Timezone Map</span>
</div>
<div class="actions">
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-cloud-upload"></i>
</a>
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-wrench"></i>
</a>
<a class="btn btn-circle btn-icon-only btn-default" href="javascript:;">
<i class="icon-trash"></i>
</a>
</div>
</div>
<div class="portlet-body">
<div id="highmaps_3" style="height:500px;"></div>
</div>
</div>
</div>
</div>
<!-- MAP 2 DATA --><pre id="_csv" style="display: none">Date, Time, Temperature
2013-04-01,0,-0.7
2013-04-02,0,-3.4
2013-04-03,0,-1.1</pre> <pre id="csv" style="display: none">Date, Time, Temperature
2015-05-01,0,2.0
2015-05-01,1,1.7
2015-05-01,2,1.5
2015-05-01,3,1.5
2015-05-01,4,1.1
2015-05-01,5,1.1
2015-05-01,6,1.1
2015-05-01,7,0.8
2015-05-01,8,0.3
2015-05-01,9,-0.7
2015-05-01,10,1.0
2015-05-01,11,3.4
2015-05-01,12,4.5
2015-05-01,13,5.5
2015-05-01,14,5.7
2015-05-01,15,6.7
2015-05-01,16,6.0
2015-05-01,17,5.7
2015-05-01,18,5.1
2015-05-01,19,5.0
2015-05-01,20,4.5
2015-05-01,21,3.3
2015-05-01,22,2.9
2015-05-01,23,3.6
2015-05-01,0,2.3
2015-05-01,1,2.2
2015-05-01,2,1.8
2015-05-01,3,1.9
2015-05-01,4,2.5
2015-05-01,5,3.2
2015-05-01,6,1.9
2015-05-01,8,1.1
2015-05-01,9,0.7
2015-05-01,7,1.0
2015-05-01,10,1.4
2015-05-01,11,0.6
2015-05-01,12,1.7
2015-05-01,13,2.3
2015-05-01,14,2.5
2015-05-01,15,2.5
2015-05-01,16,4.2
2015-05-01,18,3.2
2015-05-01,17,3.9
2015-05-01,19,3.6
2015-05-01,20,2.0
2015-05-01,21,1.6
2015-05-01,22,1.5
2015-05-01,23,1.5
2015-05-02,0,1.1
2015-05-02,1,0.8
2015-05-02,2,0.9
2015-05-02,3,0.9
2015-05-02,4,1.0
2015-05-02,5,0.9
2015-05-02,6,0.2
2015-05-02,8,-1.5
2015-05-02,7,-0.9
2015-05-02,9,-0.4
2015-05-02,10,1.3
2015-05-02,11,3.5
2015-05-02,12,3.6
2015-05-02,13,3.8
2015-05-02,14,4.3
2015-05-02,15,6.0
2015-05-02,16,5.7
2015-05-02,17,6.2
2015-05-02,18,5.4
2015-05-02,19,4.2
2015-05-02,20,4.8
2015-05-02,21,4.4
2015-05-02,22,4.3
2015-05-02,23,4.2
2015-05-03,0,3.9
2015-05-03,1,3.8
2015-05-03,2,3.7
2015-05-03,3,3.7
2015-05-03,4,3.3
2015-05-03,5,3.1
2015-05-03,7,3.3
2015-05-03,6,3.2
2015-05-03,8,3.2
2015-05-03,9,3.1
2015-05-03,10,3.4
2015-05-03,11,4.0
2015-05-03,12,4.4
2015-05-03,13,5.0
2015-05-03,14,5.7
2015-05-03,15,5.9
2015-05-03,16,7.1
2015-05-03,17,5.7
2015-05-03,18,6.0
2015-05-03,19,5.6
2015-05-03,20,4.4
2015-05-03,21,2.8
2015-05-03,22,0.4
2015-05-03,23,-0.6
2015-05-04,0,-1.1
2015-05-04,1,-1.8
2015-05-04,2,-1.8
2015-05-04,3,-1.9
2015-05-04,4,-2.2
2015-05-04,5,-2.5
2015-05-04,7,-2.9
2015-05-04,6,-2.5
2015-05-04,8,-2.8
2015-05-04,9,-2.3
2015-05-04,10,-0.2
2015-05-04,11,2.5
2015-05-04,12,3.6
2015-05-04,13,5.2
2015-05-04,14,6.1
2015-05-04,15,6.2
2015-05-04,16,6.5
2015-05-04,17,6.7
2015-05-04,18,5.8
2015-05-04,19,5.4
2015-05-04,20,3.5
2015-05-04,21,1.0
2015-05-04,22,0.0
2015-05-04,23,-0.3
2015-05-05,0,-0.9
2015-05-05,1,-0.7
2015-05-05,2,-0.4
2015-05-05,3,-0.5
2015-05-05,4,0.2
2015-05-05,5,0.7
2015-05-05,6,1.0
2015-05-05,7,0.9
2015-05-05,8,0.5
2015-05-05,9,0.4
2015-05-05,10,0.4
2015-05-05,11,0.7
2015-05-05,12,1.1
2015-05-05,13,1.8
2015-05-05,14,2.1
2015-05-05,15,2.3
2015-05-05,16,2.3
2015-05-05,17,2.3
2015-05-05,18,2.8
2015-05-05,19,2.3
2015-05-05,20,2.1
2015-05-05,21,1.9
2015-05-05,22,1.9
2015-05-05,23,1.8
2015-05-06,0,1.7
2015-05-06,1,1.9
2015-05-06,2,2.1
2015-05-06,3,2.2
2015-05-06,4,2.3
2015-05-06,5,2.0
2015-05-06,6,1.9
2015-05-06,7,2.0
2015-05-06,8,2.0
2015-05-06,9,3.2
2015-05-06,10,4.0
2015-05-06,11,5.2
2015-05-06,12,5.4
2015-05-06,13,6.7
2015-05-06,14,7.2
2015-05-06,15,7.1
2015-05-06,16,6.5
2015-05-06,17,6.3
2015-05-06,18,8.4
2015-05-06,19,6.0
2015-05-06,20,5.7
2015-05-06,21,5.2
2015-05-06,22,8.6
2015-05-06,23,8.9
2015-05-07,0,7.5
2015-05-07,1,6.2
2015-05-07,2,6.7
2015-05-07,3,7.1
2015-05-07,4,6.0
2015-05-07,5,6.1
2015-05-07,6,6.4
2015-05-07,7,5.6
2015-05-07,8,5.3
2015-05-07,9,5.9
2015-05-07,10,6.8
2015-05-07,11,7.5
2015-05-07,12,7.6
2015-05-07,13,8.3
2015-05-07,14,8.7
2015-05-07,15,9.1
2015-05-07,16,9.9
2015-05-07,17,9.4
2015-05-07,18,9.5
2015-05-07,19,8.9
2015-05-07,20,8.0
2015-05-07,21,7.7
2015-05-07,22,7.7
2015-05-07,23,7.5
2015-05-08,0,7.4
2015-05-08,1,6.6
2015-05-08,2,6.9
2015-05-08,3,6.9
2015-05-08,4,6.4
2015-05-08,5,6.0
2015-05-08,6,5.6
2015-05-08,7,4.9
2015-05-08,8,5.2
2015-05-08,9,4.4
2015-05-08,10,5.7
2015-05-08,11,6.7
2015-05-08,12,7.5
2015-05-08,13,8.9
2015-05-08,14,9.9
2015-05-08,15,10.6
2015-05-08,16,9.7
2015-05-08,17,9.9
2015-05-08,18,9.8
2015-05-08,19,8.6
2015-05-08,20,7.6
2015-05-08,22,5.8
2015-05-08,21,6.0
2015-05-08,23,5.2
2015-05-09,0,7.7
2015-05-09,1,8.1
2015-05-09,2,8.3
2015-05-09,3,8.3
2015-05-09,4,7.3
2015-05-09,5,7.3
2015-05-09,6,7.0
2015-05-09,7,7.4
2015-05-09,8,7.4
2015-05-09,9,7.5
2015-05-09,10,8.3
2015-05-09,11,8.5
2015-05-09,12,9.2
2015-05-09,13,10.2
2015-05-09,14,10.8
2015-05-09,15,10.7
2015-05-09,16,10.4
2015-05-09,17,11.0
2015-05-09,18,10.6
2015-05-09,19,9.5
2015-05-09,20,9.5
2015-05-09,21,8.9
2015-05-09,22,8.7
2015-05-09,23,9.1
2015-05-10,0,9.6
2015-05-10,1,9.4
2015-05-10,2,8.5
2015-05-10,3,7.7
2015-05-10,4,8.0
2015-05-10,5,7.7
2015-05-10,6,7.6
2015-05-10,7,9.1
2015-05-10,8,7.8
2015-05-10,9,7.7
2015-05-10,10,7.7
2015-05-10,11,8.7
2015-05-10,12,10.4
2015-05-10,13,11.1
2015-05-10,14,12.1
2015-05-10,15,12.8
2015-05-10,16,12.8
2015-05-10,17,12.9
2015-05-10,18,12.6
2015-05-10,19,11.9
2015-05-10,20,10.2
2015-05-10,21,8.0
2015-05-10,22,5.7
2015-05-10,23,4.4
2015-05-11,0,3.6
2015-05-11,1,4.4
2015-05-11,2,5.2
2015-05-11,3,4.9
2015-05-11,4,4.0
2015-05-11,5,3.7
2015-05-11,6,3.7
2015-05-11,7,3.0
2015-05-11,8,3.6
2015-05-11,9,5.5
2015-05-11,10,6.9
2015-05-11,11,7.5
2015-05-11,12,8.7
2015-05-11,13,8.8
2015-05-11,14,9.1
2015-05-11,15,9.2
2015-05-11,16,11.4
2015-05-11,17,10.5
2015-05-11,18,10.1
2015-05-11,19,8.8
2015-05-11,20,7.5
2015-05-11,21,6.2
2015-05-11,22,4.5
2015-05-11,23,4.2
2015-05-12,0,3.7
2015-05-12,1,3.3
2015-05-12,2,3.1
2015-05-12,3,3.0
2015-05-12,4,3.1
2015-05-12,5,3.0
2015-05-12,6,3.0
2015-05-12,7,2.8
2015-05-12,8,2.8
2015-05-12,9,3.2
2015-05-12,10,4.6
2015-05-12,11,4.6
2015-05-12,12,5.7
2015-05-12,13,6.4
2015-05-12,14,5.0
2015-05-12,15,5.6
2015-05-12,16,3.8
2015-05-12,17,5.2
2015-05-12,18,3.7
2015-05-12,19,3.7
2015-05-12,20,4.2
2015-05-12,21,2.9
2015-05-12,22,3.0
2015-05-12,23,3.0
2015-05-13,0,2.5
2015-05-13,1,2.2
2015-05-13,2,1.6
2015-05-13,3,1.5
2015-05-13,4,1.3
2015-05-13,5,1.6
2015-05-13,6,2.0
2015-05-13,7,2.8
2015-05-13,8,3.0
2015-05-13,9,2.9
2015-05-13,10,3.2
2015-05-13,11,3.2
2015-05-13,12,3.4
2015-05-13,13,4.0
2015-05-13,14,3.8
2015-05-13,15,4.9
2015-05-13,17,4.1
2015-05-13,16,3.8
2015-05-13,18,5.0
2015-05-13,19,5.4
2015-05-13,20,3.8
2015-05-13,21,2.3
2015-05-13,22,1.6
2015-05-13,23,1.7
2015-05-14,0,1.9
2015-05-14,1,1.6
2015-05-14,2,1.6
2015-05-14,3,1.7
2015-05-14,4,1.7
2015-05-14,5,1.4
2015-05-14,6,0.4
2015-05-14,7,0.4
2015-05-14,8,0.3
2015-05-14,9,0.3
2015-05-14,10,0.3
2015-05-14,11,0.5
2015-05-14,12,0.9
2015-05-14,13,1.2
2015-05-14,14,1.6
2015-05-14,15,2.6
2015-05-14,16,3.3
2015-05-14,17,6.2
2015-05-14,18,5.4
2015-05-14,19,5.9
2015-05-14,20,6.6
2015-05-14,21,6.7
2015-05-14,22,7.1
2015-05-14,23,4.8
2015-05-15,0,5.3
2015-05-15,1,4.8
2015-05-15,2,4.6
2015-05-15,3,4.9
2015-05-15,4,4.9
2015-05-15,5,6.4
2015-05-15,6,4.2
2015-05-15,7,3.3
2015-05-15,8,3.8
2015-05-15,10,4.5
2015-05-15,9,4.1
2015-05-15,11,4.9
2015-05-15,12,4.6
2015-05-15,13,6.6
2015-05-15,14,6.0
2015-05-15,15,6.0
2015-05-15,16,4.9
2015-05-15,17,6.6
2015-05-15,18,7.0
2015-05-15,19,5.9
2015-05-15,20,5.1
2015-05-15,21,4.4
2015-05-15,22,3.7
2015-05-15,23,3.4
2015-05-16,0,4.0
2015-05-16,1,5.1
2015-05-16,2,5.1
2015-05-16,3,4.9
2015-05-16,4,4.7
2015-05-16,5,4.6
2015-05-16,6,4.6
2015-05-16,7,4.3
2015-05-16,8,4.3
2015-05-16,9,4.3
2015-05-16,11,4.6
2015-05-16,10,4.7
2015-05-16,12,5.4
2015-05-16,13,5.9
2015-05-16,14,6.1
2015-05-16,15,7.0
2015-05-16,16,7.9
2015-05-16,17,6.6
2015-05-16,18,6.6
2015-05-16,19,6.4
2015-05-16,20,6.1
2015-05-16,21,5.9
2015-05-16,22,5.6
2015-05-16,23,5.1
2015-05-17,0,4.4
2015-05-17,1,3.0
2015-05-17,2,1.6
2015-05-17,3,0.7
2015-05-17,4,0.6
2015-05-17,5,-0.1
2015-05-17,6,-0.4
2015-05-17,7,0.1
2015-05-17,8,0.2
2015-05-17,9,2.0
2015-05-17,10,4.9
2015-05-17,11,6.1
2015-05-17,12,7.3
2015-05-17,13,8.7
2015-05-17,14,9.8
2015-05-17,15,10.1
2015-05-17,16,10.2
2015-05-17,17,11.1
2015-05-17,18,11.1
2015-05-17,19,10.9
2015-05-17,20,7.5
2015-05-17,21,5.0
2015-05-17,22,2.9
2015-05-17,23,2.8
2015-05-18,0,2.3
2015-05-18,1,1.6
2015-05-18,2,1.0
2015-05-18,4,0.7
2015-05-18,5,0.7
2015-05-18,6,-0.2
2015-05-18,7,0.2
2015-05-18,3,0.2
2015-05-18,8,1.0
2015-05-18,9,2.7
2015-05-18,10,5.3
2015-05-18,11,7.1
2015-05-18,12,7.7
2015-05-18,13,8.9
2015-05-18,14,9.8
2015-05-18,15,10.7
2015-05-18,16,11.3
2015-05-18,17,10.9
2015-05-18,18,9.4
2015-05-18,19,9.3
2015-05-18,20,8.8
2015-05-18,21,8.3
2015-05-18,22,6.9
2015-05-18,23,5.2
2015-05-19,0,3.8
2015-05-19,1,3.3
2015-05-19,2,2.6
2015-05-19,3,2.0
2015-05-19,4,2.0
2015-05-19,5,2.0
2015-05-19,6,2.5
2015-05-19,7,2.3
2015-05-19,8,3.1
2015-05-19,9,5.1
2015-05-19,10,6.8
2015-05-19,11,7.9
2015-05-19,12,9.0
2015-05-19,13,10.3
2015-05-19,14,11.1
2015-05-19,15,12.2
2015-05-19,16,12.5
2015-05-19,17,13.7
2015-05-19,18,14.4
2015-05-19,19,14.0
2015-05-19,20,11.3
2015-05-19,21,7.0
2015-05-19,22,5.7
2015-05-19,23,5.3
2015-05-20,0,4.9
2015-05-20,1,4.1
2015-05-20,2,3.6
2015-05-20,3,3.3
2015-05-20,4,2.8
2015-05-20,5,3.0
2015-05-20,6,2.7
2015-05-20,7,1.9
2015-05-20,8,2.5
2015-05-20,9,5.4
2015-05-20,10,8.0
2015-05-20,11,9.4
2015-05-20,12,10.5
2015-05-20,13,12.2
2015-05-20,14,13.2
2015-05-20,15,14.5
2015-05-20,16,15.5
2015-05-20,17,15.5
2015-05-20,18,15.4
2015-05-20,19,16.1
2015-05-20,20,12.9
2015-05-20,21,9.2
2015-05-20,22,7.9
2015-05-20,23,7.3
2015-05-21,0,5.7
2015-05-21,1,4.6
2015-05-21,2,5.0
2015-05-21,3,4.4
2015-05-21,4,3.7
2015-05-21,5,2.9
2015-05-21,6,2.8
2015-05-21,7,2.8
2015-05-21,8,2.7
2015-05-21,9,5.7
2015-05-21,10,8.5
2015-05-21,11,9.9
2015-05-21,12,9.0
2015-05-21,13,8.0
2015-05-21,14,7.2
2015-05-21,15,7.7
2015-05-21,16,8.4
2015-05-21,17,8.1
2015-05-21,18,8.2
2015-05-21,19,9.5
2015-05-21,20,8.4
2015-05-21,21,7.6
2015-05-21,22,6.5
2015-05-21,23,5.4
2015-05-22,0,5.1
2015-05-22,1,3.8
2015-05-22,2,3.0
2015-05-22,3,2.8
2015-05-22,4,4.0
2015-05-22,5,4.3
2015-05-22,6,5.2
2015-05-22,7,5.3
2015-05-22,8,6.0
2015-05-22,9,6.5
2015-05-22,10,7.4
2015-05-22,11,8.4
2015-05-22,12,8.7
2015-05-22,13,9.3
2015-05-22,14,10.5
2015-05-22,15,10.9
2015-05-22,16,11.1
2015-05-22,17,10.0
2015-05-22,18,8.2
2015-05-22,19,7.3
2015-05-22,20,7.7
2015-05-22,21,7.7
2015-05-22,22,8.1
2015-05-22,23,9.0
2015-05-23,0,8.9
2015-05-23,1,8.4
2015-05-23,2,8.3
2015-05-23,3,8.0
2015-05-23,4,7.6
2015-05-23,5,7.3
2015-05-23,6,6.9
2015-05-23,7,6.7
2015-05-23,8,6.5
2015-05-23,9,6.6
2015-05-23,10,6.9
2015-05-23,11,7.6
2015-05-23,12,8.3
2015-05-23,13,7.5
2015-05-23,14,6.1
2015-05-23,15,7.1
2015-05-23,16,6.7
2015-05-23,17,5.3
2015-05-23,18,5.9
2015-05-23,19,6.2
2015-05-23,20,5.9
2015-05-23,21,5.3
2015-05-23,22,4.6
2015-05-23,23,3.6
2015-05-24,0,3.0
2015-05-24,1,3.0
2015-05-24,2,2.2
2015-05-24,3,1.7
2015-05-24,4,1.4
2015-05-24,5,1.9
2015-05-24,6,1.6
2015-05-24,7,1.4
2015-05-24,8,2.1
2015-05-24,9,3.1
2015-05-24,10,3.4
2015-05-24,11,3.9
2015-05-24,12,5.4
2015-05-24,13,5.2
2015-05-24,14,5.6
2015-05-24,15,5.8
2015-05-24,16,5.8
2015-05-24,17,5.3
2015-05-24,18,4.0
2015-05-24,19,3.0
2015-05-24,20,2.1
2015-05-24,21,1.7
2015-05-24,22,1.4
2015-05-24,23,1.2
2015-05-25,0,0.8
2015-05-25,1,0.6
2015-05-25,2,0.4
2015-05-25,3,0.5
2015-05-25,4,0.5
2015-05-25,5,0.5
2015-05-25,6,0.8
2015-05-25,7,0.7
2015-05-25,8,0.7
2015-05-25,9,0.7
2015-05-25,10,1.0
2015-05-25,12,2.6
2015-05-25,13,2.9
2015-05-25,11,2.0
2015-05-25,14,2.9
2015-05-25,15,3.3
2015-05-25,16,3.9
2015-05-25,17,4.2
2015-05-25,18,4.3
2015-05-25,19,4.7
2015-05-25,20,4.8
2015-05-25,21,5.2
2015-05-25,22,4.3
2015-05-25,23,4.0
2015-05-26,0,4.0
2015-05-26,1,4.7
2015-05-26,2,5.1
2015-05-26,3,4.6
2015-05-26,4,4.8
2015-05-26,5,4.7
2015-05-26,6,4.5
2015-05-26,7,3.8
2015-05-26,8,3.0
2015-05-26,9,3.4
2015-05-26,10,4.8
2015-05-26,11,6.3
2015-05-26,12,7.2
2015-05-26,13,6.3
2015-05-26,14,5.1
2015-05-26,15,7.2
2015-05-26,16,6.5
2015-05-26,17,5.6
2015-05-26,18,7.0
2015-05-26,19,7.4
2015-05-26,20,6.3
2015-05-26,21,5.9
2015-05-26,22,5.3
2015-05-26,23,4.5
2015-05-27,0,4.1
2015-05-27,1,4.1
2015-05-27,2,4.5
2015-05-27,3,4.7
2015-05-27,4,3.9
2015-05-27,5,2.6
2015-05-27,6,1.5
2015-05-27,7,0.8
2015-05-27,8,1.9
2015-05-27,9,4.5
2015-05-27,10,6.5
2015-05-27,11,7.6
2015-05-27,12,8.0
2015-05-27,13,9.1
2015-05-27,14,9.3
2015-05-27,15,9.3
2015-05-27,16,9.0
2015-05-27,17,9.8
2015-05-27,18,10.0
2015-05-27,19,9.5
2015-05-27,20,7.5
2015-05-27,21,4.2
2015-05-27,22,2.6
2015-05-27,23,2.7
2015-05-28,0,1.4
2015-05-28,1,0.7
2015-05-28,2,0.6
2015-05-28,3,-0.1
2015-05-28,4,-0.1
2015-05-28,5,-0.7
2015-05-28,6,-0.2
2015-05-28,7,0.4
2015-05-28,8,1.5
2015-05-28,9,4.3
2015-05-28,10,6.0
2015-05-28,11,7.2
2015-05-28,12,8.2
2015-05-28,13,8.6
2015-05-28,14,8.3
2015-05-28,15,10.0
2015-05-28,16,10.5
2015-05-28,17,10.8
2015-05-28,18,10.8
2015-05-28,19,10.7
2015-05-28,20,7.9
2015-05-28,21,4.4
2015-05-28,22,1.9
2015-05-28,23,1.4
2015-05-29,0,1.4
2015-05-29,1,0.8
2015-05-29,2,1.1
2015-05-29,3,2.0
2015-05-29,4,2.2
2015-05-29,5,1.5
2015-05-29,6,1.7
2015-05-29,7,2.1
2015-05-29,8,4.3
2015-05-29,9,4.6
2015-05-29,10,4.2
2015-05-29,11,5.2
2015-05-29,12,5.2
2015-05-29,13,6.0
2015-05-29,14,6.7
2015-05-29,15,8.5
2015-05-29,16,8.1
2015-05-29,17,8.8
2015-05-29,18,10.3
2015-05-29,19,9.2
2015-05-29,20,7.2
2015-05-29,21,5.7
2015-05-29,22,2.4
2015-05-29,23,0.9
2015-05-30,0,0.4
2015-05-30,1,0.3
2015-05-30,2,0.1
2015-05-30,3,0.2
2015-05-30,4,0.7
2015-05-30,5,1.9
2015-05-30,6,2.6
2015-05-30,7,3.2
2015-05-30,8,2.7
2015-05-30,9,2.6
2015-05-30,10,2.9
2015-05-30,11,4.0
2015-05-30,12,5.1
2015-05-30,13,5.8
2015-05-30,14,6.3
2015-05-30,15,6.8
2015-05-30,16,8.7
2015-05-30,17,9.1
2015-05-30,18,7.4
2015-05-30,19,7.3
2015-05-30,20,7.0
2015-05-30,21,6.1
2015-05-30,22,5.6
2015-05-30,23,4.5</pre>
<!-- END MAP 2 DATA -->
<!-- END : HIGHSTOCK -->
</div>
<!-- END CONTENT BODY -->
</div>
<!-- END CONTENT -->
<!-- BEGIN QUICK SIDEBAR -->
<a href="javascript:;" class="page-quick-sidebar-toggler">
<i class="icon-login"></i>
</a>
<div class="page-quick-sidebar-wrapper" data-close-on-body-click="false">
<div class="page-quick-sidebar">
<ul class="nav nav-tabs">
<li class="active">
<a href="javascript:;" data-target="#quick_sidebar_tab_1" data-toggle="tab"> Users
<span class="badge badge-danger">2</span>
</a>
</li>
<li>
<a href="javascript:;" data-target="#quick_sidebar_tab_2" data-toggle="tab"> Alerts
<span class="badge badge-success">7</span>
</a>
</li>
<li class="dropdown">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> More
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu pull-right">
<li>
<a href="javascript:;" data-target="#quick_sidebar_tab_3" data-toggle="tab">
<i class="icon-bell"></i> Alerts </a>
</li>
<li>
<a href="javascript:;" data-target="#quick_sidebar_tab_3" data-toggle="tab">
<i class="icon-info"></i> Notifications </a>
</li>
<li>
<a href="javascript:;" data-target="#quick_sidebar_tab_3" data-toggle="tab">
<i class="icon-speech"></i> Activities </a>
</li>
<li class="divider"></li>
<li>
<a href="javascript:;" data-target="#quick_sidebar_tab_3" data-toggle="tab">
<i class="icon-settings"></i> Settings </a>
</li>
</ul>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active page-quick-sidebar-chat" id="quick_sidebar_tab_1">
<div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">
<h3 class="list-heading">Staff</h3>
<ul class="media-list list-items">
<li class="media">
<div class="media-status">
<span class="badge badge-success">8</span>
</div>
<img class="media-object" src="../assets/layouts/layout/img/avatar3.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Bob Nilson</h4>
<div class="media-heading-sub"> Project Manager </div>
</div>
</li>
<li class="media">
<img class="media-object" src="../assets/layouts/layout/img/avatar1.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Nick Larson</h4>
<div class="media-heading-sub"> Art Director </div>
</div>
</li>
<li class="media">
<div class="media-status">
<span class="badge badge-danger">3</span>
</div>
<img class="media-object" src="../assets/layouts/layout/img/avatar4.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Deon Hubert</h4>
<div class="media-heading-sub"> CTO </div>
</div>
</li>
<li class="media">
<img class="media-object" src="../assets/layouts/layout/img/avatar2.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Ella Wong</h4>
<div class="media-heading-sub"> CEO </div>
</div>
</li>
</ul>
<h3 class="list-heading">Customers</h3>
<ul class="media-list list-items">
<li class="media">
<div class="media-status">
<span class="badge badge-warning">2</span>
</div>
<img class="media-object" src="../assets/layouts/layout/img/avatar6.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Lara Kunis</h4>
<div class="media-heading-sub"> CEO, Loop Inc </div>
<div class="media-heading-small"> Last seen 03:10 AM </div>
</div>
</li>
<li class="media">
<div class="media-status">
<span class="label label-sm label-success">new</span>
</div>
<img class="media-object" src="../assets/layouts/layout/img/avatar7.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Ernie Kyllonen</h4>
<div class="media-heading-sub"> Project Manager,
<br> SmartBizz PTL </div>
</div>
</li>
<li class="media">
<img class="media-object" src="../assets/layouts/layout/img/avatar8.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Lisa Stone</h4>
<div class="media-heading-sub"> CTO, Keort Inc </div>
<div class="media-heading-small"> Last seen 13:10 PM </div>
</div>
</li>
<li class="media">
<div class="media-status">
<span class="badge badge-success">7</span>
</div>
<img class="media-object" src="../assets/layouts/layout/img/avatar9.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Deon Portalatin</h4>
<div class="media-heading-sub"> CFO, H&D LTD </div>
</div>
</li>
<li class="media">
<img class="media-object" src="../assets/layouts/layout/img/avatar10.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Irina Savikova</h4>
<div class="media-heading-sub"> CEO, Tizda Motors Inc </div>
</div>
</li>
<li class="media">
<div class="media-status">
<span class="badge badge-danger">4</span>
</div>
<img class="media-object" src="../assets/layouts/layout/img/avatar11.jpg" alt="...">
<div class="media-body">
<h4 class="media-heading">Maria Gomez</h4>
<div class="media-heading-sub"> Manager, Infomatic Inc </div>
<div class="media-heading-small"> Last seen 03:10 AM </div>
</div>
</li>
</ul>
</div>
<div class="page-quick-sidebar-item">
<div class="page-quick-sidebar-chat-user">
<div class="page-quick-sidebar-nav">
<a href="javascript:;" class="page-quick-sidebar-back-to-list">
<i class="icon-arrow-left"></i>Back</a>
</div>
<div class="page-quick-sidebar-chat-user-messages">
<div class="post out">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar3.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Bob Nilson</a>
<span class="datetime">20:15</span>
<span class="body"> When could you send me the report ? </span>
</div>
</div>
<div class="post in">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar2.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Ella Wong</a>
<span class="datetime">20:15</span>
<span class="body"> Its almost done. I will be sending it shortly </span>
</div>
</div>
<div class="post out">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar3.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Bob Nilson</a>
<span class="datetime">20:15</span>
<span class="body"> Alright. Thanks! :) </span>
</div>
</div>
<div class="post in">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar2.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Ella Wong</a>
<span class="datetime">20:16</span>
<span class="body"> You are most welcome. Sorry for the delay. </span>
</div>
</div>
<div class="post out">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar3.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Bob Nilson</a>
<span class="datetime">20:17</span>
<span class="body"> No probs. Just take your time :) </span>
</div>
</div>
<div class="post in">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar2.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Ella Wong</a>
<span class="datetime">20:40</span>
<span class="body"> Alright. I just emailed it to you. </span>
</div>
</div>
<div class="post out">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar3.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Bob Nilson</a>
<span class="datetime">20:17</span>
<span class="body"> Great! Thanks. Will check it right away. </span>
</div>
</div>
<div class="post in">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar2.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Ella Wong</a>
<span class="datetime">20:40</span>
<span class="body"> Please let me know if you have any comment. </span>
</div>
</div>
<div class="post out">
<img class="avatar" alt="" src="../assets/layouts/layout/img/avatar3.jpg" />
<div class="message">
<span class="arrow"></span>
<a href="javascript:;" class="name">Bob Nilson</a>
<span class="datetime">20:17</span>
<span class="body"> Sure. I will check and buzz you if anything needs to be corrected. </span>
</div>
</div>
</div>
<div class="page-quick-sidebar-chat-user-form">
<div class="input-group">
<input type="text" class="form-control" placeholder="Type a message here...">
<div class="input-group-btn">
<button type="button" class="btn green">
<i class="icon-paper-clip"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane page-quick-sidebar-alerts" id="quick_sidebar_tab_2">
<div class="page-quick-sidebar-alerts-list">
<h3 class="list-heading">General</h3>
<ul class="feeds list-items">
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-info">
<i class="fa fa-check"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> You have 4 pending tasks.
<span class="label label-sm label-warning "> Take action
<i class="fa fa-share"></i>
</span>
</div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> Just now </div>
</div>
</li>
<li>
<a href="javascript:;">
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-success">
<i class="fa fa-bar-chart-o"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> Finance Report for year 2013 has been released. </div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 20 mins </div>
</div>
</a>
</li>
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-danger">
<i class="fa fa-user"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> You have 5 pending membership that requires a quick review. </div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 24 mins </div>
</div>
</li>
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-info">
<i class="fa fa-shopping-cart"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> New order received with
<span class="label label-sm label-success"> Reference Number: DR23923 </span>
</div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 30 mins </div>
</div>
</li>
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-success">
<i class="fa fa-user"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> You have 5 pending membership that requires a quick review. </div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 24 mins </div>
</div>
</li>
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-info">
<i class="fa fa-bell-o"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> Web server hardware needs to be upgraded.
<span class="label label-sm label-warning"> Overdue </span>
</div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 2 hours </div>
</div>
</li>
<li>
<a href="javascript:;">
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-default">
<i class="fa fa-briefcase"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> IPO Report for year 2013 has been released. </div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 20 mins </div>
</div>
</a>
</li>
</ul>
<h3 class="list-heading">System</h3>
<ul class="feeds list-items">
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-info">
<i class="fa fa-check"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> You have 4 pending tasks.
<span class="label label-sm label-warning "> Take action
<i class="fa fa-share"></i>
</span>
</div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> Just now </div>
</div>
</li>
<li>
<a href="javascript:;">
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-danger">
<i class="fa fa-bar-chart-o"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> Finance Report for year 2013 has been released. </div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 20 mins </div>
</div>
</a>
</li>
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-default">
<i class="fa fa-user"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> You have 5 pending membership that requires a quick review. </div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 24 mins </div>
</div>
</li>
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-info">
<i class="fa fa-shopping-cart"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> New order received with
<span class="label label-sm label-success"> Reference Number: DR23923 </span>
</div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 30 mins </div>
</div>
</li>
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-success">
<i class="fa fa-user"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> You have 5 pending membership that requires a quick review. </div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 24 mins </div>
</div>
</li>
<li>
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-warning">
<i class="fa fa-bell-o"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> Web server hardware needs to be upgraded.
<span class="label label-sm label-default "> Overdue </span>
</div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 2 hours </div>
</div>
</li>
<li>
<a href="javascript:;">
<div class="col1">
<div class="cont">
<div class="cont-col1">
<div class="label label-sm label-info">
<i class="fa fa-briefcase"></i>
</div>
</div>
<div class="cont-col2">
<div class="desc"> IPO Report for year 2013 has been released. </div>
</div>
</div>
</div>
<div class="col2">
<div class="date"> 20 mins </div>
</div>
</a>
</li>
</ul>
</div>
</div>
<div class="tab-pane page-quick-sidebar-settings" id="quick_sidebar_tab_3">
<div class="page-quick-sidebar-settings-list">
<h3 class="list-heading">General Settings</h3>
<ul class="list-items borderless">
<li> Enable Notifications
<input type="checkbox" class="make-switch" checked data-size="small" data-on-color="success" data-on-text="ON" data-off-color="default" data-off-text="OFF"> </li>
<li> Allow Tracking
<input type="checkbox" class="make-switch" data-size="small" data-on-color="info" data-on-text="ON" data-off-color="default" data-off-text="OFF"> </li>
<li> Log Errors
<input type="checkbox" class="make-switch" checked data-size="small" data-on-color="danger" data-on-text="ON" data-off-color="default" data-off-text="OFF"> </li>
<li> Auto Sumbit Issues
<input type="checkbox" class="make-switch" data-size="small" data-on-color="warning" data-on-text="ON" data-off-color="default" data-off-text="OFF"> </li>
<li> Enable SMS Alerts
<input type="checkbox" class="make-switch" checked data-size="small" data-on-color="success" data-on-text="ON" data-off-color="default" data-off-text="OFF"> </li>
</ul>
<h3 class="list-heading">System Settings</h3>
<ul class="list-items borderless">
<li> Security Level
<select class="form-control input-inline input-sm input-small">
<option value="1">Normal</option>
<option value="2" selected>Medium</option>
<option value="e">High</option>
</select>
</li>
<li> Failed Email Attempts
<input class="form-control input-inline input-sm input-small" value="5" /> </li>
<li> Secondary SMTP Port
<input class="form-control input-inline input-sm input-small" value="3560" /> </li>
<li> Notify On System Error
<input type="checkbox" class="make-switch" checked data-size="small" data-on-color="danger" data-on-text="ON" data-off-color="default" data-off-text="OFF"> </li>
<li> Notify On SMTP Error
<input type="checkbox" class="make-switch" checked data-size="small" data-on-color="warning" data-on-text="ON" data-off-color="default" data-off-text="OFF"> </li>
</ul>
<div class="inner-content">
<button class="btn btn-success">
<i class="icon-settings"></i> Save Changes</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="page-footer">
<div class="page-footer-inner"> 2016 © Metronic Theme By
<a target="_blank" href="http://keenthemes.com">Keenthemes</a> |
<a href="http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes" title="Purchase Metronic just for 27$ and get lifetime updates for free" target="_blank">Purchase Metronic!</a>
</div>
<div class="scroll-to-top">
<i class="icon-arrow-up"></i>
</div>
</div>
<!-- END FOOTER -->
</div>
<!-- BEGIN QUICK NAV -->
<nav class="quick-nav">
<a class="quick-nav-trigger" href="#0">
<span aria-hidden="true"></span>
</a>
<ul>
<li>
<a href="https://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes" target="_blank" class="active">
<span>Purchase Metronic</span>
<i class="icon-basket"></i>
</a>
</li>
<li>
<a href="https://themeforest.net/item/metronic-responsive-admin-dashboard-template/reviews/4021469?ref=keenthemes" target="_blank">
<span>Customer Reviews</span>
<i class="icon-users"></i>
</a>
</li>
<li>
<a href="http://keenthemes.com/showcast/" target="_blank">
<span>Showcase</span>
<i class="icon-user"></i>
</a>
</li>
<li>
<a href="http://keenthemes.com/metronic-theme/changelog/" target="_blank">
<span>Changelog</span>
<i class="icon-graph"></i>
</a>
</li>
</ul>
<span aria-hidden="true" class="quick-nav-bg"></span>
</nav>
<div class="quick-nav-overlay"></div>
<!-- END QUICK NAV -->
<!--[if lt IE 9]>
<script src="../assets/global/plugins/respond.min.js"></script>
<script src="../assets/global/plugins/excanvas.min.js"></script>
<script src="../assets/global/plugins/ie8.fix.min.js"></script>
<![endif]-->
<!-- BEGIN CORE PLUGINS -->
<script src="../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="../assets/global/plugins/highcharts/js/highcharts.js" type="text/javascript"></script>
<script src="../assets/global/plugins/highcharts/js/highcharts-3d.js" type="text/javascript"></script>
<script src="../assets/global/plugins/highcharts/js/highcharts-more.js" type="text/javascript"></script>
<script src="../assets/global/plugins/highmaps/js/modules/data.js" type="text/javascript"></script>
<script src="../assets/global/plugins/highmaps/js/modules/map.js" type="text/javascript"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN THEME GLOBAL SCRIPTS -->
<script src="../assets/global/scripts/app.min.js" type="text/javascript"></script>
<!-- END THEME GLOBAL SCRIPTS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="../assets/pages/scripts/charts-highmaps.min.js" type="text/javascript"></script>
<script src="http://code.highcharts.com/mapdata/custom/world.min.js" type="text/javascript"></script>
<script src="http://code.highcharts.com/mapdata/custom/europe.min.js" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME LAYOUT SCRIPTS -->
<script src="../assets/layouts/layout/scripts/layout.min.js" type="text/javascript"></script>
<script src="../assets/layouts/layout/scripts/demo.min.js" type="text/javascript"></script>
<script src="../assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
<script src="../assets/layouts/global/scripts/quick-nav.min.js" type="text/javascript"></script>
<!-- END THEME LAYOUT SCRIPTS -->
</body>
</html> | gpl-3.0 |
apachler/dolibarr | htdocs/compta/stats/cabyuser.php | 15636 | <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004-2016 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2013 Antoine Iauch <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/stats/cabyuser.php
* \brief Page reporting Salesover by user
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$socid = GETPOST('socid','int');
// Security check
if ($user->societe_id > 0) $socid = $user->societe_id;
if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
$modecompta = $conf->global->ACCOUNTING_MODE;
if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta");
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
if (! $sortorder) $sortorder="asc";
if (! $sortfield) $sortfield="name";
// Date range
$year=GETPOST("year");
$month=GETPOST("month");
$date_startyear = GETPOST("date_startyear");
$date_startmonth = GETPOST("date_startmonth");
$date_startday = GETPOST("date_startday");
$date_endyear = GETPOST("date_endyear");
$date_endmonth = GETPOST("date_endmonth");
$date_endday = GETPOST("date_endday");
if (empty($year))
{
$year_current = strftime("%Y",dol_now());
$month_current = strftime("%m",dol_now());
$year_start = $year_current;
} else {
$year_current = $year;
$month_current = strftime("%m",dol_now());
$year_start = $year;
}
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]);
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
// Quarter
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
{
$q=GETPOST("q")?GETPOST("q"):0;
if ($q==0)
{
// We define date_start and date_end
$month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
$year_end=$year_start;
$month_end=$month_start;
if (! GETPOST("month")) // If month not forced
{
if (! GETPOST('year') && $month_start > $month_current)
{
$year_start--;
$year_end--;
}
$month_end=$month_start-1;
if ($month_end < 1) $month_end=12;
else $year_end++;
}
$date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false);
}
if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); }
if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); }
if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); }
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
}
else
{
// TODO We define q
}
$commonparams=array();
$commonparams['modecompta']=$modecompta;
$commonparams['sortorder'] = $sortorder;
$commonparams['sortfield'] = $sortfield;
$headerparams = array();
$headerparams['date_startyear'] = $date_startyear;
$headerparams['date_startmonth'] = $date_startmonth;
$headerparams['date_startday'] = $date_startday;
$headerparams['date_endyear'] = $date_endyear;
$headerparams['date_endmonth'] = $date_endmonth;
$headerparams['date_endday'] = $date_endday;
$headerparams['q'] = $q;
$tableparams = array();
$tableparams['search_categ'] = $selected_cat;
$tableparams['subcat'] = ($subcat === true)?'yes':'';
// Adding common parameters
$allparams = array_merge($commonparams, $headerparams, $tableparams);
$headerparams = array_merge($commonparams, $headerparams);
$tableparams = array_merge($commonparams, $tableparams);
foreach($allparams as $key => $value) {
$paramslink .= '&' . $key . '=' . $value;
}
/*
* View
*/
llxHeader();
$form=new Form($db);
// Show report header
if ($modecompta=="CREANCES-DETTES") {
$nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice");
$calcmode=$langs->trans("CalcModeDebt");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
//$periodlink="<a href='".$_SERVER["PHP_SELF"]."?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
$description=$langs->trans("RulesCADue");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
else $description.= $langs->trans("DepositsAreIncluded");
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
} else {
$nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice");
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=CREANCES-DETTES">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
//$periodlink="<a href='".$_SERVER["PHP_SELF"]."?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
$description=$langs->trans("RulesCAIn");
$description.= $langs->trans("DepositsAreIncluded");
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
}
$moreparam=array();
if (! empty($modecompta)) $moreparam['modecompta']=$modecompta;
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode);
if (! empty($conf->accounting->enabled))
{
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}
// Show array
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
// Extra parameters management
foreach($headerparams as $key => $value)
{
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
}
$catotal=0;
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total) as amount, sum(f.total_ttc) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid";
$sql.= " WHERE f.fk_statut in (1,2)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql.= " AND f.type IN (0,1,2,5)";
} else {
$sql.= " AND f.type IN (0,1,2,3,5)";
}
if ($date_start && $date_end) {
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
}
} else {
/*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
*/
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u" ;
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid ";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_facture = f.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
$sql.= " WHERE 1=1";
if ($date_start && $date_end) {
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
}
}
$sql.= " AND f.entity = ".$conf->entity;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
$sql .= " GROUP BY u.rowid, u.lastname, u.firstname";
$sql .= " ORDER BY u.rowid";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i=0;
while ($i < $num) {
$obj = $db->fetch_object($result);
$amount_ht[$obj->rowid] = $obj->amount;
$amount[$obj->rowid] = $obj->amount_ttc;
$name[$obj->rowid] = $obj->name.' '.$obj->firstname;
$catotal_ht+=$obj->amount;
$catotal+=$obj->amount_ttc;
$i++;
}
} else {
dol_print_error($db);
}
// Adding old-version payments, non-bound by "paiement_facture" then without User
if ($modecompta != 'CREANCES-DETTES') {
$sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."paiement as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
$sql.= " WHERE pf.rowid IS NULL";
$sql.= " AND p.fk_bank = b.rowid";
$sql.= " AND b.fk_account = ba.rowid";
$sql.= " AND ba.entity IN (".getEntity('bank_account').")";
if ($date_start && $date_end) {
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
}
$sql.= " GROUP BY rowidx, name, firstname";
$sql.= " ORDER BY rowidx";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i=0;
while ($i < $num) {
$obj = $db->fetch_object($result);
$amount[$obj->rowidx] = $obj->amount_ttc;
$name[$obj->rowidx] = $obj->name.' '.$obj->firstname;
$catotal+=$obj->amount_ttc;
$i++;
}
} else {
dol_print_error($db);
}
}
$morefilter='';
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print "<tr class=\"liste_titre\">";
print_liste_field_titre(
$langs->trans("User"),
$_SERVER["PHP_SELF"],
"name",
"",
$paramslink,
"",
$sortfield,
$sortorder
);
if ($modecompta == 'CREANCES-DETTES') {
print_liste_field_titre(
$langs->trans('AmountHT'),
$_SERVER["PHP_SELF"],
"amount_ht",
"",
$paramslink,
'align="right"',
$sortfield,
$sortorder
);
} else {
print_liste_field_titre('');
}
print_liste_field_titre(
$langs->trans("AmountTTC"),
$_SERVER["PHP_SELF"],
"amount_ttc",
"",
$paramslink,
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans("Percentage"),
$_SERVER["PHP_SELF"],"amount_ttc",
"",
$paramslink,
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans("OtherStatistics"),
$_SERVER["PHP_SELF"],
"",
"",
"",
'align="center" width="20%"'
);
print "</tr>\n";
$var=true;
if (count($amount)) {
$arrayforsort=$name;
// We define arrayforsort
if ($sortfield == 'name' && $sortorder == 'asc') {
asort($name);
$arrayforsort=$name;
}
if ($sortfield == 'name' && $sortorder == 'desc') {
arsort($name);
$arrayforsort=$name;
}
if ($sortfield == 'amount_ht' && $sortorder == 'asc') {
asort($amount_ht);
$arrayforsort=$amount_ht;
}
if ($sortfield == 'amount_ht' && $sortorder == 'desc') {
arsort($amount_ht);
$arrayforsort=$amount_ht;
}
if ($sortfield == 'amount_ttc' && $sortorder == 'asc') {
asort($amount);
$arrayforsort=$amount;
}
if ($sortfield == 'amount_ttc' && $sortorder == 'desc') {
arsort($amount);
$arrayforsort=$amount;
}
$i = 0;
foreach($arrayforsort as $key => $value) {
print '<tr class="oddeven">';
// Third party
$fullname=$name[$key];
if ($key >= 0) {
$linkname='<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$key.'">'.img_object($langs->trans("ShowUser"),'user').' '.$fullname.'</a>';
} else {
$linkname=$langs->trans("PaymentsNotLinkedToUser");
}
print "<td>".$linkname."</td>\n";
// Amount w/o VAT
print '<td align="right">';
if ($modecompta != 'CREANCES-DETTES')
{
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
}
} else {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
} else {
print '<a href="#">';
}
print price($amount_ht[$key]);
}
print '</td>';
// Amount with VAT
print '<td align="right">';
if ($modecompta != 'CREANCES-DETTES') {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
}
} else {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
} else {
print '<a href="#">';
}
}
print price($amount[$key]);
print '</td>';
// Percent
print '<td align="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal,2).'%' : ' ').'</td>';
// Other stats
print '<td align="center">';
if (! empty($conf->propal->enabled) && $key>0) {
print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a> ';
}
if (! empty($conf->commande->enabled) && $key>0) {
print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a> ';
}
if (! empty($conf->facture->enabled) && $key>0) {
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a> ';
}
print '</td>';
print "</tr>\n";
$i++;
}
// Total
print '<tr class="liste_total">';
print '<td>'.$langs->trans("Total").'</td>';
if ($modecompta != 'CREANCES-DETTES') {
print '<td colspan="1"></td>';
} else {
print '<td align="right">'.price($catotal_ht).'</td>';
}
print '<td align="right">'.price($catotal).'</td>';
print '<td> </td>';
print '<td> </td>';
print '</tr>';
$db->free($result);
}
print "</table>";
print '</div>';
print '</form>';
llxFooter();
$db->close();
| gpl-3.0 |
securityfirst/tent | utils/persistence.go | 416 | package utils
import (
"os"
"path/filepath"
"github.com/securityfirst/tent/component"
)
func WriteCmp(base string, c component.Component) error {
path := filepath.Join(base, c.Path())
if err := os.MkdirAll(filepath.Dir(path), 0777); err != nil {
return err
}
f, err := os.Create(path)
if err != nil {
return err
}
if _, err := f.WriteString(c.Contents()); err != nil {
return err
}
return nil
}
| gpl-3.0 |
burner/AngularVibed | Examples2/Example05/node_modules/angular2/ts/examples/core/ts/prod_mode/my_component.js | 1526 | System.register(['angular2/core'], function(exports_1) {
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1;
var MyComponent;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
MyComponent = (function () {
function MyComponent() {
}
MyComponent = __decorate([
core_1.Component({ selector: 'my-component', template: '<h1>My Component</h1>' }),
__metadata('design:paramtypes', [])
], MyComponent);
return MyComponent;
})();
exports_1("MyComponent", MyComponent);
}
}
});
//# sourceMappingURL=my_component.js.map | gpl-3.0 |
ernestovi/ups | spip/plugins-dist/forum/lang/forum_id.php | 6067 | <?php
// This is a SPIP language file -- Ceci est un fichier langue de SPIP
// extrait automatiquement de http://trad.spip.net/tradlang_module/forum?lang_cible=id
// ** ne pas modifier le fichier **
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
$GLOBALS[$GLOBALS['idx_lang']] = array(
// B
'bouton_radio_articles_futurs' => 'untuk artikel yang akan dipublikasikan di masa depan saja (tidak ada aksi di database).',
'bouton_radio_articles_tous' => 'untuk semua artikel tanpa pengecualian.',
'bouton_radio_articles_tous_sauf_forum_desactive' => 'untuk semua artikel, terkecuali artikel yang forumnya dinonaktifkan.',
'bouton_radio_enregistrement_obligatoire' => 'Registrasi diperlukan (pengguna harus mendaftarkan diri dengan memberikan alamat e-mailnya sebelum dapat berkontribusi).',
'bouton_radio_moderation_priori' => 'Moderasi awal (
kontribusi hanya akan ditampilkan setelah validasi
oleh administrator).', # MODIF
'bouton_radio_modere_abonnement' => 'registrasi diperlukan',
'bouton_radio_modere_posteriori' => 'moderasi akhir', # MODIF
'bouton_radio_modere_priori' => 'moderasi awal', # MODIF
'bouton_radio_publication_immediate' => 'Publikasi pesan segera
(kontribusi akan ditampilkan sesegera mungkin setelah dikirimkan, kemudian
administrator dapat menghapusnya).',
// F
'form_pet_message_commentaire' => 'Ada pesan atau komentar?',
'forum' => 'Forum',
'forum_acces_refuse' => 'Anda tidak memiliki akses ke forum ini lagi.',
'forum_attention_dix_caracteres' => '<b>Peringatan!</b> Pesan anda hendaknya terdiri dari sepuluh karakter atau lebih.',
'forum_attention_trois_caracteres' => '<b>Peringatan!</b> Judul anda hendaknya terdiri dari tiga karakter atau lebih.',
'forum_attention_trop_caracteres' => '<b>Peringatan !</b> pesan anda terlalu panjang (@compte@ karakter) : untuk dapat menyimpannya, pesan tidak boleh lebih dari @max@ karakter.', # MODIF
'forum_avez_selectionne' => 'Anda telah memilih:',
'forum_cliquer_retour' => 'Klik <a href=\'@retour_forum@\'>di sini</a> untuk lanjut.',
'forum_forum' => 'forum',
'forum_info_modere' => 'Forum ini telah dimoderasi: kontribusi anda hanya akan muncul setelah divalidasi oleh administrator situs.', # MODIF
'forum_lien_hyper' => '<b>Tautan web</b> (opsional)', # MODIF
'forum_message_definitif' => 'Pesan akhir: kirim ke situs',
'forum_message_trop_long' => 'Pesan anda terlalu panjang. Panjang maksimum adalah 20000 karakter.', # MODIF
'forum_ne_repondez_pas' => 'Jangan balas ke e-mail ini tapi ke forum yang terdapat di alamat berikut:', # MODIF
'forum_page_url' => '(Jika pesan anda merujuk pada sebuah artikel yang dipublikasi di web atau halaman yang memberikan informasi lebih lanjut, silakan masukkan judul halaman dan URL-nya di bawah).',
'forum_poste_par' => 'Pesan dikirim@parauteur@ mengikuti artikel anda.', # MODIF
'forum_qui_etes_vous' => '<b>Siapa anda?</b> (opsional)', # MODIF
'forum_texte' => 'Teks pesan anda:', # MODIF
'forum_titre' => 'Subyek:', # MODIF
'forum_url' => 'URL:', # MODIF
'forum_valider' => 'Validasi pilihan ini',
'forum_voir_avant' => 'Lihat pesan sebelum dikirim', # MODIF
'forum_votre_email' => 'Alamat e-mail anda:', # MODIF
'forum_votre_nom' => 'Nama anda (atau alias):', # MODIF
'forum_vous_enregistrer' => 'Sebelum berpartisipasi di
forum ini, anda harus mendaftarkan diri. Terima kasih
telah memasukkan pengidentifikasi pribadi yang
diberikan pada anda. Jika anda belum terdaftar, anda harus',
'forum_vous_inscrire' => 'mendaftarkan diri.',
// I
'icone_poster_message' => 'Kirim sebuah pesan',
'icone_suivi_forum' => 'Tindak lanjut dari forum umum: @nb_forums@ kontribusi',
'icone_suivi_forums' => 'Kelola forum',
'icone_supprimer_message' => 'Hapus pesan ini',
'icone_valider_message' => 'Validasi pesan ini',
'info_activer_forum_public' => '<i>Untuk mengaktifkan forum-forum umum, silakan pilih mode moderasi standar forum-forum tersebut:</I>', # MODIF
'info_appliquer_choix_moderation' => 'Terapkan pilihan moderasi ini:',
'info_desactiver_forum_public' => 'Non aktifkan penggunaan forum
umum. Forum umum dapat digunakan berdasarkan kasus per kasus untuk
artikel-artikel; dan penggunannya dilarang untuk bagian, berita, dll.',
'info_envoi_forum' => 'Kirim forum ke penulis artikel',
'info_fonctionnement_forum' => 'Operasi forum:',
'info_gauche_suivi_forum_2' => 'Halaman <i>tindak lanjut forum</i> adalah alat bantu pengelola situs anda (bukan area diskusi atau pengeditan). Halaman ini menampilkan semua kontribusi forum umum artikel ini dan mengizinkan anda untuk mengelola kontribusi-kontribusi ini.', # MODIF
'info_liens_syndiques_3' => 'forum',
'info_liens_syndiques_4' => 'adalah',
'info_liens_syndiques_5' => 'forum',
'info_liens_syndiques_6' => 'adalah',
'info_liens_syndiques_7' => 'validasi tertunda.',
'info_mode_fonctionnement_defaut_forum_public' => 'Mode operasi standar forum-forum umum',
'info_option_email' => 'Ketika seorang pengunjung situs mengirimkan sebuah pesan ke forum
yang terasosiasi dengan sebuah artikel, penulis artikel akan diinformasikan
melalui e-mail. Anda ingin menggunakan opsi ini?', # MODIF
'info_pas_de_forum' => 'tidak ada forum',
'item_activer_forum_administrateur' => 'Aktifkan forum administrator',
'item_desactiver_forum_administrateur' => 'Non aktifkan forum administrator',
// L
'lien_reponse_article' => 'Balasan pada artikel',
'lien_reponse_breve_2' => 'Balasan pada artikel berita',
'lien_reponse_rubrique' => 'Balasan pada bagian',
'lien_reponse_site_reference' => 'Balasan pada situs-situs referensi:', # MODIF
// O
'onglet_messages_internes' => 'Pesan internal',
'onglet_messages_publics' => 'Pesan umum',
'onglet_messages_vide' => 'Pesan tanpa teks',
// R
'repondre_message' => 'Balasan pada pesan ini',
// S
'statut_original' => 'asli',
// T
'titre_cadre_forum_administrateur' => 'Forum pribadi para administrator',
'titre_cadre_forum_interne' => 'Forum intern',
'titre_forum' => 'Forum',
'titre_forum_suivi' => 'Tindak lanjut forum',
'titre_page_forum_suivi' => 'Tindak lanjut forum'
);
?>
| gpl-3.0 |
JasonBaier/Open-Blog | application/modules/admin/controllers/dashboard.php | 952 | <?php
class Dashboard extends Controller
{
// Protected or private properties
protected $_template;
// Constructor
public function __construct()
{
parent::Controller();
// Check if the logged user is an administrator
$this->access_library->check_access();
// Load needed models, libraries, helpers and language files
$this->load->module_model('admin', 'information_model', 'information');
$this->load->module_language('admin', 'dashboard');
}
// Public methods
public function index()
{
$this->config->load('open_blog');
$data['website_url'] = $this->config->item('website_url');
$data['new_version'] = $this->information->check_for_upgrade();
$this->_template['page'] = 'dashboard';
$this->system_library->load($this->_template['page'], $data, TRUE);
}
}
/* End of file dashboard.php */
/* Location: ./application/modules/admin/controllers/dashboard.php */ | gpl-3.0 |
AppleDash/burpyhooves | modules/vore.py | 3226 | # This file is part of BuhIRC.
#
# BuhIRC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BuhIRC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the# GNU General Public License
# along with BuhIRC. If not, see <http://www.gnu.org/licenses/>.
import re
import random
from modules import Module
class VoreModule(Module):
name = "Vore"
description = "#vore-specific commands and chat responses."
# These regexes are borrowed from GyroTech's code
self_regex = "(?i)(((it|him|her|their|them)sel(f|ves))|Burpy\s?Hooves)"
all_regex = "(?i)every\s?(body|one|pony|pone|poni)"
def module_init(self, bot):
if "vore" not in bot.config:
return "Vore section in config is required."
self.config = bot.config["vore"]
self.reacts = self.config["react_messages"]
self.cmd_replies = self.config["command_replies"]
self.hook_command("eat", self.on_command_eat)
self.hook_command("cockvore", self.on_command_cockvore)
self.hook_command("inflate", self.on_command_inflate)
def do_command_reply(self, bot, target, replies):
# Replies is a 3-tuple of lists that looks like: (replies for target=me, replies for target=all, replies for target=user)
reply = None
if re.match(self.self_regex, target, re.IGNORECASE): # !eat BuhIRC
reply = random.choice(replies[0])
elif re.match(self.all_regex, target, re.IGNORECASE): # !eat everypony
reply = random.choice(replies[1])
else:
reply = random.choice(replies[2]) # !eat AppleDash (Or any other user.)
try:
bot.reply_act(reply % target)
except TypeError: # Format string wasn't filled. (No %s)
bot.reply_act(reply)
def on_command_eat(self, bot, ln, args):
eaten = ln.hostmask.nick
if len(args) > 0:
eaten = " ".join(args)
eaten = eaten.strip()
self.do_command_reply(bot, eaten, (self.cmd_replies["eat_self"], self.cmd_replies["eat_all"], self.cmd_replies["eat_user"]))
def on_command_cockvore(self, bot, ln, args):
cockvored = ln.hostmask.nick
if len(args) > 0:
cockvored = " ".join(args)
cockvored = cockvored.strip()
self.do_command_reply(bot, cockvored, (self.cmd_replies["cockvore_self"], self.cmd_replies["cockvore_all"], self.cmd_replies["cockvore_user"]))
def on_command_inflate(self, bot, ln, args):
inflated = ln.hostmask.nick
if len(args) > 0:
inflated = " ".join(args)
inflated = inflated.strip()
if re.match(self.all_regex, inflated, re.IGNORECASE): # Not implemented
return
self.do_command_reply(bot, inflated, (self.cmd_replies["inflate_self"], [], self.cmd_replies["inflate_user"]))
| gpl-3.0 |
fazlerabby7/group_warning | group_warning/wsgi.py | 404 | """
WSGI config for group_warning project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "group_warning.settings")
application = get_wsgi_application()
| gpl-3.0 |
hallowname/librebecca | doc/web/doxygen/11tp1/api+framework+samples/html/classrebecca_1_1framework_1_1impl_1_1_star.html | 16256 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>RebeccaAIML: Star Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="nav">
<a class="el" href="namespacerebecca.html">rebecca</a>::<b>framework</b>::<b>impl</b>::<a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html">Star</a></div>
<h1>Star Class Reference</h1><!-- doxytag: class="rebecca::framework::impl::Star" --><!-- doxytag: inherits="rebecca::framework::impl::InnerTemplate" --><a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> class that represents the <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> XML tag "star".
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="_star_8h-source.html">Star.h</a>></code>
<p>
<div class="dynheader">
Inheritance diagram for Star:</div>
<div class="dynsection">
<p><center><img src="classrebecca_1_1framework_1_1impl_1_1_star.png" usemap="#Star_map" border="0" alt=""></center>
<map name="Star_map">
<area href="classrebecca_1_1framework_1_1impl_1_1_inner_template.html" alt="InnerTemplate" shape="rect" coords="0,224,93,248">
<area href="classrebecca_1_1framework_1_1impl_1_1_inner_category.html" alt="InnerCategory" shape="rect" coords="0,168,93,192">
<area href="classrebecca_1_1framework_1_1impl_1_1_inner_topic.html" alt="InnerTopic" shape="rect" coords="0,112,93,136">
<area href="classrebecca_1_1framework_1_1impl_1_1_inner_a_i_m_l.html" alt="InnerAIML" shape="rect" coords="0,56,93,80">
<area href="classrebecca_1_1framework_1_1impl_1_1_tag.html" alt="Tag" shape="rect" coords="0,0,93,24">
<area href="classcustom_tag_1_1impl_1_1_custom_star.html" alt="CustomStar" shape="rect" coords="0,336,93,360">
</map>
</div>
<p>
<a href="classrebecca_1_1framework_1_1impl_1_1_star-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classrebecca_1_1impl_1_1_string_pimpl.html">StringPimpl</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#587c9d6cda3737a781f0f37216436aee">getString</a> () const throw (InternalProgrammerErrorException &)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Calls <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_graph_builder_framework.html#60864e24587bd2278cb7a5c25dd002cb" title="Returns the value "captured" by a particular wildcard from the pattern-specified...">GraphBuilderFramework::getStar()</a> with the index set from <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#0b668332b49d3a8f785197df856a4e4f" title="Sets its attribute of "index".">Star::setAttribute()</a> and returns the result. <a href="#587c9d6cda3737a781f0f37216436aee"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#0b668332b49d3a8f785197df856a4e4f">setAttribute</a> (const <a class="el" href="classrebecca_1_1impl_1_1_string_pimpl.html">StringPimpl</a> &name, const <a class="el" href="classrebecca_1_1impl_1_1_string_pimpl.html">StringPimpl</a> &value) throw (InternalProgrammerErrorException &)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets its attribute of "index". <a href="#0b668332b49d3a8f785197df856a4e4f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#cfa77e7048f2023fff8e7699584bafa0">Star</a> () throw (InternalProgrammerErrorException &)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initalizes the private implementation (m_pimpl) data and sets the private implementation with a reference to the <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_graph_builder_framework.html" title="Adds more operations to the already existing set of rebecca::impl::GraphBuilder in...">GraphBuilderFramework</a>. <a href="#cfa77e7048f2023fff8e7699584bafa0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#e89029c43eb559bd8e7c6709128fef00">~Star</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default virtual destructor. <a href="#e89029c43eb559bd8e7c6709128fef00"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">StarImpl * </td><td class="memItemRight" valign="bottom"><a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#621cdaf3b1812c8055cfc3a1558a89a4">m_pimpl</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The private implementation in which you cannot get access to. <a href="#621cdaf3b1812c8055cfc3a1558a89a4"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> class that represents the <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> XML tag "star".
<p>
Every time a XML <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_tag.html" title="The abstract AIML XML Tag class that all other AIML XML tags should inherit from...">Tag</a> of <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> is encountered, an instance of this class will be created. All text inbetween the begin and end tag, all attributes, and all inner Tags will go through methods of this class. <hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="cfa77e7048f2023fff8e7699584bafa0"></a><!-- doxytag: member="rebecca::framework::impl::Star::Star" ref="cfa77e7048f2023fff8e7699584bafa0" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html">Star</a> </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> throw (<a class="el" href="classrebecca_1_1impl_1_1_internal_programmer_error_exception.html">InternalProgrammerErrorException</a> &)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Initalizes the private implementation (m_pimpl) data and sets the private implementation with a reference to the <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_graph_builder_framework.html" title="Adds more operations to the already existing set of rebecca::impl::GraphBuilder in...">GraphBuilderFramework</a>.
<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InternalProgrammerErrorException</em> </td><td>is thrown only if the error is so grave that the entire <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> engine has to be shut down. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="e89029c43eb559bd8e7c6709128fef00"></a><!-- doxytag: member="rebecca::framework::impl::Star::~Star" ref="e89029c43eb559bd8e7c6709128fef00" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual ~<a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html">Star</a> </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Default virtual destructor.
<p>
Destroys the private implementation (m_pimpl) data.
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="587c9d6cda3737a781f0f37216436aee"></a><!-- doxytag: member="rebecca::framework::impl::Star::getString" ref="587c9d6cda3737a781f0f37216436aee" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classrebecca_1_1impl_1_1_string_pimpl.html">StringPimpl</a> getString </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const throw (<a class="el" href="classrebecca_1_1impl_1_1_internal_programmer_error_exception.html">InternalProgrammerErrorException</a> &)<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Calls <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_graph_builder_framework.html#60864e24587bd2278cb7a5c25dd002cb" title="Returns the value "captured" by a particular wildcard from the pattern-specified...">GraphBuilderFramework::getStar()</a> with the index set from <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#0b668332b49d3a8f785197df856a4e4f" title="Sets its attribute of "index".">Star::setAttribute()</a> and returns the result.
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The result from calling <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_graph_builder_framework.html#60864e24587bd2278cb7a5c25dd002cb" title="Returns the value "captured" by a particular wildcard from the pattern-specified...">GraphBuilderFramework::getStar()</a> with the index set from <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#0b668332b49d3a8f785197df856a4e4f" title="Sets its attribute of "index".">Star::setAttribute()</a></dd></dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InternalProgrammerErrorException</em> </td><td>is thrown only if the error is so grave that the entire <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> engine has to be shut down. </td></tr>
</table>
</dl>
<p>Reimplemented from <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_inner_template.html#587c9d6cda3737a781f0f37216436aee">InnerTemplate</a>.</p>
<p>Reimplemented in <a class="el" href="classcustom_tag_1_1impl_1_1_custom_star.html#587c9d6cda3737a781f0f37216436aee">CustomStar</a>.</p>
</div>
</div><p>
<a class="anchor" name="0b668332b49d3a8f785197df856a4e4f"></a><!-- doxytag: member="rebecca::framework::impl::Star::setAttribute" ref="0b668332b49d3a8f785197df856a4e4f" args="(const StringPimpl &name, const StringPimpl &value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void setAttribute </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classrebecca_1_1impl_1_1_string_pimpl.html">StringPimpl</a> & </td>
<td class="paramname"> <em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classrebecca_1_1impl_1_1_string_pimpl.html">StringPimpl</a> & </td>
<td class="paramname"> <em>value</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"> throw (<a class="el" href="classrebecca_1_1impl_1_1_internal_programmer_error_exception.html">InternalProgrammerErrorException</a> &)<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets its attribute of "index".
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> XML attribute</td></tr>
<tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>The value of the <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> XML attribute</td></tr>
</table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InternalProgrammerErrorException</em> </td><td>is thrown only if the error is so grave that the entire <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_a_i_m_l.html" title="AIML class that represents the AIML XML tag "aiml".">AIML</a> engine has to be shut down. </td></tr>
</table>
</dl>
<p>Reimplemented from <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_tag.html#0b668332b49d3a8f785197df856a4e4f">Tag</a>.</p>
</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="621cdaf3b1812c8055cfc3a1558a89a4"></a><!-- doxytag: member="rebecca::framework::impl::Star::m_pimpl" ref="621cdaf3b1812c8055cfc3a1558a89a4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StarImpl* <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_star.html#621cdaf3b1812c8055cfc3a1558a89a4">m_pimpl</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The private implementation in which you cannot get access to.
<p>
This pointer holds the private methods and private member variables of this class. This makes ABI (Application Binary Interface) more resilient to change. See the private implementation idiom on the internet for more information about this.
<p>Reimplemented from <a class="el" href="classrebecca_1_1framework_1_1impl_1_1_inner_template.html#53f57b35a7c542ef3e96d4a9ac3d90b7">InnerTemplate</a>.</p>
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>C:/rebecca/include/rebecca/framework/<a class="el" href="_star_8h-source.html">Star.h</a></ul>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 27 12:26:55 2007 for RebeccaAIML by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>
| gpl-3.0 |
create3000/titania | libtitania-x3d/Titania/X3D/Components/Layout/Layout.h | 6026 | /* -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
*******************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
*
* All rights reserved. Holger Seelig <[email protected]>.
*
* THIS IS UNPUBLISHED SOURCE CODE OF create3000.
*
* The copyright notice above does not evidence any actual of intended
* publication of such source code, and is an unpublished work by create3000.
* This material contains CONFIDENTIAL INFORMATION that is the property of
* create3000.
*
* No permission is granted to copy, distribute, or create derivative works from
* the contents of this software, in whole or in part, without the prior written
* permission of create3000.
*
* NON-MILITARY USE ONLY
*
* All create3000 software are effectively free software with a non-military use
* restriction. It is free. Well commented source is provided. You may reuse the
* source in any way you please with the exception anything that uses it must be
* marked to indicate is contains 'non-military use only' components.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 1999, 2016 Holger Seelig <[email protected]>.
*
* This file is part of the Titania Project.
*
* Titania is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License version 3 only, as published by the
* Free Software Foundation.
*
* Titania is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
* details (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License version 3
* along with Titania. If not, see <http://www.gnu.org/licenses/gpl.html> for a
* copy of the GPLv3 License.
*
* For Silvio, Joy and Adi.
*
******************************************************************************/
#ifndef __TITANIA_X3D_COMPONENTS_LAYOUT_LAYOUT_H__
#define __TITANIA_X3D_COMPONENTS_LAYOUT_LAYOUT_H__
#include "../Layout/X3DLayoutNode.h"
namespace titania {
namespace X3D {
class Layout :
public X3DLayoutNode
{
public:
/// @name Construction
Layout (X3DExecutionContext* const executionContext);
virtual
X3DBaseNode*
create (X3DExecutionContext* const executionContext) const final override;
/// @name Common members
virtual
const Component &
getComponent () const final override
{ return component; }
virtual
const std::string &
getTypeName () const final override
{ return typeName; }
virtual
const std::string &
getContainerField () const final override
{ return containerField; }
/// @name Fields
MFString &
align ()
{ return *fields .align; }
const MFString &
align () const
{ return *fields .align; }
MFString &
offsetUnits ()
{ return *fields .offsetUnits; }
const MFString &
offsetUnits () const
{ return *fields .offsetUnits; }
MFFloat &
offset ()
{ return *fields .offset; }
const MFFloat &
offset () const
{ return *fields .offset; }
MFString &
sizeUnits ()
{ return *fields .sizeUnits; }
const MFString &
sizeUnits () const
{ return *fields .sizeUnits; }
MFFloat &
size ()
{ return *fields .size; }
const MFFloat &
size () const
{ return *fields .size; }
MFString &
scaleMode ()
{ return *fields .scaleMode; }
const MFString &
scaleMode () const
{ return *fields .scaleMode; }
/// @name Member access
virtual
HorizontalAlignType
getAlignX () const final override
{ return alignX; }
virtual
VerticalAlignType
getAlignY () const final override
{ return alignY; }
virtual
SizeUnitType
getOffsetUnitX () const final override;
virtual
SizeUnitType
getOffsetUnitY () const final override;
double
getOffsetX () const
{ return offsetX; }
double
getOffsetY () const
{ return offsetY; }
virtual
SizeUnitType
getSizeUnitX () const final override;
virtual
SizeUnitType
getSizeUnitY () const final override;
double
getSizeX () const
{ return sizeX; }
double
getSizeY () const
{ return sizeY; }
ScaleModeType
getScaleModeX () const;
ScaleModeType
getScaleModeY () const;
virtual
const Vector2d &
getRectangleCenter () const final override
{ return rectangleCenter; }
virtual
const Vector2d &
getRectangleSize () const final override
{ return rectangleSize; }
virtual
const Matrix4d &
getMatrix () const final override
{ return matrix; }
/// @name Operations
virtual
const Matrix4d &
transform (const TraverseType type, X3DRenderObject* const renderObject) final override;
private:
/// @name Construction
virtual
void
initialize () final override;
/// @name Event handler
void
set_align ();
void
set_offsetUnits ();
void
set_offset ();
void
set_scaleMode ();
void
set_sizeUnits ();
void
set_size ();
/// @name Static members
static const Component component;
static const std::string typeName;
static const std::string containerField;
/// @name Members
struct Fields
{
Fields ();
MFString* const align;
MFString* const offsetUnits;
MFFloat* const offset;
MFString* const sizeUnits;
MFFloat* const size;
MFString* const scaleMode;
};
Fields fields;
HorizontalAlignType alignX;
VerticalAlignType alignY;
SizeUnitType offsetUnitX;
SizeUnitType offsetUnitY;
double offsetX;
double offsetY;
SizeUnitType sizeUnitX;
SizeUnitType sizeUnitY;
double sizeX;
double sizeY;
ScaleModeType scaleModeX;
ScaleModeType scaleModeY;
X3DLayoutNode* parent;
Vector2d rectangleCenter; // In m
Vector2d rectangleSize; // In m
Matrix4d matrix;
};
} // X3D
} // titania
#endif
| gpl-3.0 |
AllaMaevskaya/AliceO2 | Detectors/MUON/MID/Simulation/src/MIDSimulationLinkDef.h | 1245 | // Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ namespace o2;
#pragma link C++ namespace o2::mid;
#pragma link C++ class o2::mid::Detector + ;
#pragma link C++ class o2::base::DetImpl < o2::mid::Detector> + ;
#pragma link C++ class o2::mid::Hit + ;
#pragma link C++ class std::vector < o2::mid::Hit> + ;
#pragma link C++ class o2::mid::ColumnDataMC + ;
#pragma link C++ class std::vector < o2::mid::ColumnDataMC> + ;
#pragma link C++ class o2::mid::MCClusterLabel + ;
#pragma link C++ class o2::dataformats::MCTruthContainer < o2::mid::MCClusterLabel> + ;
#pragma link C++ class o2::mid::MCLabel + ;
#pragma link C++ class o2::dataformats::MCTruthContainer < o2::mid::MCLabel> + ;
#endif
| gpl-3.0 |
smeighan/xLights | xSchedule/PlayList/PlayListItemSerialSend.h | 2115 | #ifndef PLAYLISTITEMSERIALSEND_H
#define PLAYLISTITEMSERIALSEND_H
#include "PlayListItem.h"
#include <string>
class wxXmlNode;
class wxWindow;
class PlayListItemSerialSend : public PlayListItem
{
protected:
#pragma region Member Variables
std::string _commport;
std::string _data;
bool _started;
int _stopBits;
int _speed;
int _bits;
char _parity;
#pragma endregion Member Variables
public:
#pragma region Constructors and Destructors
PlayListItemSerialSend(wxXmlNode* node);
PlayListItemSerialSend();
virtual ~PlayListItemSerialSend() {};
virtual PlayListItem* Copy() const override;
#pragma endregion Constructors and Destructors
#pragma region Getters and Setters
static std::string GetTooltip();
std::string GetNameNoTime() const override;
std::string GetRawName() const { return _name; }
void SetData(const std::string& data) { if (_data != data) { _data = data; _changeCount++; } }
std::string GetData() const { return _data; }
int GetConfig(int& bits, int &stopBits, char& parity) const { bits = _bits; stopBits = _stopBits; parity = _parity; return _speed; }
void SetConfig(int speed, int bits, int stopBits, char parity) {
if (_speed != speed) { _speed = speed; _changeCount++; }
if (_bits != bits) { _bits = bits; _changeCount++; }
if (_stopBits != stopBits) { _stopBits = stopBits; _changeCount++; }
if (_parity != parity) { _parity = parity; _changeCount++; }
}
virtual std::string GetTitle() const override;
#pragma endregion Getters and Setters
virtual wxXmlNode* Save() override;
void Load(wxXmlNode* node) override;
#pragma region Playing
virtual void Frame(wxByte* buffer, size_t size, size_t ms, size_t framems, bool outputframe) override;
virtual void Start() override;
#pragma endregion Playing
#pragma region UI
virtual void Configure(wxNotebook* notebook) override;
#pragma endregion UI
static std::string Encode(const std::string data);
static std::string Decode(const std::string data);
};
#endif | gpl-3.0 |
AmesianX/OpenBLT | Target/Source/ARMCM3_STM32/types.h | 2001 | #ifndef TYPES_H
#define TYPES_H
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#endif /* TYPES_H */
/*********************************** end of types.h ************************************/
/************************************************************************************//**
* \file Source\ARMCM3_STM32\types.h
* \brief Bootloader types header file.
* \ingroup Target_ARMCM3_STM32
* \internal
*----------------------------------------------------------------------------------------
* C O P Y R I G H T
*----------------------------------------------------------------------------------------
* Copyright (c) 2011 by Feaser http://www.feaser.com All rights reserved
*
*----------------------------------------------------------------------------------------
* L I C E N S E
*----------------------------------------------------------------------------------------
* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenBLT.
* If not, see <http://www.gnu.org/licenses/>.
*
* A special exception to the GPL is included to allow you to distribute a combined work
* that includes OpenBLT without being obliged to provide the source code for any
* proprietary components. The exception text is included at the bottom of the license
* file <license.html>.
*
* \endinternal
****************************************************************************************/
| gpl-3.0 |
agordon/agnostic | src/tests/shell_syntax_tests.js | 27765 | /****************************************
* This file is part of UNIX Guide for the Perplexed project.
* Copyright (C) 2014 by Assaf Gordon <[email protected]>
* Released under GPLv3 or later.
****************************************/
/* Each test in 'tests' array has the following elements:
* 1. short name for the test (must be unique).
* 2. input string for the parser
* 3. should-be-accepted: true/false.
* if TRUE, the syntax is expected to be
* accepted by the parser, using the specific rule in item 4,
* *AND ALL SUBSEQUENT* rules. See "rules" variable for the list and order
* of rules.
* if FALSE, the syntax must not be accepted by the parser, using the
* specific rule in item 4.
* 4. parser rule to check.
* The rule name must match the names in 'posix_shell.pegjs' .
* See 'rules' variable for list of valid starting rules.
*/
"use strict";
/* List of rules, must be the same as the rules
* listed in "posix_shell.pegjs".
* For each rule (the key), the subsequent rules to be also tested are listed.
* The hierarchial order must match 'posix_shell.pegjs'.
*/
var rules = {
'Non_Operator_UnquotedCharacters' : 'Tokens_Command',
'SingleQuotedString' : 'Tokens_Command',
'DoubleQuotedString' : 'Tokens_Command',
'SubshellExpandable' : 'Tokens_Command',
'BacktickExpandable' : 'Tokens_Command',
'ParameterExpandable' : 'Tokens_Command',
'ParameterOperationExpandable' : 'Tokens_Command',
'ArithmeticExpandable' : 'Tokens_Command',
'Expandable' : '',
'Tokens_Command' : 'SimpleCommand',
'Redirection' : 'Redirections',
'Assignment' : 'Assignments_Or_Redirections',
'Assignments_Or_Redirections' : 'SimpleCommand',
'Redirections' : 'SimpleCommand',
'SimpleCommand' : 'Command',
'Command' : 'Pipeline',
'Pipeline' : 'AndOrList',
'AndOrList' : 'List',
'List' : undefined, /* last rule in hierarchy */
/* Special rules, which should not automatically lead to subsequent rules */
'Token_NoDelimiter' : undefined,
'TerminatedList' : undefined,
/* NOTE: these rules must be used directly, no other rule points to them */
'Compound_Command_Subshell' : 'Command',
'Compound_Command_Currentshell' : 'Command',
'For_clause' : 'Command'
};
var tests = [
/* test-name, test-input, should-be-accepted, start-rule */
/* Single words, without any quoted characters, accpted in the context of a command. */
["nqc1", "hello", true, "Non_Operator_UnquotedCharacters"],
["nqc2", "he%llo", true, "Non_Operator_UnquotedCharacters"],
["nqc3", "9hello", true, "Non_Operator_UnquotedCharacters"],
["nqc4", "h_", true, "Non_Operator_UnquotedCharacters"],
["nqc5", "==ds@_", true, "Non_Operator_UnquotedCharacters"],
["nqc6", "foo bar", true, "Non_Operator_UnquotedCharacters"],
["nqc7", "foo\"bar", false, "Non_Operator_UnquotedCharacters"],
["nqc8", "foo\$bar", false, "Non_Operator_UnquotedCharacters"],
["nqc9", "|foobar", false, "Non_Operator_UnquotedCharacters"],
["nqc10", "foobar>", false, "Non_Operator_UnquotedCharacters"],
["nqc11", "foobar&", false, "Non_Operator_UnquotedCharacters"],
["nqc12", "foobar;", false, "Non_Operator_UnquotedCharacters"],
["nqc13", ";foobar", false, "Non_Operator_UnquotedCharacters"],
/* Single and Double Quoted strings (must be properly quoted) */
["dquote1", '"hello"', true, "DoubleQuotedString"],
["dquote2", 'hello', false, "DoubleQuotedString"],
["dquote3", 'h"ello', false, "DoubleQuotedString"],
["dquote4", '"hello', false, "DoubleQuotedString"],
["dquote5", 'hello"', false, "DoubleQuotedString"],
["dquote6", '"he$llo"', true, "DoubleQuotedString"],
["dquote7", '"he>llo"', true, "DoubleQuotedString"],
["dquote8", '"he llo"', true, "DoubleQuotedString"],
["dquote9", '"he\\llo"', true, "DoubleQuotedString"],
["dquote10", '"he|llo"', true, "DoubleQuotedString"],
["dquote11", '""', true, "DoubleQuotedString"],
["dquote12", '"hell\'lo"', true, "DoubleQuotedString"],
["dquote13", '"hello world"',true, "DoubleQuotedString"],
["dquote14", '"foo\tbar"', true, "DoubleQuotedString"],
["dquote15", '"hello("', true, "DoubleQuotedString"],
["dquote16", '"he)llo"', true, "DoubleQuotedString"],
["dquote17", '"he{llo"', true, "DoubleQuotedString"],
["dquote18", '"he}llo"', true, "DoubleQuotedString"],
["dquote19", '"${FOO}world"',true, "DoubleQuotedString"],
/* Double-Quotes with parameter expansion */
["dquote30", '"hello$(uname)world"', true, "DoubleQuotedString"],
["dquote31", '"hello$(uname -s)world"',true, "DoubleQuotedString"],
["dquote32", '"hello${uname}world"', true, "DoubleQuotedString"],
["dquote33", '"hello$(echo "world")"',true, "DoubleQuotedString"],
["dquote34", '"hello$(echo \'world\')"',true, "DoubleQuotedString"],
["dquote37", '"hello$FOO"', true, "DoubleQuotedString"],
["dquote38", '"hello$((1+4))"',true, "DoubleQuotedString"],
["dquote39", '"hello$(echo"',false, "DoubleQuotedString"],
["dquote40", '"hello${echo"',false, "DoubleQuotedString"],
["dquote41", '"hello$((1+4)"',false, "DoubleQuotedString"],
["squote1", "'hello'", true, "SingleQuotedString"],
["squote2", "he'llo", false, "SingleQuotedString"],
["squote3", "'hello", false, "SingleQuotedString"],
["squote4", "hello'", false, "SingleQuotedString"],
["squote5", "'he$llo'", true, "SingleQuotedString"],
["squote6", "'he\"llo'", true, "SingleQuotedString"],
["squote7", "'he llo'", true, "SingleQuotedString"],
["squote8", "''", true, "SingleQuotedString"],
["squote9", "'\"'", true, "SingleQuotedString"],
/* Test single tokens - any combination fo quoted and unquoted strings,
that logically become one token/word.
Special characters must be properly quoted. */
["word1", 'he"llo"', true, "Token_NoDelimiter"],
["word2", 'he"ll\'o"', true, "Token_NoDelimiter"],
["word3", 'he"ll""o"', true, "Token_NoDelimiter"],
["word4", 'hell\\"o', true, "Token_NoDelimiter"],
["word5", 'he"\'ll"o', true, "Token_NoDelimiter"],
["word6", 'he\\|llo', true, "Token_NoDelimiter"],
["word7", 'he"\\|"llo', true, "Token_NoDelimiter"],
["word8", 'he"\\\\"llo', true, "Token_NoDelimiter"],
["word9", 'he\\\\llo', true, "Token_NoDelimiter"],
["word10", '"he|llo"', true, "Token_NoDelimiter"],
["word11", '"he l lo"', true, "Token_NoDelimiter"],
["word12", '"he&llo"', true, "Token_NoDelimiter"],
["word13", '"he;llo"', true, "Token_NoDelimiter"],
["word14", '"he>llo"', true, "Token_NoDelimiter"],
["word15", '"he>llo"world',true, "Token_NoDelimiter"],
["word16", 'foo>bar', false, "Token_NoDelimiter"],
["word17", 'foo|bar', false, "Token_NoDelimiter"],
["word18", 'foo bar', false, "Token_NoDelimiter"],
["word19", 'foo\\|bar', true, "Token_NoDelimiter"],
["word20", 'foo\\>bar', true, "Token_NoDelimiter"],
["word21", 'foo\\ bar', true, "Token_NoDelimiter"],
["word22", '"foo|bar"', true, "Token_NoDelimiter"],
["word23", '"foo>bar"', true, "Token_NoDelimiter"],
["word24", '"foo bar"', true, "Token_NoDelimiter"],
["word25", '"foo "bar', true, "Token_NoDelimiter"],
["word26", "'foo 'bar", true, "Token_NoDelimiter"],
["word27", "'foo '\"bar\"",true, "Token_NoDelimiter"],
/* TODO: these are accepted, but at the moment - do not actually
perform sub-shell and parameter expansion */
/* Test 'tokens' rule - whitespace separates tokens,
only non-operator tokens should be accepted
(operator characters can be accepted if they're quoted - thus
losing their special meaning) */
["token1", "hello world", true, "Tokens_Command"],
["token2", "hello world", true, "Tokens_Command"],
["token4", "'hello world' foo bar", true, "Tokens_Command"],
["token5", "'hello world' \"foo bar\"", true, "Tokens_Command"],
/* single-quote not terminated */
["token6", "hello world' \"foo bar\"", false, "Tokens_Command"],
["token7", "hello \t \t world", true, "Tokens_Command"],
["token8", "hello '' world", true, "Tokens_Command"],
["token9", 'cut -f1 -d""', true, "Tokens_Command"],
["token10", 'foo bar|', false, "Tokens_Command"],
["token11", 'foo|bar', false, "Tokens_Command"],
["token12", 'foo>bar', false, "Tokens_Command"],
["token13", 'foo ">bar"', true, "Tokens_Command"],
["token14", 'foo && bar', false, "Tokens_Command"],
["token15", 'foo ; bar', false, "Tokens_Command"],
["token16", 'foo > bar', false, "Tokens_Command"],
["token17", 'foo ">" bar', true, "Tokens_Command"],
/* Token commands must not accept reserved words as first words
of the command, but accept if non-first */
["token18", 'echo if', true, "Tokens_Command"],
["token19", 'if echo', false, "Tokens_Command"],
["token20", 'echo {', true, "Tokens_Command"],
["token21", '{ echo', false, "Tokens_Command"],
["token22", 'echo }', true, "Tokens_Command"],
["token23", '} echo', false, "Tokens_Command"],
["token24", 'echo else', true, "Tokens_Command"],
["token25", 'else echo', false, "Tokens_Command"],
["token26", 'echo elif', true, "Tokens_Command"],
["token27", 'elif echo', false, "Tokens_Command"],
["token28", 'echo then', true, "Tokens_Command"],
["token29", 'then echo', false, "Tokens_Command"],
["token30", 'echo fi', true, "Tokens_Command"],
["token31", 'fi echo', false, "Tokens_Command"],
["token32", 'echo while', true, "Tokens_Command"],
["token33", 'while echo', false, "Tokens_Command"],
["token34", 'echo until', true, "Tokens_Command"],
["token35", 'until echo', false, "Tokens_Command"],
["token36", 'echo do', true, "Tokens_Command"],
["token37", 'do echo', false, "Tokens_Command"],
["token38", 'echo done', true, "Tokens_Command"],
["token39", 'done echo', false, "Tokens_Command"],
["token40", 'echo case', true, "Tokens_Command"],
["token41", 'case echo', false, "Tokens_Command"],
["token42", 'echo esac', true, "Tokens_Command"],
["token43", 'esac echo', false, "Tokens_Command"],
["token44", 'echo in', true, "Tokens_Command"],
["token45", 'in echo', false, "Tokens_Command"],
["token46", 'echo !', true, "Tokens_Command"],
["token47", '! echo', false, "Tokens_Command"],
/* Test single redirection */
["redir1", ">foo.txt", true, "Redirection"],
["redir2", "2>foo.txt", true, "Redirection"],
["redir3", "<foo.txt", true, "Redirection"],
["redir4", "2>&1", true, "Redirection"],
["redir5", ">&1", true, "Redirection"],
["redir6", "<>foo.txt", true, "Redirection"],
["redir7", ">>foo.txt", true, "Redirection"],
["redir8", ">'f o o.txt'", true, "Redirection"],
["redir9", ">f o o.txt", false, "Redirection"],
["redir10", ">", false, "Redirection"],
["redir11", "<", false, "Redirection"],
/* The redirection rule accepts just one redirection.
multiple redirections are tested below. */
["redir12", ">foo.txt 2>&1", false, "Redirection"],
["redir13", "<bar.txt >foo.txt", false, "Redirection"],
//allow whitespace before the filename
["redir14", "> foo.txt", true, "Redirection"],
["redir15", "< foo.txt", true, "Redirection"],
["redir16", ">> foo.txt", true, "Redirection"],
["redir17", "<> foo.txt", true, "Redirection"],
/* Test Multiple Redirections */
["mredir1", ">foo.txt 2>&1", true, "Redirections"],
["mredir2", "<bar.txt >foo.txt", true, "Redirections"],
["mredir3", "<bar.txt>foo.txt", true, "Redirections"],
["mredir4", "2>&1<foo.txt", true, "Redirections"],
/* Test Single Assignment */
["asgn1", "FOO=BAR", true, "Assignment"],
["asgn2", "FOO='fo fo > BAR'", true, "Assignment"],
["asgn3", "FOO=HELLO\"WOR LD\"", true, "Assignment"],
["asgn4", "FOO=", true, "Assignment"],
["asgn5", "F\"OO\"=BAR", false, "Assignment"],
["asgn6", "=BAR", false, "Assignment"],
/* Test multiple assignments and redirections.
though not very common, both assignments AND redirections can appear
before the actual command to execute, eg.:
FOO=BAR <input.txt >counts.txt wc -l
Additionally, shell commands with only assignments and redirections
(and no command to execute) are perfectly valid.
*/
["asgnrdr1", "FOO=BAR >hello.txt", true, "Assignments_Or_Redirections"],
["asgnrdr2", "FOO=BAR HELLO=WORLD", true, "Assignments_Or_Redirections"],
["asgnrdr3", "2>&1 FOO=BAR BAZ=BOM", true, "Assignments_Or_Redirections"],
["asgnrdr4", "FOO=BAR>out.txt", true, "Assignments_Or_Redirections"],
["asgnrdr5", "FOO=\">foo.txt\">out.txt", true, "Assignments_Or_Redirections"],
/* this test includes a command 'seq', and should not be accepted by this rule.
it should be accepted by later rules. */
["asgnrdr6", "FOO=BAR seq 10", false, "Assignments_Or_Redirections"],
["asgnrdr7", "FOO=BAR >out.txt seq 10", false, "Assignments_Or_Redirections"],
/* Test Simple Commands, with assignment and redirections */
["smpl1", "FOO=BAR cut -f1", true, "SimpleCommand" ],
["smpl2", "FOO=BAR HELLO=WORLD cut -f1", true, "SimpleCommand" ],
/* NOTE: the last BAZ=BOO is NOT a variable assignment. it should be parsed
* as a normal parameter to 'cut' - but it is still a valid command syntax. */
["smpl3", "FOO=BAR HELLO=WORLD cut -f1 BAZ=BOO", true, "SimpleCommand" ],
["smpl4", "FOO=BAR <foo.txt cut -f1", true, "SimpleCommand" ],
["smpl5", "<foo.txt cut -f1", true, "SimpleCommand" ],
["smpl6", "7<foo.txt cut -f1", true, "SimpleCommand" ],
["smpl7", "7<foo.txt FOO=BAR ZOOM=ZOOM >text.txt cut -f1", true, "SimpleCommand" ],
["smpl8", "2>&1 FOO=BAR ZOOM=ZOOM cut -f1", true, "SimpleCommand" ],
["smpl9", "7<&1 FOO=BAR ZOOM=ZOOM cut -f1", true, "SimpleCommand" ],
["smpl10", "<>yes.txt FOO=BAR ZOOM=ZOOM cut -f1", true, "SimpleCommand" ],
["smpl11", "FFO=BAR>yes.txt cut -f1", true, "SimpleCommand" ],
["smpl12", ">yes.txt cut -f1 <foo.txt", true, "SimpleCommand" ],
/* test 'redirection_word_hack' rule */
["smpl13", "cut -f1 >foo.txt 2>&1", true, "SimpleCommand" ],
["smpl14", "cut -f1 2>&1", true, "SimpleCommand" ],
["smpl15", "cut -f1 1>foo.txt 2>&1", true, "SimpleCommand" ],
["smpl16", "HELLO=FOO 1>foo.txt 2>&1" , true, "SimpleCommand" ],
/* Simple commands must not accept pipes, ands, ors and
other special operators, unless quoted. */
["smpl17", "seq 10 | wc -l", false, "SimpleCommand" ],
["smpl18", "seq 10 '|' wc -l", true, "SimpleCommand" ],
["smpl19", "seq 10 && echo ok", false, "SimpleCommand" ],
["smpl20", "seq 10 \"&&\" echo ok", true, "SimpleCommand" ],
["smpl21", "seq 10 || echo ok", false, "SimpleCommand" ],
["smpl22", "seq 10 \"||\" echo ok", true, "SimpleCommand" ],
["smpl23", "seq 10 \\|\\| echo ok" , true, "SimpleCommand" ],
["smpl25", "seq 10 ; echo ok", false, "SimpleCommand" ],
["smpl26", "seq 10 & echo ok", false, "SimpleCommand" ],
/* Few more cases */
["smpl27", "true>foo.txt", true, "SimpleCommand" ],
["smpl28", "true>foo.txt<foo.txt", true, "SimpleCommand" ],
/* Simple Command rule must not accept compound commands */
["smpl40", "( true | false )", false, "SimpleCommand" ],
["smpl41", "{ true ; false ; }", false, "SimpleCommand" ],
/* Test Compound-Command-SubShell rule */
["cmpss1", "( uname )", true, "Compound_Command_Subshell"],
["cmpss2", "(uname)", true, "Compound_Command_Subshell"],
["cmpss3", "( uname | true | false)", true, "Compound_Command_Subshell"],
["cmpss4", "( uname | true & false)", true, "Compound_Command_Subshell"],
["cmpss5", "( uname ; true ; false)", true, "Compound_Command_Subshell"],
["cmpss6", "( uname && true || false)", true, "Compound_Command_Subshell"],
["cmpss7", "()", false, "Compound_Command_Subshell"],
/* Test Compound-Command-CurrentShell rule */
["cmpcs1", "{ uname ; }", true, "Compound_Command_Currentshell"],
["cmpcs2", "{ uname & }", true, "Compound_Command_Currentshell"],
["cmpcs3", "{ uname }", false, "Compound_Command_Currentshell"],
["cmpcs4", "{ uname;}", true, "Compound_Command_Currentshell"],
["cmpcs5", "{ uname&}", true, "Compound_Command_Currentshell"],
["cmpcs6", "{ uname; }", true, "Compound_Command_Currentshell"],
["cmpcs7", "{ uname& }", true, "Compound_Command_Currentshell"],
["cmpcs9", "{ uname | true | false ; }", true, "Compound_Command_Currentshell"],
["cmpcs10", "{ uname | true & false ; }", true, "Compound_Command_Currentshell"],
["cmpcs11", "{ uname ; true ; false ; }", true, "Compound_Command_Currentshell"],
["cmpcs12", "{ uname && true || false & }", true, "Compound_Command_Currentshell"],
["cmpcs13", "{}", false, "Compound_Command_Currentshell"],
/* Test For clause */
["for1", "for a in a b c d ; do true ; done", true, "For_clause"],
/* missing 'in' */
["for2", "for a a b c d ; do true ; done", false, "For_clause"],
/* missing semi-colon before do */
["for3", "for a in a b c d do true ; done", false, "For_clause"],
/* missing 'do' */
["for4", "for a in a b c d ; true ; done", false, "For_clause"],
/* missing semi-colon before done */
["for5", "for a in a b c d ; do true done", false, "For_clause"],
/* missing command between do and done */
["for6", "for a in a b c d ; do ; done", false, "For_clause"],
/* non-simple values in word-list */
["for7", "for a in $(ls); do echo a=$a ; done", true, "For_clause"],
/* Test Pipeline rule */
["pipe1", "seq 1 2 10 | wc -l", true, "Pipeline"],
["pipe2", "seq 1 2 10 2>foo.txt | wc -l 2>>foo2.txt ", true, "Pipeline"],
["pipe3", "FOO=BAR seq 1 2 10 2>foo.txt | wc -l 2>>foo2.txt ", true, "Pipeline"],
["pipe4", "FOO=BAR seq 1 2 10 2>foo.txt | FOO=BAR Pc -l 2>>foo2.txt ", true, "Pipeline"],
["pipe5", "FOO=BAR seq 1 2 10 2>foo.txt | <input.txt wc -l 2>>foo2.txt ", true, "Pipeline"],
["pipe6", "FOO=BAR seq 1 2 10 2>foo.txt | FOO=BAR <input.txt wc -l 2>>foo2.txt ", true, "Pipeline"],
["pipe7", "cut -f1 <genes.txt|sort -k1V,1 -k2nr,2 ", true, "Pipeline"],
["pipe8", "cut -f1 <genes.txt | sort -k1V,1 -k2nr,2 | uniq -c >text.txt", true, "Pipeline"],
/* Pipeline'd commands must not accept ands, ors and
other special operators, unless quoted. */
["pipe9", "cut -f1 | seq 10 && echo ok ", false, "Pipeline"],
["pipe10", "cut -f1 | seq 10 & echo ok ", false, "Pipeline"],
["pipe11", "cut -f1 | seq 10 ; echo ok ", false, "Pipeline"],
["pipe12", "true && cut -f1 | seq 10", false, "Pipeline"],
["pipe13", "cut -f1 |", false, "Pipeline"],
["pipe14", "|cut -f1 |", false, "Pipeline"],
["pipe15", "|cut -f1", false, "Pipeline"],
/* Pipelines with compound commands */
["pipe30", "seq 10 | ( sed -u 1q ; sort -nr)", true, "Pipeline"],
["pipe31", "( cat hello ; tac world ) | wc -l", true, "Pipeline"],
["pipe32", "seq 10 | { sed -u 1q ; sort -nr ; }", true, "Pipeline"],
["pipe33", "{ cat hello ; tac world ; } | wc -l", true, "Pipeline"],
/* Test AndOrList rule */
["andor1", "true && false || seq 1", true, "AndOrList" ],
["andor2", "true && false | wc", true, "AndOrList" ],
["andor3", "true && false | wc || seq 1", true, "AndOrList" ],
["andor4", "true && false && false && echo ok || echo fail",true, "AndOrList" ],
["andor5", "true && false ; wc", false, "AndOrList" ],
["andor6", "true && false & wc", false, "AndOrList" ],
["andor7", "true &&", false, "AndOrList" ],
["andor8", "true ||", false, "AndOrList" ],
["andor9", " && true", false, "AndOrList" ],
["andor10", " || true", false, "AndOrList" ],
["andor11", "&& true", false, "AndOrList" ],
["andor12", "|| true", false, "AndOrList" ],
["andor13", "true && && true", false, "AndOrList" ],
["andor14", "false && || true", false, "AndOrList" ],
/* AndOrLists with compound commands */
["andor30", "true && ( sed -u 1q ; sort -nr)", true, "AndOrList"],
["andor31", "( cat hello ; tac world ) || wc -l", true, "AndOrList"],
["andor32", "seq 10 && { sed -u 1q ; sort -nr ; }", true, "AndOrList"],
["andor33", "{ cat hello ; tac world ; } && wc -l", true, "AndOrList"],
/* Test List rule */
["list1", "true ;", true, "List" ],
["list2", "true &", true, "List" ],
["list3", "true ; false", true, "List" ],
["list4", "true ; false ;", true, "List" ],
["list5", "true & false ;", true, "List" ],
["list6", "true & false &", true, "List" ],
["list7", "true && false &", true, "List" ],
["list8", ";", false, "List" ],
["list9", "&", false, "List" ],
/* Test TerminatedList Rule - a special rule for commands inside "{}" which requires
that each command be terminated (unlike "List" rule,
in which the last command is optionally terminated */
["tlist1", "true ;", true, "TerminatedList"],
["tlist2", "true &", true, "TerminatedList"],
["tlist3", "true ; false ;", true, "TerminatedList"],
["tlist4", "true ; false &", true, "TerminatedList"],
["tlist5", "true", false, "TerminatedList"],
["tlist6", "true", false, "TerminatedList"],
["tlist7", "true ; false", false, "TerminatedList"],
["tlist8", "true ; false", false, "TerminatedList"],
/* Test Sub-Shell Parameter Expansion */
["subshell1", "$()", true, "SubshellExpandable"],
["subshell2", "$())", false, "SubshellExpandable"],
["subshell3", "$(ls)", true, "SubshellExpandable"],
["subshell4", "$(echo $(uname -s))", true, "SubshellExpandable"],
["subshell5", "$(()", false, "SubshellExpandable"],
["subshell6", "$(echo \\()", true, "SubshellExpandable"],
["subshell7", "$(echo \\))", true, "SubshellExpandable"],
["subshell8", "$(echo \\$)", true, "SubshellExpandable"],
["subshell9", "$(echo $($()$()$($($()))uname -s))", true, "SubshellExpandable"],
["subshell10", "$(echo ${USER})", true, "SubshellExpandable"],
["subshell11", "$(echo `uname -s`)", true, "SubshellExpandable"],
["subshell12", "aaa$()", false, "SubshellExpandable"],
["subshell13", "$(echo hi)" , true, "SubshellExpandable"],
["subshell14", "$( )", true, "SubshellExpandable"],
["subshell15", "$( \t \t )", true, "SubshellExpandable"],
["subshell16", "$(FOO=BAR)", true, "SubshellExpandable"],
["subshell17", "$(true|false)", true, "SubshellExpandable"],
["subshell18", "$(true;false)", true, "SubshellExpandable"],
["subshell19", "$(true;false;)", true, "SubshellExpandable"],
["subshell20", "$(foo 2>1.txt | wc-l)", true, "SubshellExpandable"],
/* Test Backtick Subshell parameter expansion */
/*TODO: add more backtick tests */
["backtick1", "`ls`", true, "BacktickExpandable"],
["backtick2", "`ls", false, "BacktickExpandable"],
["backtick3", "ls`", false, "BacktickExpandable"],
["backtick4", "ls``", false, "BacktickExpandable"],
/* TODO: Test 5 should not fail. what's the diff between this and subshell13? */
/*["backtick5", "`echo hi`", true, "BacktickExpandable"],*/
/* Test Parameter Expansion (without operations) */
["ParamExp1", "${FOO}", true, "ParameterExpandable"],
["ParamExp2", "$FOO", true, "ParameterExpandable"],
["ParamExp3", "${FOO", false, "ParameterExpandable"],
["ParamExp4", "$FOO}", false, "ParameterExpandable"],
["ParamExp5", "$F.OO", false, "ParameterExpandable"],
["ParamExp6", "$FOO=", false, "ParameterExpandable"],
["ParamExp7", "$FO${O}", false, "ParameterExpandable"],
["ParamExp8", "${FOO=BAR}", false, "ParameterExpandable"],
/* Special parameters */
["ParamExp9", "$!", true, "ParameterExpandable"],
["ParamExp10", "$$", true, "ParameterExpandable"],
["ParamExp11", "$-", true, "ParameterExpandable"],
["ParamExp12", "$?", true, "ParameterExpandable"],
["ParamExp13", "$@", true, "ParameterExpandable"],
["ParamExp14", "${!}", true, "ParameterExpandable"],
["ParamExp15", "${$}", true, "ParameterExpandable"],
["ParamExp16", "${-}", true, "ParameterExpandable"],
["ParamExp17", "${?}", true, "ParameterExpandable"],
["ParamExp18", "${@}", true, "ParameterExpandable"],
/* Test Parameter Expansion with operations */
["ParmOpExp1", "${FOO=BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp2", "${FOO:-BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp3", "${FOO-BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp4", "${FOO:=BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp5", "${FOO=BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp6", "${FOO:?BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp7", "${FOO?BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp8", "${FOO:+BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp9", "${FOO+BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp10", "${FOO%BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp12", "${FOO%%BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp13", "${FOO#BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp14", "${FOO##BAR}", true, "ParameterOperationExpandable"],
["ParmOpExp15", "${FOO=}", true, "ParameterOperationExpandable"],
["ParmOpExp16", "${FOO=(}", true, "ParameterOperationExpandable"],
/* Go Recursive */
["ParmOpExp17", "${FOO=${BAR}}", true, "ParameterOperationExpandable"],
["ParmOpExp18", "${FOO=BAR${BAR}}", true, "ParameterOperationExpandable"],
["ParmOpExp19", "${FOO=${BAR-BAZ}}", true, "ParameterOperationExpandable"],
["ParmOpExp20", "${FOO=$(uname -s)BAZ}", true, "ParameterOperationExpandable"],
["ParmOpExp21", "${FOO=$BAR}", true, "ParameterOperationExpandable"],
/* Test bad syntax */
["ParmOpExp22", "${FOO", false, "ParameterOperationExpandable"],
["ParmOpExp23", "${FOO=", false, "ParameterOperationExpandable"],
["ParmOpExp24", "$FOO=BAR", false, "ParameterOperationExpandable"],
["ParmOpExp25", "$FOO=BAR}", false, "ParameterOperationExpandable"],
["ParmOpExp26", "$FOO}", false, "ParameterOperationExpandable"],
["ParmOpExp28", "${FOO=HELLO\"WORLD}", false, "ParameterOperationExpandable"],
["ParmOpExp29", "${FOO=HELLO\'WORLD}", false, "ParameterOperationExpandable"],
["ParmOpExp30", "${FOO=HEL${LOWORLD}", false, "ParameterOperationExpandable"],
["ParmOpExp31", "${#FOO}", true, "ParameterOperationExpandable"],
/* Test Arithmatic Expansion */
/* TODO: as more arithmetic operations are added, add appropriate tests */
["arthm1", "$(())", true, "ArithmeticExpandable"],
["arthm2", "$(( ))", true, "ArithmeticExpandable"],
["arthm3", "$((1))", true, "ArithmeticExpandable"],
["arthm4", "$(( 3 ))", true, "ArithmeticExpandable"],
["arthm5", "$((A))", true, "ArithmeticExpandable"],
["arthm6", "$(($A))", true, "ArithmeticExpandable"],
["arthm7", "$((1+2+3))", true, "ArithmeticExpandable"],
["arthm8", "$((1+2*3))", true, "ArithmeticExpandable"],
["arthm9", "$((A*3))", true, "ArithmeticExpandable"],
["arthm10", "$((1+FOO*3))", true, "ArithmeticExpandable"],
["arthm11", "$(((1+FOO)*3))", true, "ArithmeticExpandable"],
// Zero
["arthm12", "$((0))", true, "ArithmeticExpandable"],
// Octal
["arthm13", "$((033))", true, "ArithmeticExpandable"],
// Hex
["arthm14", "$((0x33))", true, "ArithmeticExpandable"],
/* Go Recursive */
["arthm20", "$(( $(nproc)+1 ))", true, "ArithmeticExpandable"],
["arthm21", "$(( ${PID}*1 ))", true, "ArithmeticExpandable"],
["arthm22", "$(( $((42))*9 ))", true, "ArithmeticExpandable"],
/* Test bad syntax */
["arthm30", "$(( 3+4 )", false, "ArithmeticExpandable"],
/* Test possible combinations of parameter expansions - single token*/
["expan1", "una$(echo me)", true, "Token_NoDelimiter"],
["expan2", "una${A}", true, "Token_NoDelimiter"],
["expan3", "una$A", true, "Token_NoDelimiter"],
["expan4", "una${FOO-me}", true, "Token_NoDelimiter"],
["expan5", "hel'lo'${USER}$(echo wo)`uptime`", true, "Token_NoDelimiter"],
["expan6", "${A}$(ls)$B$C${D}-foo", true, "Token_NoDelimiter"],
/* TODO: test expansion with assignment, redirection */
];
module.exports = {
"tests" : tests,
"parser_rules": rules
};
| gpl-3.0 |
eric-lemesre/OpenConcerto | OpenConcerto/src/org/openconcerto/sql/view/EditPanelListener.java | 830 | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
*
* The contents of this file are subject to the terms of the GNU General Public License Version 3
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each file.
*/
package org.openconcerto.sql.view;
public interface EditPanelListener {
public void cancelled();
public void modified();
public void deleted();
public void inserted(int id);
}
| gpl-3.0 |
kkorte/backend | src/resources/views/news/edit.blade.php | 3427 | @extends('hideyo_backend::_layouts.default')
@section('main')
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
@include('hideyo_backend::_partials.news-tabs', array('newsEdit' => true))
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb">
<li><a href="/"><i class="entypo-folder"></i>Dashboard</a></li>
<li><a href="{!! URL::route('hideyo.news.index') !!}">News</a></li>
<li><a href="{!! URL::route('hideyo.news.edit', $news->id) !!}">edit</a></li>
<li><a href="{!! URL::route('hideyo.news.edit', $news->id) !!}">{!! $news->title !!}</a></li>
</ol>
<h2>News <small>edit</small></h2>
<hr/>
{!! Notification::showAll() !!}
{!! Form::model($news, array('method' => 'put', 'route' => array('hideyo.news.update', $news->id), 'files' => true, 'class' => 'form-horizontal form-groups-bordered validate')) !!}
<input type="hidden" name="_token" value="{!! Session::token() !!}">
<div class="form-group">
{!! Form::label('news_group_id', 'Group', array('class' => 'col-sm-3 control-label')) !!}
<div class="col-sm-5">
{!! Form::select('news_group_id', [null => '--select--'] + $groups, null, array('class' => 'form-control')) !!}
</div>
</div>
<div class="form-group">
{!! Form::label('title', 'Title', array('class' => 'col-sm-3 control-label')) !!}
<div class="col-sm-5">
{!! Form::text('title', null, array('class' => 'form-control', 'data-validate' => 'required', 'data-message-required' => 'This is custom message for required field.')) !!}
</div>
</div>
<div class="form-group">
{!! Form::label('short_description', 'Short description', array('class' => 'col-sm-3 control-label')) !!}
<div class="col-sm-5">
{!! Form::text('short_description', null, array('class' => 'form-control', 'data-validate' => 'required', 'data-message-required' => 'This is custom message for required field.')) !!}
</div>
</div>
<div class="form-group">
{!! Form::label('news', 'Content', array('class' => 'col-sm-3 control-label')) !!}
<div class="col-sm-9">
{!! Form::textarea('content', null, array('class' => 'form-control ckeditor', 'data-validate' => 'required', 'data-message-required' => 'This is custom message for required field.')) !!}
</div>
</div>
<div class="form-group">
{!! Form::label('published_at', 'Published at', array('class' => 'col-sm-3 control-label')) !!}
<div class="col-sm-5">
{!! Form::text('published_at', null, array('class' => 'datepicker form-control', 'data-sign' => '€')) !!}
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-5">
{!! Form::submit('Save', array('class' => 'btn btn-default')) !!}
<a href="{!! URL::route('hideyo.news.index') !!}" class="btn btn-large">Cancel</a>
</div>
</div>
</div>
</div>
@stop
| gpl-3.0 |
b3h3moth/L-LP | src/Unix_Programming/Process_Control/02_fork_5_zombie.c | 1537 | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
/*
Si e' visto[1] come un processo possa essere definito orfano, e le varie
implicazioni; vi e' anche il caso in cui sia il processo figlio a terminare
prima del processo padre, con il padre in attesa di ricevere informazioni sullo
stato di terminazione del processo figlio.
Nota: Il kernel deve conservare una certa quantita' di informazioni su ogni
processo in fase di terminazione (memoria e file aperti sono chiusi subito):
- PID;
- termination status;
- costi della CPU;
I processi terminati il cui "termination status" non e' stato ancora inviato al
processo padre, sono detti "processi zombie"; in pratica il processo e' morto,
ma e' ancora 'visibile' (ad esempio col comando 'ps' o con 'top' o con 'htop'
viene indicato con la lettera Z) in attesa di fornire al padre i dati circa la
propria terminaazione.
*/
int main(int argc, char *argv[])
{
pid_t pid;
pid = fork();
if (pid < 0) {
fprintf(stderr, "Err.(%s) fork() failed\n", strerror(errno));
exit(EXIT_FAILURE);
} else if (pid > 0)
/* Il processo padre va in attesa per 30 secondi dando tutto il tempo
al processo figlio di essere eseguito */
sleep(30);
else
/* Il processo figlio esce immediatamente, con il padre che resta ancora
in attesa di ricevere le informazioni sullo stato di terminazione del
figlio */
exit(0);
return(EXIT_SUCCESS);
}
/*
[1] ../Process-Control/02_fork_4_orfano.c
*/
| gpl-3.0 |
rydnr/radare2 | libr/fs/p/grub/kern/misc.c | 19321 | /* misc.c - definitions of misc functions */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/misc.h>
#include <grub/err.h>
#include <grub/mm.h>
#include <stdarg.h>
#include <grub/term.h>
#include <grub/env.h>
#include <grub/i18n.h>
GRUB_EXPORT(grub_memmove);
GRUB_EXPORT(grub_strcpy);
GRUB_EXPORT(grub_strncpy);
GRUB_EXPORT(grub_stpcpy);
GRUB_EXPORT(grub_memcmp);
GRUB_EXPORT(grub_strcmp);
GRUB_EXPORT(grub_strncmp);
GRUB_EXPORT(grub_strchr);
GRUB_EXPORT(grub_strrchr);
GRUB_EXPORT(grub_strword);
GRUB_EXPORT(grub_strstr);
GRUB_EXPORT(grub_isspace);
GRUB_EXPORT(grub_isprint);
GRUB_EXPORT(grub_strtoul);
GRUB_EXPORT(grub_strtoull);
GRUB_EXPORT(grub_strdup);
GRUB_EXPORT(grub_strndup);
GRUB_EXPORT(grub_memset);
GRUB_EXPORT(grub_strlen);
GRUB_EXPORT(grub_printf);
GRUB_EXPORT(grub_printf_);
GRUB_EXPORT(grub_puts);
GRUB_EXPORT(grub_puts_);
GRUB_EXPORT(grub_real_dprintf);
GRUB_EXPORT(grub_vprintf);
GRUB_EXPORT(grub_snprintf);
GRUB_EXPORT(grub_vsnprintf);
GRUB_EXPORT(grub_xasprintf);
GRUB_EXPORT(grub_xvasprintf);
GRUB_EXPORT(grub_exit);
GRUB_EXPORT(grub_abort);
GRUB_EXPORT(grub_utf8_to_ucs4);
GRUB_EXPORT(grub_divmod64);
GRUB_EXPORT(grub_gettext);
static int
grub_vsnprintf_real (char *str, grub_size_t n, const char *fmt, va_list args);
static int
grub_iswordseparator (int c)
{
return (grub_isspace (c) || c == ',' || c == ';' || c == '|' || c == '&');
}
/* grub_gettext_dummy is not translating anything. */
static const char *
grub_gettext_dummy (const char *s)
{
return s;
}
const char* (*grub_gettext) (const char *s) = grub_gettext_dummy;
void *
grub_memmove (void *dest, const void *src, grub_size_t n)
{
char *d = (char *) dest;
const char *s = (const char *) src;
if (d < s)
while (n--)
*d++ = *s++;
else
{
d += n;
s += n;
while (n--)
*--d = *--s;
}
return dest;
}
char *
grub_strcpy (char *dest, const char *src)
{
char *p = dest;
while ((*p++ = *src++) != '\0')
;
return dest;
}
char *
grub_strncpy (char *dest, const char *src, int c)
{
char *p = dest;
while ((*p++ = *src++) != '\0' && --c)
;
return dest;
}
char *
grub_stpcpy (char *dest, const char *src)
{
char *d = dest;
const char *s = src;
do
*d++ = *s;
while (*s++ != '\0');
return d - 1;
}
int
grub_printf (const char *fmt, ...)
{
va_list ap;
int ret;
va_start (ap, fmt);
ret = grub_vprintf (fmt, ap);
va_end (ap);
return ret;
}
int
grub_printf_ (const char *fmt, ...)
{
va_list ap;
int ret;
va_start (ap, fmt);
ret = grub_vprintf (_(fmt), ap);
va_end (ap);
return ret;
}
int
grub_puts (const char *s)
{
while (*s)
{
grub_putchar (*s);
s++;
}
grub_putchar ('\n');
return 1; /* Cannot fail. */
}
int
grub_puts_ (const char *s)
{
return grub_puts (_(s));
}
#if defined (APPLE_CC) && ! defined (GRUB_UTIL)
int
grub_err_printf (const char *fmt, ...)
{
va_list ap;
int ret;
va_start (ap, fmt);
ret = grub_vprintf (fmt, ap);
va_end (ap);
return ret;
}
#endif
#if ! defined (APPLE_CC) && ! defined (GRUB_UTIL)
int grub_err_printf (const char *fmt, ...)
__attribute__ ((alias("grub_printf")));
#endif
void
grub_real_dprintf (const char *file, const int line, const char *condition,
const char *fmt, ...)
{
va_list args;
const char *debug = grub_env_get ("debug");
if (! debug)
return;
if (grub_strword (debug, "all") || grub_strword (debug, condition))
{
grub_printf ("%s:%d: ", file, line);
va_start (args, fmt);
grub_vprintf (fmt, args);
va_end (args);
}
}
int
grub_vprintf (const char *fmt, va_list args)
{
int ret;
ret = grub_vsnprintf_real (0, 0, fmt, args);
return ret;
}
int
grub_memcmp (const void *s1, const void *s2, grub_size_t n)
{
const char *t1 = s1;
const char *t2 = s2;
while (n--)
{
if (*t1 != *t2)
return (int) *t1 - (int) *t2;
t1++;
t2++;
}
return 0;
}
int
grub_strcmp (const char *s1, const char *s2)
{
while (*s1 && *s2)
{
if (*s1 != *s2)
break;
s1++;
s2++;
}
return (int) *s1 - (int) *s2;
}
int
grub_strncmp (const char *s1, const char *s2, grub_size_t n)
{
if (n == 0)
return 0;
while (*s1 && *s2 && --n)
{
if (*s1 != *s2)
break;
s1++;
s2++;
}
return (int) *s1 - (int) *s2;
}
char *
grub_strchr (const char *s, int c)
{
do
{
if (*s == c)
return (char *) s;
}
while (*s++);
return 0;
}
char *
grub_strrchr (const char *s, int c)
{
char *p = NULL;
do
{
if (*s == c)
p = (char *) s;
}
while (*s++);
return p;
}
/* Copied from gnulib.
Written by Bruno Haible <[email protected]>, 2005. */
char *
grub_strstr (const char *haystack, const char *needle)
{
/* Be careful not to look at the entire extent of haystack or needle
until needed. This is useful because of these two cases:
- haystack may be very long, and a match of needle found early,
- needle may be very long, and not even a short initial segment of
needle may be found in haystack. */
if (*needle != '\0')
{
/* Speed up the following searches of needle by caching its first
character. */
char b = *needle++;
for (;; haystack++)
{
if (*haystack == '\0')
/* No match. */
return NULL;
if (*haystack == b)
/* The first character matches. */
{
const char *rhaystack = haystack + 1;
const char *rneedle = needle;
for (;; rhaystack++, rneedle++)
{
if (*rneedle == '\0')
/* Found a match. */
return (char *) haystack;
if (*rhaystack == '\0')
/* No match. */
return NULL;
if (*rhaystack != *rneedle)
/* Nothing in this round. */
break;
}
}
}
}
else
return (char *) haystack;
}
int
grub_strword (const char *haystack, const char *needle)
{
const char *n_pos = needle;
while (grub_iswordseparator (*haystack))
haystack++;
while (*haystack)
{
/* Crawl both the needle and the haystack word we're on. */
while(*haystack && !grub_iswordseparator (*haystack)
&& *haystack == *n_pos)
{
haystack++;
n_pos++;
}
/* If we reached the end of both words at the same time, the word
is found. If not, eat everything in the haystack that isn't the
next word (or the end of string) and "reset" the needle. */
if ( (!*haystack || grub_iswordseparator (*haystack))
&& (!*n_pos || grub_iswordseparator (*n_pos)))
return 1;
else
{
n_pos = needle;
while (*haystack && !grub_iswordseparator (*haystack))
haystack++;
while (grub_iswordseparator (*haystack))
haystack++;
}
}
return 0;
}
int
grub_isspace (int c)
{
return (c == '\n' || c == '\r' || c == ' ' || c == '\t');
}
int
grub_isprint (int c)
{
return (c >= ' ' && c <= '~');
}
unsigned long
grub_strtoul (const char *str, char **end, int base)
{
unsigned long long num;
num = grub_strtoull (str, end, base);
if (num > ~0UL)
{
grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
return ~0UL;
}
return (unsigned long) num;
}
unsigned long long
grub_strtoull (const char *str, char **end, int base)
{
unsigned long long num = 0;
int found = 0;
/* Skip white spaces. */
while (*str && grub_isspace (*str))
str++;
/* Guess the base, if not specified. The prefix `0x' means 16, and
the prefix `0' means 8. */
if (str[0] == '0')
{
if (str[1] == 'x')
{
if (base == 0 || base == 16)
{
base = 16;
str += 2;
}
}
else if (base == 0 && str[1] >= '0' && str[1] <= '7')
base = 8;
}
if (base == 0)
base = 10;
while (*str)
{
unsigned long digit;
digit = grub_tolower (*str) - '0';
if (digit > 9)
{
digit += '0' - 'a' + 10;
if (digit >= (unsigned long) base)
break;
}
found = 1;
/* NUM * BASE + DIGIT > ~0ULL */
if (num > grub_divmod64 (~0ULL - digit, base, 0))
{
grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
return ~0ULL;
}
num = num * base + digit;
str++;
}
if (! found)
{
grub_error (GRUB_ERR_BAD_NUMBER, "unrecognized number");
return 0;
}
if (end)
*end = (char *) str;
return num;
}
char *
grub_strdup (const char *s)
{
grub_size_t len;
char *p;
len = grub_strlen (s) + 1;
p = (char *) grub_malloc (len);
if (! p)
return 0;
return grub_memcpy (p, s, len);
}
char *
grub_strndup (const char *s, grub_size_t n)
{
grub_size_t len;
char *p;
len = grub_strlen (s);
if (len > n)
len = n;
p = (char *) grub_malloc (len + 1);
if (! p)
return 0;
grub_memcpy (p, s, len);
p[len] = '\0';
return p;
}
void *
grub_memset (void *s, int c, grub_size_t n)
{
unsigned char *p = (unsigned char *) s;
while (n--)
*p++ = (unsigned char) c;
return s;
}
grub_size_t
grub_strlen (const char *s)
{
const char *p = s;
while (*p)
p++;
return p - s;
}
static inline void
grub_reverse (char *str) {
char tmp, *p = str + grub_strlen (str) - 1;
while (str < p) {
tmp = *str;
*str = *p;
*p = tmp;
str++;
p--;
}
}
/* Divide N by D, return the quotient, and store the remainder in *R. */
grub_uint64_t
grub_divmod64 (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r)
{
/* This algorithm is typically implemented by hardware. The idea
is to get the highest bit in N, 64 times, by keeping
upper(N * 2^i) = upper((Q * 10 + M) * 2^i), where upper
represents the high 64 bits in 128-bits space. */
unsigned bits = 64;
unsigned long long q = 0;
unsigned m = 0;
/* Skip the slow computation if 32-bit arithmetic is possible. */
if (n < 0xffffffff)
{
if (r)
*r = ((grub_uint32_t) n) % d;
return ((grub_uint32_t) n) / d;
}
while (bits--)
{
m <<= 1;
if (n & (1ULL << 63))
m |= 1;
q <<= 1;
n <<= 1;
if (m >= d)
{
q |= 1;
m -= d;
}
}
if (r)
*r = m;
return q;
}
/* Convert a long long value to a string. This function avoids 64-bit
modular arithmetic or divisions. */
static char *
grub_lltoa (char *str, int c, unsigned long long n)
{
unsigned base = (c == 'x') ? 16 : 10;
char *p;
if ((long long) n < 0 && c == 'd')
{
n = (unsigned long long) (-((long long) n));
*str++ = '-';
}
p = str;
if (base == 16)
do
{
unsigned d = (unsigned) (n & 0xf);
*p++ = (d > 9) ? d + 'a' - 10 : d + '0';
}
while (n >>= 4);
else
/* BASE == 10 */
do
{
unsigned m;
n = grub_divmod64 (n, 10, &m);
*p++ = m + '0';
}
while (n);
*p = 0;
grub_reverse (str);
return p;
}
struct vsnprintf_closure
{
char *str;
grub_size_t count;
grub_size_t max_len;
};
static void
write_char (unsigned char ch, struct vsnprintf_closure *cc)
{
if (cc->str)
{
if (cc->count < cc->max_len)
*(cc->str)++ = ch;
}
else
grub_putchar (ch);
(cc->count)++;
}
static void
write_str (const char *s, struct vsnprintf_closure *cc)
{
while (*s)
write_char (*s++, cc);
}
static void
write_fill (const char ch, int n, struct vsnprintf_closure *cc)
{
int i;
for (i = 0; i < n; i++)
write_char (ch, cc);
}
static int
grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt, va_list args)
{
char c;
struct vsnprintf_closure cc;
cc.str = str;
cc.max_len = max_len;
cc.count = 0;
while ((c = *fmt++) != 0)
{
if (c != '%')
write_char (c, &cc);
else
{
char tmp[32];
char *p;
unsigned int format1 = 0;
unsigned int format2 = ~ 0U;
char zerofill = ' ';
int rightfill = 0;
int n;
int longfmt = 0;
int longlongfmt = 0;
int unsig = 0;
if (*fmt && *fmt =='-')
{
rightfill = 1;
fmt++;
}
p = (char *) fmt;
/* Read formatting parameters. */
while (*p && grub_isdigit (*p))
p++;
if (p > fmt)
{
char s[p - fmt + 1];
grub_strncpy (s, fmt, p - fmt);
s[p - fmt] = 0;
if (s[0] == '0')
zerofill = '0';
format1 = grub_strtoul (s, 0, 10);
fmt = p;
}
if (*p && *p == '.')
{
p++;
fmt++;
while (*p && grub_isdigit (*p))
p++;
if (p > fmt)
{
char fstr[p - fmt + 1];
grub_strncpy (fstr, fmt, p - fmt);
fstr[p - fmt] = 0;
format2 = grub_strtoul (fstr, 0, 10);
fmt = p;
}
}
c = *fmt++;
if (c == 'l')
{
longfmt = 1;
c = *fmt++;
if (c == 'l')
{
longlongfmt = 1;
c = *fmt++;
}
}
switch (c)
{
case 'p':
write_str ("0x", &cc);
c = 'x';
longlongfmt |= (sizeof (void *) == sizeof (long long));
/* Fall through. */
case 'x':
case 'u':
unsig = 1;
/* Fall through. */
case 'd':
if (longlongfmt)
{
long long ll;
ll = va_arg (args, long long);
grub_lltoa (tmp, c, ll);
}
else if (longfmt && unsig)
{
unsigned long l = va_arg (args, unsigned long);
grub_lltoa (tmp, c, l);
}
else if (longfmt)
{
long l = va_arg (args, long);
grub_lltoa (tmp, c, l);
}
else if (unsig)
{
unsigned u = va_arg (args, unsigned);
grub_lltoa (tmp, c, u);
}
else
{
n = va_arg (args, int);
grub_lltoa (tmp, c, n);
}
if (! rightfill && grub_strlen (tmp) < format1)
write_fill (zerofill, format1 - grub_strlen (tmp), &cc);
write_str (tmp, &cc);
if (rightfill && grub_strlen (tmp) < format1)
write_fill (zerofill, format1 - grub_strlen (tmp), &cc);
break;
case 'c':
n = va_arg (args, int);
write_char (n & 0xff, &cc);
break;
case 'C':
{
grub_uint32_t code = va_arg (args, grub_uint32_t);
int shift;
unsigned mask;
if (code <= 0x7f)
{
shift = 0;
mask = 0;
}
else if (code <= 0x7ff)
{
shift = 6;
mask = 0xc0;
}
else if (code <= 0xffff)
{
shift = 12;
mask = 0xe0;
}
else if (code <= 0x1fffff)
{
shift = 18;
mask = 0xf0;
}
else if (code <= 0x3ffffff)
{
shift = 24;
mask = 0xf8;
}
else if (code <= 0x7fffffff)
{
shift = 30;
mask = 0xfc;
}
else
{
code = '?';
shift = 0;
mask = 0;
}
write_char (mask | (code >> shift), &cc);
for (shift -= 6; shift >= 0; shift -= 6)
write_char (0x80 | (0x3f & (code >> shift)), &cc);
}
break;
case 's':
p = va_arg (args, char *);
if (p)
{
grub_size_t len = 0;
while (len < format2 && p[len])
len++;
if (!rightfill && len < format1)
write_fill (zerofill, format1 - len, &cc);
grub_size_t i;
for (i = 0; i < len; i++)
write_char (*p++, &cc);
if (rightfill && len < format1)
write_fill (zerofill, format1 - len, &cc);
}
else
write_str ("(null)", &cc);
break;
default:
write_char (c, &cc);
break;
}
}
}
if (cc.str)
*(cc.str) = '\0';
return cc.count;
}
int
grub_vsnprintf (char *str, grub_size_t n, const char *fmt, va_list ap)
{
grub_size_t ret;
if (!n)
return 0;
n--;
ret = grub_vsnprintf_real (str, n, fmt, ap);
return ret < n ? ret : n;
}
int
grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
{
va_list ap;
int ret;
va_start (ap, fmt);
ret = grub_vsnprintf (str, n, fmt, ap);
va_end (ap);
return ret;
}
#define PREALLOC_SIZE 255
char *
grub_xvasprintf (const char *fmt, va_list ap)
{
grub_size_t s, as = PREALLOC_SIZE;
char *ret;
while (1)
{
ret = grub_malloc (as + 1);
if (!ret)
return NULL;
s = grub_vsnprintf_real (ret, as, fmt, ap);
if (s <= as)
return ret;
grub_free (ret);
as = s;
}
}
char *
grub_xasprintf (const char *fmt, ...)
{
va_list ap;
char *ret;
va_start (ap, fmt);
ret = grub_xvasprintf (fmt, ap);
va_end (ap);
return ret;
}
/* Convert a (possibly null-terminated) UTF-8 string of at most SRCSIZE
bytes (if SRCSIZE is -1, it is ignored) in length to a UCS-4 string.
Return the number of characters converted. DEST must be able to hold
at least DESTSIZE characters.
If SRCEND is not NULL, then *SRCEND is set to the next byte after the
last byte used in SRC. */
grub_size_t
grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
const grub_uint8_t *src, grub_size_t srcsize,
const grub_uint8_t **srcend)
{
grub_uint32_t *p = dest;
int count = 0;
grub_uint32_t code = 0;
if (srcend)
*srcend = src;
while (srcsize && destsize)
{
grub_uint32_t c = *src++;
if (srcsize != (grub_size_t)-1)
srcsize--;
if (count)
{
if ((c & 0xc0) != 0x80)
{
/* invalid */
code = '?';
/* Character c may be valid, don't eat it. */
src--;
if (srcsize != (grub_size_t)-1)
srcsize++;
count = 0;
}
else
{
code <<= 6;
code |= (c & 0x3f);
count--;
}
}
else
{
if (c == 0)
break;
if ((c & 0x80) == 0x00)
code = c;
else if ((c & 0xe0) == 0xc0)
{
count = 1;
code = c & 0x1f;
}
else if ((c & 0xf0) == 0xe0)
{
count = 2;
code = c & 0x0f;
}
else if ((c & 0xf8) == 0xf0)
{
count = 3;
code = c & 0x07;
}
else if ((c & 0xfc) == 0xf8)
{
count = 4;
code = c & 0x03;
}
else if ((c & 0xfe) == 0xfc)
{
count = 5;
code = c & 0x01;
}
else
{
/* invalid */
code = '?';
count = 0;
}
}
if (count == 0)
{
*p++ = code;
destsize--;
}
}
if (srcend)
*srcend = src;
return p - dest;
}
/* Abort GRUB. This function does not return. */
void
grub_abort (void)
{
grub_printf ("\nAborted.");
#ifndef GRUB_UTIL
if (grub_term_inputs)
#endif
{
grub_printf (" Press any key to exit.");
grub_getkey ();
}
//grub_exit ();
}
#if defined(NEED_ENABLE_EXECUTE_STACK) && !defined(GRUB_UTIL)
/* Some gcc versions generate a call to this function
in trampolines for nested functions. */
void __enable_execute_stack (void *addr __attribute__ ((unused)))
{
}
#endif
#if defined (NEED_REGISTER_FRAME_INFO) && !defined(GRUB_UTIL)
void __register_frame_info (void)
{
}
void __deregister_frame_info (void)
{
}
#endif
| gpl-3.0 |
Great-Li-Xin/00864088 | [课后作业]/实验二编写简单程序/6. 2.4.5 计算还款年限-月还款额 .c | 322 | #include <stdio.h>
#include <math.h>
int main(void)
{
double i,l,r,m;
printf("Enter loan: ");
scanf("%lf",&l);
printf("Enter rate: ");
scanf("%lf",&r);
for (i = 5; i <= 30; i++) {
m=l*r*pow(1+r,12*i)/(pow(1+r,12*i)-1);
printf("money(%.0f,%.0f)=%.0f\n",l,i,m);
}
return 0;
}
| gpl-3.0 |
MeeBlip/meeblip-anode-limited-edition | README.md | 67 | meeblip-anode
=============
Meeblip anode hybrid MIDI synthesizer
| gpl-3.0 |
Raphcal/sigmah | src/main/java/org/sigmah/offline/js/TransfertJS.java | 3177 | package org.sigmah.offline.js;
/*
* #%L
* Sigmah
* %%
* Copyright (C) 2010 - 2016 URD
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import java.util.HashMap;
import java.util.Map;
import org.sigmah.offline.fileapi.Int8Array;
import org.sigmah.shared.dto.value.FileVersionDTO;
import org.sigmah.shared.file.TransfertType;
/**
* File upload progression.
*
* @author Raphaël Calabro ([email protected])
*/
public final class TransfertJS extends JavaScriptObject {
public static TransfertJS createTransfertJS(FileVersionDTO fileVersionDTO, TransfertType type) {
final TransfertJS transfertJS = Values.createJavaScriptObject(TransfertJS.class);
transfertJS.setFileVersion(FileVersionJS.toJavaScript(fileVersionDTO));
transfertJS.setData(Values.createTypedJavaScriptArray(Int8Array.class));
transfertJS.setProgress(0);
transfertJS.setType(type);
return transfertJS;
}
protected TransfertJS() {
}
public native int getId() /*-{
return this.id;
}-*/;
public native void setId(int id) /*-{
this.id = id;
}-*/;
public TransfertType getType() {
return Values.getEnum(this, "type", TransfertType.class);
}
public void setType(TransfertType type) {
Values.setEnum(this, "type", type);
}
public native FileVersionJS getFileVersion() /*-{
return this.fileVersion;
}-*/;
public native void setFileVersion(FileVersionJS fileVersion) /*-{
this.fileVersion = fileVersion;
}-*/;
public native JsArray<Int8Array> getData() /*-{
return this.data;
}-*/;
public native void setData(JsArray<Int8Array> data) /*-{
this.data = data;
}-*/;
public native void setData(Int8Array data) /*-{
this.data = [data];
}-*/;
public native int getProgress() /*-{
return this.progress;
}-*/;
public native void setProgress(int progress) /*-{
this.progress = progress;
}-*/;
public native JsMap<String, String> getProperties() /*-{
return this.properties;
}-*/;
public native void setProperties(JsMap<String, String> properties) /*-{
this.properties = properties;
}-*/;
public Map<String, String> getPropertyMap() {
if(getProperties() != null) {
return new HashMap<String, String>(new AutoBoxingJsMap<String, String>(getProperties(), AutoBoxingJsMap.STRING_BOXER));
}
return null;
}
public void setProperties(Map<String, String> map) {
if(map != null) {
final JsMap<String, String> jsMap = JsMap.createMap();
jsMap.putAll(map);
setProperties(jsMap);
}
}
}
| gpl-3.0 |
chinapacs/ImageViewer | ImageViewer/PresentationStates/Dicom/Tests/OverlayPlanePresentationTests.cs | 14746 | #region License
// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project. If not, see
// <http://www.gnu.org/licenses/>.
#endregion
#if UNIT_TESTS
#pragma warning disable 1591,0419,1574,1587
using System;
using System.Collections.Generic;
using System.Drawing;
using ClearCanvas.Dicom;
using ClearCanvas.ImageViewer.StudyManagement;
using NUnit.Framework;
namespace ClearCanvas.ImageViewer.PresentationStates.Dicom.Tests
{
[TestFixture]
public class OverlayPlanePresentationTests
{
private static GeneratedOverlayTestImages _testImages;
[TestFixtureSetUp]
public void Init()
{
_testImages = new GeneratedOverlayTestImages();
}
[Test]
public void TestSanity()
{
// make sure that the functions that supporting testing here can actually tell when something is wrong
var file = _testImages.ImageDataOverlay;
using (var images = CreateImages(file))
{
AssertFrameIdentity(1, 1, images[0], "assertion 1 yielded false negative");
try
{
AssertFrameIdentity(0, 1, images[0], "2");
Assert.Fail("assertion 2 yielded false positive");
}
catch (Exception)
{
// expected
}
try
{
AssertFrameIdentity(1, 5, images[0], "3");
Assert.Fail("assertion 3 yielded false positive");
}
catch (Exception)
{
// expected
}
try
{
AssertFrameIdentity(1, null, images[0], "4");
Assert.Fail("assertion 4 yielded false positive");
}
catch (Exception)
{
// expected
}
}
}
[Test]
public void TestMultiframeImageEmbeddedOverlay()
{
var file = _testImages.MultiframeImageEmbeddedOverlay;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should be exactly 1-to-1
for (int n = 0; n < 17; n++)
AssertFrameIdentity(n + 1, n + 1, images[n], "multiframe image with embedded overlay image #{0}", n + 1);
}
}
[Test]
public void TestMultiframeImageDataOverlay()
{
var file = _testImages.MultiframeImageDataOverlay;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should be exactly 1-to-1
for (int n = 0; n < 17; n++)
AssertFrameIdentity(n + 1, n + 1, images[n], "multiframe image with data overlay image #{0}", n + 1);
}
}
[Test]
public void TestMultiframeImageDataOverlayDifferentSize()
{
var file = _testImages.MultiframeImageDataOverlayDifferentSize;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should be exactly 1-to-1
for (int n = 0; n < 17; n++)
AssertFrameIdentity(n + 1, n + 1, images[n], "multiframe image with different size data overlay image #{0}", n + 1);
}
}
[Test]
public void TestMultiframeImageDataOverlayNotMultiframe()
{
var file = _testImages.MultiframeImageDataOverlayNotMultiframe;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should all have overlay #1
for (int n = 0; n < 17; n++)
AssertFrameIdentity(n + 1, 1, images[n], "multiframe image with non-multiframe data overlay image #{0}", n + 1);
}
}
[Test]
public void TestMultiframeImageDataOverlayLowSubrangeImplicitOrigin()
{
var file = _testImages.MultiframeImageDataOverlayLowSubrangeImplicitOrigin;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should all have 1-to-1 overlays
for (int n = 0; n < 7; n++)
AssertFrameIdentity(n + 1, n + 1, images[n], "multiframe image with data overlays on subrange 1-7 (encoded as implicit origin) image #{0}", n + 1);
// these frames should not have overlays
for (int n = 7; n < 17; n++)
AssertFrameIdentity(n + 1, null, images[n], "multiframe image with data overlays on subrange 1-7 (encoded as implicit origin) image #{0}", n + 1);
}
}
[Test]
public void TestMultiframeImageDataOverlayLowSubrange()
{
var file = _testImages.MultiframeImageDataOverlayLowSubrange;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should all have 1-to-1 overlays
for (int n = 0; n < 7; n++)
AssertFrameIdentity(n + 1, n + 1, images[n], "multiframe image with data overlays on subrange 1-7 image #{0}", n + 1);
// these frames should not have overlays
for (int n = 7; n < 17; n++)
AssertFrameIdentity(n + 1, null, images[n], "multiframe image with data overlays on subrange 1-7 image #{0}", n + 1);
}
}
[Test]
public void TestMultiframeImageDataOverlayMidSubrange()
{
var file = _testImages.MultiframeImageDataOverlayMidSubrange;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should all have 1-to-1 overlays
for (int n = 5; n < 12; n++)
AssertFrameIdentity(n + 1, n + 1 - 5, images[n], "multiframe image with data overlays on subrange 6-12 image #{0}", n + 1);
// these frames should not have overlays
for (int n = 12; n < 17; n++)
AssertFrameIdentity(n + 1, null, images[n], "multiframe image with data overlays on subrange 6-12 image #{0}", n + 1);
// these frames should not have overlays
for (int n = 0; n < 5; n++)
AssertFrameIdentity(n + 1, null, images[n], "multiframe image with data overlays on subrange 6-12 image #{0}", n + 1);
}
}
[Test]
public void TestMultiframeImageDataOverlayHighSubrange()
{
var file = _testImages.MultiframeImageDataOverlayHighSubrange;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should all have 1-to-1 overlays
for (int n = 10; n < 17; n++)
AssertFrameIdentity(n + 1, n + 1 - 10, images[n], "multiframe image with data overlays on subrange 11-17 image #{0}", n + 1);
// these frames should not have overlays
for (int n = 0; n < 10; n++)
AssertFrameIdentity(n + 1, null, images[n], "multiframe image with data overlays on subrange 11-17 image #{0}", n + 1);
}
}
[Test]
public void TestImageEmbeddedOverlay()
{
var file = _testImages.ImageEmbeddedOverlay;
using (var images = CreateImages(file))
{
Assert.AreEqual(1, images.Count, "should be exactly 1 frames in this instance");
// that frames should be exactly 1-to-1
AssertFrameIdentity(1, 1, images[0], "image with embedded overlay image #{0}", 1);
}
}
[Test]
public void TestImageDataOverlay()
{
var file = _testImages.ImageDataOverlay;
using (var images = CreateImages(file))
{
Assert.AreEqual(1, images.Count, "should be exactly 1 frames in this instance");
// that frames should be exactly 1-to-1
AssertFrameIdentity(1, 1, images[0], "image with data overlay image #{0}", 1);
}
}
[Test]
public void TestImageDataOverlayDifferentSize()
{
var file = _testImages.ImageDataOverlayDifferentSize;
using (var images = CreateImages(file))
{
Assert.AreEqual(1, images.Count, "should be exactly 1 frames in this instance");
// that frames should be exactly 1-to-1
AssertFrameIdentity(1, 1, images[0], "image with different size data overlay image #{0}", 1);
}
}
[Test]
public void TestImageDataOverlayMultiframe()
{
var file = _testImages.ImageDataOverlayMultiframe;
using (var images = CreateImages(file))
{
Assert.AreEqual(1, images.Count, "should be exactly 1 frames in this instance");
// that frames should not have an overlay displayed
AssertFrameIdentity(1, null, images[0], "image with multiframe data overlay image #{0}", 1);
}
// should check that there is an error displayed
}
[Test]
public void TestImageEmbeddedOverlay8Bit()
{
var file = _testImages.ImageEmbeddedOverlay8Bit;
using (var images = CreateImages(file))
{
Assert.AreEqual(1, images.Count, "should be exactly 1 frames in this instance");
// that frames should be exactly 1-to-1
AssertFrameIdentity(1, 1, images[0], "image with embedded overlay image #{0}", 1);
}
}
[Test]
public void TestImageDataOverlayOWAttribute()
{
var file = _testImages.ImageDataOverlayOWAttribute;
using (var images = CreateImages(file))
{
Assert.AreEqual(1, images.Count, "should be exactly 1 frames in this instance");
// that frames should be exactly 1-to-1
AssertFrameIdentity(1, 1, images[0], "image with data overlay image #{0}", 1);
}
}
[Test]
public void TestMultiframeImageEmbeddedOverlay8Bit()
{
var file = _testImages.MultiframeImageEmbeddedOverlay8Bit;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should be exactly 1-to-1
for (int n = 0; n < 17; n++)
AssertFrameIdentity(n + 1, n + 1, images[n], "multiframe image with embedded overlay image #{0}", n + 1);
}
}
[Test]
public void TestMultiframeImageDataOverlayOWAttribute()
{
var file = _testImages.MultiframeImageDataOverlayOWAttribute;
using (var images = CreateImages(file))
{
Assert.AreEqual(17, images.Count, "should be exactly 17 frames in this instance");
// these frames should be exactly 1-to-1
for (int n = 0; n < 17; n++)
AssertFrameIdentity(n + 1, n + 1, images[n], "multiframe image with data overlay image #{0}", n + 1);
}
}
private static void AssertFrameIdentity(int expectedImageFrameNumber, int? expectedOverlayFrameNumber, IPresentationImage image, string message, params object[] args)
{
int actualImageFrameNumber;
int? actualOverlayFrameNumber;
IdentifyPresentationImageFrames(image, out actualImageFrameNumber, out actualOverlayFrameNumber);
Assert.AreEqual(expectedImageFrameNumber, actualImageFrameNumber, message + " (IMAGE frame number)", args);
Assert.AreEqual(expectedOverlayFrameNumber, actualOverlayFrameNumber, message + " (OVERLAY frame number)", args);
}
private static void IdentifyPresentationImageFrames(IPresentationImage image, out int imageFrameNumber, out int? overlayFrameNumber)
{
var overlayColor = Color.Red;
var imageColor = Color.White;
// force the overlays to show in our chosen colour
PresentationState.DicomDefault.Deserialize(image);
var dps = DicomGraphicsPlane.GetDicomGraphicsPlane((IDicomPresentationImage) image, true);
foreach (var overlay in dps.ImageOverlays)
overlay.Color = overlayColor;
var sopProvider = (IImageSopProvider) image;
using (var dump = image.DrawToBitmap(sopProvider.Frame.Columns, sopProvider.Frame.Rows))
{
// identify the frame number encoded in the image
imageFrameNumber = 0;
imageFrameNumber += AreEqual(Sample(dump, 95, 205, 8, 8), imageColor) ? 0x10 : 0;
imageFrameNumber += AreEqual(Sample(dump, 113, 205, 8, 8), imageColor) ? 0x08 : 0;
imageFrameNumber += AreEqual(Sample(dump, 130, 205, 8, 8), imageColor) ? 0x04 : 0;
imageFrameNumber += AreEqual(Sample(dump, 148, 205, 8, 8), imageColor) ? 0x02 : 0;
imageFrameNumber += AreEqual(Sample(dump, 166, 205, 8, 8), imageColor) ? 0x01 : 0;
// check if overlay positioning blocks are in the right place
if (!AreEqual(Sample(dump, 187, 73, 8, 8), overlayColor) || !AreEqual(Sample(dump, 74, 182, 8, 8), overlayColor))
{
overlayFrameNumber = null;
return;
}
// identify the frame number encoded in the overlay
overlayFrameNumber = 0;
overlayFrameNumber += AreEqual(Sample(dump, 95, 182, 8, 8), overlayColor) ? 0x10 : 0;
overlayFrameNumber += AreEqual(Sample(dump, 113, 182, 8, 8), overlayColor) ? 0x08 : 0;
overlayFrameNumber += AreEqual(Sample(dump, 130, 182, 8, 8), overlayColor) ? 0x04 : 0;
overlayFrameNumber += AreEqual(Sample(dump, 148, 182, 8, 8), overlayColor) ? 0x02 : 0;
overlayFrameNumber += AreEqual(Sample(dump, 166, 182, 8, 8), overlayColor) ? 0x01 : 0;
}
}
private static DisposableList<IPresentationImage> CreateImages(DicomFile dicomFile)
{
using (var dataSource = new LocalSopDataSource(dicomFile))
{
using (var sop = new ImageSop(dataSource))
{
return new DisposableList<IPresentationImage>(PresentationImageFactory.Create(sop));
}
}
}
private class DisposableList<T> : List<T>, IDisposable
where T : IDisposable
{
public DisposableList(IEnumerable<T> collection)
: base(collection) {}
public void Dispose()
{
foreach (var item in this)
item.Dispose();
}
}
private static bool AreEqual(Color a, Color b)
{
var c = Color.FromArgb(Math.Abs(a.R - b.R), Math.Abs(a.G - b.G), Math.Abs(a.B - b.B));
return c.GetBrightness() < 0.01f;
}
private static Color Sample(Bitmap image, int x, int y, int width, int height)
{
float count = width*height;
float r = 0;
float g = 0;
float b = 0;
for (int dx = -width/2; dx < width/2; dx++)
{
for (int dy = -height/2; dy < height/2; dy++)
{
var c = image.GetPixel(dx + x, dy + y);
r += c.R/count;
g += c.G/count;
b += c.B/count;
}
}
return Color.FromArgb((int) r, (int) g, (int) b);
}
}
}
#endif | gpl-3.0 |
wtsi-hgi/hgi-ansible | ansible/library/arvados_repository.py | 670 | #!/usr/bin/python3
from ansible.module_utils.arvados_common import process
def main():
additional_argument_spec={
"uuid": dict(required=True, type="str"),
"owner_uuid": dict(required=True, type="str"),
"name": dict(required=True, type="str"),
}
filter_property = "uuid"
filter_value_module_parameter = "uuid"
module_parameter_to_resource_parameter_map = {
"owner_uuid": "owner_uuid",
"name": "name",
}
process("repositories", additional_argument_spec, filter_property, filter_value_module_parameter,
module_parameter_to_resource_parameter_map)
if __name__ == "__main__":
main()
| gpl-3.0 |
benhylau/flying-photo-booth | party-photo-booth/src/com/groundupworks/partyphotobooth/setup/fragments/PhotoBoothSetupFragment.java | 7157 | /*
* This file is part of Flying PhotoBooth.
*
* Flying PhotoBooth is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Flying PhotoBooth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Flying PhotoBooth. If not, see <http://www.gnu.org/licenses/>.
*/
package com.groundupworks.partyphotobooth.setup.fragments;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Button;
import android.widget.Spinner;
import com.groundupworks.partyphotobooth.R;
import com.groundupworks.partyphotobooth.helpers.PreferencesHelper;
import com.groundupworks.partyphotobooth.helpers.PreferencesHelper.PhotoBoothMode;
import com.groundupworks.partyphotobooth.helpers.PreferencesHelper.PhotoBoothTheme;
import com.groundupworks.partyphotobooth.helpers.PreferencesHelper.PhotoStripTemplate;
import com.groundupworks.partyphotobooth.setup.model.PhotoBoothModeAdapter;
import com.groundupworks.partyphotobooth.setup.model.PhotoBoothThemeAdapter;
import com.groundupworks.partyphotobooth.setup.model.PhotoStripTemplateAdapter;
import java.lang.ref.WeakReference;
/**
* Ui for setting up the photo booth.
*
* @author Benedict Lau
*/
public class PhotoBoothSetupFragment extends Fragment {
/**
* Callbacks for this fragment.
*/
private WeakReference<PhotoBoothSetupFragment.ICallbacks> mCallbacks = null;
/**
* A {@link PreferencesHelper} instance.
*/
private PreferencesHelper mPreferencesHelper = new PreferencesHelper();
//
// Views.
//
private Spinner mMode;
private Spinner mTheme;
private Spinner mTemplate;
private Button mNext;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
mCallbacks = new WeakReference<PhotoBoothSetupFragment.ICallbacks>(
(PhotoBoothSetupFragment.ICallbacks) activity);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
/*
* Inflate views from XML.
*/
View view = inflater.inflate(R.layout.fragment_photo_booth_setup, container, false);
mMode = (Spinner) view.findViewById(R.id.setup_photo_booth_mode);
mTheme = (Spinner) view.findViewById(R.id.setup_photo_booth_theme);
mTemplate = (Spinner) view.findViewById(R.id.setup_photo_booth_template);
mNext = (Button) view.findViewById(R.id.setup_photo_booth_button_next);
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Activity activity = getActivity();
final Context appContext = activity.getApplicationContext();
/*
* Configure views with saved preferences and functionalize.
*/
final PhotoBoothModeAdapter modeAdapter = new PhotoBoothModeAdapter(activity);
mMode.setAdapter(modeAdapter);
mMode.setSelection(mPreferencesHelper.getPhotoBoothMode(appContext).ordinal());
mMode.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
PhotoBoothMode selectedMode = modeAdapter.getPhotoBoothMode(position);
mPreferencesHelper.storePhotoBoothMode(appContext, selectedMode);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// Do nothing.
}
});
final PhotoBoothThemeAdapter themeAdapter = new PhotoBoothThemeAdapter(activity);
mTheme.setAdapter(themeAdapter);
mTheme.setSelection(mPreferencesHelper.getPhotoBoothTheme(appContext).ordinal());
mTheme.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
PhotoBoothTheme selectedTheme = themeAdapter.getPhotoBoothTheme(position);
mPreferencesHelper.storePhotoBoothTheme(appContext, selectedTheme);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// Do nothing.
}
});
final PhotoStripTemplateAdapter templateAdapter = new PhotoStripTemplateAdapter(activity);
mTemplate.setAdapter(templateAdapter);
mTemplate.setSelection(mPreferencesHelper.getPhotoStripTemplate(appContext).ordinal());
mTemplate.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
PhotoStripTemplate selectedTemplate = templateAdapter.getPhotoStripTemplate(position);
mPreferencesHelper.storePhotoStripTemplate(appContext, selectedTemplate);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// Do nothing.
}
});
mNext.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Call to client.
ICallbacks callbacks = getCallbacks();
if (callbacks != null) {
callbacks.onPhotoBoothSetupCompleted();
}
}
});
}
//
// Private methods.
//
/**
* Gets the callbacks for this fragment.
*
* @return the callbacks; or null if not set.
*/
private PhotoBoothSetupFragment.ICallbacks getCallbacks() {
PhotoBoothSetupFragment.ICallbacks callbacks = null;
if (mCallbacks != null) {
callbacks = mCallbacks.get();
}
return callbacks;
}
//
// Public methods.
//
/**
* Creates a new {@link PhotoBoothSetupFragment} instance.
*
* @return the new {@link PhotoBoothSetupFragment} instance.
*/
public static PhotoBoothSetupFragment newInstance() {
return new PhotoBoothSetupFragment();
}
//
// Interfaces.
//
/**
* Callbacks for this fragment.
*/
public interface ICallbacks {
/**
* Setup of the photo booth has completed.
*/
void onPhotoBoothSetupCompleted();
}
}
| gpl-3.0 |
igr-santos/hub-client | app/components/Layout/SettingsPageMenuLayout.js | 624 | import React, { PropTypes } from 'react'
import classnames from 'classnames'
const SettingsPageMenuLayout = ({ children, title, className }) => (
<div
className={classnames(
'settings-page-menu-layout bg-white pt3 pr4 pl5 border-only-bottom border-gray94',
className
)}
>
<h1 className="h1 mt0 mb3">{title}</h1>
{children}
</div>
)
SettingsPageMenuLayout.propTypes = {
children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
title: PropTypes.string.isRequired
}
export default SettingsPageMenuLayout
| gpl-3.0 |
pojome/elementor | assets/dev/js/editor/utils/files-upload-handler.js | 1087 | export default class FilesUploadHandler {
static isUploadEnabled( mediaType ) {
const unfilteredFilesTypes = [ 'svg', 'application/json' ];
if ( ! unfilteredFilesTypes.includes( mediaType ) ) {
return true;
}
return elementor.config.filesUpload.unfilteredFiles;
}
static setUploadTypeCaller( frame ) {
frame.uploader.uploader.param( 'uploadTypeCaller', 'elementor-wp-media-upload' );
}
static getUnfilteredFilesNotEnabledDialog( callback ) {
const onConfirm = () => {
elementorCommon.ajax.addRequest( 'enable_unfiltered_files_upload', {}, true );
elementor.config.filesUpload.unfilteredFiles = true;
callback();
};
return elementor.helpers.getSimpleDialog(
'e-enable-unfiltered-files-dialog',
__( 'Enable Unfiltered File Uploads', 'elementor' ),
__( 'Before you enable unfiltered files upload, note that this kind of files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.', 'elementor' ),
__( 'Enable', 'elementor' ),
onConfirm
);
}
}
| gpl-3.0 |
gozora/rear | usr/share/rear/prep/GALAXY7/default/400_prep_galaxy.sh | 285 | #
# prepare stuff for Galaxy 7
#
COPY_AS_IS+=( "${COPY_AS_IS_GALAXY7[@]}" )
COPY_AS_IS_EXCLUDE+=( "${COPY_AS_IS_EXCLUDE_GALAXY7[@]}" )
PROGS+=( chgrp touch )
# include argument file if specified
if test "$GALAXY7_Q_ARGUMENTFILE" ; then
COPY_AS_IS+=( "$GALAXY7_Q_ARGUMENTFILE" )
fi
| gpl-3.0 |
vacuumlabs/babel-plugin-superstrict | test/eval_tests/casting_signed_right_shift_numbers.js | 106 | 'use superstrict';
try {
if ((-25 >> 3) === -4) {
'ok';
} else {
'fail';
}
} catch (e) {
}
| gpl-3.0 |
lizardsystem/flooding | flooding_lib/conf.py | 875 | # (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
"""Use AppConf to store sensible defaults for settings. This also documents the
settings that lizard_damage defines. Each setting name automatically has
"FLOODING_LIB_" prepended to it.
By puttng the AppConf in this module and importing the Django settings
here, it is possible to import Django's settings with `from flooding_lib.conf
import settings` and be certain that the AppConf
stuff has also been loaded."""
# Python 3 is coming
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import os
from django.conf import settings
settings # Pyflakes...
from appconf import AppConf
class MyAppConf(AppConf):
COLORMAP_DIR = os.path.join(
settings.FLOODING_SHARE, 'colormaps')
| gpl-3.0 |
raisercostin/mucommander | src/test/com/mucommander/share/impl/imgur/ImgurJobTest.java | 3124 | package com.mucommander.share.impl.imgur;
import com.mucommander.commons.file.AbstractFile;
import com.mucommander.commons.file.FileFactory;
import com.mucommander.commons.file.util.FileSet;
import com.mucommander.share.impl.imgur.ImgurAPI.Callback;
import com.mucommander.text.Translator;
import com.mucommander.ui.dialog.file.ProgressDialog;
import com.mucommander.ui.main.MainFrame;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.Future;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
*
* @author Mathias
*/
public class ImgurJobTest {
private ImgurAPI mockImgurAPI;
private ProgressDialog mockProgressDialog;
private MainFrame mockMainFrame;
private FileSet mockFiles;
private Future mockFuture;
private ImgurJob instance;
public ImgurJobTest() {
}
@BeforeClass
public void setUpClass() throws Exception {
//Uses localized strings
try {
Translator.init();
} catch (Exception e) {
throw new RuntimeException(e);
}
//Mock Future
mockFuture = mock(Future.class);
when(mockFuture.isDone()).thenReturn(true);
//Mock ImgurAPI
mockImgurAPI = mock(ImgurAPI.class);
when(mockImgurAPI.uploadAsync(any(File.class), any(Callback.class))).thenReturn(mockFuture);
//Mock ProgressDialog
mockProgressDialog = mock(ProgressDialog.class);
//Mock MainFrame
mockMainFrame = mock(MainFrame.class);
//Mock FileSet
mockFiles = mock(FileSet.class);
}
@BeforeMethod
public void setUpMethod() throws Exception {
instance = new ImgurJob(mockImgurAPI, mockProgressDialog, mockMainFrame, mockFiles);
}
/**
* Test of hasFolderChanged method, of class ImgurJob.
*/
@Test
public void testHasFolderChanged() {
System.out.println("hasFolderChanged");
AbstractFile folder = mock(AbstractFile.class);
boolean expResult = false;
boolean result = instance.hasFolderChanged(folder);
assertEquals(result, expResult);
}
@Test
public void successLocalFile() throws IOException {
File tmp = File.createTempFile("test", ".tmp");
tmp.deleteOnExit();
AbstractFile file = FileFactory.getFile(tmp.getAbsolutePath());
boolean result = instance.processFile(file, null);
boolean expResult = true;
assertEquals(result, expResult);
}
/**
* Test of getStatusString method, of class ImgurJob.
*/
@Test
public void testGetStatusString() {
System.out.println("getStatusString");
String status = instance.getStatusString();
assertNotNull(status);
assertTrue(!status.equals(""));
}
}
| gpl-3.0 |
adalee-group/watering-system | server/schedule-service/src/main/java/edu/hucare/model/User.java | 1897 | package edu.hucare.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*;
import java.util.Set;
/**
* Created by Kuzon on 7/28/2016.
*/
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String email;
private String name;
private String password;
@OneToMany(mappedBy = "user")
private Set<ControlDevice> controlDevices;
@OneToMany(mappedBy = "user")
private Set<TerminalDevice> terminalDevices;
@OneToMany(mappedBy = "user")
private Set<Schedule> schedules;
public User() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@JsonIgnore
public Set<ControlDevice> getControlDevices() {
return controlDevices;
}
@JsonIgnore
public void setControlDevices(Set<ControlDevice> controlDevices) {
this.controlDevices = controlDevices;
}
@JsonIgnore
public Set<TerminalDevice> getTerminalDevices() {
return terminalDevices;
}
@JsonIgnore
public void setTerminalDevices(Set<TerminalDevice> terminalDevices) {
this.terminalDevices = terminalDevices;
}
@JsonIgnore
public Set<Schedule> getSchedules() {
return schedules;
}
@JsonIgnore
public void setSchedules(Set<Schedule> schedules) {
this.schedules = schedules;
}
}
| gpl-3.0 |
dnowatsc/Varial | docs/_build/html/rendering.html | 17715 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Canvas Rendering — CmsAnalysisAC3B 0.1.0 documentation</title>
<link rel="stylesheet" href="_static/celery.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="CmsAnalysisAC3B 0.1.0 documentation" href="index.html" />
<link rel="prev" title="Wrapper types" href="wrappers.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="wrappers.html" title="Wrapper types"
accesskey="P">previous</a> |</li>
<li><a href="index.html">CmsAnalysisAC3B 0.1.0 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="canvas-rendering">
<h1>Canvas Rendering<a class="headerlink" href="#canvas-rendering" title="Permalink to this headline">¶</a></h1>
<p>The members of this package make plots from histograms or other wrapped
ROOT-objects. The ‘Renderers’ extend the functionality of wrappers for drawing.
The ROOT-canvas is build with the <tt class="docutils literal"><span class="pre">CanvasBuilder</span></tt> class.
The functionality of <tt class="docutils literal"><span class="pre">CanvasBuilder</span></tt> can be extended with decorators, see
below.</p>
<div class="section" id="renderers-for-wrapper-types">
<h2>Renderers for wrapper types<a class="headerlink" href="#renderers-for-wrapper-types" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="cmstoolsac3b.rendering.Renderer">
<em class="property">class </em><tt class="descclassname">cmstoolsac3b.rendering.</tt><tt class="descname">Renderer</tt><big>(</big><em>wrp</em><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#Renderer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.Renderer" title="Permalink to this definition">¶</a></dt>
<dd><p>Baseclass for rendered wrappers.</p>
</dd></dl>
<dl class="class">
<dt id="cmstoolsac3b.rendering.HistoRenderer">
<em class="property">class </em><tt class="descclassname">cmstoolsac3b.rendering.</tt><tt class="descname">HistoRenderer</tt><big>(</big><em>wrp</em><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#HistoRenderer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.HistoRenderer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#cmstoolsac3b.rendering.Renderer" title="cmstoolsac3b.rendering.Renderer"><tt class="xref py py-class docutils literal"><span class="pre">cmstoolsac3b.rendering.Renderer</span></tt></a>, <a class="reference internal" href="wrappers.html#cmstoolsac3b.wrappers.HistoWrapper" title="cmstoolsac3b.wrappers.HistoWrapper"><tt class="xref py py-class docutils literal"><span class="pre">cmstoolsac3b.wrappers.HistoWrapper</span></tt></a></p>
<p>Extend HistoWrapper for drawing.</p>
</dd></dl>
<dl class="class">
<dt id="cmstoolsac3b.rendering.StackRenderer">
<em class="property">class </em><tt class="descclassname">cmstoolsac3b.rendering.</tt><tt class="descname">StackRenderer</tt><big>(</big><em>wrp</em><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#StackRenderer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.StackRenderer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#cmstoolsac3b.rendering.HistoRenderer" title="cmstoolsac3b.rendering.HistoRenderer"><tt class="xref py py-class docutils literal"><span class="pre">cmstoolsac3b.rendering.HistoRenderer</span></tt></a>, <a class="reference internal" href="wrappers.html#cmstoolsac3b.wrappers.StackWrapper" title="cmstoolsac3b.wrappers.StackWrapper"><tt class="xref py py-class docutils literal"><span class="pre">cmstoolsac3b.wrappers.StackWrapper</span></tt></a></p>
<p>Extend StackWrapper for drawing.</p>
</dd></dl>
</div>
<div class="section" id="canvas-building">
<h2>Canvas Building<a class="headerlink" href="#canvas-building" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="cmstoolsac3b.rendering.CanvasBuilder">
<em class="property">class </em><tt class="descclassname">cmstoolsac3b.rendering.</tt><tt class="descname">CanvasBuilder</tt><big>(</big><em>wrps</em>, <em>**kws</em><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#CanvasBuilder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.CanvasBuilder" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a TCanvas and plot wrapped ROOT-objects.</p>
<p>Use this class like so:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cb</span> <span class="o">=</span> <span class="n">CanvasBuilder</span><span class="p">(</span><span class="n">list_of_wrappers</span><span class="p">,</span> <span class="o">**</span><span class="n">kws</span><span class="p">)</span>
<span class="n">canvas_wrp</span> <span class="o">=</span> <span class="n">cb</span><span class="o">.</span><span class="n">build_canvas</span><span class="p">()</span>
</pre></div>
</div>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">list_of_wrappers</span></tt> is can also be a list of renderers. If not, the
renderers are created automaticly.</li>
<li><tt class="docutils literal"><span class="pre">**kws</span></tt> can be empty. Accepted keywords are <tt class="docutils literal"><span class="pre">name=</span></tt> and <tt class="docutils literal"><span class="pre">title=</span></tt> and
any keyword that is accepted by <tt class="docutils literal"><span class="pre">histotools.wrappers.CanvasWrapper</span></tt>.</li>
</ul>
<p>When designing decorators, these instance data members can be of interest:</p>
<table border="1" class="docutils">
<colgroup>
<col width="23%" />
<col width="77%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">x_bounds</span></tt></td>
<td>Bounds of canvas area in x</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">y_bounds</span></tt></td>
<td>Bounds of canvas area in y</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">y_min_gr_zero</span></tt></td>
<td>smallest y greater zero (need in log plotting)</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">canvas</span></tt></td>
<td>Reference to the TCanvas instance</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">main_pad</span></tt></td>
<td>Reference to TPad instance</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">second_pad</span></tt></td>
<td>Reference to TPad instance or None</td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">first_drawn</span></tt></td>
<td>TObject which is first drawed (for valid TAxis reference)</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">legend</span></tt></td>
<td>Reference to TLegend object.</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="cmstoolsac3b.rendering.CanvasBuilder.configure">
<tt class="descname">configure</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#CanvasBuilder.configure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.CanvasBuilder.configure" title="Permalink to this definition">¶</a></dt>
<dd><p>Called at first. Can be used to initialize decorators.</p>
</dd></dl>
<dl class="method">
<dt id="cmstoolsac3b.rendering.CanvasBuilder.find_x_y_bounds">
<tt class="descname">find_x_y_bounds</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#CanvasBuilder.find_x_y_bounds"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.CanvasBuilder.find_x_y_bounds" title="Permalink to this definition">¶</a></dt>
<dd><p>Scan ROOT-objects for x and y bounds.</p>
</dd></dl>
<dl class="method">
<dt id="cmstoolsac3b.rendering.CanvasBuilder.make_empty_canvas">
<tt class="descname">make_empty_canvas</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#CanvasBuilder.make_empty_canvas"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.CanvasBuilder.make_empty_canvas" title="Permalink to this definition">¶</a></dt>
<dd><p>Instanciate <tt class="docutils literal"><span class="pre">self.canvas</span></tt> .</p>
</dd></dl>
<dl class="method">
<dt id="cmstoolsac3b.rendering.CanvasBuilder.draw_full_plot">
<tt class="descname">draw_full_plot</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#CanvasBuilder.draw_full_plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.CanvasBuilder.draw_full_plot" title="Permalink to this definition">¶</a></dt>
<dd><p>The renderers draw method is called.</p>
</dd></dl>
<dl class="method">
<dt id="cmstoolsac3b.rendering.CanvasBuilder.do_final_cosmetics">
<tt class="descname">do_final_cosmetics</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#CanvasBuilder.do_final_cosmetics"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.CanvasBuilder.do_final_cosmetics" title="Permalink to this definition">¶</a></dt>
<dd><p>Pimp the canvas!</p>
</dd></dl>
<dl class="method">
<dt id="cmstoolsac3b.rendering.CanvasBuilder.run_procedure">
<tt class="descname">run_procedure</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#CanvasBuilder.run_procedure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.CanvasBuilder.run_procedure" title="Permalink to this definition">¶</a></dt>
<dd><p>This method calls all other methods, which fill and build the canvas.</p>
</dd></dl>
<dl class="method">
<dt id="cmstoolsac3b.rendering.CanvasBuilder.build_canvas">
<tt class="descname">build_canvas</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#CanvasBuilder.build_canvas"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.CanvasBuilder.build_canvas" title="Permalink to this definition">¶</a></dt>
<dd><p>With this method, the building procedure is started.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><tt class="docutils literal"><span class="pre">CanvasWrapper</span></tt> instance.</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="decorators-for-canvasbuilder">
<h2>Decorators for CanvasBuilder<a class="headerlink" href="#decorators-for-canvasbuilder" title="Permalink to this headline">¶</a></h2>
<p>Decorators are the way to add content to canvases, like a legend, boxes, lines,
text, etc.. See <a class="reference internal" href="utilities.html#decorator-module"><em>Decorator</em></a> for details on the decorator
implementation. Apply as below (e.g. with a ‘Legend’ and a ‘TextBox’
Decorator):</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cb</span> <span class="o">=</span> <span class="n">CanvasBuilder</span><span class="p">(</span><span class="n">wrappers</span><span class="p">)</span>
<span class="n">cb</span> <span class="o">=</span> <span class="n">Legend</span><span class="p">(</span><span class="n">cb</span><span class="p">,</span> <span class="n">x1</span><span class="o">=</span><span class="mf">0.2</span><span class="p">,</span> <span class="n">x2</span><span class="o">=</span><span class="mf">0.5</span><span class="p">)</span>
<span class="n">cb</span> <span class="o">=</span> <span class="n">Textbox</span><span class="p">(</span><span class="n">cb</span><span class="p">,</span> <span class="n">text</span><span class="o">=</span><span class="s">"Some boxed Text"</span><span class="p">)</span>
<span class="n">canvas_wrp</span> <span class="o">=</span> <span class="n">cb</span><span class="o">.</span><span class="n">build_canvas</span><span class="p">()</span>
</pre></div>
</div>
<dl class="class">
<dt id="cmstoolsac3b.rendering.Legend">
<em class="property">class </em><tt class="descclassname">cmstoolsac3b.rendering.</tt><tt class="descname">Legend</tt><big>(</big><em>inner</em>, <em>dd='True'</em>, <em>**kws</em><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#Legend"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.Legend" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="utilities.html#cmstoolsac3b.decorator.Decorator" title="cmstoolsac3b.decorator.Decorator"><tt class="xref py py-class docutils literal"><span class="pre">cmstoolsac3b.decorator.Decorator</span></tt></a></p>
<p>Adds a legend to the main_pad.</p>
<p>Takes entries from <tt class="docutils literal"><span class="pre">self.main_pad.BuildLegend()</span></tt> .
The box height is adjusted by the number of legend entries.
No border or shadow are printed. See __init__ for keywords.</p>
<dl class="method">
<dt id="cmstoolsac3b.rendering.Legend.do_final_cosmetics">
<tt class="descname">do_final_cosmetics</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/cmstoolsac3b/rendering.html#Legend.do_final_cosmetics"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cmstoolsac3b.rendering.Legend.do_final_cosmetics" title="Permalink to this definition">¶</a></dt>
<dd><p>Only <tt class="docutils literal"><span class="pre">do_final_cosmetics</span></tt> is overwritten here.</p>
<p>If self.legend == None, this method will create a default legend and
store it to self.legend</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Canvas Rendering</a><ul>
<li><a class="reference internal" href="#renderers-for-wrapper-types">Renderers for wrapper types</a></li>
<li><a class="reference internal" href="#canvas-building">Canvas Building</a></li>
<li><a class="reference internal" href="#decorators-for-canvasbuilder">Decorators for CanvasBuilder</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="wrappers.html"
title="previous chapter">Wrapper types</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/rendering.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="wrappers.html" title="Wrapper types"
>previous</a> |</li>
<li><a href="index.html">CmsAnalysisAC3B 0.1.0 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2012, Heiner Tholen.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html> | gpl-3.0 |
jschnasse/regal-drupal | edoweb/js/edoweb.js | 13745 | /**
* Copyright 2013 hbz NRW (http://www.hbz-nrw.de/)
*
* This file is part of regal-drupal.
*
* regal-drupal is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* regal-drupal is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with regal-drupal. If not, see <http://www.gnu.org/licenses/>.
*/
(function($) {
var translations = {
}
/**
* Common behaviours
*/
Drupal.behaviors.edoweb = {
attach: function (context, settings) {
var home_href = Drupal.settings.basePath + 'resource';
if (document.location.pathname == home_href && '' != document.location.search) {
var query_params = [];
var all_params = document.location.search.substr(1).split('&');
$.each(all_params, function(i, param) {
if ('query[0][facets]' == param.substr(0, 16)) {
query_params.push(param);
}
});
if (query_params) {
sessionStorage.setItem('edoweb_search', '?' + query_params.join('&'));
}
} else if (document.location.pathname == home_href) {
sessionStorage.removeItem('edoweb_search');
}
if (search = sessionStorage.getItem('edoweb_search')) {
$('a[href="' + home_href + '"]').attr('href', home_href + search);
if ('resource' == Drupal.settings.edoweb.site_frontpage) {
$('a[href="/"]').attr('href', home_href + search);
}
}
/**
* Date parser for tablesort plugin
*/
$.tablesorter.addParser({
id: 'edowebDate',
is: function(s) {
return /^.*, /.test(s);
},
format: function(s, table, cell, cellIndex) {
return $(cell).closest('tr').attr('data-updated');
},
type: 'text'
});
/**
* Translations, these have to be defined here (i.e. in a behaviour)
* in order for Drupal.t to pick them up.
*/
translations['Add researchData'] = Drupal.t('Add researchData');
translations['Add monograph'] = Drupal.t('Add monograph');
translations['Add journal'] = Drupal.t('Add journal');
translations['Add volume'] = Drupal.t('Add volume');
translations['Add issue'] = Drupal.t('Add issue');
translations['Add article'] = Drupal.t('Add article');
translations['Add file'] = Drupal.t('Add file');
translations['Add part'] = Drupal.t('Add part');
translations['Add webpage'] = Drupal.t('Add webpage');
translations['Add version'] = Drupal.t('Add version');
}
}
/**
* Edoweb helper functions
*/
Drupal.edoweb = {
/**
* URI to CURIE
*/
compact_uri: function(uri) {
var namespaces = Drupal.settings.edoweb.namespaces;
for (prefix in namespaces) {
if (uri.indexOf(namespaces[prefix]) == 0) {
var local_part = uri.substring(namespaces[prefix].length);
return prefix + ':' + local_part;
}
}
return uri;
},
expand_curie: function(curie) {
var namespaces = Drupal.settings.edoweb.namespaces;
var curie_parts = curie.split(':');
for (prefix in namespaces) {
if (prefix == curie_parts[0]) {
return namespaces[prefix] + curie_parts[1];
}
}
},
t: function(string) {
if (string in translations) {
return translations[string];
} else {
return string;
}
},
/**
* Pending AJAX requests
*/
pending_requests: [],
/**
* Function loads a tabular view for a list of linked entities
*/
entity_table: function(field_items, operations, view_mode) {
view_mode = view_mode || 'default';
field_items.each(function() {
var container = $(this);
var curies = [];
container.find('a[data-curie]').each(function() {
curies.push(this.getAttribute('data-curie'));
});
var columns = container.find('a[data-target-bundle]')
.attr('data-target-bundle')
.split(' ')[0];
if (columns && curies.length > 0) {
container.siblings('table').remove();
var throbber = $('<div class="ajax-progress"><div class="throbber"> </div></div>')
container.before(throbber);
Drupal.edoweb.entity_list('edoweb_basic', curies, columns, view_mode).onload = function () {
if (this.status == 200) {
var result_table = $(this.responseText).find('table');
result_table.find('a[data-curie]').not('.resolved').not('.edoweb.download').each(function() {
Drupal.edoweb.entity_label($(this));
});
result_table.removeClass('sticky-enabled');
var updated_column = result_table.find('th[specifier="updated"]').index();
if (updated_column > -1) {
result_table.tablesorter({sortList: [[updated_column,1]]});
}
//TODO: check interference with tree navigation block
//Drupal.attachBehaviors(result_table);
container.find('div.field-item>a[data-curie]').each(function() {
if (! result_table.find('tr[data-curie="' + $(this).attr('data-curie') + '"]').length) {
var missing_entry = $(this).clone();
var row = $('<tr />');
result_table.find('thead').find('tr>th').each(function() {
row.append($('<td />'));
});
missing_entry.removeAttr('data-target-bundle');
row.find('td:eq(0)').append(missing_entry);
row.find('td:eq(1)').append(missing_entry.attr('data-curie'));
//FIXME: how to deal with this with configurable columns?
result_table.append(row);
}
});
container.hide();
container.after(result_table);
for (label in operations) {
operations[label](result_table);
}
Drupal.edoweb.last_modified_label(result_table);
Drupal.edoweb.hideEmptyTableColumns(result_table);
Drupal.edoweb.hideTableHeaders(result_table);
}
throbber.remove();
};
}
});
},
/**
* Function loads a tabular view for a list of linked entities
*/
entity_table_detail: function(field_items, operations, view_mode) {
view_mode = 'default';
field_items.each(function() {
var container = $(this);
var curies = [];
container.find('a[data-curie]').each(function() {
curies.push(this.getAttribute('data-curie'));
});
var columns = container.find('a[data-target-bundle]')
.attr('data-target-bundle')
.split(' ')[0];
if (columns && curies.length > 0) {
container.siblings('table').remove();
var throbber = $('<div class="ajax-progress"><div class="throbber"> </div></div>')
container.before(throbber);
Drupal.edoweb.entity_list_detail('edoweb_basic', curies, columns, view_mode).onload = function () {
if (this.status == 200) {
result_table = $(this.responseText).find('table');
result_table.find('a[data-curie]').not('.resolved').not('.edoweb.download').each(function() {
Drupal.edoweb.entity_label($(this));
});
result_table.removeClass('sticky-enabled');
var updated_column = result_table.find('th[specifier="updated"]').index();
if (updated_column > -1) {
result_table.tablesorter({sortList: [[updated_column,1]]});
}
//TODO: check interference with tree navigation block
//Drupal.attachBehaviors(result_table);
container.find('div.field-item>a[data-curie]').each(function() {
if (! result_table.find('tr[data-curie="' + $(this).attr('data-curie') + '"]').length) {
var missing_entry = $(this).clone();
var row = $('<tr />');
result_table.find('thead').find('tr>th').each(function() {
row.append($('<td />'));
});
missing_entry.removeAttr('data-target-bundle');
row.find('td:eq(0)').append(missing_entry);
row.find('td:eq(1)').append(missing_entry.attr('data-curie'));
//FIXME: how to deal with this with configurable columns?
result_table.append(row);
}
});
container.hide();
container.after(result_table);
container.after("<br/>");
for (label in operations) {
operations[label](result_table);
}
Drupal.edoweb.last_modified_label(result_table);
Drupal.edoweb.hideEmptyTableColumns(result_table);
Drupal.edoweb.hideTableHeaders(result_table);
}
throbber.remove();
};
}
});
},
/**
* Function returns an entities label.
*/
entity_label: function(element) {
var entity_type = 'edoweb_basic';
var entity_id = element.attr('data-curie');
if (cached_label = sessionStorage.getItem(entity_id)) {
element.text(cached_label);
} else {
$.get(Drupal.settings.basePath + 'edoweb_entity_label/' + entity_type + '/' + entity_id).onload = function() {
var label = this.status == 200 ? this.responseText : entity_id;
if (this.status == 200) {
sessionStorage.setItem(entity_id, label);
}
element.text(label);
element.addClass('resolved');
};
}
},
/**
* Function returns a list of entities.
*/
entity_list: function(entity_type, entity_curies, columns, view_mode) {
return $.get(Drupal.settings.basePath
+ 'edoweb_entity_list/'
+ entity_type
+ '/' + view_mode
+ '?' + $.param({'ids': entity_curies, 'columns': columns})
);
},
/**
* Function returns a list of entities.
*/
entity_list_detail: function(entity_type, entity_curies, columns, view_mode) {
return $.get(Drupal.settings.basePath
+ 'edoweb_entity_list_detail/'
+ entity_type
+ '/' + view_mode
+ '?' + $.param({'ids': entity_curies, 'columns': columns})
);
},
last_modified_label: function(container) {
$('a.edoweb.lastmodified', container).each(function() {
var link = $(this);
$.get(link.attr('href'), function(data) {
link.replaceWith($(data));
});
});
},
/**
* Hides table columns that do not contain any data
*/
hideEmptyTableColumns: function(table) {
// Hide table columns that do not contain any data
table.find('th').each(function(i) {
var remove = 0;
var tds = $(this).parents('table').find('tr td:nth-child(' + (i + 1) + ')')
tds.each(function(j) { if ($(this).text() == '') remove++; });
if (remove == (table.find('tr').length - 1)) {
$(this).hide();
tds.hide();
}
});
},
/**
* Hide the th of a table
*/
hideTableHeaders: function(table) {
if (!(table.parent().hasClass('field-name-field-edoweb-struct-child'))
&& !(table.hasClass('sticky-enabled'))
&& !(table.closest('form').length))
{
table.find('thead').hide();
}
},
blockUIMessage: {
message: '<div class="ajax-progress"><div class="throbber"> </div></div> Bitte warten...'
}
}
// AJAX navigation, if possible
if (window.history && history.pushState) {
Drupal.edoweb.navigateTo = function(href) {
var throbber = $('<div class="ajax-progress"><div class="throbber"> </div></div>');
$('#content').html(throbber);
$.ajax({
url: href,
complete: function(xmlHttp, status) {
throbber.remove();
var html = $(xmlHttp.response);
Drupal.attachBehaviors(html);
$('#content').replaceWith(html.find('#content'));
$('#breadcrumb').replaceWith(html.find('#breadcrumb'));
if ($('#messages').length) {
$('#messages').replaceWith(html.find('#messages'));
} else {
$('#header').after(html.find('#messages'));
}
document.title = html.filter('title').text();
$('.edoweb-tree li.active').removeClass('active');
$('.edoweb-tree li>a[href="' + location.pathname + '"]').closest('li').addClass('active');
}
});
};
if (!this.attached) {
history.replaceState({tree: true}, null, document.location);
window.addEventListener("popstate", function(e) {
if (e.state && e.state.tree) {
Drupal.edoweb.navigateTo(location.pathname);
if (Drupal.edoweb.refreshTree) {
Drupal.edoweb.refreshTree();
}
}
});
this.attached = true;
}
} else {
Drupal.edoweb.navigateTo = function(href) {
window.location = href;
};
}
})(jQuery);
| gpl-3.0 |
joergoster/cutechess | projects/lib/src/sprt.cpp | 4340 | /*
This file is part of Cute Chess.
Copyright (C) 2008-2018 Cute Chess authors
Cute Chess is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Cute Chess is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sprt.h"
#include <cmath>
#include <QtGlobal>
class BayesElo;
class SprtProbability;
class BayesElo
{
public:
BayesElo(double bayesElo, double drawElo);
BayesElo(const SprtProbability& p);
double bayesElo() const;
double drawElo() const;
double scale() const;
private:
double m_bayesElo;
double m_drawElo;
};
class SprtProbability
{
public:
SprtProbability(int wins, int losses, int draws);
SprtProbability(const BayesElo& b);
bool isValid() const;
double pWin() const;
double pLoss() const;
double pDraw() const;
private:
double m_pWin;
double m_pLoss;
double m_pDraw;
};
BayesElo::BayesElo(double bayesElo, double drawElo)
: m_bayesElo(bayesElo),
m_drawElo(drawElo)
{
}
BayesElo::BayesElo(const SprtProbability& p)
{
Q_ASSERT(p.isValid());
m_bayesElo = 200.0 * std::log10(p.pWin() / p.pLoss() *
(1.0 - p.pLoss()) / (1.0 - p.pWin()));
m_drawElo = 200.0 * std::log10((1.0 - p.pLoss()) / p.pLoss() *
(1.0 - p.pWin()) / p.pWin());
}
double BayesElo::bayesElo() const
{
return m_bayesElo;
}
double BayesElo::drawElo() const
{
return m_drawElo;
}
double BayesElo::scale() const
{
const double x = std::pow(10.0, -m_drawElo / 400.0);
return 4.0 * x / ((1.0 + x) * (1.0 + x));
}
SprtProbability::SprtProbability(int wins, int losses, int draws)
{
Q_ASSERT(wins > 0 && losses > 0 && draws > 0);
const int count = wins + losses + draws;
m_pWin = double(wins) / count;
m_pLoss = double(losses) / count;
m_pDraw = 1.0 - m_pWin - m_pLoss;
}
SprtProbability::SprtProbability(const BayesElo& b)
{
m_pWin = 1.0 / (1.0 + std::pow(10.0, (b.drawElo() - b.bayesElo()) / 400.0));
m_pLoss = 1.0 / (1.0 + std::pow(10.0, (b.drawElo() + b.bayesElo()) / 400.0));
m_pDraw = 1.0 - m_pWin - m_pLoss;
}
bool SprtProbability::isValid() const
{
return 0.0 < m_pWin && m_pWin < 1.0 &&
0.0 < m_pLoss && m_pLoss < 1.0 &&
0.0 < m_pDraw && m_pDraw < 1.0;
}
double SprtProbability::pWin() const
{
return m_pWin;
}
double SprtProbability::pLoss() const
{
return m_pLoss;
}
double SprtProbability::pDraw() const
{
return m_pDraw;
}
Sprt::Sprt()
: m_elo0(0),
m_elo1(0),
m_alpha(0),
m_beta(0),
m_wins(0),
m_losses(0),
m_draws(0)
{
}
bool Sprt::isNull() const
{
return m_elo0 == 0 && m_elo1 == 0 && m_alpha == 0 && m_beta == 0;
}
void Sprt::initialize(double elo0, double elo1,
double alpha, double beta)
{
m_elo0 = elo0;
m_elo1 = elo1;
m_alpha = alpha;
m_beta = beta;
}
Sprt::Status Sprt::status() const
{
Status status = {
Continue,
0.0,
0.0,
0.0
};
if (m_wins <= 0 || m_losses <= 0 || m_draws <= 0)
return status;
// Estimate draw_elo out of sample
const SprtProbability p(m_wins, m_losses, m_draws);
const BayesElo b(p);
// Probability laws under H0 and H1
const double s = b.scale();
const BayesElo b0(m_elo0 / s, b.drawElo());
const BayesElo b1(m_elo1 / s, b.drawElo());
const SprtProbability p0(b0), p1(b1);
// Log-Likelyhood Ratio
status.llr = m_wins * std::log(p1.pWin() / p0.pWin()) +
m_losses * std::log(p1.pLoss() / p0.pLoss()) +
m_draws * std::log(p1.pDraw() / p0.pDraw());
// Bounds based on error levels of the test
status.lBound = std::log(m_beta / (1.0 - m_alpha));
status.uBound = std::log((1.0 - m_beta) / m_alpha);
if (status.llr > status.uBound)
status.result = AcceptH1;
else if (status.llr < status.lBound)
status.result = AcceptH0;
return status;
}
void Sprt::addGameResult(GameResult result)
{
if (result == Win)
m_wins++;
else if (result == Draw)
m_draws++;
else if (result == Loss)
m_losses++;
}
| gpl-3.0 |
obiba/mica2 | mica-webapp/src/main/webapp/app/contact/contact-service.js | 3513 | /*
* Copyright (c) 2018 OBiBa. All rights reserved.
*
* This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
'use strict';
mica.contact
.factory('ContactsSearchResource', ['$resource', 'ContactSerializationService',
function ($resource, ContactSerializationService) {
return $resource(contextPath + '/ws/draft/persons/_search?', {}, {
'search': {
method: 'GET',
params: {query: '@query', 'exclude': '@exclude'},
transformResponse: ContactSerializationService.deserializeList,
errorHandler: true
}
});
}])
.factory('PersonResource', ['$resource', function ($resource) {
return $resource(contextPath + '/ws/draft/person/:id', {}, {
'get': {method: 'GET', params: {id: '@id'}},
'update': {method: 'PUT', params: {id: '@id'}},
'delete': {method: 'DELETE', params: {id: '@id'}},
'create': {url: contextPath + '/ws/draft/persons', method: 'POST'},
'getStudyMemberships': {url: contextPath + '/ws/draft/persons/study/:studyId', method: 'GET', isArray: true, params: {studyId: '@studyId'}},
'getNetworkMemberships': {url: contextPath + '/ws/draft/persons/network/:networkId', method: 'GET', isArray: true, params: {networkId: '@networkId'}}
});
}])
.factory('ContactSerializationService', ['LocalizedValues',
function (LocalizedValues) {
var it = this;
this.serialize = function(person) {
if (person.institution) {
person.institution.name = LocalizedValues.objectToArray(person.institution.name);
person.institution.department = LocalizedValues.objectToArray(person.institution.department);
if (person.institution.address) {
person.institution.address.street = LocalizedValues.objectToArray(person.institution.address.street);
person.institution.address.city = LocalizedValues.objectToArray(person.institution.address.city);
if (person.institution.address.country) {
person.institution.address.country = {'iso': person.institution.address.country};
}
}
}
return person;
};
this.deserializeList = function (personsList) {
personsList = angular.fromJson(personsList);
if (personsList.persons) {
personsList.persons = personsList.persons.map(function (person) {
return it.deserialize(person);
});
}
return personsList;
};
this.deserialize = function(person) {
person = angular.copy(person);
if (person.institution) {
person.institution.name = LocalizedValues.arrayToObject(person.institution.name);
person.institution.department = LocalizedValues.arrayToObject(person.institution.department);
if (person.institution.address) {
person.institution.address.street = LocalizedValues.arrayToObject(person.institution.address.street);
person.institution.address.city = LocalizedValues.arrayToObject(person.institution.address.city);
if (person.institution.address.country) {
person.institution.address.country = person.institution.address.country.iso;
}
}
}
return person;
};
return this;
}]);
| gpl-3.0 |
jjs0sbw/CSPLN | test/update_test_subreadme.py | 3717 | # -*- coding: utf-8 -*-
"""
<license>
CSPLN_MaryKeelerEdition; Manages images to which notes can be added.
Copyright (C) 2015, Thomas Kercheval
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
___________________________________________________________</license>
Description:
Updates README.txt file in the specified directory.
Inputs:
Functions that are in the specified directory.
discover_functions() detects them automatically.
Outputs:
README.txt file, with Scope&&Details listed.
Covers functions in specified directory.
Currently:
To Do:
Done:
Update readme file with current functions&&their docstrings.
"""
import os
def discover_functions(directory):
"""Discorvers python modules in current directory."""
function_names = []
curr_dir = os.listdir(directory)
for name in curr_dir:
if name[-3:] == '.py':
function_names.append(str(name))
return function_names
def grab_docstrings(directory):
""""Grabs the docstrings of all python modules specified."""
import ast
docstrings = {}
for name in discover_functions(directory):
path_name = os.path.join(directory, name)
thing = ast.parse(''.join(open(path_name)))
docstring = ast.get_docstring(thing)
docstrings[name] = docstring
return docstrings
def create_readme(doc_dic, directory):
"""Strips off license statement, formats readme, returns readme text."""
end_lisence = "</license>"
scope = '''Scope:
{}'''
details = '''Details:{}'''
scopelist = []
detaillist = []
scopestuff = ''
detailstuff = ''
# Now to create the contents of the README...
for script in doc_dic.keys().sort():
print " Creating readme entry for: {}...".format(script)
if doc_dic[script] == None:
print " But it has no docstring..."
continue
scopelist.append(script+'\n ')
docstring = doc_dic[script].replace('\n', '\n ')
doc_index = docstring.find(end_lisence) + 11
# Stripping off the license in the docstring...
docstring = docstring[doc_index:]
detaillist.append('\n\n'+script+'\n')
detaillist.append(' '+docstring)
for item in scopelist:
scopestuff += item
for ano_item in detaillist:
detailstuff += ano_item
# Now to put the contents in their correct place...
readme = (scope.format(scopestuff[:-4]) + '\n'
+ details.format(detailstuff) + '\n')
# And write the README in its directory...
write_readme(readme, directory)
return None
def write_readme(r_text, directory):
"""Writes the readme!"""
readme_path = os.path.join(directory, 'subreadme.txt')
with open(readme_path, 'w') as readme:
readme.write(r_text)
return None
def update_readme(directory):
"""Updates the readme everytime this script is called."""
documentation_dict = grab_docstrings(directory)
create_readme(documentation_dict, directory)
return None
if __name__ == "__main__":
CURR_DIR = os.path.abspath(os.path.dirname(__file__))
update_readme(CURR_DIR)
| gpl-3.0 |
kariminf/AS_preProcess_plugins | docs/kariminf/langpi/basic/indonesian/IdInfo.html | 12720 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Tue Mar 28 17:38:09 CET 2017 -->
<title>IdInfo (LangPi 1.1.1 API)</title>
<meta name="date" content="2017-03-28">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IdInfo (LangPi 1.1.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../kariminf/langpi/basic/indonesian/IdNormalizer.html" title="class in kariminf.langpi.basic.indonesian"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?kariminf/langpi/basic/indonesian/IdInfo.html" target="_top">Frames</a></li>
<li><a href="IdInfo.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>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>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">kariminf.langpi.basic.indonesian</div>
<h2 title="Class IdInfo" class="title">Class IdInfo</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>kariminf.langpi.basic.indonesian.IdInfo</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../kariminf/langpi/basic/BasicInfo.html" title="interface in kariminf.langpi.basic">BasicInfo</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">IdInfo</span>
extends java.lang.Object
implements <a href="../../../../kariminf/langpi/basic/BasicInfo.html" title="interface in kariminf.langpi.basic">BasicInfo</a></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.kariminf.langpi.basic.BasicInfo">
<!-- -->
</a>
<h3>Fields inherited from interface kariminf.langpi.basic.<a href="../../../../kariminf/langpi/basic/BasicInfo.html" title="interface in kariminf.langpi.basic">BasicInfo</a></h3>
<code><a href="../../../../kariminf/langpi/basic/BasicInfo.html#version">version</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../kariminf/langpi/basic/indonesian/IdInfo.html#IdInfo--">IdInfo</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../kariminf/langpi/basic/indonesian/IdInfo.html#getClassPrefix--">getClassPrefix</a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../kariminf/langpi/basic/indonesian/IdInfo.html#getIndicator--">getIndicator</a></span>()</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../kariminf/langpi/basic/indonesian/IdInfo.html#getLangEnglishName--">getLangEnglishName</a></span>()</code>
<div class="block">Returns the English name of the language, for example "Arabic".</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../kariminf/langpi/basic/indonesian/IdInfo.html#getLangName--">getLangName</a></span>()</code>
<div class="block">Returns the original name of the language, for example: "العربية".</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="IdInfo--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>IdInfo</h4>
<pre>public IdInfo()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getIndicator--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIndicator</h4>
<pre>public java.lang.String getIndicator()</pre>
</li>
</ul>
<a name="getLangEnglishName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLangEnglishName</h4>
<pre>public java.lang.String getLangEnglishName()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../kariminf/langpi/basic/BasicInfo.html#getLangEnglishName--">BasicInfo</a></code></span></div>
<div class="block">Returns the English name of the language, for example "Arabic".</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../kariminf/langpi/basic/BasicInfo.html#getLangEnglishName--">getLangEnglishName</a></code> in interface <code><a href="../../../../kariminf/langpi/basic/BasicInfo.html" title="interface in kariminf.langpi.basic">BasicInfo</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>English name of the language</dd>
</dl>
</li>
</ul>
<a name="getLangName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLangName</h4>
<pre>public java.lang.String getLangName()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../kariminf/langpi/basic/BasicInfo.html#getLangName--">BasicInfo</a></code></span></div>
<div class="block">Returns the original name of the language, for example: "العربية".</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../kariminf/langpi/basic/BasicInfo.html#getLangName--">getLangName</a></code> in interface <code><a href="../../../../kariminf/langpi/basic/BasicInfo.html" title="interface in kariminf.langpi.basic">BasicInfo</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>language's name with the original alphabet</dd>
</dl>
</li>
</ul>
<a name="getClassPrefix--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getClassPrefix</h4>
<pre>public java.lang.String getClassPrefix()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../kariminf/langpi/basic/indonesian/IdNormalizer.html" title="class in kariminf.langpi.basic.indonesian"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?kariminf/langpi/basic/indonesian/IdInfo.html" target="_top">Frames</a></li>
<li><a href="IdInfo.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>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>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| gpl-3.0 |
ckpp/edusys | src/edusys/domain/src/main/java/org/labcrypto/edusys/domain/jpa/dao/membership/TokenDao.java | 324 | package org.labcrypto.edusys.domain.jpa.dao.membership;
import org.labcrypto.edusys.domain.jpa.dao.EntityDao;
import org.labcrypto.edusys.domain.jpa.entity.membership.Token;
public interface TokenDao extends EntityDao<Token> {
Token getLatestActiveToken(Long userId);
Token getTokenByValue(String tokenValue);
}
| gpl-3.0 |
juergenhamel/cuon | api/html/cuon.Addresses.SingleAddress-module.html | 5558 | <?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>cuon.Addresses.SingleAddress</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<th class="navbar" width="100%"></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="cuon-module.html">Package cuon</a> ::
<a href="cuon.Addresses-module.html">Package Addresses</a> ::
Module SingleAddress
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>] | <a href="cuon.Addresses.SingleAddress-module.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module SingleAddress</h1><p class="nomargin-top"><span class="codelink"><a href="cuon.Addresses.SingleAddress-pysrc.html">source code</a></span></p>
<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Classes</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Classes"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="cuon.Addresses.SingleAddress.SingleAddress-class.html" class="summary-name">SingleAddress</a>
</td>
</tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Variables</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Variables"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'cuon.Addresses'"><code class="variable-quote">'</code><code class="variable-string">cuon.Addresses</code><code class="variable-quote">'</code></code>
</td>
</tr>
</table>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<th class="navbar" width="100%"></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Fri Feb 11 22:17:02 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
| gpl-3.0 |
tomeshnet/prototype-cjdns-pi | contrib/ramdisk-overlay/raspbian.sh | 718 | #!/bin/sh
wget https://github.com/jacobalberty/root-ro/raw/master/root-ro
wget https://github.com/jacobalberty/root-ro/raw/master/raspi-gpio
chmod 0755 root-ro
chmod 0755 raspi-gpio
sudo mv root-ro /etc/initramfs-tools/scripts/init-bottom
sudo mv raspi-gpio /etc/initramfs-tools/hooks
echo overlay | sudo tee --append /etc/initramfs-tools/modules > /dev/null
sudo apt-get install -y raspi-gpio
sudo mkinitramfs -o /boot/initrd
sudo cat <<"EOF" | sudo tee --append /boot/config.txt > /dev/null
initramfs initrd followkernel
ramfsfile=initrd
ramfsaddr=-1
EOF
sudo sed -i -e '/rootwait/s/$/ root-ro-driver=overlay root-rw-pin=21/' /boot/cmdline.txt
| gpl-3.0 |
neilmayhew/pathway | DistFiles/Template/Scripture/Flex.css | 5096 | /* Cascading Style Sheet generated by TE version 2.5.0.3339 on Wednesday, February 11, 2009 10:49 AM */
@page {
counter-increment: page;
height: 11in;
width: 8.5in;
margin: 72pt 72pt 72pt 72pt;
@top-left { content: ''; }
@top-center {
//content: string(bookname, last) string(chapter, last):string(verse, last) ;
direction: ltr;
font-family: "Arial", sans-serif; /* default Sans-Serif font */
}
@top-right {
content: counter(page) ;
direction: ltr;
font-family: "Arial", sans-serif; /* default Sans-Serif font */
}
@bottom-left { content: ''; }
@bottom-center { content: ''; }
@bottom-right { content: ''; }
}
@page :left {
@top-left {
content: counter(page) ;
direction: ltr;
font-family: "Arial", sans-serif; /* default Sans-Serif font */
}
@top-center {
//content: string(bookname, first) string(chapter, first):string(verse, first) ;
direction: ltr;
font-family: "Arial", sans-serif; /* default Sans-Serif font */
}
@top-right { content: ''; }
@bottom-left { content: ''; }
@bottom-center { content: ''; }
@bottom-right { content: ''; }
}
@page :first {
@top-left { content: ''; }
@top-center { content: ''; }
@top-right { content: ''; }
@bottom-left { content: ''; }
@bottom-center {
content: counter(page) ;
direction: ltr;
font-family: "Arial", sans-serif; /* default Sans-Serif font */
}
@bottom-right { content: ''; }
}
.Chapter_Head {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 20pt; /* cascaded environment */
font-weight: bold; /* cascaded environment */
font-style: normal; /* cascaded environment */
text-align: center;
color: #FF6600;
}
.Chapter_Number {
font-family: "Times New Roman", serif; /* default Serif font */
font-size: 200%;
font-weight: bolder;
vertical-align: top;
float: left;
string-set: chapter content();
color: #666666;
}
.Intro_Paragraph {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 9pt; /* cascaded environment */
line-height: 11pt;
color: #3333CC;
}
.Intro_Section_Head {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 8pt; /* cascaded environment */
font-weight: bold; /* cascaded environment */
font-style: normal; /* cascaded environment */
/*text-align: leading;*/
line-height: 11pt;
}
.Note_General_Paragraph {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 8pt; /* cascaded environment */
line-height: normal;
}
.Paragraph {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 18pt; /* cascaded environment */
text-indent: 12pt;
line-height: 20pt;
color: #000099;
}
.Paragraph[lang='en'] {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 18pt; /* cascaded environment */
text-indent: 12pt;
line-height: 20pt;
}
.picture {
height: 1.0in;
}
.pictureCaption {
}
.pictureCenter {
float: center;
margin: 0pt 0pt 4pt 4pt;
padding: 2pt;
text-indent: 0pt;
text-align: center;
}
.scrBody {
}
.scrBook {
column-count: 1;
clear: both;
}
.scrBookName {
string-set: bookname content();
display: none;
}
.scrFootnoteMarker {
font-size: smaller;
font-weight: bolder;
vertical-align: super;
}
.scrIntroSection {
text-align: left;
}
.scrSection {
text-align: left;
}
.Section_Head {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 20pt; /* cascaded environment */
font-weight: bold; /* cascaded environment */
font-style: normal; /* cascaded environment */
text-align: center;
line-height: 20pt;
padding-bottom: 4pt;
padding-top: 8pt;
color: #CC3333;
}
.Section_Head_Major {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 20pt; /* cascaded environment */
font-weight: bold; /* cascaded environment */
font-style: normal; /* cascaded environment */
text-align: center;
}
.Title_Main {
font-family: "Charis SIL", serif; /* cascaded environment */
font-size: 24pt; /* cascaded environment */
font-weight: bold; /* cascaded environment */
font-style: italic; /* cascaded environment */
text-align: center;
line-height: 24pt;
padding-bottom: 12pt;
padding-top: 36pt;
color: #CC0066;
border-bottom: 4pt #006633 solid;
}
.Verse_Number {
font-family: "Times New Roman", serif; /* default Serif font */
font-size: smaller;
vertical-align: super; /* cascaded environment */
string-set: verse content();
}
.Verse_Number_Alternate {
font-family: "Times New Roman", serif; /* default Serif font */
vertical-align: super; /* cascaded environment */
}
| gpl-3.0 |
freecores/usb_fpga_1_2 | examples/all/ucecho/ucecho.c | 2155 | /*!
ucecho -- uppercase conversion example for all EZ-USB devices
Copyright (C) 2009-2011 ZTEX GmbH.
http://www.ztex.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see http://www.gnu.org/licenses/.
!*/
#include[ztex-conf.h] // Loads the configuration macros, see ztex-conf.h for the available macros
#include[ztex-utils.h] // include basic functions
// define endpoints 2 and 4, both belong to interface 0 (in/out are from the point of view of the host)
EP_CONFIG(2,0,BULK,IN,512,2);
EP_CONFIG(4,0,BULK,OUT,512,2);
// this product string is also used for identification by the host software
#define[PRODUCT_STRING]["ucecho for EZ-USB devices"]
// include the main part of the firmware kit, define the descriptors, ...
#include[ztex.h]
void main(void)
{
WORD i,size;
BYTE b;
// init everything
init_USB();
EP2CS &= ~bmBIT0; // stall = 0
SYNCDELAY;
EP4CS &= ~bmBIT0; // stall = 0
SYNCDELAY; // first two packages are waste
EP4BCL = 0x80; // skip package, (re)arm EP4
SYNCDELAY;
EP4BCL = 0x80; // skip package, (re)arm EP4
while (1) {
if ( !(EP4CS & bmBIT2) ) { // EP4 is not empty
size = (EP4BCH << 8) | EP4BCL;
if ( size>0 && size<=512 && !(EP2CS & bmBIT3)) { // EP2 is not full
for ( i=0; i<size; i++ ) {
b = EP4FIFOBUF[i]; // data from EP4 ...
if ( b>=(BYTE)'a' && b<=(BYTE)'z' ) // ... is converted to uppercase ...
b-=32;
EP2FIFOBUF[i] = b; // ... and written back to EP2 buffer
}
EP2BCH = size >> 8;
SYNCDELAY;
EP2BCL = size & 255; // arm EP2
}
SYNCDELAY;
EP4BCL = 0x80; // skip package, (re)arm EP4
}
}
}
| gpl-3.0 |
teemuatlut/Marlin | Marlin/src/gcode/feature/trinamic/M911-M914.cpp | 12013 | /**
* Marlin 3D Printer Firmware
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_TRINAMIC
#include "../../gcode.h"
#include "../../../feature/tmc_util.h"
#include "../../../module/stepper_indirection.h"
#include "../../../module/planner.h"
#include "../../queue.h"
#if ENABLED(MONITOR_DRIVER_STATUS)
#define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2160) || AXIS_DRIVER_TYPE(ST, TMC2208) || AXIS_DRIVER_TYPE(ST, TMC2660) || AXIS_DRIVER_TYPE(ST, TMC5130) || AXIS_DRIVER_TYPE(ST, TMC5160))
#define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N))
#define M91x_SOME_X (M91x_USE(X) || M91x_USE(X2))
#define M91x_SOME_Y (M91x_USE(Y) || M91x_USE(Y2))
#define M91x_SOME_Z (M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3))
#define M91x_SOME_E (M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5))
#if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_SOME_E
#error "MONITOR_DRIVER_STATUS requires at least one TMC2130, TMC2208, or TMC2660."
#endif
/**
* M911: Report TMC stepper driver overtemperature pre-warn flag
* This flag is held by the library, persisting until cleared by M912
*/
void GcodeSuite::M911() {
#if M91x_USE(X)
tmc_report_otpw(stepperX);
#endif
#if M91x_USE(X2)
tmc_report_otpw(stepperX2);
#endif
#if M91x_USE(Y)
tmc_report_otpw(stepperY);
#endif
#if M91x_USE(Y2)
tmc_report_otpw(stepperY2);
#endif
#if M91x_USE(Z)
tmc_report_otpw(stepperZ);
#endif
#if M91x_USE(Z2)
tmc_report_otpw(stepperZ2);
#endif
#if M91x_USE(Z3)
tmc_report_otpw(stepperZ3);
#endif
#if M91x_USE_E(0)
tmc_report_otpw(stepperE0);
#endif
#if M91x_USE_E(1)
tmc_report_otpw(stepperE1);
#endif
#if M91x_USE_E(2)
tmc_report_otpw(stepperE2);
#endif
#if M91x_USE_E(3)
tmc_report_otpw(stepperE3);
#endif
#if M91x_USE_E(4)
tmc_report_otpw(stepperE4);
#endif
#if M91x_USE_E(5)
tmc_report_otpw(stepperE5);
#endif
}
/**
* M912: Clear TMC stepper driver overtemperature pre-warn flag held by the library
* Specify one or more axes with X, Y, Z, X1, Y1, Z1, X2, Y2, Z2, Z3 and E[index].
* If no axes are given, clear all.
*
* Examples:
* M912 X ; clear X and X2
* M912 X1 ; clear X1 only
* M912 X2 ; clear X2 only
* M912 X E ; clear X, X2, and all E
* M912 E1 ; clear E1 only
*/
void GcodeSuite::M912() {
#if M91x_SOME_X
const bool hasX = parser.seen(axis_codes[X_AXIS]);
#else
constexpr bool hasX = false;
#endif
#if M91x_SOME_Y
const bool hasY = parser.seen(axis_codes[Y_AXIS]);
#else
constexpr bool hasY = false;
#endif
#if M91x_SOME_Z
const bool hasZ = parser.seen(axis_codes[Z_AXIS]);
#else
constexpr bool hasZ = false;
#endif
#if M91x_SOME_E
const bool hasE = parser.seen(axis_codes[E_AXIS]);
#else
constexpr bool hasE = false;
#endif
const bool hasNone = !hasX && !hasY && !hasZ && !hasE;
#if M91x_SOME_X
const int8_t xval = int8_t(parser.byteval(axis_codes[X_AXIS], 0xFF));
#if M91x_USE(X)
if (hasNone || xval == 1 || (hasX && xval < 0)) tmc_clear_otpw(stepperX);
#endif
#if M91x_USE(X2)
if (hasNone || xval == 2 || (hasX && xval < 0)) tmc_clear_otpw(stepperX2);
#endif
#endif
#if M91x_SOME_Y
const int8_t yval = int8_t(parser.byteval(axis_codes[Y_AXIS], 0xFF));
#if M91x_USE(Y)
if (hasNone || yval == 1 || (hasY && yval < 0)) tmc_clear_otpw(stepperY);
#endif
#if M91x_USE(Y2)
if (hasNone || yval == 2 || (hasY && yval < 0)) tmc_clear_otpw(stepperY2);
#endif
#endif
#if M91x_SOME_Z
const int8_t zval = int8_t(parser.byteval(axis_codes[Z_AXIS], 0xFF));
#if M91x_USE(Z)
if (hasNone || zval == 1 || (hasZ && zval < 0)) tmc_clear_otpw(stepperZ);
#endif
#if M91x_USE(Z2)
if (hasNone || zval == 2 || (hasZ && zval < 0)) tmc_clear_otpw(stepperZ2);
#endif
#if M91x_USE(Z3)
if (hasNone || zval == 3 || (hasZ && zval < 0)) tmc_clear_otpw(stepperZ3);
#endif
#endif
#if M91x_SOME_E
const int8_t eval = int8_t(parser.byteval(axis_codes[E_AXIS], 0xFF));
#if M91x_USE_E(0)
if (hasNone || eval == 0 || (hasE && eval < 0)) tmc_clear_otpw(stepperE0);
#endif
#if M91x_USE_E(1)
if (hasNone || eval == 1 || (hasE && eval < 0)) tmc_clear_otpw(stepperE1);
#endif
#if M91x_USE_E(2)
if (hasNone || eval == 2 || (hasE && eval < 0)) tmc_clear_otpw(stepperE2);
#endif
#if M91x_USE_E(3)
if (hasNone || eval == 3 || (hasE && eval < 0)) tmc_clear_otpw(stepperE3);
#endif
#if M91x_USE_E(4)
if (hasNone || eval == 4 || (hasE && eval < 0)) tmc_clear_otpw(stepperE4);
#endif
#if M91x_USE_E(5)
if (hasNone || eval == 5 || (hasE && eval < 0)) tmc_clear_otpw(stepperE5);
#endif
#endif
}
#endif // MONITOR_DRIVER_STATUS
/**
* M913: Set HYBRID_THRESHOLD speed.
*/
#if ENABLED(HYBRID_THRESHOLD)
void GcodeSuite::M913() {
#define TMC_SAY_PWMTHRS(A,Q) tmc_print_pwmthrs(stepper##Q)
#define TMC_SET_PWMTHRS(A,Q) stepper##Q.set_pwm_thrs(value)
#define TMC_SAY_PWMTHRS_E(E) tmc_print_pwmthrs(stepperE##E)
#define TMC_SET_PWMTHRS_E(E) stepperE##E.set_pwm_thrs(value)
bool report = true;
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3)
const uint8_t index = parser.byteval('I');
#endif
LOOP_XYZE(i) if (int32_t value = parser.longval(axis_codes[i])) {
report = false;
switch (i) {
case X_AXIS:
#if AXIS_HAS_STEALTHCHOP(X)
if (index < 2) TMC_SET_PWMTHRS(X,X);
#endif
#if AXIS_HAS_STEALTHCHOP(X2)
if (!(index & 1)) TMC_SET_PWMTHRS(X,X2);
#endif
break;
case Y_AXIS:
#if AXIS_HAS_STEALTHCHOP(Y)
if (index < 2) TMC_SET_PWMTHRS(Y,Y);
#endif
#if AXIS_HAS_STEALTHCHOP(Y2)
if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2);
#endif
break;
case Z_AXIS:
#if AXIS_HAS_STEALTHCHOP(Z)
if (index < 2) TMC_SET_PWMTHRS(Z,Z);
#endif
#if AXIS_HAS_STEALTHCHOP(Z2)
if (index == 0 || index == 2) TMC_SET_PWMTHRS(Z,Z2);
#endif
#if AXIS_HAS_STEALTHCHOP(Z3)
if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3);
#endif
break;
case E_AXIS: {
#if E_STEPPERS
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
switch (target_extruder) {
#if AXIS_HAS_STEALTHCHOP(E0)
case 0: TMC_SET_PWMTHRS_E(0); break;
#endif
#if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
case 1: TMC_SET_PWMTHRS_E(1); break;
#endif
#if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
case 2: TMC_SET_PWMTHRS_E(2); break;
#endif
#if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
case 3: TMC_SET_PWMTHRS_E(3); break;
#endif
#if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
case 4: TMC_SET_PWMTHRS_E(4); break;
#endif
#if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
case 5: TMC_SET_PWMTHRS_E(5); break;
#endif
}
#endif // E_STEPPERS
} break;
}
}
if (report) {
#if AXIS_HAS_STEALTHCHOP(X)
TMC_SAY_PWMTHRS(X,X);
#endif
#if AXIS_HAS_STEALTHCHOP(X2)
TMC_SAY_PWMTHRS(X,X2);
#endif
#if AXIS_HAS_STEALTHCHOP(Y)
TMC_SAY_PWMTHRS(Y,Y);
#endif
#if AXIS_HAS_STEALTHCHOP(Y2)
TMC_SAY_PWMTHRS(Y,Y2);
#endif
#if AXIS_HAS_STEALTHCHOP(Z)
TMC_SAY_PWMTHRS(Z,Z);
#endif
#if AXIS_HAS_STEALTHCHOP(Z2)
TMC_SAY_PWMTHRS(Z,Z2);
#endif
#if AXIS_HAS_STEALTHCHOP(Z3)
TMC_SAY_PWMTHRS(Z,Z3);
#endif
#if E_STEPPERS && AXIS_HAS_STEALTHCHOP(E0)
TMC_SAY_PWMTHRS_E(0);
#endif
#if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
TMC_SAY_PWMTHRS_E(1);
#endif
#if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
TMC_SAY_PWMTHRS_E(2);
#endif
#if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
TMC_SAY_PWMTHRS_E(3);
#endif
#if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
TMC_SAY_PWMTHRS_E(4);
#endif
#if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5)
TMC_SAY_PWMTHRS_E(5);
#endif
}
}
#endif // HYBRID_THRESHOLD
/**
* M914: Set StallGuard sensitivity.
*/
#if USE_SENSORLESS
void GcodeSuite::M914() {
bool report = true;
const uint8_t index = parser.byteval('I');
LOOP_XYZ(i) if (parser.seen(axis_codes[i])) {
const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63);
report = false;
switch (i) {
#if X_SENSORLESS
case X_AXIS:
#if AXIS_HAS_STALLGUARD(X)
if (index < 2) stepperX.sgt(value);
#endif
#if AXIS_HAS_STALLGUARD(X2)
if (!(index & 1)) stepperX2.sgt(value);
#endif
break;
#endif
#if Y_SENSORLESS
case Y_AXIS:
#if AXIS_HAS_STALLGUARD(Y)
if (index < 2) stepperY.sgt(value);
#endif
#if AXIS_HAS_STALLGUARD(Y2)
if (!(index & 1)) stepperY2.sgt(value);
#endif
break;
#endif
#if Z_SENSORLESS
case Z_AXIS:
#if AXIS_HAS_STALLGUARD(Z)
if (index < 2) stepperZ.sgt(value);
#endif
#if AXIS_HAS_STALLGUARD(Z2)
if (index == 0 || index == 2) stepperZ2.sgt(value);
#endif
#if AXIS_HAS_STALLGUARD(Z3)
if (index == 0 || index == 3) stepperZ3.sgt(value);
#endif
break;
#endif
}
}
if (report) {
#if X_SENSORLESS
#if AXIS_HAS_STALLGUARD(X)
tmc_print_sgt(stepperX);
#endif
#if AXIS_HAS_STALLGUARD(X2)
tmc_print_sgt(stepperX2);
#endif
#endif
#if Y_SENSORLESS
#if AXIS_HAS_STALLGUARD(Y)
tmc_print_sgt(stepperY);
#endif
#if AXIS_HAS_STALLGUARD(Y2)
tmc_print_sgt(stepperY2);
#endif
#endif
#if Z_SENSORLESS
#if AXIS_HAS_STALLGUARD(Z)
tmc_print_sgt(stepperZ);
#endif
#if AXIS_HAS_STALLGUARD(Z2)
tmc_print_sgt(stepperZ2);
#endif
#if AXIS_HAS_STALLGUARD(Z3)
tmc_print_sgt(stepperZ3);
#endif
#endif
}
}
#endif // USE_SENSORLESS
#endif // HAS_TRINAMIC
| gpl-3.0 |
IndustriaLeuven/dolibarr | htdocs/compta/facture/list.php | 38537 | <?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004 Eric Seigne <[email protected]>
* Copyright (C) 2004-2012 Laurent Destailleur <[email protected]>
* Copyright (C) 2005 Marc Barilley / Ocebo <[email protected]>
* Copyright (C) 2005-2015 Regis Houssin <[email protected]>
* Copyright (C) 2006 Andre Cianfarani <[email protected]>
* Copyright (C) 2010-2012 Juanjo Menent <[email protected]>
* Copyright (C) 2012 Christophe Battarel <[email protected]>
* Copyright (C) 2013 Florian Henry <[email protected]>
* Copyright (C) 2013 Cédric Salvador <[email protected]>
* Copyright (C) 2015 Jean-François Ferry <[email protected]>
* Copyright (C) 2015-2016 Ferran Marcet <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/facture/list.php
* \ingroup facture
* \brief Page to create/see an invoice
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (! empty($conf->projet->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
$langs->load('bills');
$langs->load('companies');
$langs->load('products');
$langs->load('main');
$sall=trim(GETPOST('sall'));
$projectid=(GETPOST('projectid')?GETPOST('projectid','int'):0);
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
$ref=GETPOST('ref','alpha');
$socid=GETPOST('socid','int');
$action=GETPOST('action','alpha');
$massaction=GETPOST('massaction','alpha');
$confirm=GETPOST('confirm','alpha');
$lineid=GETPOST('lineid','int');
$userid=GETPOST('userid','int');
$search_product_category=GETPOST('search_product_category','int');
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha');
$search_refcustomer=GETPOST('search_refcustomer','alpha');
$search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha');
$search_montant_ttc=GETPOST('search_montant_ttc','alpha');
$search_status=GETPOST('search_status','int');
$search_paymentmode=GETPOST('search_paymentmode','int');
$option = GETPOST('option');
if ($option == 'late') $filter = 'paye:0';
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int');
if ($page == -1) {
$page = 0;
}
$offset = $limit * $page;
if (! $sortorder && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
if (! $sortorder) $sortorder='DESC';
if (! $sortfield) $sortfield='f.datef';
$pageprev = $page - 1;
$pagenext = $page + 1;
$search_user = GETPOST('search_user','int');
$search_sale = GETPOST('search_sale','int');
$day = GETPOST('day','int');
$month = GETPOST('month','int');
$year = GETPOST('year','int');
$day_lim = GETPOST('day_lim','int');
$month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int');
$filtre = GETPOST('filtre');
$toselect = GETPOST('toselect', 'array');
// Security check
$fieldid = (! empty($ref)?'facnumber':'rowid');
if (! empty($user->societe_id)) $socid=$user->societe_id;
$result = restrictedArea($user, 'facture', $id,'','','fk_soc',$fieldid);
$object=new Facture($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('invoicelist'));
$now=dol_now();
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
'f.facnumber'=>'Ref',
'f.ref_client'=>'RefCustomer',
'fd.description'=>'Description',
's.nom'=>"ThirdParty",
'f.note_public'=>'NotePublic',
);
if (empty($user->socid)) $fieldstosearchall["f.note_private"]="NotePrivate";
/*
* Actions
*/
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
// Mass actions
if (! empty($massaction) && count($toselect) < 1)
{
$error++;
setEventMessages($langs->trans("NoLineChecked"), null, "warnings");
}
if (! $error && $massaction == 'confirm_presend')
{
$resaction = '';
$nbsent = 0;
$nbignored = 0;
$langs->load("mails");
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if (!isset($user->email))
{
$error++;
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
}
if (! $error)
{
$thirdparty=new Societe($db);
$objecttmp=new Facture($db);
$listofobjectid=array();
$listofobjectthirdparties=array();
$listofobjectref=array();
foreach($toselect as $toselectid)
{
$objecttmp=new Facture($db); // must create new instance because instance is saved into $listofobjectref array for future use
$result=$objecttmp->fetch($toselectid);
if ($result > 0)
{
$listoinvoicesid[$toselectid]=$toselectid;
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
$listofobjectref[$thirdpartyid][$toselectid]=$objecttmp;
}
}
//var_dump($listofobjectthirdparties);exit;
foreach ($listofobjectthirdparties as $thirdpartyid)
{
$result = $thirdparty->fetch($thirdpartyid);
if ($result < 0)
{
dol_print_error($db);
exit;
}
// Define recipient $sendto and $sendtocc
if (trim($_POST['sendto']))
{
// Recipient is provided into free text
$sendto = trim($_POST['sendto']);
$sendtoid = 0;
}
elseif ($_POST['receiver'] != '-1')
{
// Recipient was provided from combo list
if ($_POST['receiver'] == 'thirdparty') // Id of third party
{
$sendto = $thirdparty->email;
$sendtoid = 0;
}
else // Id du contact
{
$sendto = $thirdparty->contact_get_property((int) $_POST['receiver'],'email');
$sendtoid = $_POST['receiver'];
}
}
if (trim($_POST['sendtocc']))
{
$sendtocc = trim($_POST['sendtocc']);
}
elseif ($_POST['receivercc'] != '-1')
{
// Recipient was provided from combo list
if ($_POST['receivercc'] == 'thirdparty') // Id of third party
{
$sendtocc = $thirdparty->email;
}
else // Id du contact
{
$sendtocc = $thirdparty->contact_get_property((int) $_POST['receivercc'],'email');
}
}
//var_dump($listofobjectref[$thirdpartyid]); // Array of invoice for this thirdparty
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
$listofqualifiedinvoice=array();
$listofqualifiedref=array();
foreach($listofobjectref[$thirdpartyid] as $objectid => $object)
{
//var_dump($object);
//var_dump($thirdpartyid.' - '.$objectid.' - '.$object->statut);
if ($object->statut != Facture::STATUS_VALIDATED)
{
$nbignored++;
continue; // Payment done or started or canceled
}
// Read document
// TODO Use future field $object->fullpathdoc to know where is stored default file
// TODO If not defined, use $object->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc.
$filename=dol_sanitizeFileName($object->ref).'.pdf';
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
$file = $filedir . '/' . $filename;
$mime = dol_mimetype($file);
if (dol_is_file($file))
{
if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send)
{
$object->fetch_thirdparty();
$sendto = $object->thirdparty->email;
}
if (empty($sendto))
{
//print "No recipient for thirdparty ".$object->thirdparty->name;
$nbignored++;
continue;
}
if (dol_strlen($sendto))
{
// Create form object
$attachedfiles=array(
'paths'=>array_merge($attachedfiles['paths'],array($file)),
'names'=>array_merge($attachedfiles['names'],array($filename)),
'mimes'=>array_merge($attachedfiles['mimes'],array($mime))
);
}
$listofqualifiedinvoice[$objectid]=$object;
$listofqualifiedref[$objectid]=$object->ref;
}
else
{
$nbignored++;
$langs->load("other");
$resaction.='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
dol_syslog('Failed to read file: '.$file, LOG_WARNING);
continue;
}
//var_dump($listofqualifiedref);
}
if (count($listofqualifiedinvoice) > 0)
{
$langs->load("commercial");
$from = $user->getFullName($langs) . ' <' . $user->email .'>';
$replyto = $from;
$subject = GETPOST('subject');
$message = GETPOST('message');
$sendtocc = GETPOST('sentocc');
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
$substitutionarray=array(
'__ID__' => join(', ',array_keys($listofqualifiedinvoice)),
'__EMAIL__' => $thirdparty->email,
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
//'__LASTNAME__' => $obj2->lastname,
//'__FIRSTNAME__' => $obj2->firstname,
'__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility
'__REF__' => join(', ',$listofqualifiedref),
'__REFCLIENT__' => $thirdparty->name
);
$subject=make_substitutions($subject, $substitutionarray);
$message=make_substitutions($message, $substitutionarray);
$filepath = $attachedfiles['paths'];
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
//var_dump($filepath);
// Send mail
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
if ($mailfile->error)
{
$resaction.='<div class="error">'.$mailfile->error.'</div>';
}
else
{
$result=$mailfile->sendfile();
if ($result)
{
$resaction.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'<br>'; // Must not contain "
$error=0;
// Insert logs into agenda
foreach($listofqualifiedinvoice as $invid => $object)
{
$actiontypecode='AC_FAC';
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
if ($message)
{
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $message);
}
// Initialisation donnees
$object->sendtoid = 0;
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text
$object->fk_element = $invid;
$object->elementtype = $object->element;
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($db);
$result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf);
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
if ($error)
{
setEventMessages($db->lasterror(), $errors, 'errors');
dol_syslog("Error in trigger BILL_SENTBYMAIL ".$db->lasterror(), LOG_ERR);
}
$nbsent++;
}
}
else
{
$langs->load("other");
if ($mailfile->error)
{
$resaction.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$resaction.='<br><div class="error">'.$mailfile->error.'</div>';
}
else
{
$resaction.='<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
}
}
}
}
}
$resaction.=($resaction?'<br>':$resaction);
$resaction.='<strong>'.$langs->trans("ResultOfMailSending").':</strong><br>'."\n";
$resaction.=$langs->trans("NbSelected").': '.count($toselect)."\n<br>";
$resaction.=$langs->trans("NbIgnored").': '.($nbignored?$nbignored:0)."\n<br>";
$resaction.=$langs->trans("NbSent").': '.($nbsent?$nbsent:0)."\n<br>";
if ($nbsent)
{
$action=''; // Do not show form post if there was at least one successfull sent
setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs');
setEventMessages($resaction, null, 'mesgs');
}
else
{
//setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings'); // May be object has no generated PDF file
setEventMessages($resaction, null, 'warnings');
}
}
$action='list';
$massaction='';
}
}
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search_user='';
$search_sale='';
$search_product_category='';
$search_ref='';
$search_refcustomer='';
$search_societe='';
$search_montant_ht='';
$search_montant_ttc='';
$search_status='';
$search_paymentmode='';
$day='';
$year='';
$month='';
$toselect='';
$option='';
$filter='';
$day_lim='';
$year_lim='';
$month_lim='';
}
/*
* View
*/
llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
$form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$bankaccountstatic=new Account($db);
$facturestatic=new Facture($db);
$sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_tva, f.total_ttc,';
$sql.= ' f.datef as df, f.date_lim_reglement as datelimite,';
$sql.= ' f.paye as paye, f.fk_statut,';
$sql.= ' s.nom as name, s.rowid as socid, s.code_client, s.client ';
if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'facture as f';
if (! $sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid';
else $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as fd ON fd.fk_facture = f.rowid';
if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture';
if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
// We'll need this table joined to the select in order to filter by sale
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($search_user > 0)
{
$sql.=", ".MAIN_DB_PREFIX."element_contact as ec";
$sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc";
}
$sql.= ' WHERE f.fk_soc = s.rowid';
$sql.= " AND f.entity = ".$conf->entity;
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category;
if ($socid > 0) $sql.= ' AND s.rowid = '.$socid;
if ($userid)
{
if ($userid == -1) $sql.=' AND f.fk_user_author IS NULL';
else $sql.=' AND f.fk_user_author = '.$userid;
}
if ($filtre)
{
$aFilter = explode(',', $filtre);
foreach ($aFilter as $filter)
{
$filt = explode(':', $filter);
$sql .= ' AND ' . trim($filt[0]) . ' = ' . trim($filt[1]);
}
}
if ($search_ref) $sql .= natural_search('f.facnumber', $search_ref);
if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcustomer);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status);
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode."";
if ($month > 0)
{
if ($year > 0 && empty($day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
else if ($year > 0 && ! empty($day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$month."'";
}
else if ($year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
if ($month_lim > 0)
{
if ($year_lim > 0 && empty($day_lim))
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,$month_lim,false))."' AND '".$db->idate(dol_get_last_day($year_lim,$month_lim,false))."'";
else if ($year_lim > 0 && ! empty($day_lim))
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_lim, $day_lim, $year_lim))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month_lim, $day_lim, $year_lim))."'";
else
$sql.= " AND date_format(f.date_lim_reglement, '%m') = '".$month_lim."'";
}
else if ($year_lim > 0)
{
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,1,false))."' AND '".$db->idate(dol_get_last_day($year_lim,12,false))."'";
}
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'";
if ($filter == 'paye:0') $sql.= " AND f.fk_statut = 1";
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0)
{
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
}
if (! $sall)
{
$sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.total, f.tva, f.total_ttc,';
$sql.= ' f.datef, f.date_lim_reglement,';
$sql.= ' f.paye, f.fk_statut,';
$sql.= ' s.nom, s.rowid, s.code_client, s.client';
}
else
{
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
}
$sql.= ' ORDER BY ';
$listfield=explode(',',$sortfield);
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
$sql.= ' f.rowid DESC ';
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}
$sql.= $db->plimit($limit+1,$offset);
//print $sql;
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$arrayofselected=is_array($toselect)?$toselect:array();
if ($socid)
{
$soc = new Societe($db);
$soc->fetch($socid);
}
$param='&socid='.$socid;
if ($day) $param.='&day='.$day;
if ($month) $param.='&month='.$month;
if ($year) $param.='&year=' .$year;
if ($day_lim) $param.='&day_lim='.$day_lim;
if ($month_lim) $param.='&month_lim='.$month_lim;
if ($year_lim) $param.='&year_lim=' .$year_lim;
if ($search_ref) $param.='&search_ref=' .$search_ref;
if ($search_refcustomer) $param.='&search_refcustomer=' .$search_refcustomer;
if ($search_societe) $param.='&search_societe=' .$search_societe;
if ($search_sale > 0) $param.='&search_sale=' .$search_sale;
if ($search_user > 0) $param.='&search_user=' .$search_user;
if ($search_product_category > 0) $param.='$search_product_category=' .$search_product_category;
if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht;
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc;
if ($search_status != '') $param.='&search_status='.$search_status;
if ($search_paymentmode > 0) $param.='search_paymentmode='.$search_paymentmode;
$param.=(! empty($option)?"&option=".$option:"");
$massactionbutton=$form->selectMassAction('', $massaction ? array() : array('presend'=>$langs->trans("SendByMail")));
$i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$massactionbutton,$num,$nbtotalofrecords,'title_accountancy.png');
if ($massaction == 'presend')
{
$langs->load("mails");
if (! GETPOST('cancel'))
{
$objecttmp=new Facture($db);
$listofselectedid=array();
$listofselectedthirdparties=array();
$listofselectedref=array();
foreach($arrayofselected as $toselectid)
{
$result=$objecttmp->fetch($toselectid);
if ($result > 0)
{
$listofselectedid[$toselectid]=$toselectid;
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
$listofselectedthirdparties[$thirdpartyid]=$thirdpartyid;
$listofselectedref[$thirdpartyid][$toselectid]=$objecttmp->ref;
}
}
}
print '<input type="hidden" name="massaction" value="confirm_presend">';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
dol_fiche_head(null, '', '');
$topicmail="SendBillRef";
$modelmail="facture_send";
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->withform=-1;
$formmail->fromtype = 'user';
$formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='inv'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'inv'.$object->id);
}
$formmail->withfrom=1;
$liste=$langs->trans("AllRecipientSelected");
if (count($listofselectedthirdparties) == 1)
{
$liste=array();
$thirdpartyid=array_shift($listofselectedthirdparties);
$soc=new Societe($db);
$soc->fetch($thirdpartyid);
foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
{
$liste[$key]=$value;
}
$formmail->withtoreadonly=0;
}
else
{
$formmail->withtoreadonly=1;
}
$formmail->withto=$liste;
$formmail->withtofree=0;
$formmail->withtocc=1;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withtopic=$langs->transnoentities($topicmail, '__REF__', '__REFCLIENT__');
$formmail->withfile=$langs->trans("OnlyPDFattachmentSupported");
$formmail->withbody=1;
$formmail->withdeliveryreceipt=1;
$formmail->withcancel=1;
// Tableau des substitutions
$formmail->substit['__REF__']='__REF__'; // We want to keep the tag
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
// Tableau des parametres complementaires du post
$formmail->param['action']=$action;
$formmail->param['models']=$modelmail;
$formmail->param['models_id']=GETPOST('modelmailselected','int');
$formmail->param['facid']=join(',',$arrayofselected);
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
print $formmail->get_form();
dol_fiche_end();
}
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
// If the user can view prospects other than his'
$moreforfilter='';
if ($user->rights->societe->client->voir || $socid)
{
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
$moreforfilter.='</div>';
}
// If the user can view prospects other than his'
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
{
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
$moreforfilter.='</div>';
}
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
if ($moreforfilter)
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>';
}
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PaymentModeShort"),$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Taxes'),$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Received'),$_SERVER['PHP_SELF'],'am','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_statut,paye,am','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
// Filters lines
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
print '</td>';
print '<td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
$formother->select_year($year?$year:-1,'year',1, 20, 5);
print '</td>';
print '<td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day_lim" value="'.$day_lim.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_lim" value="'.$month_lim.'">';
$formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5);
print '<br><input type="checkbox" name="option" value="late"'.($option == 'late'?' checked':'').'> '.$langs->trans("Late");
print '</td>';
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="8" name="search_societe" value="'.$search_societe.'"></td>';
print '<td class="liste_titre" align="left">';
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10);
print '</td>';
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ht" value="'.$search_montant_ht.'"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ttc" value="'.$search_montant_ttc.'"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre" align="right">';
$liststatus=array('0'=>$langs->trans("BillShortStatusDraft"), '1'=>$langs->trans("BillShortStatusNotPaid"), '2'=>$langs->trans("BillShortStatusPaid"), '3'=>$langs->trans("BillShortStatusCanceled"));
print $form->selectarray('search_status', $liststatus, $search_status, 1);
print '</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n";
if ($num > 0)
{
$var=true;
$total_ht=0;
$total_tva=0;
$total_ttc=0;
$totalrecu=0;
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
$var=!$var;
$datelimit=$db->jdate($objp->datelimite);
print '<tr '.$bc[$var].'>';
print '<td class="nowrap">';
$facturestatic->id=$objp->facid;
$facturestatic->ref=$objp->facnumber;
$facturestatic->type=$objp->type;
$facturestatic->statut=$objp->fk_statut;
$facturestatic->date_lim_reglement=$db->jdate($objp->datelimite);
$notetoshow=dol_string_nohtmltag(($user->societe_id>0?$objp->note_public:$objp->note_private),1);
$paiement = $facturestatic->getSommePaiement();
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">';
print $facturestatic->getNomUrl(1,'',200,0,$notetoshow);
print $objp->increment;
print '</td>';
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
if (! empty($objp->note_private))
{
print ' <span class="note">';
print '<a href="'.DOL_URL_ROOT.'/compta/facture/note.php?id='.$objp->facid.'">'.img_picto($langs->trans("ViewPrivateNote"),'object_generic').'</a>';
print '</span>';
}
$filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid;
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>';
print '</tr>';
print '</table>';
print "</td>\n";
// Customer ref
print '<td class="nowrap">';
print $objp->ref_client;
print '</td>';
// Date
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($objp->df),'day');
print '</td>';
// Date limit
print '<td align="center" class="nowrap">'.dol_print_date($datelimit,'day');
if ($facturestatic->hasDelay())
{
print img_warning($langs->trans('Late'));
}
print '</td>';
print '<td>';
$thirdparty=new Societe($db);
$thirdparty->id=$objp->socid;
$thirdparty->name=$objp->name;
$thirdparty->client=$objp->client;
$thirdparty->code_client=$objp->code_client;
print $thirdparty->getNomUrl(1,'customer');
print '</td>';
// Payment mode
print '<td>';
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none', '', -1);
print '</td>';
print '<td align="right">'.price($objp->total_ht,0,$langs).'</td>';
print '<td align="right">'.price($objp->total_tva,0,$langs).'</td>';
print '<td align="right">'.price($objp->total_ttc,0,$langs).'</td>';
print '<td align="right">'.(! empty($paiement)?price($paiement,0,$langs):' ').'</td>';
// Status
print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$paiement,$objp->type);
print "</td>";
// Checkbox
print '<td class="nowrap" align="center">';
$selected=0;
if (in_array($objp->facid, $arrayofselected)) $selected=1;
print '<input id="cb'.$objp->facid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objp->facid.'"'.($selected?' checked="checked"':'').'>';
print '</td>' ;
print "</tr>\n";
$total_ht+=$objp->total_ht;
$total_tva+=$objp->total_tva;
$total_ttc+=$objp->total_ttc;
$totalrecu+=$paiement;
$i++;
}
if (($offset + $num) <= $limit)
{
// Print total
print '<tr class="liste_total">';
print '<td class="liste_total" colspan="6" align="left">'.$langs->trans('Total').'</td>';
print '<td class="liste_total" align="right">'.price($total_ht,0,$langs).'</td>';
print '<td class="liste_total" align="right">'.price($total_tva,0,$langs).'</td>';
print '<td class="liste_total" align="right">'.price($total_ttc,0,$langs).'</td>';
print '<td class="liste_total" align="right">'.price($totalrecu,0,$langs).'</td>';
print '<td class="liste_total"></td>';
print '<td class="liste_total"></td>';
print '</tr>';
}
}
print "</table>\n";
print "</form>\n";
$db->free($resql);
}
else
{
dol_print_error($db);
}
llxFooter();
$db->close();
| gpl-3.0 |
rotcehdnih/betaflight | src/main/target/MATEKF411/target.h | 3705 | /*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define TARGET_BOARD_IDENTIFIER "MK41"
#define USBD_PRODUCT_STRING "MatekF411"
#define LED0_PIN PC13
#define LED1_PIN PC14
#define USE_BEEPER
#define BEEPER_PIN PB2
#define BEEPER_INVERTED
// *************** Gyro & ACC **********************
#define USE_SPI
#define USE_SPI_DEVICE_1
#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7
#define MPU6000_CS_PIN PA4
#define MPU6000_SPI_INSTANCE SPI1
#define MPU6500_CS_PIN PA4
#define MPU6500_SPI_INSTANCE SPI1
#define USE_EXTI
#define MPU_INT_EXTI PA1
#define USE_MPU_DATA_READY_SIGNAL
#define USE_GYRO
#define USE_GYRO_SPI_MPU6000
#define GYRO_MPU6000_ALIGN CW180_DEG
#define USE_ACC
#define USE_ACC_SPI_MPU6000
#define ACC_MPU6000_ALIGN CW180_DEG
#define USE_GYRO_SPI_MPU6500
#define GYRO_MPU6500_ALIGN CW180_DEG
#define USE_ACC_SPI_MPU6500
#define ACC_MPU6500_ALIGN CW180_DEG
// *************** Baro **************************
#define USE_I2C
#define USE_I2C_DEVICE_1
#define I2C_DEVICE (I2CDEV_1)
#define I2C1_SCL PB8 // SCL pad
#define I2C1_SDA PB9 // SDA pad
#define BARO_I2C_INSTANCE (I2CDEV_1)
#define USE_BARO
#define USE_BARO_BMP280
#define USE_BARO_MS5611
#define USE_BARO_BMP085
// *************** UART *****************************
#define USE_VCP
#define VBUS_SENSING_PIN PC15
#define VBUS_SENSING_ENABLED
#define USE_UART1
#define UART1_RX_PIN PA10
#define UART1_TX_PIN PA9
#define USE_UART2
#define UART2_RX_PIN PA3
#define UART2_TX_PIN PA2
#define USE_SOFTSERIAL1
#define USE_SOFTSERIAL2
#define SERIAL_PORT_COUNT 5
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define SERIALRX_PROVIDER SERIALRX_SBUS
#define SERIALRX_UART SERIAL_PORT_USART1
// *************** OSD *****************************
#define USE_SPI_DEVICE_2
#define SPI2_SCK_PIN PB13
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15
#define USE_MAX7456
#define MAX7456_SPI_INSTANCE SPI2
#define MAX7456_SPI_CS_PIN PB12
// *************** ADC *****************************
#define USE_ADC
#define ADC1_DMA_STREAM DMA2_Stream0
#define VBAT_ADC_PIN PB0
#define CURRENT_METER_ADC_PIN PB1
//#define RSSI_ADC_PIN PA0
#define USE_ESCSERIAL
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define USABLE_TIMER_CHANNEL_COUNT 10
#define USED_TIMERS ( TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(4)|TIM_N(5)|TIM_N(9) )
| gpl-3.0 |
ishmaelchibvuri/splayweb.io | app/js/background.js | 481 | /*!
* web-SplayChat v0.4.0 - messaging web application for MTProto
* http://SplayChat.com/
* Copyright (C) 2014 SplayChat Messenger <[email protected]>
* http://SplayChat.com//blob/master/LICENSE
*/
chrome.app.runtime.onLaunched.addListener(function(launchData) {
chrome.app.window.create('../index.html', {
id: 'web-SplayChat-chat',
innerBounds: {
width: 1000,
height: 700
},
minWidth: 320,
minHeight: 400,
frame: 'chrome'
});
});
| gpl-3.0 |
stephanfo/AWG | src/CartBundle/Controller/CartController.php | 914 | <?php
namespace CartBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
class CartController extends Controller {
/**
* @Route("/cart/current", name="admin_cart_current")
* @Method({"GET"})
*/
public function currentAction()
{
$users = $this->getDoctrine()->getRepository('UserBundle:User')->findAll();
$priceCalculator = $this->get('price_calculator');
$usersPrice = array();
foreach ($users as $key => $user) {
$usersPrice[$key]['user'] = $user;
$usersPrice[$key]['price'] = $priceCalculator->getPricing($user);
}
return $this->render('CartBundle:Cart:current.html.twig', array(
'usersPrice' => $usersPrice
));
}
}
| gpl-3.0 |
mapsquare/osm-contributor | src/main/java/io/jawg/osmcontributor/ui/utils/ZoomAnimationGestureDetector.java | 2599 | /**
* Copyright (C) 2019 Takima
*
* This file is part of OSM Contributor.
*
* OSM Contributor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OSM Contributor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSM Contributor. If not, see <http://www.gnu.org/licenses/>.
*/
package io.jawg.osmcontributor.ui.utils;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.view.ScaleGestureDetector;
import android.view.animation.DecelerateInterpolator;
import java.util.Queue;
import io.jawg.osmcontributor.utils.LimitedQueue;
/**
* @author Tommy Buonomo on 16/06/16.
*/
public abstract class ZoomAnimationGestureDetector extends ScaleGestureDetector.SimpleOnScaleGestureListener {
private static final float MAX_SPEED = 50.0f;
private static final float MIN_SPEED = 2.0f;
private Queue<Float> previousSpeedQueue = new LimitedQueue<>(5);
@Override
public boolean onScaleBegin(ScaleGestureDetector scaleGestureDetector) {
previousSpeedQueue.clear();
return true;
}
@Override
public boolean onScale(ScaleGestureDetector scaleGestureDetector) {
float currentSpeed = scaleGestureDetector.getPreviousSpan() - scaleGestureDetector.getCurrentSpan();
previousSpeedQueue.add(currentSpeed);
return true;
}
@Override
public void onScaleEnd(ScaleGestureDetector scaleGestureDetector) {
float sum = 0;
for (Float speed : previousSpeedQueue) {
sum += speed;
}
float moy = sum / previousSpeedQueue.size();
if (Math.abs(moy) > MAX_SPEED) {
moy = moy > 0 ? MAX_SPEED : -MAX_SPEED;
}
ValueAnimator valueAnimator = ObjectAnimator.ofFloat(-moy / 1000, 0);
int duration = (int) (Math.abs(moy) * 12);
valueAnimator.setDuration(duration);
valueAnimator.setInterpolator(new DecelerateInterpolator());
onZoomAnimationEnd(valueAnimator);
if (Math.abs(moy) > MIN_SPEED) {
onZoomAnimationEnd(valueAnimator);
}
}
public abstract void onZoomAnimationEnd(ValueAnimator animator);
}
| gpl-3.0 |
Blucky87/Otiose2D | src/libs/MonoGame/MonoGame.Framework/Content/ContentReaders/TimeSpanReader.cs | 3388 | #region License
/*
Microsoft Public License (Ms-PL)
MonoGame - Copyright © 2009 The MonoGame Team
All rights reserved.
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under
U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software,
your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including
a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object
code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
purpose and non-infringement.
*/
#endregion License
//
// Author: Kenneth James Pouncey
//
using System;
using Microsoft.Xna.Framework.Content;
namespace Microsoft.Xna.Framework.Content
{
internal class TimeSpanReader : ContentTypeReader<TimeSpan>
{
internal TimeSpanReader ()
{
}
protected internal override TimeSpan Read (ContentReader input, TimeSpan existingInstance)
{
// Could not find any information on this really but from all the searching it looks
// like the constructor of number of ticks is long so I have placed that here for now
// long is a Int64 so we read with 64
// <Duration>PT2S</Duration>
//
return new TimeSpan(input.ReadInt64 ());
}
}
}
| gpl-3.0 |
mrpollo/ardupilot | libraries/AP_TECS/AP_TECS.cpp | 33291 | // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#include "AP_TECS.h"
#include <AP_HAL.h>
extern const AP_HAL::HAL& hal;
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
#include <stdio.h>
# define Debug(fmt, args ...) do {printf("%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## args); hal.scheduler->delay(1); } while(0)
#else
# define Debug(fmt, args ...)
#endif
//Debug("%.2f %.2f %.2f %.2f \n", var1, var2, var3, var4);
// table of user settable parameters
const AP_Param::GroupInfo AP_TECS::var_info[] PROGMEM = {
// @Param: CLMB_MAX
// @DisplayName: Maximum Climb Rate (metres/sec)
// @Description: This is the best climb rate that the aircraft can achieve with the throttle set to THR_MAX and the airspeed set to the default value. For electric aircraft make sure this number can be achieved towards the end of flight when the battery voltage has reduced. The setting of this parameter can be checked by commanding a positive altitude change of 100m in loiter, RTL or guided mode. If the throttle required to climb is close to THR_MAX and the aircraft is maintaining airspeed, then this parameter is set correctly. If the airspeed starts to reduce, then the parameter is set to high, and if the throttle demand require to climb and maintain speed is noticeably less than THR_MAX, then either CLMB_MAX should be increased or THR_MAX reduced.
// @Increment: 0.1
// @User: User
AP_GROUPINFO("CLMB_MAX", 0, AP_TECS, _maxClimbRate, 5.0f),
// @Param: SINK_MIN
// @DisplayName: Minimum Sink Rate (metres/sec)
// @Description: This is the sink rate of the aircraft with the throttle set to THR_MIN and the same airspeed as used to measure CLMB_MAX.
// @Increment: 0.1
// @User: User
AP_GROUPINFO("SINK_MIN", 1, AP_TECS, _minSinkRate, 2.0f),
// @Param: TIME_CONST
// @DisplayName: Controller time constant (sec)
// @Description: This is the time constant of the TECS control algorithm. Smaller values make it faster to respond, large values make it slower to respond.
// @Range: 3.0-10.0
// @Increment: 0.2
// @User: Advanced
AP_GROUPINFO("TIME_CONST", 2, AP_TECS, _timeConst, 5.0f),
// @Param: THR_DAMP
// @DisplayName: Controller throttle damping
// @Description: This is the damping gain for the throttle demand loop. Increase to add damping to correct for oscillations in speed and height.
// @Range: 0.1-1.0
// @Increment: 0.1
// @User: Advanced
AP_GROUPINFO("THR_DAMP", 3, AP_TECS, _thrDamp, 0.5f),
// @Param: INTEG_GAIN
// @DisplayName: Controller integrator
// @Description: This is the integrator gain on the control loop. Increase to increase the rate at which speed and height offsets are trimmed out
// @Range: 0.0-0.5
// @Increment: 0.02
// @User: Advanced
AP_GROUPINFO("INTEG_GAIN", 4, AP_TECS, _integGain, 0.1f),
// @Param: VERT_ACC
// @DisplayName: Vertical Acceleration Limit (metres/sec^2)
// @Description: This is the maximum vertical acceleration either up or down that the controller will use to correct speed or height errors.
// @Range: 1.0-10.0
// @Increment: 0.5
// @User: Advanced
AP_GROUPINFO("VERT_ACC", 5, AP_TECS, _vertAccLim, 7.0f),
// @Param: HGT_OMEGA
// @DisplayName: Height complementary filter frequency (radians/sec)
// @Description: This is the cross-over frequency of the complementary filter used to fuse vertical acceleration and baro alt to obtain an estimate of height rate and height.
// @Range: 1.0-5.0
// @Increment: 0.05
// @User: Advanced
AP_GROUPINFO("HGT_OMEGA", 6, AP_TECS, _hgtCompFiltOmega, 3.0f),
// @Param: SPD_OMEGA
// @DisplayName: Speed complementary filter frequency (radians/sec)
// @Description: This is the cross-over frequency of the complementary filter used to fuse longitudinal acceleration and airspeed to obtain a lower noise and lag estimate of airspeed.
// @Range: 0.5-2.0
// @Increment: 0.05
// @User: Advanced
AP_GROUPINFO("SPD_OMEGA", 7, AP_TECS, _spdCompFiltOmega, 2.0f),
// @Param: RLL2THR
// @DisplayName: Bank angle compensation gain
// @Description: Increasing this gain turn increases the amount of throttle that will be used to compensate for the additional drag created by turning. Ideally this should be set to approximately 10 x the extra sink rate in m/s created by a 45 degree bank turn. Increase this gain if the aircraft initially loses energy in turns and reduce if the aircraft initially gains energy in turns. Efficient high aspect-ratio aircraft (eg powered sailplanes) can use a lower value, whereas inefficient low aspect-ratio models (eg delta wings) can use a higher value.
// @Range: 5.0 to 30.0
// @Increment: 1.0
// @User: Advanced
AP_GROUPINFO("RLL2THR", 8, AP_TECS, _rollComp, 10.0f),
// @Param: SPDWEIGHT
// @DisplayName: Weighting applied to speed control
// @Description: This parameter adjusts the amount of weighting that the pitch control applies to speed vs height errors. Setting it to 0.0 will cause the pitch control to control height and ignore speed errors. This will normally improve height accuracy but give larger airspeed errors. Setting it to 2.0 will cause the pitch control loop to control speed and ignore height errors. This will normally reduce airsped errors, but give larger height errors. A value of 1.0 gives a balanced response and is the default.
// @Range: 0.0 to 2.0
// @Increment: 0.1
// @User: Advanced
AP_GROUPINFO("SPDWEIGHT", 9, AP_TECS, _spdWeight, 1.0f),
// @Param: PTCH_DAMP
// @DisplayName: Controller pitch damping
// @Description: This is the damping gain for the pitch demand loop. Increase to add damping to correct for oscillations in speed and height.
// @Range: 0.1-1.0
// @Increment: 0.1
// @User: Advanced
AP_GROUPINFO("PTCH_DAMP", 10, AP_TECS, _ptchDamp, 0.0f),
// @Param: SINK_MAX
// @DisplayName: Maximum Descent Rate (metres/sec)
// @Description: This sets the maximum descent rate that the controller will use. If this value is too large, the aircraft will reach the pitch angle limit first and be enable to achieve the descent rate. This should be set to a value that can be achieved at the lower pitch angle limit.
// @Increment: 0.1
// @User: User
AP_GROUPINFO("SINK_MAX", 11, AP_TECS, _maxSinkRate, 5.0f),
// @Param: LAND_ARSPD
// @DisplayName: Airspeed during landing approach (m/s)
// @Description: When performing an autonomus landing, this value is used as the goal airspeed during approach. Note that this parameter is not useful if your platform does not have an airspeed sensor (use TECS_LAND_THR instead). If negative then this value is not used during landing.
// @Range: -1 to 127
// @Increment: 1
// @User: User
AP_GROUPINFO("LAND_ARSPD", 12, AP_TECS, _landAirspeed, -1),
// @Param: LAND_THR
// @DisplayName: Cruise throttle during landing approach (percentage)
// @Description: Use this parameter instead of LAND_ASPD if your platform does not have an airspeed sensor. It is the cruise throttle during landing approach. If it is negative if TECS_LAND_ASPD is in use then this value is not used during landing.
// @Range: -1 to 100
// @Increment: 0.1
// @User: User
AP_GROUPINFO("LAND_THR", 13, AP_TECS, _landThrottle, -1),
// @Param: LAND_SPDWGT
// @DisplayName: Weighting applied to speed control during landing.
// @Description: Same as SPDWEIGHT parameter, with the exception that this parameter is applied during landing flight stages. A value closer to 2 will result in the plane ignoring height error during landing and our experience has been that the plane will therefore keep the nose up -- sometimes good for a glider landing (with the side effect that you will likely glide a ways past the landing point). A value closer to 0 results in the plane ignoring speed error -- use caution when lowering the value below 1 -- ignoring speed could result in a stall.
// @Range: 0.0 to 2.0
// @Increment: 0.1
// @User: Advanced
AP_GROUPINFO("LAND_SPDWGT", 14, AP_TECS, _spdWeightLand, 1.0f),
// @Param: PITCH_MAX
// @DisplayName: Maximum pitch in auto flight
// @Description: This controls maximum pitch up in automatic throttle modes. If this is set to zero then LIM_PITCH_MAX is used instead. The purpose of this parameter is to allow the use of a smaller pitch range when in automatic flight than what is used in FBWA mode.
// @Range: 0 45
// @Increment: 1
// @User: Advanced
AP_GROUPINFO("PITCH_MAX", 15, AP_TECS, _pitch_max, 0),
// @Param: PITCH_MIN
// @DisplayName: Minimum pitch in auto flight
// @Description: This controls minimum pitch in automatic throttle modes. If this is set to zero then LIM_PITCH_MIN is used instead. The purpose of this parameter is to allow the use of a smaller pitch range when in automatic flight than what is used in FBWA mode. Note that TECS_PITCH_MIN should be a negative number.
// @Range: -45 0
// @Increment: 1
// @User: Advanced
AP_GROUPINFO("PITCH_MIN", 16, AP_TECS, _pitch_min, 0),
// @Param: LAND_SINK
// @DisplayName: Sink rate for final landing stage
// @Description: The sink rate in meters/second for the final stage of landing.
// @Range: 0.0 to 2.0
// @Increment: 0.1
// @User: Advanced
AP_GROUPINFO("LAND_SINK", 17, AP_TECS, _land_sink, 0.25f),
// @Param: TECS_LAND_TCONST
// @DisplayName: Land controller time constant (sec)
// @Description: This is the time constant of the TECS control algorithm when in final landing stage of flight. It should be smaller than TECS_TIME_CONST to allow for faster flare
// @Range: 1.0-5.0
// @Increment: 0.2
// @User: Advanced
AP_GROUPINFO("LAND_TCONST", 18, AP_TECS, _landTimeConst, 2.0f),
AP_GROUPEND
};
/*
* Written by Paul Riseborough 2013 to provide:
* - Combined control of speed and height using throttle to control
* total energy and pitch angle to control exchange of energy between
* potential and kinetic.
* Selectable speed or height priority modes when calculating pitch angle
* - Fallback mode when no airspeed measurement is available that
* sets throttle based on height rate demand and switches pitch angle control to
* height priority
* - Underspeed protection that demands maximum throttle and switches pitch angle control
* to speed priority mode
* - Relative ease of tuning through use of intuitive time constant, integrator and damping gains and the use
* of easy to measure aircraft performance data
*
*/
void AP_TECS::update_50hz(float hgt_afe)
{
// Implement third order complementary filter for height and height rate
// estimted height rate = _climb_rate
// estimated height above field elevation = _integ3_state
// Reference Paper :
// Optimising the Gains of the Baro-Inertial Vertical Channel
// Widnall W.S, Sinha P.K,
// AIAA Journal of Guidance and Control, 78-1307R
// Calculate time in seconds since last update
uint32_t now = hal.scheduler->micros();
float DT = max((now - _update_50hz_last_usec),0)*1.0e-6f;
if (DT > 1.0f) {
_integ3_state = hgt_afe;
_climb_rate = 0.0f;
_integ1_state = 0.0f;
DT = 0.02f; // when first starting TECS, use a
// small time constant
}
_update_50hz_last_usec = now;
// USe inertial nav verical velocity and height if available
Vector3f posned, velned;
if (_ahrs.get_velocity_NED(velned) && _ahrs.get_relative_position_NED(posned)) {
_climb_rate = - velned.z;
_integ3_state = - posned.z;
} else {
// Get height acceleration
float hgt_ddot_mea = -(_ahrs.get_accel_ef().z + GRAVITY_MSS);
// Perform filter calculation using backwards Euler integration
// Coefficients selected to place all three filter poles at omega
float omega2 = _hgtCompFiltOmega*_hgtCompFiltOmega;
float hgt_err = hgt_afe - _integ3_state;
float integ1_input = hgt_err * omega2 * _hgtCompFiltOmega;
_integ1_state = _integ1_state + integ1_input * DT;
float integ2_input = _integ1_state + hgt_ddot_mea + hgt_err * omega2 * 3.0f;
_climb_rate = _climb_rate + integ2_input * DT;
float integ3_input = _climb_rate + hgt_err * _hgtCompFiltOmega * 3.0f;
// If more than 1 second has elapsed since last update then reset the integrator state
// to the measured height
if (DT > 1.0f) {
_integ3_state = hgt_afe;
} else {
_integ3_state = _integ3_state + integ3_input*DT;
}
}
// Update and average speed rate of change
// Get DCM
const Matrix3f &rotMat = _ahrs.get_dcm_matrix();
// Calculate speed rate of change
float temp = rotMat.c.x * GRAVITY_MSS + _ahrs.get_ins().get_accel().x;
// take 5 point moving average
_vel_dot = _vdot_filter.apply(temp);
}
void AP_TECS::_update_speed(void)
{
// Calculate time in seconds since last update
uint32_t now = hal.scheduler->micros();
float DT = max((now - _update_speed_last_usec),0)*1.0e-6f;
_update_speed_last_usec = now;
// Convert equivalent airspeeds to true airspeeds
float EAS2TAS = _ahrs.get_EAS2TAS();
_TAS_dem = _EAS_dem * EAS2TAS;
_TASmax = aparm.airspeed_max * EAS2TAS;
_TASmin = aparm.airspeed_min * EAS2TAS;
if (_landAirspeed >= 0 && _ahrs.airspeed_sensor_enabled() &&
(_flight_stage == FLIGHT_LAND_APPROACH || _flight_stage== FLIGHT_LAND_FINAL)) {
_TAS_dem = _landAirspeed * EAS2TAS;
if (_TASmin > _TAS_dem) {
_TASmin = _TAS_dem;
}
}
// Reset states of time since last update is too large
if (DT > 1.0f) {
_integ5_state = (_EAS * EAS2TAS);
_integ4_state = 0.0f;
DT = 0.1f; // when first starting TECS, use a
// small time constant
}
// Get airspeed or default to halfway between min and max if
// airspeed is not being used and set speed rate to zero
if (!_ahrs.airspeed_sensor_enabled() || !_ahrs.airspeed_estimate(&_EAS)) {
// If no airspeed available use average of min and max
_EAS = 0.5f * (aparm.airspeed_min.get() + (float)aparm.airspeed_max.get());
}
// Implement a second order complementary filter to obtain a
// smoothed airspeed estimate
// airspeed estimate is held in _integ5_state
float aspdErr = (_EAS * EAS2TAS) - _integ5_state;
float integ4_input = aspdErr * _spdCompFiltOmega * _spdCompFiltOmega;
// Prevent state from winding up
if (_integ5_state < 3.1f){
integ4_input = max(integ4_input , 0.0f);
}
_integ4_state = _integ4_state + integ4_input * DT;
float integ5_input = _integ4_state + _vel_dot + aspdErr * _spdCompFiltOmega * 1.4142f;
_integ5_state = _integ5_state + integ5_input * DT;
// limit the airspeed to a minimum of 3 m/s
_integ5_state = max(_integ5_state, 3.0f);
}
void AP_TECS::_update_speed_demand(void)
{
// Set the airspeed demand to the minimum value if an underspeed condition exists
// or a bad descent condition exists
// This will minimise the rate of descent resulting from an engine failure,
// enable the maximum climb rate to be achieved and prevent continued full power descent
// into the ground due to an unachievable airspeed value
if ((_badDescent) || (_underspeed))
{
_TAS_dem = _TASmin;
}
// Constrain speed demand
_TAS_dem = constrain_float(_TAS_dem, _TASmin, _TASmax);
// calculate velocity rate limits based on physical performance limits
// provision to use a different rate limit if bad descent or underspeed condition exists
// Use 50% of maximum energy rate to allow margin for total energy contgroller
float velRateMax;
float velRateMin;
if ((_badDescent) || (_underspeed))
{
velRateMax = 0.5f * _STEdot_max / _integ5_state;
velRateMin = 0.5f * _STEdot_min / _integ5_state;
}
else
{
velRateMax = 0.5f * _STEdot_max / _integ5_state;
velRateMin = 0.5f * _STEdot_min / _integ5_state;
}
// Apply rate limit
if ((_TAS_dem - _TAS_dem_adj) > (velRateMax * 0.1f))
{
_TAS_dem_adj = _TAS_dem_adj + velRateMax * 0.1f;
_TAS_rate_dem = velRateMax;
}
else if ((_TAS_dem - _TAS_dem_adj) < (velRateMin * 0.1f))
{
_TAS_dem_adj = _TAS_dem_adj + velRateMin * 0.1f;
_TAS_rate_dem = velRateMin;
}
else
{
_TAS_dem_adj = _TAS_dem;
_TAS_rate_dem = (_TAS_dem - _TAS_dem_last) / 0.1f;
}
// Constrain speed demand again to protect against bad values on initialisation.
_TAS_dem_adj = constrain_float(_TAS_dem_adj, _TASmin, _TASmax);
_TAS_dem_last = _TAS_dem;
}
void AP_TECS::_update_height_demand(void)
{
// Apply 2 point moving average to demanded height
// This is required because height demand is only updated at 5Hz
_hgt_dem = 0.5f * (_hgt_dem + _hgt_dem_in_old);
_hgt_dem_in_old = _hgt_dem;
// Limit height rate of change
if ((_hgt_dem - _hgt_dem_prev) > (_maxClimbRate * 0.1f))
{
_hgt_dem = _hgt_dem_prev + _maxClimbRate * 0.1f;
}
else if ((_hgt_dem - _hgt_dem_prev) < (-_maxSinkRate * 0.1f))
{
_hgt_dem = _hgt_dem_prev - _maxSinkRate * 0.1f;
}
_hgt_dem_prev = _hgt_dem;
// Apply first order lag to height demand
_hgt_dem_adj = 0.05f * _hgt_dem + 0.95f * _hgt_dem_adj_last;
_hgt_dem_adj_last = _hgt_dem_adj;
// in final landing stage force height rate demand to the
// configured sink rate
if (_flight_stage == FLIGHT_LAND_FINAL) {
if (_flare_counter == 0) {
_hgt_rate_dem = _climb_rate;
}
// bring it in over 1s to prevent overshoot
if (_flare_counter < 10) {
_hgt_rate_dem = _hgt_rate_dem * 0.8f - 0.2f * _land_sink;
_flare_counter++;
} else {
_hgt_rate_dem = - _land_sink;
}
} else {
_hgt_rate_dem = (_hgt_dem_adj - _hgt_dem_adj_last) / 0.1f;
_flare_counter = 0;
}
}
void AP_TECS::_detect_underspeed(void)
{
if (((_integ5_state < _TASmin * 0.9f) &&
(_throttle_dem >= _THRmaxf * 0.95f) &&
_flight_stage != AP_TECS::FLIGHT_LAND_FINAL) ||
((_integ3_state < _hgt_dem_adj) && _underspeed))
{
_underspeed = true;
}
else
{
_underspeed = false;
}
}
void AP_TECS::_update_energies(void)
{
// Calculate specific energy demands
_SPE_dem = _hgt_dem_adj * GRAVITY_MSS;
_SKE_dem = 0.5f * _TAS_dem_adj * _TAS_dem_adj;
// Calculate specific energy rate demands
_SPEdot_dem = _hgt_rate_dem * GRAVITY_MSS;
_SKEdot_dem = _integ5_state * _TAS_rate_dem;
// Calculate specific energy
_SPE_est = _integ3_state * GRAVITY_MSS;
_SKE_est = 0.5f * _integ5_state * _integ5_state;
// Calculate specific energy rate
_SPEdot = _climb_rate * GRAVITY_MSS;
_SKEdot = _integ5_state * _vel_dot;
}
/*
current time constant. It is lower in landing to try to give a precise approach
*/
float AP_TECS::timeConstant(void)
{
if (_flight_stage==FLIGHT_LAND_FINAL ||
_flight_stage==FLIGHT_LAND_APPROACH) {
return _landTimeConst;
}
return _timeConst;
}
void AP_TECS::_update_throttle(void)
{
// Calculate limits to be applied to potential energy error to prevent over or underspeed occurring due to large height errors
float SPE_err_max = 0.5f * _TASmax * _TASmax - _SKE_dem;
float SPE_err_min = 0.5f * _TASmin * _TASmin - _SKE_dem;
// Calculate total energy error
_STE_error = constrain_float((_SPE_dem - _SPE_est), SPE_err_min, SPE_err_max) + _SKE_dem - _SKE_est;
float STEdot_dem = constrain_float((_SPEdot_dem + _SKEdot_dem), _STEdot_min, _STEdot_max);
float STEdot_error = STEdot_dem - _SPEdot - _SKEdot;
// Apply 0.5 second first order filter to STEdot_error
// This is required to remove accelerometer noise from the measurement
STEdot_error = 0.2f*STEdot_error + 0.8f*_STEdotErrLast;
_STEdotErrLast = STEdot_error;
// Calculate throttle demand
// If underspeed condition is set, then demand full throttle
if (_underspeed)
{
_throttle_dem_unc = 1.0f;
}
else
{
// Calculate gain scaler from specific energy error to throttle
float K_STE2Thr = 1 / (timeConstant() * (_STEdot_max - _STEdot_min));
// Calculate feed-forward throttle
float ff_throttle = 0;
float nomThr = aparm.throttle_cruise * 0.01f;
const Matrix3f &rotMat = _ahrs.get_dcm_matrix();
// Use the demanded rate of change of total energy as the feed-forward demand, but add
// additional component which scales with (1/cos(bank angle) - 1) to compensate for induced
// drag increase during turns.
float cosPhi = sqrtf((rotMat.a.y*rotMat.a.y) + (rotMat.b.y*rotMat.b.y));
STEdot_dem = STEdot_dem + _rollComp * (1.0f/constrain_float(cosPhi * cosPhi , 0.1f, 1.0f) - 1.0f);
ff_throttle = nomThr + STEdot_dem / (_STEdot_max - _STEdot_min) * (_THRmaxf - _THRminf);
// Calculate PD + FF throttle
_throttle_dem = (_STE_error + STEdot_error * _thrDamp) * K_STE2Thr + ff_throttle;
// Rate limit PD + FF throttle
// Calculate the throttle increment from the specified slew time
if (aparm.throttle_slewrate != 0) {
float thrRateIncr = _DT * (_THRmaxf - _THRminf) * aparm.throttle_slewrate * 0.01f;
_throttle_dem = constrain_float(_throttle_dem,
_last_throttle_dem - thrRateIncr,
_last_throttle_dem + thrRateIncr);
_last_throttle_dem = _throttle_dem;
}
// Calculate integrator state upper and lower limits
// Set to a value thqat will allow 0.1 (10%) throttle saturation to allow for noise on the demand
float integ_max = (_THRmaxf - _throttle_dem + 0.1f);
float integ_min = (_THRminf - _throttle_dem - 0.1f);
// Calculate integrator state, constraining state
// Set integrator to a max throttle value during climbout
_integ6_state = _integ6_state + (_STE_error * _integGain) * _DT * K_STE2Thr;
if (_flight_stage == AP_TECS::FLIGHT_TAKEOFF)
{
_integ6_state = integ_max;
}
else
{
_integ6_state = constrain_float(_integ6_state, integ_min, integ_max);
}
// Sum the components.
// Only use feed-forward component if airspeed is not being used
if (_ahrs.airspeed_sensor_enabled()) {
_throttle_dem = _throttle_dem + _integ6_state;
} else {
_throttle_dem = ff_throttle;
}
}
// Constrain throttle demand
_throttle_dem = constrain_float(_throttle_dem, _THRminf, _THRmaxf);
}
void AP_TECS::_update_throttle_option(int16_t throttle_nudge)
{
// Calculate throttle demand by interpolating between pitch and throttle limits
float nomThr;
//If landing and we don't have an airspeed sensor and we have a non-zero
//TECS_LAND_THR param then use it
if ((_flight_stage == FLIGHT_LAND_APPROACH || _flight_stage== FLIGHT_LAND_FINAL) &&
_landThrottle >= 0) {
nomThr = (_landThrottle + throttle_nudge) * 0.01f;
} else { //not landing or not using TECS_LAND_THR parameter
nomThr = (aparm.throttle_cruise + throttle_nudge)* 0.01f;
}
if (_flight_stage == AP_TECS::FLIGHT_TAKEOFF)
{
_throttle_dem = _THRmaxf;
}
else if (_pitch_dem > 0.0f && _PITCHmaxf > 0.0f)
{
_throttle_dem = nomThr + (_THRmaxf - nomThr) * _pitch_dem / _PITCHmaxf;
}
else if (_pitch_dem < 0.0f && _PITCHminf < 0.0f)
{
_throttle_dem = nomThr + (_THRminf - nomThr) * _pitch_dem / _PITCHminf;
}
else
{
_throttle_dem = nomThr;
}
// Calculate additional throttle for turn drag compensation including throttle nudging
const Matrix3f &rotMat = _ahrs.get_dcm_matrix();
// Use the demanded rate of change of total energy as the feed-forward demand, but add
// additional component which scales with (1/cos(bank angle) - 1) to compensate for induced
// drag increase during turns.
float cosPhi = sqrtf((rotMat.a.y*rotMat.a.y) + (rotMat.b.y*rotMat.b.y));
float STEdot_dem = _rollComp * (1.0f/constrain_float(cosPhi * cosPhi , 0.1f, 1.0f) - 1.0f);
_throttle_dem = _throttle_dem + STEdot_dem / (_STEdot_max - _STEdot_min) * (_THRmaxf - _THRminf);
}
void AP_TECS::_detect_bad_descent(void)
{
// Detect a demanded airspeed too high for the aircraft to achieve. This will be
// evident by the the following conditions:
// 1) Underspeed protection not active
// 2) Specific total energy error > 200 (greater than ~20m height error)
// 3) Specific total energy reducing
// 4) throttle demand > 90%
// If these four conditions exist simultaneously, then the protection
// mode will be activated.
// Once active, the following condition are required to stay in the mode
// 1) Underspeed protection not active
// 2) Specific total energy error > 0
// This mode will produce an undulating speed and height response as it cuts in and out but will prevent the aircraft from descending into the ground if an unachievable speed demand is set
float STEdot = _SPEdot + _SKEdot;
if ((!_underspeed && (_STE_error > 200.0f) && (STEdot < 0.0f) && (_throttle_dem >= _THRmaxf * 0.9f)) || (_badDescent && !_underspeed && (_STE_error > 0.0f)))
{
_badDescent = true;
}
else
{
_badDescent = false;
}
}
void AP_TECS::_update_pitch(void)
{
// Calculate Speed/Height Control Weighting
// This is used to determine how the pitch control prioritises speed and height control
// A weighting of 1 provides equal priority (this is the normal mode of operation)
// A SKE_weighting of 0 provides 100% priority to height control. This is used when no airspeed measurement is available
// A SKE_weighting of 2 provides 100% priority to speed control. This is used when an underspeed condition is detected. In this instance, if airspeed
// rises above the demanded value, the pitch angle will be increased by the TECS controller.
float SKE_weighting = constrain_float(_spdWeight, 0.0f, 2.0f);
if (!_ahrs.airspeed_sensor_enabled()) {
SKE_weighting = 0.0f;
} else if ( _underspeed || _flight_stage == AP_TECS::FLIGHT_TAKEOFF) {
SKE_weighting = 2.0f;
} else if (_flight_stage == AP_TECS::FLIGHT_LAND_APPROACH || _flight_stage == AP_TECS::FLIGHT_LAND_FINAL) {
SKE_weighting = constrain_float(_spdWeightLand, 0.0f, 2.0f);
}
float SPE_weighting = 2.0f - SKE_weighting;
// Calculate Specific Energy Balance demand, and error
float SEB_dem = _SPE_dem * SPE_weighting - _SKE_dem * SKE_weighting;
float SEBdot_dem = _SPEdot_dem * SPE_weighting - _SKEdot_dem * SKE_weighting;
float SEB_error = SEB_dem - (_SPE_est * SPE_weighting - _SKE_est * SKE_weighting);
float SEBdot_error = SEBdot_dem - (_SPEdot * SPE_weighting - _SKEdot * SKE_weighting);
// Calculate integrator state, constraining input if pitch limits are exceeded
float integ7_input = SEB_error * _integGain;
if (_pitch_dem_unc > _PITCHmaxf)
{
integ7_input = min(integ7_input, _PITCHmaxf - _pitch_dem_unc);
}
else if (_pitch_dem_unc < _PITCHminf)
{
integ7_input = max(integ7_input, _PITCHminf - _pitch_dem_unc);
}
_integ7_state = _integ7_state + integ7_input * _DT;
// Apply max and min values for integrator state that will allow for no more than
// 5deg of saturation. This allows for some pitch variation due to gusts before the
// integrator is clipped. Otherwise the effectiveness of the integrator will be reduced in turbulence
// During climbout/takeoff, bias the demanded pitch angle so that zero speed error produces a pitch angle
// demand equal to the minimum value (which is )set by the mission plan during this mode). Otherwise the
// integrator has to catch up before the nose can be raised to reduce speed during climbout.
float gainInv = (_integ5_state * timeConstant() * GRAVITY_MSS);
float temp = SEB_error + SEBdot_error * _ptchDamp + SEBdot_dem * timeConstant();
if (_flight_stage == AP_TECS::FLIGHT_TAKEOFF)
{
temp += _PITCHminf * gainInv;
}
_integ7_state = constrain_float(_integ7_state, (gainInv * (_PITCHminf - 0.0783f)) - temp, (gainInv * (_PITCHmaxf + 0.0783f)) - temp);
// Calculate pitch demand from specific energy balance signals
_pitch_dem_unc = (temp + _integ7_state) / gainInv;
// Constrain pitch demand
_pitch_dem = constrain_float(_pitch_dem_unc, _PITCHminf, _PITCHmaxf);
_pitch_dem = constrain_float(_pitch_dem_unc, _PITCHminf, _PITCHmaxf);
// Rate limit the pitch demand to comply with specified vertical
// acceleration limit
float ptchRateIncr = _DT * _vertAccLim / _integ5_state;
if ((_pitch_dem - _last_pitch_dem) > ptchRateIncr)
{
_pitch_dem = _last_pitch_dem + ptchRateIncr;
}
else if ((_pitch_dem - _last_pitch_dem) < -ptchRateIncr)
{
_pitch_dem = _last_pitch_dem - ptchRateIncr;
}
_last_pitch_dem = _pitch_dem;
}
void AP_TECS::_initialise_states(int32_t ptchMinCO_cd, float hgt_afe)
{
// Initialise states and variables if DT > 1 second or in climbout
if (_DT > 1.0f)
{
_integ6_state = 0.0f;
_integ7_state = 0.0f;
_last_throttle_dem = aparm.throttle_cruise * 0.01f;
_last_pitch_dem = _ahrs.pitch;
_hgt_dem_adj_last = hgt_afe;
_hgt_dem_adj = _hgt_dem_adj_last;
_hgt_dem_prev = _hgt_dem_adj_last;
_hgt_dem_in_old = _hgt_dem_adj_last;
_TAS_dem_last = _TAS_dem;
_TAS_dem_adj = _TAS_dem;
_underspeed = false;
_badDescent = false;
_DT = 0.1f; // when first starting TECS, use a
// small time constant
}
else if (_flight_stage == AP_TECS::FLIGHT_TAKEOFF)
{
_PITCHminf = 0.000174533f * ptchMinCO_cd;
_THRminf = _THRmaxf - 0.01f;
_hgt_dem_adj_last = hgt_afe;
_hgt_dem_adj = _hgt_dem_adj_last;
_hgt_dem_prev = _hgt_dem_adj_last;
_TAS_dem_last = _TAS_dem;
_TAS_dem_adj = _TAS_dem;
_underspeed = false;
_badDescent = false;
}
}
void AP_TECS::_update_STE_rate_lim(void)
{
// Calculate Specific Total Energy Rate Limits
// This is a trivial calculation at the moment but will get bigger once we start adding altitude effects
_STEdot_max = _maxClimbRate * GRAVITY_MSS;
_STEdot_min = - _minSinkRate * GRAVITY_MSS;
}
void AP_TECS::update_pitch_throttle(int32_t hgt_dem_cm,
int32_t EAS_dem_cm,
enum FlightStage flight_stage,
int32_t ptchMinCO_cd,
int16_t throttle_nudge,
float hgt_afe)
{
// Calculate time in seconds since last update
uint32_t now = hal.scheduler->micros();
_DT = max((now - _update_pitch_throttle_last_usec),0)*1.0e-6f;
_update_pitch_throttle_last_usec = now;
// Update the speed estimate using a 2nd order complementary filter
_update_speed();
// Convert inputs
_hgt_dem = hgt_dem_cm * 0.01f;
_EAS_dem = EAS_dem_cm * 0.01f;
_THRmaxf = aparm.throttle_max * 0.01f;
_THRminf = aparm.throttle_min * 0.01f;
// work out the maximum and minimum pitch
// if TECS_PITCH_{MAX,MIN} isn't set then use
// LIM_PITCH_{MAX,MIN}. Don't allow TECS_PITCH_{MAX,MIN} to be
// larger than LIM_PITCH_{MAX,MIN}
if (_pitch_max <= 0) {
_PITCHmaxf = aparm.pitch_limit_max_cd * 0.01f;
} else {
_PITCHmaxf = min(_pitch_max, aparm.pitch_limit_max_cd * 0.01f);
}
if (_pitch_min >= 0) {
_PITCHminf = aparm.pitch_limit_min_cd * 0.01f;
} else {
_PITCHminf = max(_pitch_min, aparm.pitch_limit_min_cd * 0.01f);
}
if (flight_stage == FLIGHT_LAND_FINAL) {
// in flare use min pitch from LAND_PITCH_CD
_PITCHminf = max(_PITCHminf, aparm.land_pitch_cd * 0.01f);
// and allow zero throttle
_THRminf = 0;
}
// convert to radians
_PITCHmaxf = radians(_PITCHmaxf);
_PITCHminf = radians(_PITCHminf);
_flight_stage = flight_stage;
// initialise selected states and variables if DT > 1 second or in climbout
_initialise_states(ptchMinCO_cd, hgt_afe);
// Calculate Specific Total Energy Rate Limits
_update_STE_rate_lim();
// Calculate the speed demand
_update_speed_demand();
// Calculate the height demand
_update_height_demand();
// Detect underspeed condition
_detect_underspeed();
// Calculate specific energy quantitiues
_update_energies();
// Calculate throttle demand - use simple pitch to throttle if no airspeed sensor
if (_ahrs.airspeed_sensor_enabled()) {
_update_throttle();
} else {
_update_throttle_option(throttle_nudge);
}
// Detect bad descent due to demanded airspeed being too high
_detect_bad_descent();
// Calculate pitch demand
_update_pitch();
// Write internal variables to the log_tuning structure. This
// structure will be logged in dataflash at 10Hz
log_tuning.hgt_dem = _hgt_dem_adj;
log_tuning.hgt = _integ3_state;
log_tuning.dhgt_dem = _hgt_rate_dem;
log_tuning.dhgt = _climb_rate;
log_tuning.spd_dem = _TAS_dem_adj;
log_tuning.spd = _integ5_state;
log_tuning.dspd = _vel_dot;
log_tuning.ithr = _integ6_state;
log_tuning.iptch = _integ7_state;
log_tuning.thr = _throttle_dem;
log_tuning.ptch = _pitch_dem;
log_tuning.dspd_dem = _TAS_rate_dem;
log_tuning.time_ms = hal.scheduler->millis();
}
// log the contents of the log_tuning structure to dataflash
void AP_TECS::log_data(DataFlash_Class &dataflash, uint8_t msgid)
{
log_tuning.head1 = HEAD_BYTE1;
log_tuning.head2 = HEAD_BYTE2;
log_tuning.msgid = msgid;
dataflash.WriteBlock(&log_tuning, sizeof(log_tuning));
}
| gpl-3.0 |
TamataOcean/TamataSpiru | node_modules/bson/lib/double.js | 993 | 'use strict';
/**
* A class representation of the BSON Double type.
*/
class Double {
/**
* Create a Double type
*
* @param {number} value the number we want to represent as a double.
* @return {Double}
*/
constructor(value) {
this.value = value;
}
/**
* Access the number value.
*
* @method
* @return {number} returns the wrapped double number.
*/
valueOf() {
return this.value;
}
/**
* @ignore
*/
toJSON() {
return this.value;
}
/**
* @ignore
*/
toExtendedJSON(options) {
if (options && options.relaxed && isFinite(this.value)) return this.value;
return { $numberDouble: this.value.toString() };
}
/**
* @ignore
*/
static fromExtendedJSON(doc, options) {
return options && options.relaxed
? parseFloat(doc.$numberDouble)
: new Double(parseFloat(doc.$numberDouble));
}
}
Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' });
module.exports = Double;
| gpl-3.0 |
bresalio/apg | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java | 11323 | /*
* Copyright (C) 2013-2014 Dominik Schürmann <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.sufficientlysecure.keychain.ui.adapter;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry;
import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.ui.util.FormattingUtils;
import org.sufficientlysecure.keychain.ui.util.Highlighter;
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils.State;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
protected LayoutInflater mInflater;
protected Activity mActivity;
protected List<ImportKeysListEntry> mData;
static class ViewHolder {
public TextView mainUserId;
public TextView mainUserIdRest;
public TextView keyId;
public TextView fingerprint;
public TextView algorithm;
public ImageView status;
public View userIdsDivider;
public LinearLayout userIdsList;
public CheckBox checkBox;
}
public ImportKeysAdapter(Activity activity) {
super(activity, -1);
mActivity = activity;
mInflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void setData(List<ImportKeysListEntry> data) {
clear();
if (data != null) {
this.mData = data;
// add data to extended ArrayAdapter
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
addAll(data);
} else {
for (ImportKeysListEntry entry : data) {
add(entry);
}
}
}
}
public List<ImportKeysListEntry> getData() {
return mData;
}
/** This method returns a list of all selected entries, with public keys sorted
* before secret keys, see ImportExportOperation for specifics.
* @see org.sufficientlysecure.keychain.operations.ImportExportOperation
*/
public ArrayList<ImportKeysListEntry> getSelectedEntries() {
ArrayList<ImportKeysListEntry> result = new ArrayList<>();
ArrayList<ImportKeysListEntry> secrets = new ArrayList<>();
if (mData == null) {
return result;
}
for (ImportKeysListEntry entry : mData) {
if (entry.isSelected()) {
// add this entry to either the secret or the public list
(entry.isSecretKey() ? secrets : result).add(entry);
}
}
// add secret keys at the end of the list
result.addAll(secrets);
return result;
}
@Override
public boolean hasStableIds() {
return true;
}
public View getView(int position, View convertView, ViewGroup parent) {
ImportKeysListEntry entry = mData.get(position);
Highlighter highlighter = new Highlighter(mActivity, entry.getQuery());
ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.import_keys_list_item, null);
holder.mainUserId = (TextView) convertView.findViewById(R.id.import_item_user_id);
holder.mainUserIdRest = (TextView) convertView.findViewById(R.id.import_item_user_id_email);
holder.keyId = (TextView) convertView.findViewById(R.id.import_item_key_id);
holder.fingerprint = (TextView) convertView.findViewById(R.id.import_item_fingerprint);
holder.algorithm = (TextView) convertView.findViewById(R.id.import_item_algorithm);
holder.status = (ImageView) convertView.findViewById(R.id.import_item_status);
holder.userIdsDivider = convertView.findViewById(R.id.import_item_status_divider);
holder.userIdsList = (LinearLayout) convertView.findViewById(R.id.import_item_user_ids_list);
holder.checkBox = (CheckBox) convertView.findViewById(R.id.import_item_selected);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
// main user id
String userId = entry.getUserIds().get(0);
KeyRing.UserId userIdSplit = KeyRing.splitUserId(userId);
// name
if (userIdSplit.name != null) {
// show red user id if it is a secret key
if (entry.isSecretKey()) {
holder.mainUserId.setText(mActivity.getString(R.string.secret_key)
+ " " + userIdSplit.name);
} else {
holder.mainUserId.setText(highlighter.highlight(userIdSplit.name));
}
} else {
holder.mainUserId.setText(R.string.user_id_no_name);
}
// email
if (userIdSplit.email != null) {
holder.mainUserIdRest.setVisibility(View.VISIBLE);
holder.mainUserIdRest.setText(highlighter.highlight(userIdSplit.email));
} else {
holder.mainUserIdRest.setVisibility(View.GONE);
}
holder.keyId.setText(KeyFormattingUtils.beautifyKeyIdWithPrefix(getContext(), entry.getKeyIdHex()));
// don't show full fingerprint on key import
holder.fingerprint.setVisibility(View.GONE);
if (entry.getAlgorithm() != null) {
holder.algorithm.setText(entry.getAlgorithm());
holder.algorithm.setVisibility(View.VISIBLE);
} else {
holder.algorithm.setVisibility(View.GONE);
}
if (entry.isRevoked()) {
KeyFormattingUtils.setStatusImage(getContext(), holder.status, null, State.REVOKED, R.color.bg_gray);
} else if (entry.isExpired()) {
KeyFormattingUtils.setStatusImage(getContext(), holder.status, null, State.EXPIRED, R.color.bg_gray);
}
if (entry.isRevoked() || entry.isExpired()) {
holder.status.setVisibility(View.VISIBLE);
// no more space for algorithm display
holder.algorithm.setVisibility(View.GONE);
holder.mainUserId.setTextColor(getContext().getResources().getColor(R.color.bg_gray));
holder.mainUserIdRest.setTextColor(getContext().getResources().getColor(R.color.bg_gray));
holder.keyId.setTextColor(getContext().getResources().getColor(R.color.bg_gray));
} else {
holder.status.setVisibility(View.GONE);
holder.algorithm.setVisibility(View.VISIBLE);
if (entry.isSecretKey()) {
holder.mainUserId.setTextColor(Color.RED);
} else {
holder.mainUserId.setTextColor(Color.WHITE);
}
holder.mainUserIdRest.setTextColor(Color.WHITE);
holder.keyId.setTextColor(Color.WHITE);
}
if (entry.getUserIds().size() == 1) {
holder.userIdsList.setVisibility(View.GONE);
holder.userIdsDivider.setVisibility(View.GONE);
} else {
holder.userIdsList.setVisibility(View.VISIBLE);
holder.userIdsDivider.setVisibility(View.VISIBLE);
// destroyLoader view from holder
holder.userIdsList.removeAllViews();
// we want conventional gpg UserIDs first, then Keybase ”proofs”
HashMap<String, HashSet<String>> mergedUserIds = entry.getMergedUserIds();
ArrayList<Map.Entry<String, HashSet<String>>> sortedIds = new ArrayList<Map.Entry<String, HashSet<String>>>(mergedUserIds.entrySet());
java.util.Collections.sort(sortedIds, new java.util.Comparator<Map.Entry<String, HashSet<String>>>() {
@Override
public int compare(Map.Entry<String, HashSet<String>> entry1, Map.Entry<String, HashSet<String>> entry2) {
// sort keybase UserIds after non-Keybase
boolean e1IsKeybase = entry1.getKey().contains(":");
boolean e2IsKeybase = entry2.getKey().contains(":");
if (e1IsKeybase != e2IsKeybase) {
return (e1IsKeybase) ? 1 : -1;
}
return entry1.getKey().compareTo(entry2.getKey());
}
});
for (Map.Entry<String, HashSet<String>> pair : sortedIds) {
String cUserId = pair.getKey();
HashSet<String> cEmails = pair.getValue();
TextView uidView = (TextView) mInflater.inflate(
R.layout.import_keys_list_entry_user_id, null);
uidView.setText(highlighter.highlight(cUserId));
uidView.setPadding(0, 0, FormattingUtils.dpToPx(getContext(), 8), 0);
if (entry.isRevoked() || entry.isExpired()) {
uidView.setTextColor(getContext().getResources().getColor(R.color.bg_gray));
} else {
uidView.setTextColor(getContext().getResources().getColor(R.color.black));
}
holder.userIdsList.addView(uidView);
for (String email : cEmails) {
TextView emailView = (TextView) mInflater.inflate(
R.layout.import_keys_list_entry_user_id, null);
emailView.setPadding(
FormattingUtils.dpToPx(getContext(), 16), 0,
FormattingUtils.dpToPx(getContext(), 8), 0);
emailView.setText(highlighter.highlight(email));
if (entry.isRevoked() || entry.isExpired()) {
emailView.setTextColor(getContext().getResources().getColor(R.color.bg_gray));
} else {
emailView.setTextColor(getContext().getResources().getColor(R.color.black));
}
holder.userIdsList.addView(emailView);
}
}
}
holder.checkBox.setChecked(entry.isSelected());
return convertView;
}
}
| gpl-3.0 |
smasoumi/stupidwarriors | src/engine/gameScene/SceneBuilder.java | 5638 | package engine.gameScene;
import engine.gameController.GameController;
import engine.gameScene.url.Url;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Pos;
import javafx.scene.CacheHint;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.ToolBar;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import static javafx.scene.input.KeyCode.E;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
*
* @author Saeed
*/
public class SceneBuilder {
/**
* change stage to full screen
* @param stage Game Stage
* @return Stage
*/
public static Stage setFullScreen(Stage stage){
stage.setFullScreen(true);
stage.setResizable(true);
stage.setFullScreenExitHint("");
stage.setTitle("Stupid Warriors V1.0");
stage.getIcons().add(new Image(Url.ICON));
return stage ;
}
/**
*
* @param url url needed to create a fxmlLoader
* @param obj controller to set in fxml loader
* @return return Parent to add to scene
* @throws IOException
*/
public static Parent setFxmlLoader(URL url, Object obj) throws IOException{
FXMLLoader fxmlLoader = new FXMLLoader(url);
fxmlLoader.setController(obj);
return fxmlLoader.load();
}
public static ToolBar createGameToolBar(ToolBar toolbar){
Region spacer = new Region();
spacer.getStyleClass().setAll("spacer");
HBox buttonBar = new HBox();
buttonBar.getStyleClass().setAll("segmented-button-bar");
Button sampleButton = new Button("Tasks");
sampleButton.getStyleClass().addAll("first");
Button sampleButton2 = new Button("Administrator");
Button sampleButton3 = new Button("Search");
Button sampleButton4 = new Button("Line");
Button sampleButton5 = new Button("Process");
sampleButton5.getStyleClass().addAll("last", "capsule");
buttonBar.getChildren().addAll(sampleButton, sampleButton2, sampleButton3, sampleButton4, sampleButton5);
toolbar.getItems().addAll(spacer, buttonBar);
return toolbar;
}
public static void createTableBoardRight(ImageView scoutTower,
ImageView hammerHeadTower,
ImageView bulletTower,
ImageView teamUpgrade2,
ImageView teamUpgrade3,
ImageView teamUpgrade,
StackPane mainStack) {
//add to stack
mainStack.getChildren().addAll(scoutTower,hammerHeadTower,bulletTower,teamUpgrade,teamUpgrade2,teamUpgrade3);
//set position
StackPane.setAlignment(scoutTower, Pos.BOTTOM_RIGHT);
StackPane.setAlignment(hammerHeadTower, Pos.BOTTOM_RIGHT);
StackPane.setAlignment(bulletTower, Pos.BOTTOM_RIGHT);
StackPane.setAlignment(teamUpgrade, Pos.BOTTOM_RIGHT);
StackPane.setAlignment(teamUpgrade2, Pos.BOTTOM_RIGHT);
StackPane.setAlignment(teamUpgrade3, Pos.BOTTOM_RIGHT);
//set translate x,y
scoutTower.setTranslateX(-10);
scoutTower.setTranslateY(-80);
hammerHeadTower.setTranslateX(-200);
hammerHeadTower.setTranslateY(-90);
bulletTower.setTranslateX(-100);
bulletTower.setTranslateY(-80);
teamUpgrade.setTranslateX(-10);
teamUpgrade.setTranslateY(-10);
teamUpgrade2.setTranslateX(-200);
teamUpgrade2.setTranslateY(-10);
teamUpgrade3.setTranslateX(-100);
teamUpgrade3.setTranslateY(-10);
}
public static void createTableBoardLeftSoldier(ImageView infantrySoldier, ImageView tankSoldier, StackPane mainStack) {
StackPane.setAlignment(infantrySoldier, Pos.BOTTOM_LEFT);
StackPane.setAlignment(tankSoldier, Pos.BOTTOM_LEFT);
double x = 40;
double y = -50;
double imgX = infantrySoldier.getImage().getWidth();
infantrySoldier.setTranslateX(x);
infantrySoldier.setTranslateY(y);
tankSoldier.setTranslateX(x+imgX+30);
tankSoldier.setTranslateY(y);
mainStack.getChildren().addAll(infantrySoldier,tankSoldier);
}
public static void createTableBoarderLeftTower(ImageView towerAutoRepair, ImageView towerPowerUpgrade, ImageView towerRangeUpgrade, ImageView towerReloadUpgrade,StackPane mainStack) {
StackPane.setAlignment(towerReloadUpgrade, Pos.BOTTOM_LEFT);
StackPane.setAlignment(towerPowerUpgrade, Pos.BOTTOM_LEFT);
StackPane.setAlignment(towerRangeUpgrade, Pos.BOTTOM_LEFT);
StackPane.setAlignment(towerAutoRepair, Pos.BOTTOM_LEFT);
//posotion
double x = 20;
double y = -78;
double imgX = towerRangeUpgrade.getImage().getWidth();
towerPowerUpgrade.setTranslateX(x);
towerPowerUpgrade.setTranslateY(y);
towerRangeUpgrade.setTranslateX(imgX+x+10);
towerRangeUpgrade.setTranslateY(y);
towerReloadUpgrade.setTranslateX(imgX*2+x+20);
towerReloadUpgrade.setTranslateY(y);
towerAutoRepair.setTranslateX(120);
towerAutoRepair.setTranslateY(-10);
//tooltip
mainStack.getChildren().addAll(towerAutoRepair,towerPowerUpgrade,towerRangeUpgrade,towerReloadUpgrade);
}
public static void createTableBoardLeftMap(StackPane mainStack) {
}
}
| gpl-3.0 |
boydjd/openfisma | library/Zend/Measure/Capacitance.php | 4107 | <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
/**
* Implement needed classes
*/
// require_once 'Zend/Measure/Abstract.php';
// require_once 'Zend/Locale.php';
/**
* Class for handling capacitance conversions
*
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Capacitance
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Capacitance extends Zend_Measure_Abstract
{
const STANDARD = 'FARAD';
const ABFARAD = 'ABFARAD';
const AMPERE_PER_SECOND_VOLT = 'AMPERE_PER_SECOND_VOLT';
const CENTIFARAD = 'CENTIFARAD';
const COULOMB_PER_VOLT = 'COULOMB_PER_VOLT';
const DECIFARAD = 'DECIFARAD';
const DEKAFARAD = 'DEKAFARAD';
const ELECTROMAGNETIC_UNIT = 'ELECTROMAGNETIC_UNIT';
const ELECTROSTATIC_UNIT = 'ELECTROSTATIC_UNIT';
const FARAD = 'FARAD';
const FARAD_INTERNATIONAL = 'FARAD_INTERNATIONAL';
const GAUSSIAN = 'GAUSSIAN';
const GIGAFARAD = 'GIGAFARAD';
const HECTOFARAD = 'HECTOFARAD';
const JAR = 'JAR';
const KILOFARAD = 'KILOFARAD';
const MEGAFARAD = 'MEGAFARAD';
const MICROFARAD = 'MICROFARAD';
const MILLIFARAD = 'MILLIFARAD';
const NANOFARAD = 'NANOFARAD';
const PICOFARAD = 'PICOFARAD';
const PUFF = 'PUFF';
const SECOND_PER_OHM = 'SECOND_PER_OHM';
const STATFARAD = 'STATFARAD';
const TERAFARAD = 'TERAFARAD';
/**
* Calculations for all capacitance units
*
* @var array
*/
protected $_units = array(
'ABFARAD' => array('1.0e+9', 'abfarad'),
'AMPERE_PER_SECOND_VOLT' => array('1', 'A/sV'),
'CENTIFARAD' => array('0.01', 'cF'),
'COULOMB_PER_VOLT' => array('1', 'C/V'),
'DECIFARAD' => array('0.1', 'dF'),
'DEKAFARAD' => array('10', 'daF'),
'ELECTROMAGNETIC_UNIT' => array('1.0e+9', 'capacity emu'),
'ELECTROSTATIC_UNIT' => array('1.11265e-12', 'capacity esu'),
'FARAD' => array('1', 'F'),
'FARAD_INTERNATIONAL' => array('0.99951', 'F'),
'GAUSSIAN' => array('1.11265e-12', 'G'),
'GIGAFARAD' => array('1.0e+9', 'GF'),
'HECTOFARAD' => array('100', 'hF'),
'JAR' => array('1.11265e-9', 'jar'),
'KILOFARAD' => array('1000', 'kF'),
'MEGAFARAD' => array('1000000', 'MF'),
'MICROFARAD' => array('0.000001', 'µF'),
'MILLIFARAD' => array('0.001', 'mF'),
'NANOFARAD' => array('1.0e-9', 'nF'),
'PICOFARAD' => array('1.0e-12', 'pF'),
'PUFF' => array('1.0e-12', 'pF'),
'SECOND_PER_OHM' => array('1', 's/Ohm'),
'STATFARAD' => array('1.11265e-12', 'statfarad'),
'TERAFARAD' => array('1.0e+12', 'TF'),
'STANDARD' => 'FARAD'
);
}
| gpl-3.0 |
konker/konker_ultrathin_led_matrix | include/klm_matrix.h | 8913 | /**
* Konker's LED matrix library
*
* A library for driving a red LED matrix
*
* Copyright 2015, Konrad Markus <[email protected]>
*
* This file is part of konker_led_matrix.
*
* konker_led_matrix is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* konker_led_matrix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with konker_led_matrix. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __KONKER_LED_MATRIX_H__
#define __KONKER_LED_MATRIX_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#ifdef ARDUINO
# include <Arduino.h>
#else
# ifdef KLM_WIRING_PI
# include <wiringPi.h>
# include <wiringShift.h>
# endif
// Why aren't these in wiringPi?
# define bitRead(value, bit) (((value) >> (bit)) & 0x01)
# define bitSet(value, bit) ((value) |= (1UL << (bit)))
# define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
# define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
#endif
#if !defined(ARDUINO) && !defined(KLM_WIRING_PI)
#define KLM_NON_GPIO_MACHINE
#endif
#include <time.h>
#include <hexfont.h>
#include <hexfont_list.h>
#include "klm_segment.h"
#include "klm_segment_list.h"
#include "klm_config.h"
// Symbolic constants
#define KLM_BYTE_WIDTH 8
#define KLM_OFF_BYTE 0x00
#define KLM_OFF 0x00
#define KLM_ON 0x01
// Macros for convenience
#define KLM_BUFFER_LEN(w, h) (size_t)(h * (w/KLM_BYTE_WIDTH))
#define KLM_ROW_OFFSET(matrix, y) (matrix->_row_width*y)
#define KLM_BUF_OFFSET(matrix, x, y) (size_t)(KLM_ROW_OFFSET(matrix, y)+x/KLM_BYTE_WIDTH)
#define KLM_LOG(matrix, ...) fprintf(matrix->logfp, __VA_ARGS__); \
fflush(matrix->logfp);
#define KLM_LOCK(lock) if (lock != NULL) { *lock = true; }
#define KLM_UNLOCK(lock) if (lock != NULL) { *lock = false; }
#define KLM_ONE_MILLION 1000000
#define KLM_ONE_THOUSAND 1000
#define KLM_NOW_MICROSECS(var, time_spec_var) \
clock_gettime(CLOCK_REALTIME, &time_spec_var); \
var = time_spec_var.tv_sec * KLM_ONE_MILLION; \
var += time_spec_var.tv_nsec / KLM_ONE_THOUSAND; \
// 1 thousand => 1 millisecond
#define KLM_TICK_PERIOD_MICROS 100 * KLM_ONE_THOUSAND
// Forward declare klm_segment because of circular refs
typedef struct klm_segment klm_segment;
typedef struct klm_matrix
{
// Log file pointer
FILE *logfp;
klm_config *config;
// A buffer to hold the current frame
uint8_t *display_buffer0;
// A buffer to hold the current frame for display
uint8_t *display_buffer1;
// Whether the display buffer(s) were dynamically allocated
bool _dynamic_buffer;
// A list of available fonts and associated font-metrics
hexfont_list *font_list;
// Global matrix state flags
bool on;
// A number to indicate the level of modulation used for "dimming"
uint16_t scan_modulation;
// A list of virtual segments which make up the display
klm_segment_list *segment_list;
// Keep track of the current scan row
uint16_t scan_row;
// Internal vars
uint16_t _row_width;
struct timespec now_t;
int64_t micros_0;
int64_t micros_1;
} klm_matrix;
/** Call any necessary one-time initialization */
bool klm_mat_begin();
/** Create a matrix object by specifying its physical characteristics */
klm_matrix * const klm_mat_create(FILE *logfp, klm_config * const config);
/** Clean up a matrix object */
void klm_mat_destroy(klm_matrix * const matrix);
/** Initialize a matrix object with a set of fonts and a set of segments */
void klm_mat_init(klm_matrix * const matrix,
hexfont_list * const font_list,
klm_segment_list * const segment_list);
/** Initialize a matrix object with the given font. A full-screen segment will be automatically created */
void klm_mat_simple_init(klm_matrix * const matrix,
hexfont * const font);
/** Set the default full-screen segment's text content */
void klm_mat_simple_set_text(klm_matrix * const matrix, const char *text);
/** Set the animation scroll speed of the default full-screen segment in pixels per frame */
void klm_mat_simple_set_text_speed(klm_matrix * const matrix, float hspeed, float vspeed);
/** Start animation of matrix content */
void klm_mat_simple_start(klm_matrix * const matrix);
/** Stop animation of matrix content */
void klm_mat_simple_stop(klm_matrix * const matrix);
/** Set the position of the default full-screen segment's text */
void klm_mat_simple_set_text_position(klm_matrix * const matrix, float text_hpos, float text_vpos);
/** Reverse the matrix display */
void klm_mat_simple_reverse(klm_matrix * const matrix);
/** Drive animation */
void klm_mat_tick(klm_matrix * const matrix);
/** Clear the entire matrix */
void klm_mat_clear(klm_matrix * const matrix);
/** Clear the text of the entire matrix */
void klm_mat_clear_text(klm_matrix * const matrix);
/** Switch off matrix display altogether */
void klm_mat_on(klm_matrix * const matrix);
/** Switch on matrix display */
void klm_mat_off(klm_matrix * const matrix);
/** Set the scan loop modulation */
void klm_mat_set_scan_modulation(klm_matrix * const matrix, uint16_t scan_modulation);
// Driver functions
// ----------------------------------------------------------------------------
/** Drive the matrix hardware */
extern void klm_mat_scan(klm_matrix * const matrix);
/** Set a pixel */
extern void klm_mat_set_pixel(klm_matrix * const matrix, int16_t x, int16_t y);
/** Clear a pixel */
extern void klm_mat_clear_pixel(klm_matrix * const matrix, int16_t x, int16_t y);
/** Apply a mask to a given pixel */
extern void klm_mat_mask_pixel(klm_matrix * const matrix, int16_t x, int16_t y, bool reverse);
/** Clear the matrix */
extern void klm_mat_clear(klm_matrix *matrix);
/** Query whether or not the given pixel has been set */
extern bool klm_mat_is_pixel_set(klm_matrix * const matrix, int16_t x, int16_t y);
/** Print a representation of the display buffer to the console */
extern void klm_mat_dump_buffer(klm_matrix * const matrix);
extern void klm_mat_init_hardware(klm_matrix * const matrix);
extern void klm_mat_init_display_buffer(klm_matrix * const matrix);
// Inline funtions
// ----------------------------------------------------------------------------
/** Copy the buffer0 to buffer1 */
static inline void klm_mat_swap_buffers(klm_matrix * const matrix) {
uint8_t *tmp = matrix->display_buffer1;
matrix->display_buffer1 = matrix->display_buffer0;
matrix->display_buffer0 = tmp;
}
/** Clear a region of the matrix */
static inline void klm_mat_clear_region(
klm_matrix * const matrix,
int16_t x, int16_t y,
uint16_t w, uint16_t h)
{
int16_t bx, by;
for (by=0; by<h; by++) {
for (bx=0; bx<w; bx++) {
int16_t _x = x + bx;
int16_t _y = y + by;
klm_mat_clear_pixel(matrix, _x, _y);
}
}
}
/** Clear a region of the matrix */
static inline void klm_mat_mask_region(
klm_matrix * const matrix,
int16_t x, int16_t y,
uint16_t w, uint16_t h,
bool reverse)
{
int16_t bx, by;
for (by=0; by<h; by++) {
for (bx=0; bx<w; bx++) {
int16_t _x = x + bx;
int16_t _y = y + by;
klm_mat_mask_pixel(matrix, _x, _y, reverse);
}
}
}
/** Set a region of pixels from a source sprite array */
static inline void klm_mat_render_sprite(
klm_matrix * const matrix,
hexfont_character * const sprite,
int16_t x, int16_t y,
int16_t clip_x0, int16_t clip_y0,
int16_t clip_x1, int16_t clip_y1)
{
int16_t by, bx;
for (by=0; by<sprite->height; by++) {
for (bx=0; bx<sprite->width; bx++) {
int16_t _x = x + bx;
int16_t _y = y + by;
if (_x < clip_x0 || _x >= clip_x1 ||
_y < clip_y0 || _y >= clip_y1)
{
continue;
}
if (hexfont_character_get_pixel(sprite, bx, by)) {
klm_mat_set_pixel(matrix, _x, _y);
}
else {
klm_mat_clear_pixel(matrix, _x, _y);
}
}
}
}
#ifdef __cplusplus
}
#endif
#endif // __KONKER_LED_MATRIX_H__
| gpl-3.0 |
bit0Ar/pilas-bloques | releases/pilas-engine-bloques-linux-ia32/resources/app/ejerciciosPilas/src/escenas/TresNaranjas.ts | 1676 | /// <reference path = "EscenaActividad.ts" />
/// <reference path = "../../dependencias/pilasweb.d.ts"/>
/// <reference path = "../actores/Cuadricula.ts"/>
/// <reference path = "../actores/PerroCohete.ts"/>
/// <reference path = "../comportamientos/MovimientosEnCuadricula.ts"/>
/**
* @class TresNaranjas
*
*/
class TresNaranjas extends EscenaActividad {
fondo;
automata;
cuadricula;
objetos = [];
iniciar() {
this.fondo = new Fondo('fondo.tresNaranjas.png',0,0);
this.cuadricula = new Cuadricula(0,0,1,4,
{separacionEntreCasillas: 5},
{grilla: 'casilla.tresNaranjas.png', ancho:100,alto:100});
//se cargan los Naranjas
var hayAlMenosUno = false;
for(var i = 0; i < 3; i++) {
if (Math.random() < .5) {
hayAlMenosUno = true;
this.agregarNaranja(i+1);
}
}
if (!hayAlMenosUno) {
var columna = 1;
var rand = Math.random()
if (rand> 0.33 && rand<0.66) {
columna = 2;
} else if (rand > 0.66) {
columna = 3
}
this.agregarNaranja(columna);
}
// se crea el personaje
this.automata = new MarcianoAnimado(0,0);
this.cuadricula.agregarActor(this.automata,0,0);
}
agregarNaranja(columna) {
var objeto = new NaranjaAnimada(0,0);
this.cuadricula.agregarActor(objeto,0,columna);
this.objetos.push(objeto);
}
estaResueltoElProblema(){
return this.contarActoresConEtiqueta('NaranjaAnimada')==0 && this.automata.estaEnCasilla(null,3);
}
}
| gpl-3.0 |
randomstuffpaul/KernelAdiutor | app/src/main/java/com/grarak/kerneladiutor/activities/BaseActivity.java | 5069 | /*
* Copyright (C) 2015-2016 Willi Ye <[email protected]>
*
* This file is part of Kernel Adiutor.
*
* Kernel Adiutor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Kernel Adiutor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kernel Adiutor. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.grarak.kerneladiutor.activities;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import com.grarak.kerneladiutor.R;
import com.grarak.kerneladiutor.utils.Prefs;
import com.grarak.kerneladiutor.utils.Utils;
import com.grarak.kerneladiutor.utils.ViewUtils;
import java.util.HashMap;
/**
* Created by willi on 14.04.16.
*/
public class BaseActivity extends AppCompatActivity {
private static HashMap<String, Integer> sAccentColors = new HashMap<>();
private static HashMap<String, Integer> sAccentDarkColors = new HashMap<>();
static {
sAccentColors.put("red_accent", R.style.Theme_Red);
sAccentColors.put("pink_accent", R.style.Theme_Pink);
sAccentColors.put("purple_accent", R.style.Theme_Purple);
sAccentColors.put("blue_accent", R.style.Theme_Blue);
sAccentColors.put("green_accent", R.style.Theme_Green);
sAccentColors.put("orange_accent", R.style.Theme_Orange);
sAccentColors.put("brown_accent", R.style.Theme_Brown);
sAccentColors.put("grey_accent", R.style.Theme_Grey);
sAccentColors.put("blue_grey_accent", R.style.Theme_BlueGrey);
sAccentColors.put("teal_accent", R.style.Theme_Teal);
sAccentDarkColors.put("red_accent", R.style.Theme_Red_Dark);
sAccentDarkColors.put("pink_accent", R.style.Theme_Pink_Dark);
sAccentDarkColors.put("purple_accent", R.style.Theme_Purple_Dark);
sAccentDarkColors.put("blue_accent", R.style.Theme_Blue_Dark);
sAccentDarkColors.put("green_accent", R.style.Theme_Green_Dark);
sAccentDarkColors.put("orange_accent", R.style.Theme_Orange_Dark);
sAccentDarkColors.put("brown_accent", R.style.Theme_Brown_Dark);
sAccentDarkColors.put("grey_accent", R.style.Theme_Grey_Dark);
sAccentDarkColors.put("blue_grey_accent", R.style.Theme_BlueGrey_Dark);
sAccentDarkColors.put("teal_accent", R.style.Theme_Teal_Dark);
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
Utils.DARK_THEME = Prefs.getBoolean("darktheme", false, this);
int theme;
String accent = Prefs.getString("accent_color", "pink_accent", this);
if (Utils.DARK_THEME) {
theme = sAccentDarkColors.get(accent);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
} else {
theme = sAccentColors.get(accent);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
}
setTheme(theme);
super.onCreate(savedInstanceState);
if (Prefs.getBoolean("forceenglish", false, this)) {
Utils.setLocale("en_US", this);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && setStatusBarColor()) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(statusBarColor());
}
}
public AppBarLayout getAppBarLayout() {
return (AppBarLayout) findViewById(R.id.appbarlayout);
}
public Toolbar getToolBar() {
return (Toolbar) findViewById(R.id.toolbar);
}
public void initToolBar() {
Toolbar toolbar = getToolBar();
if (toolbar != null) {
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
protected boolean setStatusBarColor() {
return true;
}
protected int statusBarColor() {
return ViewUtils.getColorPrimaryDarkColor(this);
}
}
| gpl-3.0 |
dejan-brkic/commons | utilities/src/main/java/org/craftercms/commons/logging/Logged.java | 1171 | /*
* Copyright (C) 2007-2017 Crafter Software Corporation.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.craftercms.commons.logging;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation used to indicate that a method (or all methods of a class, if used in a class) should be logged.
*
* @author avasquez
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Logged {
}
| gpl-3.0 |
waterlgndx/darkstar | scripts/globals/abilities/yonin.lua | 701 | -----------------------------------
-- Ability: Yonin
-- Increases enmity and enhances "Ninja Tool Expertise" effect, but impairs accuracy. Improves evasion and reduces enemy Critical Hit Rate when in front of target.
-- Obtained: Ninja Level 40
-- Recast Time: 3:00
-- Duration: 5:00
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
-----------------------------------
function onAbilityCheck(player,target,ability)
return 0,0;
end;
function onUseAbility(player,target,ability)
target:delStatusEffect(dsp.effect.INNIN);
target:delStatusEffect(dsp.effect.YONIN);
target:addStatusEffect(dsp.effect.YONIN,30,15,300,0,20);
end; | gpl-3.0 |
ZeroOne71/ql | 03_SellerPortal/ECommerce.Utility.DataAccess/RLDB/Config/DataOperations.cs | 4968 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Data;
namespace ECommerce.Utility.DataAccess.Database.Config
{
[XmlRoot("dataOperations", Namespace = "http://oversea.ECommerce.com/DataOperation")]
public partial class DataOperations
{
[XmlElement("dataCommand")]
public DataCommandConfig[] DataCommand
{
get;
set;
}
}
[XmlRoot("dataCommand")]
public partial class DataCommandConfig
{
private CommandType m_CommandType = CommandType.Text;
private int m_TimeOut = 300;
[XmlElement("commandText")]
public string CommandText
{
get;
set;
}
[XmlElement("parameters")]
public Parameters Parameters
{
get;
set;
}
[XmlAttribute("name")]
public string Name
{
get;
set;
}
[XmlAttributeAttribute("database")]
public string Database
{
get;
set;
}
[XmlAttributeAttribute("commandType")]
[DefaultValueAttribute(CommandType.Text)]
public CommandType CommandType
{
get
{
return this.m_CommandType;
}
set
{
this.m_CommandType = value;
}
}
[XmlAttributeAttribute("timeOut")]
[DefaultValueAttribute(300)]
public int TimeOut
{
get
{
return this.m_TimeOut;
}
set
{
this.m_TimeOut = value;
}
}
public DataCommandConfig Clone()
{
DataCommandConfig config = new DataCommandConfig();
config.CommandText = this.CommandText;
config.CommandType = this.CommandType;
config.Database = this.Database;
config.Name = this.Name;
config.Parameters = this.Parameters == null ? null : this.Parameters.Clone();
config.TimeOut = this.TimeOut;
return config;
}
}
[XmlRoot("parameters")]
public partial class Parameters
{
[XmlElement("param")]
public Param[] Param
{
get;
set;
}
public Parameters Clone()
{
Parameters p = new Parameters();
if (this.Param != null)
{
p.Param = new Param[this.Param.Length];
for (int i = 0; i < this.Param.Length; i++)
{
p.Param[i] = this.Param[i].Clone();
}
}
return p;
}
}
[XmlRoot("param")]
public partial class Param
{
private ParameterDirection m_Direction = ParameterDirection.Input;
private int m_Size = -1;
private byte m_Scale = 0;
private byte m_Precision = 0;
public Param Clone()
{
Param p = new Param();
p.DbType = this.DbType;
p.Direction = this.Direction;
p.Name = this.Name;
p.Precision = this.Precision;
p.Property = this.Property;
p.Scale = this.Scale;
p.Size = this.Size;
return p;
}
[XmlAttribute("name")]
public string Name
{
get;
set;
}
[XmlAttribute("dbType")]
public DbType DbType
{
get;
set;
}
[XmlAttribute("direction")]
[DefaultValue(ParameterDirection.Input)]
public ParameterDirection Direction
{
get
{
return this.m_Direction;
}
set
{
this.m_Direction = value;
}
}
[XmlAttribute("size")]
[DefaultValue(-1)]
public int Size
{
get
{
return this.m_Size;
}
set
{
this.m_Size = value;
}
}
[XmlAttribute("scale")]
[DefaultValue(0)]
public byte Scale
{
get
{
return this.m_Scale;
}
set
{
this.m_Scale = value;
}
}
[XmlAttribute("precision")]
[DefaultValue(0)]
public byte Precision
{
get
{
return this.m_Precision;
}
set
{
this.m_Precision = value;
}
}
[XmlAttribute("property")]
public string Property
{
get;
set;
}
}
}
| gpl-3.0 |
SavageLearning/Machete | Machete.Web/Maps/Legacy/WorkerSigninProfile.cs | 5028 | using System;
using AutoMapper;
using Machete.Web.Helpers;
using static Machete.Web.Helpers.Extensions;
namespace Machete.Web.Maps
{
public class WorkerSigninProfile : Profile
{
public WorkerSigninProfile()
{
CreateMap<Domain.WorkerSignin, Service.DTO.WorkerSigninList>()
.ForMember(v => v.englishlevel, opt => opt.MapFrom(d => d == null ? 0 : d.worker.englishlevelID))
.ForMember(v => v.waid, opt => opt.MapFrom(d => d.WorkAssignmentID))
.ForMember(v => v.skill1, opt => opt.MapFrom(d => d == null ? null : d.worker.skill1))
.ForMember(v => v.skill2, opt => opt.MapFrom(d => d == null ? null : d.worker.skill2))
.ForMember(v => v.skill3, opt => opt.MapFrom(d => d == null ? null : d.worker.skill3))
.ForMember(v => v.program, opt => opt.MapFrom(d => d.worker.typeOfWork))
.ForMember(v => v.skillCodes, opt => opt.MapFrom(d => d.worker.skillCodes))
.ForMember(v => v.lotterySequence, opt => opt.MapFrom(d => d.lottery_sequence))
.ForMember(v => v.fullname, opt => opt.MapFrom(d =>
$"{d.worker.Person.firstname1} {d.worker.Person.firstname2} {d.worker.Person.lastname1} {d.worker.Person.lastname2}")
)
.ForMember(v => v.firstname1, opt => opt.MapFrom(d => d.worker.Person.firstname1))
.ForMember(v => v.firstname2, opt => opt.MapFrom(d => d.worker.Person.firstname2))
.ForMember(v => v.lastname1, opt => opt.MapFrom(d => d.worker.Person.lastname1))
.ForMember(v => v.lastname2, opt => opt.MapFrom(d => d.worker.Person.lastname2))
.ForMember(v => v.expirationDate, opt => opt.MapFrom(d => d.worker.memberexpirationdate))
.ForMember(v => v.memberStatusID, opt => opt.MapFrom(d => d.worker.memberStatusID))
.ForMember(v => v.memberStatusEN, opt => opt.MapFrom(d => d.worker.memberStatusEN))
.ForMember(v => v.memberStatusES, opt => opt.MapFrom(d => d.worker.memberStatusES))
.ForMember(v => v.memberExpired, opt => opt.MapFrom(d => d.worker.memberStatusID == Domain.Worker.iExpired))
.ForMember(v => v.memberInactive, opt => opt.MapFrom(d => d.worker.memberStatusID == Domain.Worker.iInactive))
.ForMember(v => v.memberSanctioned, opt => opt.MapFrom(d => d.worker.memberStatusID == Domain.Worker.iSanctioned))
.ForMember(v => v.memberExpelled, opt => opt.MapFrom(d => d.worker.memberStatusID == Domain.Worker.iExpelled))
.ForMember(v => v.imageRef, opt => opt.MapFrom(d => d.worker.ImageID == null ? "/Content/images/NO-IMAGE-AVAILABLE.jpg" : "/Image/GetImage/" + d.worker.ImageID))
.ForMember(v => v.imageID, opt => opt.MapFrom(d => d.worker.ImageID))
.ForMember(v => v.typeOfWorkID, opt => opt.MapFrom(d => d.worker.typeOfWorkID))
.ForMember(v => v.signinID, opt => opt.MapFrom(d => d.ID))
;
CreateMap<Domain.WorkerSignin, ViewModel.WorkerSignin>()
.ForMember(v => v.memberExpired, opt => opt.MapFrom(d => d.worker.memberStatusID == Domain.Worker.iExpired))
.ForMember(v => v.memberInactive, opt => opt.MapFrom(d => d.worker.memberStatusID == Domain.Worker.iInactive))
.ForMember(v => v.memberSanctioned, opt => opt.MapFrom(d => d.worker.memberStatusID == Domain.Worker.iSanctioned))
.ForMember(v => v.memberExpelled, opt => opt.MapFrom(d => d.worker.memberStatusID == Domain.Worker.iExpelled))
.ForMember(v => v.imageRef, opt => opt.MapFrom(d => d.worker.ImageID == null ? "/Content/images/NO-IMAGE-AVAILABLE.jpg" : "/Image/GetImage/" + d.worker.ImageID))
.ForMember(v => v.message, opt => opt.MapFrom(src => "success"))
.ForMember(v => v.worker, opt => opt.Ignore())
.ForMember(v => v.def, opt => opt.Ignore())
.ForMember(v => v.idString, opt => opt.Ignore())
.ForMember(v => v.tabref, opt => opt.Ignore())
.ForMember(v => v.tablabel, opt => opt.Ignore())
;
CreateMap<Service.DTO.WorkerSigninList, ViewModel.WorkerSigninList>()
.ForMember(v => v.recordid, opt => opt.MapFrom(d => d.ID))
.ForMember(v => v.WSIID, opt => opt.MapFrom(d => d.ID))
.ForMember(v => v.expirationDate, opt => opt.MapFrom(d => d.expirationDate.ToShortDateString()))
.ForMember(v => v.memberStatus,
opt => opt.MapFrom(d => getCI() == "ES" ? d.memberStatusES : d.memberStatusEN))
.ForMember(v => v.dateforsignin, opt => opt.MapFrom(d => d.dateforsignin))
.ForMember(v => v.dateforsigninstring, opt => opt.MapFrom(d =>
d.dateforsignin.UtcToClientString("hh:mm:ss tt"))
)
;
}
}
}
| gpl-3.0 |
rajmahesh/magento2-master | vendor/magento/module-quote/Model/GuestCartManagement/Plugin/Authorization.php | 1301 | <?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quote\Model\GuestCartManagement\Plugin;
use Magento\Framework\Exception\StateException;
class Authorization
{
/**
* @var \Magento\Authorization\Model\UserContextInterface
*/
protected $userContext;
/**
* @param \Magento\Authorization\Model\UserContextInterface $userContext
*/
public function __construct(
\Magento\Authorization\Model\UserContextInterface $userContext
) {
$this->userContext = $userContext;
}
/**
* @param \Magento\Quote\Model\GuestCart\GuestCartManagement $subject
* @param string $cartId
* @param int $customerId
* @param int $storeId
* @throws StateException
* @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function beforeAssignCustomer(
\Magento\Quote\Model\GuestCart\GuestCartManagement $subject,
$cartId,
$customerId,
$storeId
) {
if ($customerId !== (int)$this->userContext->getUserId()) {
throw new StateException(
__('Cannot assign customer to the given cart. You don\'t have permission for this operation.')
);
}
}
}
| gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.