code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
/* This file is part of the db4o object database http://www.db4o.com
Copyright (C) 2004 - 2011 Versant Corporation http://www.versant.com
db4o is free software; you can redistribute it and/or modify it under
the terms of version 3 of the GNU General Public License as published
by the Free Software Foundation.
db4o 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/. */
using Db4objects.Db4o;
using Db4objects.Db4o.CS;
using Db4objects.Db4o.CS.Internal.Config;
using Db4objects.Db4o.Config;
using Db4objects.Db4o.Foundation;
using Db4objects.Drs.Db4o;
using Db4objects.Drs.Tests;
namespace Db4objects.Drs.Tests
{
public class Db4oClientServerDrsFixture : Db4oDrsFixture
{
private static readonly string Host = "localhost";
private static readonly string Username = "db4o";
private static readonly string Password = Username;
private IObjectServer _server;
private int _port;
public Db4oClientServerDrsFixture(string name, int port) : base(name)
{
_port = port;
}
public override void Close()
{
base.Close();
_server.Close();
}
public override void Open()
{
Config().MessageLevel(-1);
_server = Db4oClientServer.OpenServer(Db4oClientServerLegacyConfigurationBridge.AsServerConfiguration
(CloneConfiguration()), testFile.GetPath(), _port);
_server.GrantAccess(Username, Password);
_db = Db4oClientServer.OpenClient(Db4oClientServerLegacyConfigurationBridge.AsClientConfiguration
(CloneConfiguration()), Host, _port, Username, Password).Ext();
_provider = Db4oProviderFactory.NewInstance(_db, _name);
}
private IConfiguration CloneConfiguration()
{
return (IConfiguration)((IDeepClone)Config()).DeepClone(Config());
}
}
}
|
masroore/db4o
|
drs/Db4objects.Drs.Tests/Db4objects.Drs.Tests/Db4oClientServerDrsFixture.cs
|
C#
|
gpl-3.0
| 2,009 |
/*
** Copyright (C) 2011 Xue Yingfei
**
** This file is part of MaxTable.
**
** Maxtable 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.
**
** Maxtable 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 Maxtable. If not, see <http://www.gnu.org/licenses/>.
*/
#include "global.h"
int
str1nstr (char *buf, char *sub, int len)
{
char *bp;
char *sp;
int i;
int j;
i = 0;
if (!*sub)
{
return i;
}
while (i < len)
{
bp = buf;
sp = sub;
j = 0;
do
{
if (!*sp)
{
return (i + j);
}
j++;
} while (*bp++ == *sp++);
buf++;
i++;
}
return i;
}
int
str01str (char *buf, char *sub, int len)
{
char *bp;
char *sp;
int i;
i = 0;
if (!*sub)
{
return (i - 1);
}
while (i < len)
{
bp = buf;
sp = sub;
do
{
if (!*sp)
{
return (i - 1);
}
} while (*bp++ == *sp++);
buf++;
i++;
}
return (i - 1);
}
int
strmnstr (char *buf, char *sub, int len)
{
char *bp;
char *sp;
int i;
int j;
int k;
i = 0;
if (!*sub)
{
return i;
}
while (*buf && (i < len))
{
bp = buf;
sp = sub;
j = 0;
do
{
if (!*sp)
{
k = (i + j);
break;
}
j++;
} while (*bp++ == *sp++);
buf++;
i++;
}
return k;
}
int
str0n_trunc_0t(char *buf, int len, int *start, int *end)
{
char *str;
*start = 0;
*end = len;
str = buf;
if (len == 0)
{
return TRUE;
}
while (((*str == ' ') || (*str == '\t')) && ((*start) < len))
{
str++;
(*start)++;
}
str = &(buf[len - 1]);
while (((*str == ' ') || (*str == '\t')) && ((*end) > (*start)))
{
str--;
(*end)--;
}
return TRUE;
}
|
fatihky2/maxtable
|
common/src/strings.c
|
C
|
gpl-3.0
| 2,247 |
;; The top half of this file draws boxes forwards; the latter draws backwards
;; Install at 0x8A00
SetupBattleDrawMessageBuffer:
LDA #$40 ; Setup DST pointer
STA $8A ; $2240 into $008A
LDA #$22
STA $8B
LDA #$1E ; Setup SRC pointer
STA $88 ; $691E into $0088
LDA #$69
STA $89
RTS
;; Install at 0x8A20
BattleDrawMessageBuffer:
LDA #$03 ; Loop counter overridden by BattleBoxDrawRows
STA $68B9
JSR $F4A1 ; BattleWaitVBlank - called outside of the loop to just do it once
Loop:
JSR $F4E8 ; Battle_DrawMessageRow (without _VBlank)
LDA $88 ; Update all pointers used by above
CLC
ADC #$20
STA $88
LDA $89
ADC #$00
STA $89
LDA $8A
CLC
ADC #$20
STA $8A
LDA $8B
ADC #$00
STA $8B
DEC $68B9
BNE Loop
RTS
;; Bottom half for reverse draw. Nearly identical.
;; Install at 0x8A80
SetupBattleDrawMessageBufferReverse:
LDA #$A0 ; Setup DST pointer
STA $8A ; $2240 into $008A
LDA #$23
STA $8B
LDA #$7E ; Setup SRC pointer
STA $88 ; $691E into $0088
LDA #$6A
STA $89
RTS
;; Install at 0x8AA0
BattleDrawMessageBufferReverse:
LDA #$03 ; Loop counter overridden by BattleBoxUndrawRows
STA $68B9
JSR $F4A1 ; VBlank
Loop:
JSR $F4E8 ; Battle_DrawMessageRow without _VBlank
LDA $88 ; subtract $20 from the source pointer
SEC
SBC #$20
STA $88
LDA $89
SBC #$00
STA $89
LDA $8A ; and from the dest pointer
SEC
SBC #$20
STA $8A
LDA $8B
SBC #$00
STA $8B
DEC $68B9
BNE Loop
RTS
;;
;; Code for Hacks.cs that draws the above. This replaces the real BattleDrawMessageBuffer:
;; Install at 0x7F4AA for the drawing operation, and 0x7F4AA for the undraw animation.
;;
BattleDrawMessageBuffer:
LDA $60FC ; Classic push of bank onto stack
PHA
LDA #$0F ; Select Bank 0x0F
JSR $FE03 ; SwapPRG_L
JSR $8A00 ; Setup routine primes some pointers (Change to $8A80 for backwards)
LDA #$04 ; Setup Loop number of frames (overridden by BattleBoxDrawInFrames)
STA $17 ; tmp + 7
FrameLoop:
LDA #$0F ; Reload Bank 0x0F
JSR $FE03 ; SwapPRG_L
JSR $8A20 ; BattleDrawMessageBuffer (Does 1 Vsync) (Change to $8AA0 for backwards)
JSR $F485 ; Battle_UpdatePPU_UpdateAudio_FixedBank. This clobbers the loaded bank.
DEC $17 ; Check and Loop
BNE FrameLoop
PLA ; Pull and restore old cur_bank
JSR $FE03 ; SwapPRG_L
RTS
|
Entroper/FF1Randomizer
|
FF1Lib/asm/0F_8A00_FastBattleBoxes.asm
|
Assembly
|
gpl-3.0
| 2,634 |
/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
/** @file
* @defgroup nrf_dev_radio_tx_example_main main.c
* @{
* @ingroup nrf_dev_radio_tx_example
*
* @brief Radio Transmitter Example Application main file.
*
* This file contains the source code for a sample application using the NRF_RADIO to transmit.
*
* @image html example_board_setup_a.jpg "Use board setup A for this example."
*/
#include "nrf_gpio.h"
#include <stdint.h>
#include <stdbool.h>
#include "nrf_delay.h"
#include "radio_config.h"
#include "boards.h"
static uint8_t packet[PACKET_PAYLOAD_MAXSIZE]; /**< Packet to transmit. */
/**
* @brief Function for application main entry.
*/
int main(void)
{
// Start 16 MHz crystal oscillator.
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK->TASKS_HFCLKSTART = 1;
// Wait for the external oscillator to start up.
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
{
// Do nothing.
}
// Set Port 0 as input.
nrf_gpio_range_cfg_input(BUTTON_START, BUTTON_STOP, BUTTON_PULL);
// Set Port 1 as output.
nrf_gpio_range_cfg_output(LED_START, LED_STOP);
// Set radio configuration parameters.
radio_configure();
// Set payload pointer.
NRF_RADIO->PACKETPTR = (uint32_t)packet;
while (true)
{
// Read Data to send, button signals are default high, and low when pressed.
packet[0] = ~(nrf_gpio_port_read(NRF_GPIO_PORT_SELECT_PORT0)); // Write GPIO to payload byte 0.
NRF_RADIO->EVENTS_READY = 0U;
NRF_RADIO->TASKS_TXEN = 1; // Enable radio and wait for ready.
while (NRF_RADIO->EVENTS_READY == 0U)
{
// Do nothing.
}
// Start transmission.
NRF_RADIO->TASKS_START = 1U;
NRF_RADIO->EVENTS_END = 0U;
while (NRF_RADIO->EVENTS_END == 0U) // Wait for end of the transmission packet.
{
// Do nothing.
}
// Write sent data to port 1.
nrf_gpio_port_write(NRF_GPIO_PORT_SELECT_PORT1, packet[0]);
NRF_RADIO->EVENTS_DISABLED = 0U;
NRF_RADIO->TASKS_DISABLE = 1U; // Disable the radio.
while (NRF_RADIO->EVENTS_DISABLED == 0U)
{
// Do nothing.
}
}
}
/** @} */
|
DroneBucket/Drone_Bucket_CrazyFlie2_NRF_Firmware
|
nrf51_sdk/nrf51822/Board/nrf6310/radio_example/main_tx.c
|
C
|
gpl-3.0
| 2,649 |
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'basicstyles', 'sr-latn', {
bold: 'Podebljano',
italic: 'Kurziv',
strike: 'Precrtano',
subscript: 'Indeks',
superscript: 'Stepen',
underline: 'Podvučeno'
} );
|
joyofsrc/src
|
resources/ckeditor/plugins/basicstyles/lang/sr-latn.js
|
JavaScript
|
gpl-3.0
| 350 |
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004-2016 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2013 Regis Houssin <[email protected]>
* Copyright (C) 2013 Philippe Grand <[email protected]>
* Copyright (C) 2013 Florian Henry <[email protected]>
* Copyright (C) 2013 Cédric Salvador <[email protected]>
* Copyright (C) 2015 Marcos García <[email protected]>
* Copyright (C) 2015-2007 Juanjo Menent <[email protected]>
* Copyright (C) 2015 Abbes Bahfir <[email protected]>
* Copyright (C) 2015-2016 Ferran Marcet <[email protected]>
* Copyright (C) 2017 Josep Lluís Amador <[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/fourn/facture/list.php
* \ingroup fournisseur,facture
* \brief List of suppliers invoices
*/
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/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
$langs->load("bills");
$langs->load("companies");
$langs->load('products');
$langs->load('projects');
$action=GETPOST('action','alpha');
$massaction=GETPOST('massaction','alpha');
$show_files=GETPOST('show_files','int');
$confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
$optioncss = GETPOST('optioncss','alpha');
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierinvoicelist';
$socid = GETPOST('socid','int');
// Security check
if ($user->societe_id > 0)
{
$action='';
$_GET["action"] = '';
$socid = $user->societe_id;
}
$mode=GETPOST("mode");
$search_all = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$search_label = GETPOST("search_label","alpha");
$search_company = GETPOST("search_company","alpha");
$search_amount_no_tax = GETPOST("search_amount_no_tax","alpha");
$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha");
$search_product_category=GETPOST('search_product_category','int');
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha');
$search_refsupplier=GETPOST('search_refsupplier','alpha');
$search_type=GETPOST('search_type','int');
$search_project=GETPOST('search_project','alpha');
$search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha');
$search_montant_vat=GETPOST('search_montant_vat','alpha');
$search_montant_localtax1=GETPOST('search_montant_localtax1','alpha');
$search_montant_localtax2=GETPOST('search_montant_localtax2','alpha');
$search_montant_ttc=GETPOST('search_montant_ttc','alpha');
$search_status=GETPOST('search_status','int');
$search_paymentmode=GETPOST('search_paymentmode','int');
$search_town=GETPOST('search_town','alpha');
$search_zip=GETPOST('search_zip','alpha');
$search_state=trim(GETPOST("search_state"));
$search_country=GETPOST("search_country",'int');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$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');
$toselect = GETPOST('toselect', 'array');
$option = GETPOST('option');
if ($option == 'late') {
$search_status = '1';
}
$filter = GETPOST('filtre','alpha');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int');
if ($page == -1 || $page == null) { $page = 0 ; }
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="f.datef,f.rowid";
$diroutputmassaction=$conf->fournisseur->facture->dir_output . '/temp/massgeneration/'.$user->id;
$now=dol_now();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new FactureFournisseur($db);
$hookmanager->initHooks(array('supplierinvoicelist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('facture_fourn');
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
'f.ref'=>'Ref',
'f.ref_supplier'=>'RefSupplier',
'pd.description'=>'Description',
's.nom'=>"ThirdParty",
'f.note_public'=>'NotePublic',
);
if (empty($user->socid)) $fieldstosearchall["f.note_private"]="NotePrivate";
$checkedtypetiers=0;
$arrayfields=array(
'f.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'f.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1),
'f.type'=>array('label'=>$langs->trans("Type"), 'checked'=>0),
'f.label'=>array('label'=>$langs->trans("Label"), 'checked'=>0),
'f.datef'=>array('label'=>$langs->trans("DateInvoice"), 'checked'=>1),
'f.date_lim_reglement'=>array('label'=>$langs->trans("DateDue"), 'checked'=>1),
'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0),
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
'f.fk_mode_reglement'=>array('label'=>$langs->trans("PaymentMode"), 'checked'=>1),
'f.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax1_assuj=="1"),
'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax2_assuj=="1"),
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
'dynamount_payed'=>array('label'=>$langs->trans("Payed"), 'checked'=>0),
'rtp'=>array('label'=>$langs->trans("Rest"), 'checked'=>0),
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'f.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}
/*
* Actions
*/
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $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))
{
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha')) // All tests must be present to be compatible with all browsers
{
$search_all="";
$search_user='';
$search_sale='';
$search_product_category='';
$search_ref="";
$search_refsupplier="";
$search_type="";
$search_label="";
$search_project='';
$search_societe="";
$search_company="";
$search_amount_no_tax="";
$search_amount_all_tax="";
$search_montant_ht='';
$search_montant_vat='';
$search_montant_localtax1='';
$search_montant_localtax2='';
$search_montant_ttc='';
$search_status='';
$search_paymentmode='';
$search_town='';
$search_zip="";
$search_state="";
$search_type='';
$search_country='';
$search_type_thirdparty='';
$year="";
$month="";
$day="";
$year_lim="";
$month_lim="";
$day_lim="";
$toselect='';
$search_array_options=array();
$filter='';
$option='';
}
// Mass actions
$objectclass='FactureFournisseur';
$objectlabel='SupplierInvoices';
$permtoread = $user->rights->fournisseur->facture->lire;
$permtocreate = $user->rights->fournisseur->facture->creer;
$permtodelete = $user->rights->fournisseur->facture->supprimer;
$uploaddir = $conf->fournisseur->facture->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
/*
* View
*/
$form=new Form($db);
$formother=new FormOther($db);
$formfile = new FormFile($db);
$bankaccountstatic=new Account($db);
$facturestatic=new FactureFournisseur($db);
$formcompany=new FormCompany($db);
$thirdparty=new Societe($db);
llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
$sql = "SELECT";
if ($search_all || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement,";
$sql.= " f.total_ht, f.total_ttc, f.total_tva as total_vat, f.paye as paye, f.fk_statut as fk_statut, f.libelle as label, f.datec as date_creation, f.tms as date_update,";
$sql.= " f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,";
$sql.= " s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
$sql.= " typent.code as typent_code,";
$sql.= " state.code_departement as state_code, state.nom as state_name,";
$sql.= " country.code as country_code,";
$sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
if (! $search_all) $sql.= ', SUM(pf.amount) as dynamount_payed';
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
$sql.= ', '.MAIN_DB_PREFIX.'facture_fourn as f';
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn_extrafields as ef on (f.rowid = ef.fk_object)";
if (! $search_all) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
if ($search_all || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn';
if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet";
// 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 IN ('.getEntity('facture_fourn').')';
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 ($search_ref)
{
if (is_numeric($search_ref)) $sql .= natural_search(array('f.ref'), $search_ref);
else $sql .= natural_search('f.ref', $search_ref);
}
if ($search_ref) $sql .= natural_search('f.ref', $search_ref);
if ($search_refsupplier) $sql .= natural_search('f.ref_supplier', $search_refsupplier);
if ($search_type != '' && $search_type >= 0)
{
if ($search_type == '0') $sql.=" AND f.type = 0"; // standard
if ($search_type == '1') $sql.=" AND f.type = 1"; // replacement
if ($search_type == '2') $sql.=" AND f.type = 2"; // credit note
if ($search_type == '3') $sql.=" AND f.type = 3"; // deposit
//if ($search_type == '4') $sql.=" AND f.type = 4"; // proforma
//if ($search_type == '5') $sql.=" AND f.type = 5"; // situation
}
if ($search_project) $sql .= natural_search('p.ref', $search_project);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_town) $sql.= natural_search('s.town', $search_town);
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
if ($search_state) $sql.= natural_search("state.nom",$search_state);
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
if ($search_company) $sql .= natural_search('s.nom', $search_company);
if ($search_montant_ht != '') $sql.= natural_search('f.total_ht', $search_montant_ht, 1);
if ($search_montant_vat != '') $sql.= natural_search('f.total_tva', $search_montant_vat, 1);
if ($search_montant_localtax1 != '') $sql.= natural_search('f.localtax1', $search_montant_localtax1, 1);
if ($search_montant_localtax2 != '') $sql.= natural_search('f.localtax2', $search_montant_localtax2, 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') = '".$db->escape($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->fournisseur->warning_delay)."'";
if ($search_label) $sql .= natural_search('f.libelle', $search_label);
if ($search_status != '' && $search_status >= 0)
{
$sql.= " AND f.fk_statut = ".$search_status;
}
if ($filter && $filter != -1)
{
$aFilter = explode(',', $filter);
foreach ($aFilter as $fil)
{
$filt = explode(':', $fil);
$sql .= ' AND ' . $db->escape(trim($filt[0])) . ' = ' . $db->escape(trim($filt[1]));
}
}
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale);
if ($search_user > 0)
{
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='invoice_supplier' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
}
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
if (! $search_all)
{
$sql.= " GROUP BY f.rowid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement, f.fk_mode_reglement,";
$sql.= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,";
$sql.= " f.localtax1, f.localtax2,";
$sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
$sql.= " typent.code,";
$sql.= " state.code_departement, state.nom,";
$sql.= ' country.code,';
$sql.= " p.rowid, p.ref";
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
{
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
}
}
else
{
$sql.= natural_search(array_keys($fieldstosearchall), $search_all);
}
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = '';
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);
if (empty($search_societe)) $search_societe = $soc->name;
}
$param='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_all) $param.='&search_all='.urlencode($search_all);
if ($day) $param.='&day='.urlencode($day);
if ($month) $param.='&month='.urlencode($month);
if ($year) $param.='&year=' .urlencode($year);
if ($day_lim) $param.='&day_lim='.urlencode($day_lim);
if ($month_lim) $param.='&month_lim='.urlencode($month_lim);
if ($year_lim) $param.='&year_lim=' .urlencode($year_lim);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_refsupplier) $param.='&search_refsupplier='.urlencode($search_refsupplier);
if ($search_type != '') $param.='&search_type='.urlencode($search_type);
if ($search_label) $param.='&search_label='.urlencode($search_label);
if ($search_company) $param.='&search_company='.urlencode($search_company);
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax);
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
if ($search_status >= 0) $param.="&search_status=".urlencode($search_status);
if ($show_files) $param.='&show_files=' .$show_files;
if ($option) $param.="&option=".$option;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
'validate'=>$langs->trans("Validate"),
//'presend'=>$langs->trans("SendByMail"),
//'builddoc'=>$langs->trans("PDFMerge"),
);
//if($user->rights->fournisseur->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
if ($user->rights->fournisseur->facture->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete','createbills'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->fournisseur->facture->creer)
{
$newcardbutton='<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create">'.$langs->trans('NewBill').'</a>';
}
$i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
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="page" value="'.$page.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
$topicmail="SendBillRef";
$modelmail="supplier_invoice_send";
$objecttmp=new FactureFournisseur($db);
$trackid='sinv'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($massaction == 'createbills')
{
//var_dump($_REQUEST);
print '<input type="hidden" name="massaction" value="confirm_createbills">';
print '<table class="border" width="100%" >';
print '<tr>';
print '<td class="titlefieldmiddle">';
print $langs->trans('DateInvoice');
print '</td>';
print '<td>';
print $form->select_date('', '', '', '', '', '', 1, 1);
print '</td>';
print '</tr>';
print '<tr>';
print '<td>';
print $langs->trans('CreateOneBillByThird');
print '</td>';
print '<td>';
print $form->selectyesno('createbills_onebythird', '', 1);
print '</td>';
print '</tr>';
print '<tr>';
print '<td>';
print $langs->trans('ValidateInvoices');
print '</td>';
print '<td>';
print $form->selectyesno('valdate_invoices', 1, 1);
print '</td>';
print '</tr>';
print '</table>';
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisCustomer').'"> ';
print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
print '</div>';
print '<br>';
}
if ($search_all)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $search_all) . 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, 'maxwidth200');
$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, '', 'maxwidth200');
$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, 'maxwidth300', 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>';
}
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
// Line for filters
print '<tr class="liste_titre_filter">';
// Ref
if (! empty($arrayfields['f.ref']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
print '</td>';
}
// Ref supplier
if (! empty($arrayfields['f.ref_supplier']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_refsupplier" value="'.$search_refsupplier.'">';
print '</td>';
}
// Type
if (! empty($arrayfields['f.type']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone">';
$listtype=array(
FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
);
/*
if (! empty($conf->global->INVOICE_USE_SITUATION))
{
$listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation");
}
*/
//$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order.
print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100');
print '</td>';
}
// Label
if (! empty($arrayfields['f.label']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_label" value="'.$search_label.'">';
print '</td>';
}
// Date invoice
if (! empty($arrayfields['f.datef']['checked']))
{
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="'.dol_escape_htmltag($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>';
}
// Date due
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
{
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="'.dol_escape_htmltag($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>';
}
// Project
if (! empty($arrayfields['p.ref']['checked']))
{
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_project" value="'.$search_project.'"></td>';
}
// Thirpdarty
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'"></td>';
}
// Town
if (! empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.dol_escape_htmltag($search_town).'"></td>';
// Zip
if (! empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_zip" value="'.dol_escape_htmltag($search_zip).'"></td>';
// State
if (! empty($arrayfields['state.nom']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
print '</td>';
}
// Country
if (! empty($arrayfields['country.code_iso']['checked']))
{
print '<td class="liste_titre" align="center">';
print $form->select_country($search_country,'search_country','',0,'maxwidth100');
print '</td>';
}
// Company type
if (! empty($arrayfields['typent.code']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
print '</td>';
}
// Payment mode
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
{
print '<td class="liste_titre" align="left">';
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10);
print '</td>';
}
if (! empty($arrayfields['f.total_ht']['checked']))
{
// Amount
print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
print '</td>';
}
if (! empty($arrayfields['f.total_vat']['checked']))
{
// Amount
print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">';
print '</td>';
}
if (! empty($arrayfields['f.total_localtax1']['checked']))
{
// Amount
print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="5" name="search_montant_localtax1" value="'.$search_montant_localtax1.'">';
print '</td>';
}
if (! empty($arrayfields['f.total_localtax2']['checked']))
{
// Amount
print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="5" name="search_montant_localtax2" value="'.$search_montant_localtax2.'">';
print '</td>';
}
if (! empty($arrayfields['f.total_ttc']['checked']))
{
// Amount
print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
print '</td>';
}
if (! empty($arrayfields['dynamount_payed']['checked']))
{
print '<td class="liste_titre" align="right">';
print '</td>';
}
if (! empty($arrayfields['rtp']['checked']))
{
print '<td class="liste_titre" align="right">';
print '</td>';
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['f.datec']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// Date modification
if (! empty($arrayfields['f.tms']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// Status
if (! empty($arrayfields['f.fk_statut']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone" align="right">';
$liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid"));
print $form->selectarray('search_status', $liststatus, $search_status, 1);
print '</td>';
}
// Action column
print '<td class="liste_titre" align="middle">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print "</tr>\n";
print '<tr class="liste_titre">';
if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($arrayfields['f.ref']['label'],$_SERVER['PHP_SELF'],'f.ref,f.rowid','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['f.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['f.ref_supplier']['label'],$_SERVER["PHP_SELF"],'f.ref_supplier','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'],$_SERVER["PHP_SELF"],'f.type','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['f.label']['checked'])) print_liste_field_titre($arrayfields['f.label']['label'],$_SERVER['PHP_SELF'],"f.libelle,f.rowid",'',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'],$_SERVER['PHP_SELF'],'f.datef,f.rowid','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'],$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER['PHP_SELF'],"p.ref",'',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'],$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'],$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'],$_SERVER['PHP_SELF'],'f.localtax1','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'],$_SERVER['PHP_SELF'],'f.localtax2','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye,type","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
$facturestatic=new FactureFournisseur($db);
$supplierstatic=new Fournisseur($db);
$projectstatic=new Project($db);
if ($num > 0)
{
$i=0;
$var=true;
$totalarray=array();
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
$datelimit=$db->jdate($obj->datelimite);
$facturestatic->id=$obj->facid;
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
$facturestatic->ref_supplier=$obj->ref_supplier;
$facturestatic->date_echeance = $db->jdate($obj->datelimite);
$facturestatic->statut = $obj->fk_statut;
$thirdparty->id=$obj->socid;
$thirdparty->name=$obj->name;
$thirdparty->client=$obj->client;
$thirdparty->fournisseur=$obj->fournisseur;
$thirdparty->code_client=$obj->code_client;
$thirdparty->code_compta_client=$obj->code_compta_client;
$thirdparty->code_fournisseur=$obj->code_fournisseur;
$thirdparty->code_compta_fournisseur=$obj->code_compta_fournisseur;
$thirdparty->email=$obj->email;
$thirdparty->country_code=$obj->country_code;
$paiement = $facturestatic->getSommePaiement();
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
print '<tr class="oddeven">';
if (! empty($arrayfields['f.ref']['checked']))
{
print '<td class="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref
print '<td class="nobordernopadding nowrap">';
print $facturestatic->getNomUrl(1);
print '</td>';
// Warning
//print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
//print '</td>';
// Other picto tool
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
$subdir = get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir);
print '</td></tr></table>';
print "</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Supplier ref
if (! empty($arrayfields['f.ref_supplier']['checked']))
{
print '<td class="nowrap">';
print $obj->ref_supplier;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Type
if (! empty($arrayfields['f.type']['checked']))
{
print '<td class="nowrap">';
print $facturestatic->getLibType();
print "</td>";
if (! $i) $totalarray['nbfield']++;
}
// Label
if (! empty($arrayfields['f.label']['checked']))
{
print '<td class="nowrap">';
print $obj->label;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date
if (! empty($arrayfields['f.datef']['checked']))
{
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->datef),'day');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date limit
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
{
print '<td align="center" class="nowrap">'.dol_print_date($datelimit,'day');
if ($facturestatic->hasDelay())
{
print img_warning($langs->trans('Late'));
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Project
if (! empty($arrayfields['p.ref']['checked']))
{
print '<td class="nowrap">';
if ($obj->project_id > 0)
{
$projectstatic->id=$obj->project_id;
$projectstatic->ref=$obj->project_ref;
$projectstatic->title=$obj->project_label;
print $projectstatic->getNomUrl(1);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Third party
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td class="tdoverflowmax200">';
print $thirdparty->getNomUrl(1,'supplier');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Town
if (! empty($arrayfields['s.town']['checked']))
{
print '<td class="nocellnopadd">';
print $obj->town;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Zip
if (! empty($arrayfields['s.zip']['checked']))
{
print '<td class="nocellnopadd">';
print $obj->zip;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// State
if (! empty($arrayfields['state.nom']['checked']))
{
print "<td>".$obj->state_name."</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Country
if (! empty($arrayfields['country.code_iso']['checked']))
{
print '<td align="center">';
$tmparray=getCountry($obj->fk_pays,'all');
print $tmparray['label'];
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Type ent
if (! empty($arrayfields['typent.code']['checked']))
{
print '<td align="center">';
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
print $typenArray[$obj->typent_code];
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Payment mode
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
{
print '<td>';
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Amount HT
if (! empty($arrayfields['f.total_ht']['checked']))
{
print '<td align="right">'.price($obj->total_ht)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
$totalarray['totalht'] += $obj->total_ht;
}
// Amount VAT
if (! empty($arrayfields['f.total_vat']['checked']))
{
print '<td align="right">'.price($obj->total_vat)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
$totalarray['totalvat'] += $obj->total_vat;
}
// Amount LocalTax1
if (! empty($arrayfields['f.total_localtax1']['checked']))
{
print '<td align="right">'.price($obj->total_localtax1)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield'];
$totalarray['totallocaltax1'] += $obj->total_localtax1;
}
// Amount LocalTax2
if (! empty($arrayfields['f.total_localtax2']['checked']))
{
print '<td align="right">'.price($obj->total_localtax2)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield'];
$totalarray['totallocaltax2'] += $obj->total_localtax2;
}
// Amount TTC
if (! empty($arrayfields['f.total_ttc']['checked']))
{
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
$totalarray['totalttc'] += $obj->total_ttc;
}
if (! empty($arrayfields['dynamount_payed']['checked']))
{
print '<td align="right">'.(! empty($totalpay)?price($totalpay,0,$langs):' ').'</td>'; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalamfield']=$totalarray['nbfield'];
$totalarray['totalam'] += $totalpay;
}
if (! empty($arrayfields['rtp']['checked']))
{
print '<td align="right">'.(! empty($remaintopay)?price($remaintopay,0,$langs):' ').'</td>'; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
$totalarray['totalrtp'] += $remaintopay;
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['f.datec']['checked']))
{
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date modification
if (! empty($arrayfields['f.tms']['checked']))
{
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Status
if (! empty($arrayfields['f.fk_statut']['checked']))
{
print '<td align="right" class="nowrap">';
// TODO $paiement is not yet defined
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
print "</td>";
if (! $i) $totalarray['nbfield']++;
}
// Action column
print '<td class="nowrap" align="center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected=0;
if (in_array($obj->facid, $arrayofselected)) $selected=1;
print '<input id="cb'.$obj->facid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.'"'.($selected?' checked="checked"':'').'>';
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
print "</tr>\n";
$i++;
}
// Show total line
if (isset($totalarray['totalhtfield'])
|| isset($totalarray['totalvatfield'])
|| isset($totalarray['totallocaltax1field'])
|| isset($totalarray['totallocaltax2field'])
|| isset($totalarray['totalttcfield'])
|| isset($totalarray['totalamfield'])
|| isset($totalarray['totalrtpfield'])
)
{
print '<tr class="liste_total">';
$i=0;
while ($i < $totalarray['nbfield'])
{
$i++;
if ($i == 1)
{
if ($num < $limit && empty($offset)) print '<td align="left">'.$langs->trans("Total").'</td>';
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
}
elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
elseif ($totalarray['totallocaltax1field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax1']).'</td>';
elseif ($totalarray['totallocaltax2field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax2']).'</td>';
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
elseif ($totalarray['totalamfield'] == $i) print '<td align="right">'.price($totalarray['totalam']).'</td>';
elseif ($totalarray['totalrtpfield'] == $i) print '<td align="right">'.price($totalarray['totalrtp']).'</td>';
else print '<td></td>';
}
print '</tr>';
}
}
$db->free($resql);
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>\n";
print '</div>';
print "</form>\n";
/*
$hidegeneratedfilelistifempty=1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
// Show list of available documents
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&','&',$param);
$filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->creer;
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
*/
}
else
{
dol_print_error($db);
}
llxFooter();
$db->close();
|
All-3kcis/dolibarr
|
htdocs/fourn/facture/list.php
|
PHP
|
gpl-3.0
| 52,911 |
/**
* MouseRun. A programming game to practice building intelligent things.
* Copyright (C) 2013 Muhammad Mustaqim
*
* This file is part of MouseRun.
*
* MouseRun 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.
*
* MouseRun 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 MouseRun. If not, see <http://www.gnu.org/licenses/>.
**/
package mouserun.game;
/**
* Class Wall connects two Grids together. It is not necessarily opened. If opened, it
* allows the Mouse to pass through to each of the Grids. Otherwise, no mouse can pass
* through it. The construction of the Maze uses a Depth-First Search algorithm. In a
* graph, Wall will be the edge.
*/
public class Wall
{
private Grid nextGrid;
private Grid otherGrid;
private boolean opened;
/**
* Creates a new instance of Wall
* @param nextGrid The first Grid to be connected by this wall
* @param otherGrid The second Grid to be connected by this wall
*/
public Wall(Grid nextGrid, Grid otherGrid)
{
this.nextGrid = nextGrid;
this.otherGrid = otherGrid;
opened = false;
}
/**
* Get the other grid of connected by the wall that is not the current grid
* @param currentGrid The current grid that connected by the wall.
* @return The other grid this is also connected by the wall.
*/
public Grid getNextGrid(Grid currentGrid)
{
return this.nextGrid == currentGrid ? this.otherGrid : this.nextGrid;
}
/**
* Get the first grid.
* @return The first grid
*/
public Grid getNextGrid()
{
return this.nextGrid;
}
/**
* Get the second grid
* @return The second grid
*/
public Grid getOtherGrid()
{
return this.otherGrid;
}
/**
* Determine if the wall is opened.
* @return True if opened, False if otherwise.
*/
public boolean isOpened()
{
return this.opened;
}
/**
* Sets the wall closed or opened.
* @param opened True for open, False for close
*/
public void setOpened(boolean opened)
{
this.opened = opened;
}
}
|
nicomda/AI
|
Practica2/src/mouserun/game/Wall.java
|
Java
|
gpl-3.0
| 2,520 |
package pneumaticCraft.client.gui.widget;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiCheckBox extends Gui implements IGuiWidget{
public boolean checked, enabled = true;
public int x, y, color;
private final int id;
public String text;
public FontRenderer fontRenderer = FMLClientHandler.instance().getClient().fontRenderer;
private List<String> tooltip = new ArrayList<String>();
private IWidgetListener listener;
private static final int CHECKBOX_WIDTH = 10;
private static final int CHECKBOX_HEIGHT = 10;
public GuiCheckBox(int id, int x, int y, int color, String text){
this.id = id;
this.x = x;
this.y = y;
this.color = color;
this.text = text;
}
@Override
public int getID(){
return id;
}
@Override
public void render(int mouseX, int mouseY, float partialTick){
drawRect(x, y, x + CHECKBOX_WIDTH, y + CHECKBOX_HEIGHT, enabled ? -6250336 : 0xFF999999);
drawRect(x + 1, y + 1, x + CHECKBOX_WIDTH - 1, y + CHECKBOX_HEIGHT - 1, enabled ? -16777216 : 0xFFAAAAAA);
if(checked) {
GL11.glDisable(GL11.GL_TEXTURE_2D);
if(enabled) {
GL11.glColor4d(1, 1, 1, 1);
} else {
GL11.glColor4d(0.8, 0.8, 0.8, 1);
}
Tessellator t = Tessellator.instance;
t.startDrawing(GL11.GL_LINE_STRIP);
t.addVertex(x + 2, y + 5, zLevel);
t.addVertex(x + 5, y + 7, zLevel);
t.addVertex(x + 8, y + 3, zLevel);
t.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
fontRenderer.drawString(I18n.format(text), x + 1 + CHECKBOX_WIDTH, y + CHECKBOX_HEIGHT / 2 - fontRenderer.FONT_HEIGHT / 2, enabled ? color : 0xFF888888);
}
@Override
public Rectangle getBounds(){
return new Rectangle(x, y, CHECKBOX_WIDTH + fontRenderer.getStringWidth(I18n.format(text)), CHECKBOX_HEIGHT);
}
@Override
public void onMouseClicked(int mouseX, int mouseY, int button){
if(enabled) {
checked = !checked;
listener.actionPerformed(this);
}
}
@Override
public void onMouseClickedOutsideBounds(int mouseX, int mouseY, int button){
}
public GuiCheckBox setTooltip(String tooltip){
this.tooltip.clear();
if(tooltip != null && !tooltip.equals("")) {
this.tooltip.add(tooltip);
}
return this;
}
public GuiCheckBox setTooltip(List<String> tooltip){
this.tooltip = tooltip;
return this;
}
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTooltip, boolean shiftPressed){
curTooltip.addAll(tooltip);
}
public String getTooltip(){
return tooltip.size() > 0 ? tooltip.get(0) : "";
}
@Override
public boolean onKey(char key, int keyCode){
return false;
}
@Override
public void setListener(IWidgetListener gui){
listener = gui;
}
public GuiCheckBox setChecked(boolean checked){
this.checked = checked;
return this;
}
@Override
public void update(){}
@Override
public void handleMouseInput(){}
}
|
islanderz/pneumaticcraft
|
src/pneumaticCraft/client/gui/widget/GuiCheckBox.java
|
Java
|
gpl-3.0
| 3,665 |
/*
* Copyright (C) 2007-2016 Hypertable, Inc.
*
* This file is part of Hypertable.
*
* Hypertable 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 3 of the
* License, or any later version.
*
* Hypertable 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 <Common/Compat.h>
#include "GroupCommitTimerHandler.h"
#include "Request/Handler/GroupCommit.h"
#include <Common/Config.h>
#include <Common/Error.h>
#include <Common/InetAddr.h>
#include <Common/StringExt.h>
#include <Common/System.h>
#include <Common/Time.h>
using namespace Hypertable;
using namespace Hypertable::RangeServer;
using namespace Hypertable::Config;
using namespace std;
GroupCommitTimerHandler::GroupCommitTimerHandler(Comm *comm, Apps::RangeServer *range_server,
ApplicationQueuePtr &app_queue)
: m_comm(comm), m_range_server(range_server), m_app_queue(app_queue) {
m_commit_interval = get_i32("Hypertable.RangeServer.CommitInterval");
}
void GroupCommitTimerHandler::start() {
int error;
if ((error = m_comm->set_timer(m_commit_interval, shared_from_this())) != Error::OK)
HT_FATALF("Problem setting timer - %s", Error::get_text(error));
}
void GroupCommitTimerHandler::handle(Hypertable::EventPtr &event_ptr) {
lock_guard<mutex> lock(m_mutex);
int error;
if (m_shutdown)
return;
m_app_queue->add( new Request::Handler::GroupCommit(m_range_server) );
if ((error = m_comm->set_timer(m_commit_interval, shared_from_this())) != Error::OK)
HT_FATALF("Problem setting timer - %s", Error::get_text(error));
}
void GroupCommitTimerHandler::shutdown() {
lock_guard<mutex> lock(m_mutex);
m_shutdown = true;
m_comm->cancel_timer(shared_from_this());
}
|
hypertable/hypertable
|
src/cc/Hypertable/RangeServer/GroupCommitTimerHandler.cc
|
C++
|
gpl-3.0
| 2,253 |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Xla_ExecuteParallelResponse Structure Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Struct/Xla_ExecuteParallelResponse" class="dashAnchor"></a>
<a title="Xla_ExecuteParallelResponse Structure Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">Proto Docs</a> (68% documented)</p>
<p class="header-right"><a href="https://github.com/Octadero/TensorFlow"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-109209508-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-109209508-2');
</script>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">Proto Reference</a>
<img id="carat" src="../img/carat.png" />
Xla_ExecuteParallelResponse Structure Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/CompareTest_Enum.html">CompareTest_Enum</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Tensorflow_DataType.html">Tensorflow_DataType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Tensorflow_Error_Code.html">Tensorflow_Error_Code</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Tensorflow_Tensorforest_LeafModelType.html">Tensorflow_Tensorforest_LeafModelType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Tensorflow_Tensorforest_SplitCollectionType.html">Tensorflow_Tensorforest_SplitCollectionType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Tensorflow_Tensorforest_SplitFinishStrategyType.html">Tensorflow_Tensorforest_SplitFinishStrategyType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Tensorflow_Tensorforest_SplitPruningStrategyType.html">Tensorflow_Tensorforest_SplitPruningStrategyType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Tensorflow_Tensorforest_StatsModelType.html">Tensorflow_Tensorforest_StatsModelType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Tensorflow_Test_ForeignEnum.html">Tensorflow_Test_ForeignEnum</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Xla_BinaryOperation.html">Xla_BinaryOperation</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Xla_PaddingValue.html">Xla_PaddingValue</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Xla_PrimitiveType.html">Xla_PrimitiveType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Xla_RandomDistribution.html">Xla_RandomDistribution</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Xla_TernaryOperation.html">Xla_TernaryOperation</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Xla_UnaryOperation.html">Xla_UnaryOperation</a>
</li>
<li class="nav-group-task">
<a href="../Enums/Xla_VariadicOperation.html">Xla_VariadicOperation</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/BoostedTrees_QuantileConfig.html">BoostedTrees_QuantileConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/BoostedTrees_QuantileEntry.html">BoostedTrees_QuantileEntry</a>
</li>
<li class="nav-group-task">
<a href="../Structs/BoostedTrees_QuantileStreamState.html">BoostedTrees_QuantileStreamState</a>
</li>
<li class="nav-group-task">
<a href="../Structs/BoostedTrees_QuantileSummaryState.html">BoostedTrees_QuantileSummaryState</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CompareTest_Labeled.html">CompareTest_Labeled</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CompareTest_Large.html">CompareTest_Large</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CompareTest_Medium.html">CompareTest_Medium</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CompareTest_Medium/GroupA.html">– GroupA</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CompareTest_Small.html">CompareTest_Small</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CompareTest_WithMap.html">CompareTest_WithMap</a>
</li>
<li class="nav-group-task">
<a href="../Structs/GraphExplorer_Edge.html">GraphExplorer_Edge</a>
</li>
<li class="nav-group-task">
<a href="../Structs/GraphExplorer_Graph.html">GraphExplorer_Graph</a>
</li>
<li class="nav-group-task">
<a href="../Structs/GraphExplorer_Node.html">GraphExplorer_Node</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_AllocationDescription.html">Tensorflow_AllocationDescription</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_AllocatorMemoryUsed.html">Tensorflow_AllocatorMemoryUsed</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ApiDef.html">Tensorflow_ApiDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ApiDef/Visibility.html">– Visibility</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ApiDef/Endpoint.html">– Endpoint</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ApiDef/Arg.html">– Arg</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ApiDef/Attr.html">– Attr</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ApiDefs.html">Tensorflow_ApiDefs</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_AssetFileDef.html">Tensorflow_AssetFileDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_AttrValue.html">Tensorflow_AttrValue</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_AttrValue/OneOf_Value.html">– OneOf_Value</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_AttrValue/ListValue.html">– ListValue</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_AutoParallelOptions.html">Tensorflow_AutoParallelOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_AvailableDeviceInfo.html">Tensorflow_AvailableDeviceInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BenchmarkEntries.html">Tensorflow_BenchmarkEntries</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BenchmarkEntry.html">Tensorflow_BenchmarkEntry</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BigQueryTablePartition.html">Tensorflow_BigQueryTablePartition</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_AveragingConfig.html">Tensorflow_BoostedTrees_Learner_AveragingConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_AveragingConfig/OneOf_Config.html">– OneOf_Config</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearnerConfig.html">Tensorflow_BoostedTrees_Learner_LearnerConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearnerConfig/OneOf_FeatureFraction.html">– OneOf_FeatureFraction</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearnerConfig/PruningMode.html">– PruningMode</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearnerConfig/GrowingMode.html">– GrowingMode</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearnerConfig/MultiClassStrategy.html">– MultiClassStrategy</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearningRateConfig.html">Tensorflow_BoostedTrees_Learner_LearningRateConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearningRateConfig/OneOf_Tuner.html">– OneOf_Tuner</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearningRateDropoutDrivenConfig.html">Tensorflow_BoostedTrees_Learner_LearningRateDropoutDrivenConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearningRateFixedConfig.html">Tensorflow_BoostedTrees_Learner_LearningRateFixedConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_LearningRateLineSearchConfig.html">Tensorflow_BoostedTrees_Learner_LearningRateLineSearchConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_SplitInfo.html">Tensorflow_BoostedTrees_Learner_SplitInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_TreeConstraintsConfig.html">Tensorflow_BoostedTrees_Learner_TreeConstraintsConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Learner_TreeRegularizationConfig.html">Tensorflow_BoostedTrees_Learner_TreeRegularizationConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_CategoricalIdBinarySplit.html">Tensorflow_BoostedTrees_Trees_CategoricalIdBinarySplit</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_CategoricalIdSetMembershipBinarySplit.html">Tensorflow_BoostedTrees_Trees_CategoricalIdSetMembershipBinarySplit</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_DecisionTreeConfig.html">Tensorflow_BoostedTrees_Trees_DecisionTreeConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_DecisionTreeEnsembleConfig.html">Tensorflow_BoostedTrees_Trees_DecisionTreeEnsembleConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_DecisionTreeMetadata.html">Tensorflow_BoostedTrees_Trees_DecisionTreeMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_DenseFloatBinarySplit.html">Tensorflow_BoostedTrees_Trees_DenseFloatBinarySplit</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_GrowingMetadata.html">Tensorflow_BoostedTrees_Trees_GrowingMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_Leaf.html">Tensorflow_BoostedTrees_Trees_Leaf</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_Leaf/OneOf_Leaf.html">– OneOf_Leaf</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_SparseFloatBinarySplitDefaultLeft.html">Tensorflow_BoostedTrees_Trees_SparseFloatBinarySplitDefaultLeft</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_SparseFloatBinarySplitDefaultRight.html">Tensorflow_BoostedTrees_Trees_SparseFloatBinarySplitDefaultRight</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_SparseVector.html">Tensorflow_BoostedTrees_Trees_SparseVector</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_TreeNode.html">Tensorflow_BoostedTrees_Trees_TreeNode</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_TreeNode/OneOf_Node.html">– OneOf_Node</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_TreeNodeMetadata.html">Tensorflow_BoostedTrees_Trees_TreeNodeMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BoostedTrees_Trees_Vector.html">Tensorflow_BoostedTrees_Trees_Vector</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BuildConfiguration.html">Tensorflow_BuildConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BundleEntryProto.html">Tensorflow_BundleEntryProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BundleHeaderProto.html">Tensorflow_BundleHeaderProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BundleHeaderProto/Endianness.html">– Endianness</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_BytesList.html">Tensorflow_BytesList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CPUInfo.html">Tensorflow_CPUInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Channel.html">Tensorflow_Channel</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CheckpointState.html">Tensorflow_CheckpointState</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CleanupAllRequest.html">Tensorflow_CleanupAllRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CleanupAllResponse.html">Tensorflow_CleanupAllResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CleanupGraphRequest.html">Tensorflow_CleanupGraphRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CleanupGraphResponse.html">Tensorflow_CleanupGraphResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CloseSessionRequest.html">Tensorflow_CloseSessionRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CloseSessionResponse.html">Tensorflow_CloseSessionResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ClusterDef.html">Tensorflow_ClusterDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CollectionDef.html">Tensorflow_CollectionDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CollectionDef/OneOf_Kind.html">– OneOf_Kind</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CollectionDef/NodeList.html">– NodeList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CollectionDef/BytesList.html">– BytesList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CollectionDef/Int64List.html">– Int64List</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CollectionDef/FloatList.html">– FloatList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CollectionDef/AnyList.html">– AnyList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CommitId.html">Tensorflow_CommitId</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CommitId/OneOf_Kind.html">– OneOf_Kind</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CondContextDef.html">Tensorflow_CondContextDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ConfigProto.html">Tensorflow_ConfigProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Mpi_MPIRequest.html">Tensorflow_Contrib_Mpi_MPIRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Mpi_MPIRequest/RequestType.html">– RequestType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Mpi_MPIResponse.html">Tensorflow_Contrib_Mpi_MPIResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Mpi_MPIResponse/ResponseType.html">– ResponseType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Tensorboard_FileInfo.html">Tensorflow_Contrib_Tensorboard_FileInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Tensorboard_LineTrace.html">Tensorflow_Contrib_Tensorboard_LineTrace</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Tensorboard_OpInfo.html">Tensorflow_Contrib_Tensorboard_OpInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Tensorboard_TensorInfo.html">Tensorflow_Contrib_Tensorboard_TensorInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Contrib_Tensorboard_TraceInfo.html">Tensorflow_Contrib_Tensorboard_TraceInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CostGraphDef.html">Tensorflow_CostGraphDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CostGraphDef/Node.html">– Node</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CppShapeInferenceInputsNeeded.html">Tensorflow_CppShapeInferenceInputsNeeded</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CppShapeInferenceResult.html">Tensorflow_CppShapeInferenceResult</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CppShapeInferenceResult/HandleShapeAndType.html">– HandleShapeAndType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CppShapeInferenceResult/HandleData.html">– HandleData</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CreateSessionRequest.html">Tensorflow_CreateSessionRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CreateSessionResponse.html">Tensorflow_CreateSessionResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CreateWorkerSessionRequest.html">Tensorflow_CreateWorkerSessionRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_CreateWorkerSessionResponse.html">Tensorflow_CreateWorkerSessionResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DebugOptions.html">Tensorflow_DebugOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DebugTensorWatch.html">Tensorflow_DebugTensorWatch</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Averaging.html">Tensorflow_DecisionTrees_Averaging</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_BinaryNode.html">Tensorflow_DecisionTrees_BinaryNode</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_BinaryNode/OneOf_LeftChildTest.html">– OneOf_LeftChildTest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_BinaryNode/Direction.html">– Direction</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_DecisionTree.html">Tensorflow_DecisionTrees_DecisionTree</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Ensemble.html">Tensorflow_DecisionTrees_Ensemble</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Ensemble/OneOf_CombinationTechnique.html">– OneOf_CombinationTechnique</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Ensemble/Member.html">– Member</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_FeatureId.html">Tensorflow_DecisionTrees_FeatureId</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_InequalityTest.html">Tensorflow_DecisionTrees_InequalityTest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_InequalityTest/OneOf_FeatureSum.html">– OneOf_FeatureSum</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_InequalityTest/TypeEnum.html">– TypeEnum</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Leaf.html">Tensorflow_DecisionTrees_Leaf</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Leaf/OneOf_Leaf.html">– OneOf_Leaf</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_MatchingValuesTest.html">Tensorflow_DecisionTrees_MatchingValuesTest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Model.html">Tensorflow_DecisionTrees_Model</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Model/OneOf_Model.html">– OneOf_Model</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_ModelAndFeatures.html">Tensorflow_DecisionTrees_ModelAndFeatures</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_ModelAndFeatures/Feature.html">– Feature</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_ObliqueFeatures.html">Tensorflow_DecisionTrees_ObliqueFeatures</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_SparseVector.html">Tensorflow_DecisionTrees_SparseVector</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Summation.html">Tensorflow_DecisionTrees_Summation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_TreeNode.html">Tensorflow_DecisionTrees_TreeNode</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_TreeNode/OneOf_NodeType.html">– OneOf_NodeType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Value.html">Tensorflow_DecisionTrees_Value</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Value/OneOf_Value.html">– OneOf_Value</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DecisionTrees_Vector.html">Tensorflow_DecisionTrees_Vector</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DeregisterGraphRequest.html">Tensorflow_DeregisterGraphRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DeregisterGraphResponse.html">Tensorflow_DeregisterGraphResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DeviceAttributes.html">Tensorflow_DeviceAttributes</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DeviceLocality.html">Tensorflow_DeviceLocality</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DeviceProperties.html">Tensorflow_DeviceProperties</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_DeviceStepStats.html">Tensorflow_DeviceStepStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_EmbeddingInfo.html">Tensorflow_EmbeddingInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_EntryValue.html">Tensorflow_EntryValue</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_EntryValue/OneOf_Kind.html">– OneOf_Kind</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Event.html">Tensorflow_Event</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Event/OneOf_What.html">– OneOf_What</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_EventReply.html">Tensorflow_EventReply</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_EventReply/DebugOpStateChange.html">– DebugOpStateChange</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Example.html">Tensorflow_Example</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ExampleParserConfiguration.html">Tensorflow_ExampleParserConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ExampleWithExtras.html">Tensorflow_ExampleWithExtras</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ExecutorOpts.html">Tensorflow_ExecutorOpts</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ExtendSessionRequest.html">Tensorflow_ExtendSessionRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ExtendSessionResponse.html">Tensorflow_ExtendSessionResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Feature.html">Tensorflow_Feature</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Feature/OneOf_Kind.html">– OneOf_Kind</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_FeatureConfiguration.html">Tensorflow_FeatureConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_FeatureConfiguration/OneOf_Config.html">– OneOf_Config</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_FeatureList.html">Tensorflow_FeatureList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_FeatureLists.html">Tensorflow_FeatureLists</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Features.html">Tensorflow_Features</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_FixedLenFeatureProto.html">Tensorflow_FixedLenFeatureProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_FloatList.html">Tensorflow_FloatList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_FunctionDef.html">Tensorflow_FunctionDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_FunctionDefLibrary.html">Tensorflow_FunctionDefLibrary</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GPUInfo.html">Tensorflow_GPUInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GPUOptions.html">Tensorflow_GPUOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GetRemoteAddressRequest.html">Tensorflow_GetRemoteAddressRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GetRemoteAddressResponse.html">Tensorflow_GetRemoteAddressResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GetStatusRequest.html">Tensorflow_GetStatusRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GetStatusResponse.html">Tensorflow_GetStatusResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GradientDef.html">Tensorflow_GradientDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphDef.html">Tensorflow_GraphDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphOptions.html">Tensorflow_GraphOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo.html">Tensorflow_GraphTransferInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo/Destination.html">– Destination</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo/NodeInput.html">– NodeInput</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo/NodeInfo.html">– NodeInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo/ConstNodeInfo.html">– ConstNodeInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo/NodeInputInfo.html">– NodeInputInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo/NodeOutputInfo.html">– NodeOutputInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo/GraphInputNodeInfo.html">– GraphInputNodeInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_GraphTransferInfo/GraphOutputNodeInfo.html">– GraphOutputNodeInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_HParamDef.html">Tensorflow_HParamDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_HParamDef/BytesList.html">– BytesList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_HParamDef/FloatList.html">– FloatList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_HParamDef/Int64List.html">– Int64List</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_HParamDef/BoolList.html">– BoolList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_HParamDef/HParamType.html">– HParamType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_HistogramProto.html">Tensorflow_HistogramProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Int64List.html">Tensorflow_Int64List</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_JobDef.html">Tensorflow_JobDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_KernelDef.html">Tensorflow_KernelDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_KernelDef/AttrConstraint.html">– AttrConstraint</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_LabeledStepStats.html">Tensorflow_LabeledStepStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ListDevicesRequest.html">Tensorflow_ListDevicesRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ListDevicesResponse.html">Tensorflow_ListDevicesResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_LogMessage.html">Tensorflow_LogMessage</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_LogMessage/Level.html">– Level</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_LogNormalDistribution.html">Tensorflow_LogNormalDistribution</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_LoggingRequest.html">Tensorflow_LoggingRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_LoggingResponse.html">Tensorflow_LoggingResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MPIRecvTensorResponse.html">Tensorflow_MPIRecvTensorResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MachineConfiguration.html">Tensorflow_MachineConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemmappedFileSystemDirectory.html">Tensorflow_MemmappedFileSystemDirectory</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemmappedFileSystemDirectoryElement.html">Tensorflow_MemmappedFileSystemDirectoryElement</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryInfo.html">Tensorflow_MemoryInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryLogRawAllocation.html">Tensorflow_MemoryLogRawAllocation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryLogRawDeallocation.html">Tensorflow_MemoryLogRawDeallocation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryLogStep.html">Tensorflow_MemoryLogStep</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryLogTensorAllocation.html">Tensorflow_MemoryLogTensorAllocation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryLogTensorDeallocation.html">Tensorflow_MemoryLogTensorDeallocation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryLogTensorOutput.html">Tensorflow_MemoryLogTensorOutput</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryRegion.html">Tensorflow_MemoryRegion</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MemoryStats.html">Tensorflow_MemoryStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MetaGraphDef.html">Tensorflow_MetaGraphDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_MetaGraphDef/MetaInfoDef.html">– MetaInfoDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_NameAttrList.html">Tensorflow_NameAttrList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_NamedTensorProto.html">Tensorflow_NamedTensorProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_NodeDef.html">Tensorflow_NodeDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_NodeExecStats.html">Tensorflow_NodeExecStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_NodeOutput.html">Tensorflow_NodeOutput</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_NormalDistribution.html">Tensorflow_NormalDistribution</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpDef.html">Tensorflow_OpDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpDef/ArgDef.html">– ArgDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpDef/AttrDef.html">– AttrDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpDeprecation.html">Tensorflow_OpDeprecation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpGenOverride.html">Tensorflow_OpGenOverride</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpGenOverride/AttrDefault.html">– AttrDefault</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpGenOverride/Rename.html">– Rename</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpGenOverrides.html">Tensorflow_OpGenOverrides</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpInfo.html">Tensorflow_OpInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpInfo/TensorProperties.html">– TensorProperties</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpList.html">Tensorflow_OpList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpPerformance.html">Tensorflow_OpPerformance</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpPerformance/OneOf_ExecutionTime.html">– OneOf_ExecutionTime</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpPerformance/OpMemory.html">– OpMemory</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OpPerformanceList.html">Tensorflow_OpPerformanceList</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OptimizerOptions.html">Tensorflow_OptimizerOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OptimizerOptions/Level.html">– Level</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_OptimizerOptions/GlobalJitLevel.html">– GlobalJitLevel</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_PartialRunSetupRequest.html">Tensorflow_PartialRunSetupRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_PartialRunSetupResponse.html">Tensorflow_PartialRunSetupResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_PlatformInfo.html">Tensorflow_PlatformInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ProfileRequest.html">Tensorflow_ProfileRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ProfileResponse.html">Tensorflow_ProfileResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ProjectorConfig.html">Tensorflow_ProjectorConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_QueueRunnerDef.html">Tensorflow_QueueRunnerDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RPCOptions.html">Tensorflow_RPCOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ReaderBaseState.html">Tensorflow_ReaderBaseState</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RecvTensorRequest.html">Tensorflow_RecvTensorRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RecvTensorResponse.html">Tensorflow_RecvTensorResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RegisterGraphRequest.html">Tensorflow_RegisterGraphRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RegisterGraphResponse.html">Tensorflow_RegisterGraphResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RemoteFusedGraphExecuteInfo.html">Tensorflow_RemoteFusedGraphExecuteInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RemoteFusedGraphExecuteInfo/NodeType.html">– NodeType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RemoteFusedGraphExecuteInfo/TensorShapeTypeProto.html">– TensorShapeTypeProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RemoteMemoryRegion.html">Tensorflow_RemoteMemoryRegion</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ResetRequest.html">Tensorflow_ResetRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ResetResponse.html">Tensorflow_ResetResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ResourceHandleProto.html">Tensorflow_ResourceHandleProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RewriterConfig.html">Tensorflow_RewriterConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RewriterConfig/Toggle.html">– Toggle</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RewriterConfig/MemOptType.html">– MemOptType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RunConfiguration.html">Tensorflow_RunConfiguration</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RunGraphRequest.html">Tensorflow_RunGraphRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RunGraphResponse.html">Tensorflow_RunGraphResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RunMetadata.html">Tensorflow_RunMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RunOptions.html">Tensorflow_RunOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RunOptions/TraceLevel.html">– TraceLevel</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RunStepRequest.html">Tensorflow_RunStepRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_RunStepResponse.html">Tensorflow_RunStepResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SaveSliceInfoDef.html">Tensorflow_SaveSliceInfoDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SavedModel.html">Tensorflow_SavedModel</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SavedSlice.html">Tensorflow_SavedSlice</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SavedSliceMeta.html">Tensorflow_SavedSliceMeta</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SavedTensorSliceMeta.html">Tensorflow_SavedTensorSliceMeta</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SavedTensorSlices.html">Tensorflow_SavedTensorSlices</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SaverDef.html">Tensorflow_SaverDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SaverDef/CheckpointFormatVersion.html">– CheckpointFormatVersion</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SequenceExample.html">Tensorflow_SequenceExample</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ServerDef.html">Tensorflow_ServerDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Serving_AssetFile.html">Tensorflow_Serving_AssetFile</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Serving_ClassificationSignature.html">Tensorflow_Serving_ClassificationSignature</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Serving_GenericSignature.html">Tensorflow_Serving_GenericSignature</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Serving_RegressionSignature.html">Tensorflow_Serving_RegressionSignature</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Serving_Signature.html">Tensorflow_Serving_Signature</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Serving_Signature/OneOf_Type.html">– OneOf_Type</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Serving_Signatures.html">Tensorflow_Serving_Signatures</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Serving_TensorBinding.html">Tensorflow_Serving_TensorBinding</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SessionLog.html">Tensorflow_SessionLog</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SessionLog/SessionStatus.html">– SessionStatus</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SignatureDef.html">Tensorflow_SignatureDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SpriteMetadata.html">Tensorflow_SpriteMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_StepStats.html">Tensorflow_StepStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Summary.html">Tensorflow_Summary</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Summary/Image.html">– Image</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Summary/Audio.html">– Audio</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Summary/Value.html">– Value</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SummaryDescription.html">Tensorflow_SummaryDescription</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SummaryMetadata.html">Tensorflow_SummaryMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_SummaryMetadata/PluginData.html">– PluginData</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TaggedRunMetadata.html">Tensorflow_TaggedRunMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorDescription.html">Tensorflow_TensorDescription</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorInfo.html">Tensorflow_TensorInfo</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorInfo/OneOf_Encoding.html">– OneOf_Encoding</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorInfo/CooSparse.html">– CooSparse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorProto.html">Tensorflow_TensorProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorShapeProto.html">Tensorflow_TensorShapeProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorShapeProto/Dim.html">– Dim</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorSliceProto.html">Tensorflow_TensorSliceProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TensorSliceProto/Extent.html">– Extent</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_DepthDependentParam.html">Tensorflow_Tensorforest_DepthDependentParam</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_DepthDependentParam/OneOf_ParamType.html">– OneOf_ParamType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_ExponentialParam.html">Tensorflow_Tensorforest_ExponentialParam</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_FertileSlot.html">Tensorflow_Tensorforest_FertileSlot</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_FertileStats.html">Tensorflow_Tensorforest_FertileStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_GiniStats.html">Tensorflow_Tensorforest_GiniStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_LeafStat.html">Tensorflow_Tensorforest_LeafStat</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_LeafStat/OneOf_LeafStat.html">– OneOf_LeafStat</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_LeafStat/GiniImpurityClassificationStats.html">– GiniImpurityClassificationStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_LeafStat/LeastSquaresRegressionStats.html">– LeastSquaresRegressionStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_LinearParam.html">Tensorflow_Tensorforest_LinearParam</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_SplitCandidate.html">Tensorflow_Tensorforest_SplitCandidate</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_SplitFinishConfig.html">Tensorflow_Tensorforest_SplitFinishConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_SplitPruningConfig.html">Tensorflow_Tensorforest_SplitPruningConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_TensorForestParams.html">Tensorflow_Tensorforest_TensorForestParams</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_ThresholdParam.html">Tensorflow_Tensorforest_ThresholdParam</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tensorforest_TreePath.html">Tensorflow_Tensorforest_TreePath</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TestResults.html">Tensorflow_TestResults</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TestResults/BenchmarkType.html">– BenchmarkType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Test_ForeignMessage.html">Tensorflow_Test_ForeignMessage</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Test_NestedTestAllTypes.html">Tensorflow_Test_NestedTestAllTypes</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Test_TestAllTypes.html">Tensorflow_Test_TestAllTypes</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Test_TestAllTypes/OneOf_OneofField.html">– OneOf_OneofField</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Test_TestAllTypes/NestedEnum.html">– NestedEnum</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Test_TestAllTypes/NestedMessage.html">– NestedMessage</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Test_TestEmptyMessage.html">Tensorflow_Test_TestEmptyMessage</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tf2xla_Config.html">Tensorflow_Tf2xla_Config</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tf2xla_Feed.html">Tensorflow_Tf2xla_Feed</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tf2xla_Fetch.html">Tensorflow_Tf2xla_Fetch</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tf2xla_TensorId.html">Tensorflow_Tf2xla_TensorId</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_AdviceProto.html">Tensorflow_Tfprof_AdviceProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_AdviceProto/Checker.html">– Checker</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_AdvisorOptionsProto.html">Tensorflow_Tfprof_AdvisorOptionsProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_AdvisorOptionsProto/CheckerOption.html">– CheckerOption</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_CodeDef.html">Tensorflow_Tfprof_CodeDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_CodeDef/Trace.html">– Trace</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_ExecProfile.html">Tensorflow_Tfprof_ExecProfile</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_ExecTime.html">Tensorflow_Tfprof_ExecTime</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_GraphNodeProto.html">Tensorflow_Tfprof_GraphNodeProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Memory.html">Tensorflow_Tfprof_Memory</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_MultiGraphNodeProto.html">Tensorflow_Tfprof_MultiGraphNodeProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_OpLogEntry.html">Tensorflow_Tfprof_OpLogEntry</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_OpLogProto.html">Tensorflow_Tfprof_OpLogProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_OptionsProto.html">Tensorflow_Tfprof_OptionsProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Pprof_Function.html">Tensorflow_Tfprof_Pprof_Function</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Pprof_Label.html">Tensorflow_Tfprof_Pprof_Label</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Pprof_Line.html">Tensorflow_Tfprof_Pprof_Line</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Pprof_Location.html">Tensorflow_Tfprof_Pprof_Location</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Pprof_Mapping.html">Tensorflow_Tfprof_Pprof_Mapping</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Pprof_Profile.html">Tensorflow_Tfprof_Pprof_Profile</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Pprof_Sample.html">Tensorflow_Tfprof_Pprof_Sample</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Pprof_ValueType.html">Tensorflow_Tfprof_Pprof_ValueType</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_ProfileNode.html">Tensorflow_Tfprof_ProfileNode</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_ProfileProto.html">Tensorflow_Tfprof_ProfileProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_TFProfTensorProto.html">Tensorflow_Tfprof_TFProfTensorProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tfprof_Tuple.html">Tensorflow_Tfprof_Tuple</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ThreadPoolOptionProto.html">Tensorflow_ThreadPoolOptionProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_Device.html">Tensorflow_Tpu_Device</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_OpProfile_Metrics.html">Tensorflow_Tpu_OpProfile_Metrics</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_OpProfile_Node.html">Tensorflow_Tpu_OpProfile_Node</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_OpProfile_Node/OneOf_Contents.html">– OneOf_Contents</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_OpProfile_Node/InstructionCategory.html">– InstructionCategory</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_OpProfile_Node/XLAInstruction.html">– XLAInstruction</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_OpProfile_Profile.html">Tensorflow_Tpu_OpProfile_Profile</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_Resource.html">Tensorflow_Tpu_Resource</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_Trace.html">Tensorflow_Tpu_Trace</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_Tpu_TraceEvent.html">Tensorflow_Tpu_TraceEvent</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TraceOpts.html">Tensorflow_TraceOpts</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TracingRequest.html">Tensorflow_TracingRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_TracingResponse.html">Tensorflow_TracingResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_ValuesDef.html">Tensorflow_ValuesDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_VarLenFeatureProto.html">Tensorflow_VarLenFeatureProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_VariableDef.html">Tensorflow_VariableDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_VariantTensorDataProto.html">Tensorflow_VariantTensorDataProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_VersionDef.html">Tensorflow_VersionDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Tensorflow_WhileContextDef.html">Tensorflow_WhileContextDef</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ThirdParty_Tensorflow_Core_Debug_DebuggerEventMetadata.html">ThirdParty_Tensorflow_Core_Debug_DebuggerEventMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ThirdParty_Tensorflow_Tools_Api_TFAPIClass.html">ThirdParty_Tensorflow_Tools_Api_TFAPIClass</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ThirdParty_Tensorflow_Tools_Api_TFAPIMember.html">ThirdParty_Tensorflow_Tools_Api_TFAPIMember</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ThirdParty_Tensorflow_Tools_Api_TFAPIMethod.html">ThirdParty_Tensorflow_Tools_Api_TFAPIMethod</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ThirdParty_Tensorflow_Tools_Api_TFAPIModule.html">ThirdParty_Tensorflow_Tools_Api_TFAPIModule</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ThirdParty_Tensorflow_Tools_Api_TFAPIObject.html">ThirdParty_Tensorflow_Tools_Api_TFAPIObject</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BatchNormGradRequest.html">Xla_BatchNormGradRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BatchNormInferenceRequest.html">Xla_BatchNormInferenceRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BatchNormTrainingRequest.html">Xla_BatchNormTrainingRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BinaryOpRequest.html">Xla_BinaryOpRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BroadcastRequest.html">Xla_BroadcastRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BufferAllocationProto.html">Xla_BufferAllocationProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BufferAllocationProto/Assigned.html">– Assigned</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BufferAssignmentProto.html">Xla_BufferAssignmentProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_BufferAssignmentProto/BufferAlias.html">– BufferAlias</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_CallRequest.html">Xla_CallRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ChannelHandle.html">Xla_ChannelHandle</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputationDataHandle.html">Xla_ComputationDataHandle</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputationHandle.html">Xla_ComputationHandle</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputationRequest.html">Xla_ComputationRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputationResponse.html">Xla_ComputationResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputationStats.html">Xla_ComputationStats</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputationStatsRequest.html">Xla_ComputationStatsRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputationStatsResponse.html">Xla_ComputationStatsResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputeConstantRequest.html">Xla_ComputeConstantRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ComputeConstantResponse.html">Xla_ComputeConstantResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ConcatenateRequest.html">Xla_ConcatenateRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ConstantRequest.html">Xla_ConstantRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ConvertRequest.html">Xla_ConvertRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ConvolutionDimensionNumbers.html">Xla_ConvolutionDimensionNumbers</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ConvolveRequest.html">Xla_ConvolveRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_CreateChannelHandleRequest.html">Xla_CreateChannelHandleRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_CreateChannelHandleResponse.html">Xla_CreateChannelHandleResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_CrossReplicaSumRequest.html">Xla_CrossReplicaSumRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_CustomCallRequest.html">Xla_CustomCallRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_DebugOptions.html">Xla_DebugOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_DeconstructTupleRequest.html">Xla_DeconstructTupleRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_DeconstructTupleResponse.html">Xla_DeconstructTupleResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_DeviceAssignmentProto.html">Xla_DeviceAssignmentProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_DeviceAssignmentProto/ComputationDevice.html">– ComputationDevice</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_DeviceHandle.html">Xla_DeviceHandle</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_DynamicSliceRequest.html">Xla_DynamicSliceRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_DynamicUpdateSliceRequest.html">Xla_DynamicUpdateSliceRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecuteAsyncRequest.html">Xla_ExecuteAsyncRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecuteAsyncResponse.html">Xla_ExecuteAsyncResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecuteParallelRequest.html">Xla_ExecuteParallelRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecuteParallelResponse.html">Xla_ExecuteParallelResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecuteRequest.html">Xla_ExecuteRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecuteResponse.html">Xla_ExecuteResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecutionHandle.html">Xla_ExecutionHandle</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecutionOptions.html">Xla_ExecutionOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ExecutionProfile.html">Xla_ExecutionProfile</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetComputationShapeRequest.html">Xla_GetComputationShapeRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetComputationShapeResponse.html">Xla_GetComputationShapeResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetDeviceHandlesRequest.html">Xla_GetDeviceHandlesRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetDeviceHandlesResponse.html">Xla_GetDeviceHandlesResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetLocalShapeRequest.html">Xla_GetLocalShapeRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetLocalShapeResponse.html">Xla_GetLocalShapeResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetShapeRequest.html">Xla_GetShapeRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetShapeResponse.html">Xla_GetShapeResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GetTupleElementRequest.html">Xla_GetTupleElementRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_GlobalDataHandle.html">Xla_GlobalDataHandle</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HeapSimulatorTrace.html">Xla_HeapSimulatorTrace</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HeapSimulatorTrace/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HloComputationProto.html">Xla_HloComputationProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HloInstructionProto.html">Xla_HloInstructionProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HloModuleProto.html">Xla_HloModuleProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HloOrderingProto.html">Xla_HloOrderingProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HloOrderingProto/SequentialComputation.html">– SequentialComputation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HloProto.html">Xla_HloProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HloReducePrecisionOptions.html">Xla_HloReducePrecisionOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_HloReducePrecisionOptions/Location.html">– Location</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_InfeedRequest.html">Xla_InfeedRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_IsConstantRequest.html">Xla_IsConstantRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_IsConstantResponse.html">Xla_IsConstantResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_Layout.html">Xla_Layout</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_LiteralProto.html">Xla_LiteralProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_LoadComputationSnapshotRequest.html">Xla_LoadComputationSnapshotRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_LoadComputationSnapshotResponse.html">Xla_LoadComputationSnapshotResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_LoadDataRequest.html">Xla_LoadDataRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_LoadDataResponse.html">Xla_LoadDataResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_LogicalBufferProto.html">Xla_LogicalBufferProto</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_LogicalBufferProto/Location.html">– Location</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_MapRequest.html">Xla_MapRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_OpDeviceAssignment.html">Xla_OpDeviceAssignment</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_OpMetadata.html">Xla_OpMetadata</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_OpRequest.html">Xla_OpRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_OpRequest/OneOf_Op.html">– OneOf_Op</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_OpResponse.html">Xla_OpResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_OperationRequest.html">Xla_OperationRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_OutfeedRequest.html">Xla_OutfeedRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_PadRequest.html">Xla_PadRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_PaddingConfig.html">Xla_PaddingConfig</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_PaddingConfig/PaddingConfigDimension.html">– PaddingConfigDimension</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ParameterRequest.html">Xla_ParameterRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ProgramShape.html">Xla_ProgramShape</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_RecvRequest.html">Xla_RecvRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ReducePrecisionRequest.html">Xla_ReducePrecisionRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ReduceRequest.html">Xla_ReduceRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ReduceWindowRequest.html">Xla_ReduceWindowRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ResetDeviceRequest.html">Xla_ResetDeviceRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ResetDeviceResponse.html">Xla_ResetDeviceResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ReshapeRequest.html">Xla_ReshapeRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_ReverseRequest.html">Xla_ReverseRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_RngRequest.html">Xla_RngRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SelectAndScatterRequest.html">Xla_SelectAndScatterRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SendRequest.html">Xla_SendRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SessionComputation.html">Xla_SessionComputation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SessionModule.html">Xla_SessionModule</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SetReturnValueRequest.html">Xla_SetReturnValueRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SetReturnValueResponse.html">Xla_SetReturnValueResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_Shape.html">Xla_Shape</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SliceRequest.html">Xla_SliceRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SnapshotComputationRequest.html">Xla_SnapshotComputationRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SnapshotComputationResponse.html">Xla_SnapshotComputationResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SpecializeRequest.html">Xla_SpecializeRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_SpecializeResponse.html">Xla_SpecializeResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TernaryOpRequest.html">Xla_TernaryOpRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TraceRequest.html">Xla_TraceRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransferFromOutfeedRequest.html">Xla_TransferFromOutfeedRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransferFromOutfeedResponse.html">Xla_TransferFromOutfeedResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransferToClientRequest.html">Xla_TransferToClientRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransferToClientResponse.html">Xla_TransferToClientResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransferToInfeedRequest.html">Xla_TransferToInfeedRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransferToInfeedResponse.html">Xla_TransferToInfeedResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransferToServerRequest.html">Xla_TransferToServerRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransferToServerResponse.html">Xla_TransferToServerResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_TransposeRequest.html">Xla_TransposeRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_UnaryOpRequest.html">Xla_UnaryOpRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_UnpackRequest.html">Xla_UnpackRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_UnpackResponse.html">Xla_UnpackResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_UnregisterRequest.html">Xla_UnregisterRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_UnregisterResponse.html">Xla_UnregisterResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_VariadicOpRequest.html">Xla_VariadicOpRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_WaitForExecutionRequest.html">Xla_WaitForExecutionRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_WaitForExecutionResponse.html">Xla_WaitForExecutionResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_WhileRequest.html">Xla_WhileRequest</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_Window.html">Xla_Window</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Xla_WindowDimension.html">Xla_WindowDimension</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Xla_ExecuteParallelResponse</h1>
<p>Undocumented</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:13SwiftProtobuf7MessageP05protoC4NameSSvZ"></a>
<a name="//apple_ref/swift/Variable/protoMessageName" class="dashAnchor"></a>
<a class="token" href="#/s:13SwiftProtobuf7MessageP05protoC4NameSSvZ">protoMessageName</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">protoMessageName</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="n">_protobuf_package</span> <span class="o">+</span> <span class="s">".ExecuteParallelResponse"</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/Octadero/TensorFlow/blob/master//Sources/Proto/compiler/xla/xla.pb.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:5Proto27Xla_ExecuteParallelResponseV9responsesSayAA0b1_cE0VGv"></a>
<a name="//apple_ref/swift/Property/responses" class="dashAnchor"></a>
<a class="token" href="#/s:5Proto27Xla_ExecuteParallelResponseV9responsesSayAA0b1_cE0VGv">responses</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="slightly-smaller">
<a href="https://github.com/Octadero/TensorFlow/blob/master//Sources/Proto/compiler/xla/xla.pb.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:13SwiftProtobuf7MessageP13unknownFieldsAA14UnknownStorageVv"></a>
<a name="//apple_ref/swift/Property/unknownFields" class="dashAnchor"></a>
<a class="token" href="#/s:13SwiftProtobuf7MessageP13unknownFieldsAA14UnknownStorageVv">unknownFields</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">unknownFields</span> <span class="o">=</span> <span class="kt">SwiftProtobuf</span><span class="o">.</span><span class="kt">UnknownStorage</span><span class="p">()</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/Octadero/TensorFlow/blob/master//Sources/Proto/compiler/xla/xla.pb.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:13SwiftProtobuf7MessagePxycfc"></a>
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
<a class="token" href="#/s:13SwiftProtobuf7MessagePxycfc">init()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/Octadero/TensorFlow/blob/master//Sources/Proto/compiler/xla/xla.pb.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:5Proto27Xla_ExecuteParallelResponseV13decodeMessageyxz7decoder_tK13SwiftProtobuf7DecoderRzlF"></a>
<a name="//apple_ref/swift/Method/decodeMessage(decoder:)" class="dashAnchor"></a>
<a class="token" href="#/s:5Proto27Xla_ExecuteParallelResponseV13decodeMessageyxz7decoder_tK13SwiftProtobuf7DecoderRzlF">decodeMessage(decoder:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used by the decoding initializers in the SwiftProtobuf library, not generally
used directly. <code>init(serializedData:)</code>, <code>init(jsonUTF8Data:)</code>, and other decoding
initializers are defined in the SwiftProtobuf library. See the Message and
Message+*Additions` files.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="n">decodeMessage</span><span class="o"><</span><span class="kt">D</span><span class="p">:</span> <span class="kt">SwiftProtobuf</span><span class="o">.</span><span class="kt">Decoder</span><span class="o">></span><span class="p">(</span><span class="nv">decoder</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">D</span><span class="p">)</span> <span class="k">throws</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/Octadero/TensorFlow/blob/master//Sources/Proto/compiler/xla/xla.pb.swift#L1968-L1975">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:5Proto27Xla_ExecuteParallelResponseV8traverseyxz7visitor_tK13SwiftProtobuf7VisitorRzlF"></a>
<a name="//apple_ref/swift/Method/traverse(visitor:)" class="dashAnchor"></a>
<a class="token" href="#/s:5Proto27Xla_ExecuteParallelResponseV8traverseyxz7visitor_tK13SwiftProtobuf7VisitorRzlF">traverse(visitor:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used by the encoding methods of the SwiftProtobuf library, not generally
used directly. <code>Message.serializedData()</code>, <code>Message.jsonUTF8Data()</code>, and
other serializer methods are defined in the SwiftProtobuf library. See the
<code>Message</code> and <code>Message+*Additions</code> files.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">traverse</span><span class="o"><</span><span class="kt">V</span><span class="p">:</span> <span class="kt">SwiftProtobuf</span><span class="o">.</span><span class="kt">Visitor</span><span class="o">></span><span class="p">(</span><span class="nv">visitor</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">V</span><span class="p">)</span> <span class="k">throws</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/Octadero/TensorFlow/blob/master//Sources/Proto/compiler/xla/xla.pb.swift#L1981-L1986">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:13SwiftProtobuf19_ProtoNameProvidingP17_protobuf_nameMapAA01_dH0VvZ"></a>
<a name="//apple_ref/swift/Variable/_protobuf_nameMap" class="dashAnchor"></a>
<a class="token" href="#/s:13SwiftProtobuf19_ProtoNameProvidingP17_protobuf_nameMapAA01_dH0VvZ">_protobuf_nameMap</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">_protobuf_nameMap</span><span class="p">:</span> <span class="kt">SwiftProtobuf</span><span class="o">.</span><span class="n">_NameMap</span> <span class="o">=</span> <span class="p">[</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/Octadero/TensorFlow/blob/master//Sources/Proto/compiler/xla/xla.pb.swift#L">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:5Proto27Xla_ExecuteParallelResponseV29_protobuf_generated_isEqualToSbAC5other_tF"></a>
<a name="//apple_ref/swift/Method/_protobuf_generated_isEqualTo(other:)" class="dashAnchor"></a>
<a class="token" href="#/s:5Proto27Xla_ExecuteParallelResponseV29_protobuf_generated_isEqualToSbAC5other_tF">_protobuf_generated_isEqualTo(other:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="slightly-smaller">
<a href="https://github.com/Octadero/TensorFlow/blob/master//Sources/Proto/compiler/xla/xla.pb.swift#L4218-L4222">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2017 <a class="link" href="https://octadero.com" target="_blank" rel="external">Octadeor</a> under <a class="link" href="https://github.com/Octadero/TensorFlow/blob/master/LICENSE" target="_blank" rel="external">open source license</a>.</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
|
Octadero/TensorFlow
|
Documentation/Proto/docsets/Proto.docset/Contents/Resources/Documents/Structs/Xla_ExecuteParallelResponse.html
|
HTML
|
gpl-3.0
| 105,792 |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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.
//
// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Library of workshop module functions needed by Moodle core and other subsystems
*
* All the functions neeeded by Moodle core, gradebook, file subsystem etc
* are placed here.
*
* @package mod_workshop
* @copyright 2009 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/calendar/lib.php');
define('WORKSHOP_EVENT_TYPE_SUBMISSION_OPEN', 'opensubmission');
define('WORKSHOP_EVENT_TYPE_SUBMISSION_CLOSE', 'closesubmission');
define('WORKSHOP_EVENT_TYPE_ASSESSMENT_OPEN', 'openassessment');
define('WORKSHOP_EVENT_TYPE_ASSESSMENT_CLOSE', 'closeassessment');
define('WORKSHOP_SUBMISSION_TYPE_DISABLED', 0);
define('WORKSHOP_SUBMISSION_TYPE_AVAILABLE', 1);
define('WORKSHOP_SUBMISSION_TYPE_REQUIRED', 2);
////////////////////////////////////////////////////////////////////////////////
// Moodle core API //
////////////////////////////////////////////////////////////////////////////////
/**
* Returns the information if the module supports a feature
*
* @see plugin_supports() in lib/moodlelib.php
* @param string $feature FEATURE_xx constant for requested feature
* @return mixed true if the feature is supported, null if unknown
*/
function workshop_supports($feature) {
switch($feature) {
case FEATURE_GRADE_HAS_GRADE: return true;
case FEATURE_GROUPS: return true;
case FEATURE_GROUPINGS: return true;
case FEATURE_MOD_INTRO: return true;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_COMPLETION_TRACKS_VIEWS:
return true;
case FEATURE_SHOW_DESCRIPTION: return true;
case FEATURE_PLAGIARISM: return true;
default: return null;
}
}
/**
* Saves a new instance of the workshop into the database
*
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will save a new instance and return the id number
* of the new instance.
*
* @param stdClass $workshop An object from the form in mod_form.php
* @return int The id of the newly inserted workshop record
*/
function workshop_add_instance(stdclass $workshop) {
global $CFG, $DB;
require_once(__DIR__ . '/locallib.php');
$workshop->phase = workshop::PHASE_SETUP;
$workshop->timecreated = time();
$workshop->timemodified = $workshop->timecreated;
$workshop->useexamples = (int)!empty($workshop->useexamples);
$workshop->usepeerassessment = 1;
$workshop->useselfassessment = (int)!empty($workshop->useselfassessment);
$workshop->latesubmissions = (int)!empty($workshop->latesubmissions);
$workshop->phaseswitchassessment = (int)!empty($workshop->phaseswitchassessment);
$workshop->evaluation = 'best';
if (isset($workshop->gradinggradepass)) {
$workshop->gradinggradepass = (float)unformat_float($workshop->gradinggradepass);
}
if (isset($workshop->submissiongradepass)) {
$workshop->submissiongradepass = (float)unformat_float($workshop->submissiongradepass);
}
if (isset($workshop->submissionfiletypes)) {
$filetypesutil = new \core_form\filetypes_util();
$submissionfiletypes = $filetypesutil->normalize_file_types($workshop->submissionfiletypes);
$workshop->submissionfiletypes = implode(' ', $submissionfiletypes);
}
if (isset($workshop->overallfeedbackfiletypes)) {
$filetypesutil = new \core_form\filetypes_util();
$overallfeedbackfiletypes = $filetypesutil->normalize_file_types($workshop->overallfeedbackfiletypes);
$workshop->overallfeedbackfiletypes = implode(' ', $overallfeedbackfiletypes);
}
// insert the new record so we get the id
$workshop->id = $DB->insert_record('workshop', $workshop);
// we need to use context now, so we need to make sure all needed info is already in db
$cmid = $workshop->coursemodule;
$DB->set_field('course_modules', 'instance', $workshop->id, array('id' => $cmid));
$context = context_module::instance($cmid);
// process the custom wysiwyg editors
if ($draftitemid = $workshop->instructauthorseditor['itemid']) {
$workshop->instructauthors = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'instructauthors',
0, workshop::instruction_editors_options($context), $workshop->instructauthorseditor['text']);
$workshop->instructauthorsformat = $workshop->instructauthorseditor['format'];
}
if ($draftitemid = $workshop->instructreviewerseditor['itemid']) {
$workshop->instructreviewers = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'instructreviewers',
0, workshop::instruction_editors_options($context), $workshop->instructreviewerseditor['text']);
$workshop->instructreviewersformat = $workshop->instructreviewerseditor['format'];
}
if ($draftitemid = $workshop->conclusioneditor['itemid']) {
$workshop->conclusion = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'conclusion',
0, workshop::instruction_editors_options($context), $workshop->conclusioneditor['text']);
$workshop->conclusionformat = $workshop->conclusioneditor['format'];
}
// re-save the record with the replaced URLs in editor fields
$DB->update_record('workshop', $workshop);
// create gradebook items
workshop_grade_item_update($workshop);
workshop_grade_item_category_update($workshop);
// create calendar events
workshop_calendar_update($workshop, $workshop->coursemodule);
if (!empty($workshop->completionexpected)) {
\core_completion\api::update_completion_date_event($cmid, 'workshop', $workshop->id, $workshop->completionexpected);
}
return $workshop->id;
}
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param stdClass $workshop An object from the form in mod_form.php
* @return bool success
*/
function workshop_update_instance(stdclass $workshop) {
global $CFG, $DB;
require_once(__DIR__ . '/locallib.php');
$workshop->timemodified = time();
$workshop->id = $workshop->instance;
$workshop->useexamples = (int)!empty($workshop->useexamples);
$workshop->usepeerassessment = 1;
$workshop->useselfassessment = (int)!empty($workshop->useselfassessment);
$workshop->latesubmissions = (int)!empty($workshop->latesubmissions);
$workshop->phaseswitchassessment = (int)!empty($workshop->phaseswitchassessment);
if (isset($workshop->gradinggradepass)) {
$workshop->gradinggradepass = (float)unformat_float($workshop->gradinggradepass);
}
if (isset($workshop->submissiongradepass)) {
$workshop->submissiongradepass = (float)unformat_float($workshop->submissiongradepass);
}
if (isset($workshop->submissionfiletypes)) {
$filetypesutil = new \core_form\filetypes_util();
$submissionfiletypes = $filetypesutil->normalize_file_types($workshop->submissionfiletypes);
$workshop->submissionfiletypes = implode(' ', $submissionfiletypes);
}
if (isset($workshop->overallfeedbackfiletypes)) {
$filetypesutil = new \core_form\filetypes_util();
$overallfeedbackfiletypes = $filetypesutil->normalize_file_types($workshop->overallfeedbackfiletypes);
$workshop->overallfeedbackfiletypes = implode(' ', $overallfeedbackfiletypes);
}
// todo - if the grading strategy is being changed, we may want to replace all aggregated peer grades with nulls
$DB->update_record('workshop', $workshop);
$context = context_module::instance($workshop->coursemodule);
// process the custom wysiwyg editors
if ($draftitemid = $workshop->instructauthorseditor['itemid']) {
$workshop->instructauthors = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'instructauthors',
0, workshop::instruction_editors_options($context), $workshop->instructauthorseditor['text']);
$workshop->instructauthorsformat = $workshop->instructauthorseditor['format'];
}
if ($draftitemid = $workshop->instructreviewerseditor['itemid']) {
$workshop->instructreviewers = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'instructreviewers',
0, workshop::instruction_editors_options($context), $workshop->instructreviewerseditor['text']);
$workshop->instructreviewersformat = $workshop->instructreviewerseditor['format'];
}
if ($draftitemid = $workshop->conclusioneditor['itemid']) {
$workshop->conclusion = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'conclusion',
0, workshop::instruction_editors_options($context), $workshop->conclusioneditor['text']);
$workshop->conclusionformat = $workshop->conclusioneditor['format'];
}
// re-save the record with the replaced URLs in editor fields
$DB->update_record('workshop', $workshop);
// update gradebook items
workshop_grade_item_update($workshop);
workshop_grade_item_category_update($workshop);
// update calendar events
workshop_calendar_update($workshop, $workshop->coursemodule);
$completionexpected = (!empty($workshop->completionexpected)) ? $workshop->completionexpected : null;
\core_completion\api::update_completion_date_event($workshop->coursemodule, 'workshop', $workshop->id, $completionexpected);
return true;
}
/**
* Given an ID of an instance of this module,
* this function will permanently delete the instance
* and any data that depends on it.
*
* @param int $id Id of the module instance
* @return boolean Success/Failure
*/
function workshop_delete_instance($id) {
global $CFG, $DB;
require_once($CFG->libdir.'/gradelib.php');
if (! $workshop = $DB->get_record('workshop', array('id' => $id))) {
return false;
}
// delete all associated aggregations
$DB->delete_records('workshop_aggregations', array('workshopid' => $workshop->id));
// get the list of ids of all submissions
$submissions = $DB->get_records('workshop_submissions', array('workshopid' => $workshop->id), '', 'id');
// get the list of all allocated assessments
$assessments = $DB->get_records_list('workshop_assessments', 'submissionid', array_keys($submissions), '', 'id');
// delete the associated records from the workshop core tables
$DB->delete_records_list('workshop_grades', 'assessmentid', array_keys($assessments));
$DB->delete_records_list('workshop_assessments', 'id', array_keys($assessments));
$DB->delete_records_list('workshop_submissions', 'id', array_keys($submissions));
// call the static clean-up methods of all available subplugins
$strategies = core_component::get_plugin_list('workshopform');
foreach ($strategies as $strategy => $path) {
require_once($path.'/lib.php');
$classname = 'workshop_'.$strategy.'_strategy';
call_user_func($classname.'::delete_instance', $workshop->id);
}
$allocators = core_component::get_plugin_list('workshopallocation');
foreach ($allocators as $allocator => $path) {
require_once($path.'/lib.php');
$classname = 'workshop_'.$allocator.'_allocator';
call_user_func($classname.'::delete_instance', $workshop->id);
}
$evaluators = core_component::get_plugin_list('workshopeval');
foreach ($evaluators as $evaluator => $path) {
require_once($path.'/lib.php');
$classname = 'workshop_'.$evaluator.'_evaluation';
call_user_func($classname.'::delete_instance', $workshop->id);
}
// delete the calendar events
$events = $DB->get_records('event', array('modulename' => 'workshop', 'instance' => $workshop->id));
foreach ($events as $event) {
$event = calendar_event::load($event);
$event->delete();
}
// gradebook cleanup
grade_update('mod/workshop', $workshop->course, 'mod', 'workshop', $workshop->id, 0, null, array('deleted' => true));
grade_update('mod/workshop', $workshop->course, 'mod', 'workshop', $workshop->id, 1, null, array('deleted' => true));
// finally remove the workshop record itself
// We must delete the module record after we delete the grade item.
$DB->delete_records('workshop', array('id' => $workshop->id));
return true;
}
/**
* This standard function will check all instances of this module
* and make sure there are up-to-date events created for each of them.
* If courseid = 0, then every workshop event in the site is checked, else
* only workshop events belonging to the course specified are checked.
*
* @param integer $courseid The Course ID.
* @param int|stdClass $instance workshop module instance or ID.
* @param int|stdClass $cm Course module object or ID.
* @return bool Returns true if the calendar events were successfully updated.
*/
function workshop_refresh_events($courseid = 0, $instance = null, $cm = null) {
global $DB;
// If we have instance information then we can just update the one event instead of updating all events.
if (isset($instance)) {
if (!is_object($instance)) {
$instance = $DB->get_record('workshop', array('id' => $instance), '*', MUST_EXIST);
}
if (isset($cm)) {
if (!is_object($cm)) {
$cm = (object)array('id' => $cm);
}
} else {
$cm = get_coursemodule_from_instance('workshop', $instance->id);
}
workshop_calendar_update($instance, $cm->id);
return true;
}
if ($courseid) {
// Make sure that the course id is numeric.
if (!is_numeric($courseid)) {
return false;
}
if (!$workshops = $DB->get_records('workshop', array('course' => $courseid))) {
return false;
}
} else {
if (!$workshops = $DB->get_records('workshop')) {
return false;
}
}
foreach ($workshops as $workshop) {
if (!$cm = get_coursemodule_from_instance('workshop', $workshop->id, $courseid, false)) {
continue;
}
workshop_calendar_update($workshop, $cm->id);
}
return true;
}
/**
* List the actions that correspond to a view of this module.
* This is used by the participation report.
*
* Note: This is not used by new logging system. Event with
* crud = 'r' and edulevel = LEVEL_PARTICIPATING will
* be considered as view action.
*
* @return array
*/
function workshop_get_view_actions() {
return array('view', 'view all', 'view submission', 'view example');
}
/**
* List the actions that correspond to a post of this module.
* This is used by the participation report.
*
* Note: This is not used by new logging system. Event with
* crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING
* will be considered as post action.
*
* @return array
*/
function workshop_get_post_actions() {
return array('add', 'add assessment', 'add example', 'add submission',
'update', 'update assessment', 'update example', 'update submission');
}
/**
* Return a small object with summary information about what a
* user has done with a given particular instance of this module
* Used for user activity reports.
* $return->time = the time they did it
* $return->info = a short text description
*
* @param stdClass $course The course record.
* @param stdClass $user The user record.
* @param cm_info|stdClass $mod The course module info object or record.
* @param stdClass $workshop The workshop instance record.
* @return stdclass|null
*/
function workshop_user_outline($course, $user, $mod, $workshop) {
global $CFG, $DB;
require_once($CFG->libdir.'/gradelib.php');
$grades = grade_get_grades($course->id, 'mod', 'workshop', $workshop->id, $user->id);
$submissiongrade = null;
$assessmentgrade = null;
$info = '';
$time = 0;
if (!empty($grades->items[0]->grades)) {
$submissiongrade = reset($grades->items[0]->grades);
$time = max($time, $submissiongrade->dategraded);
if (!$submissiongrade->hidden || has_capability('moodle/grade:viewhidden', context_course::instance($course->id))) {
$info .= get_string('submissiongrade', 'workshop') . ': ' . $submissiongrade->str_long_grade
. html_writer::empty_tag('br');
} else {
$info .= get_string('submissiongrade', 'workshop') . ': ' . get_string('hidden', 'grades')
. html_writer::empty_tag('br');
}
}
if (!empty($grades->items[1]->grades)) {
$assessmentgrade = reset($grades->items[1]->grades);
$time = max($time, $assessmentgrade->dategraded);
if (!$assessmentgrade->hidden || has_capability('moodle/grade:viewhidden', context_course::instance($course->id))) {
$info .= get_string('gradinggrade', 'workshop') . ': ' . $assessmentgrade->str_long_grade;
} else {
$info .= get_string('gradinggrade', 'workshop') . ': ' . get_string('hidden', 'grades');
}
}
if (!empty($info) and !empty($time)) {
$return = new stdclass();
$return->time = $time;
$return->info = $info;
return $return;
}
return null;
}
/**
* Print a detailed representation of what a user has done with
* a given particular instance of this module, for user activity reports.
*
* @param stdClass $course The course record.
* @param stdClass $user The user record.
* @param cm_info|stdClass $mod The course module info object or record.
* @param stdClass $workshop The workshop instance record.
* @return string HTML
*/
function workshop_user_complete($course, $user, $mod, $workshop) {
global $CFG, $DB, $OUTPUT;
require_once(__DIR__.'/locallib.php');
require_once($CFG->libdir.'/gradelib.php');
$workshop = new workshop($workshop, $mod, $course);
$grades = grade_get_grades($course->id, 'mod', 'workshop', $workshop->id, $user->id);
if (!empty($grades->items[0]->grades)) {
$submissiongrade = reset($grades->items[0]->grades);
if (!$submissiongrade->hidden || has_capability('moodle/grade:viewhidden', context_course::instance($course->id))) {
$info = get_string('submissiongrade', 'workshop') . ': ' . $submissiongrade->str_long_grade;
} else {
$info = get_string('submissiongrade', 'workshop') . ': ' . get_string('hidden', 'grades');
}
echo html_writer::tag('li', $info, array('class'=>'submissiongrade'));
}
if (!empty($grades->items[1]->grades)) {
$assessmentgrade = reset($grades->items[1]->grades);
if (!$assessmentgrade->hidden || has_capability('moodle/grade:viewhidden', context_course::instance($course->id))) {
$info = get_string('gradinggrade', 'workshop') . ': ' . $assessmentgrade->str_long_grade;
} else {
$info = get_string('gradinggrade', 'workshop') . ': ' . get_string('hidden', 'grades');
}
echo html_writer::tag('li', $info, array('class'=>'gradinggrade'));
}
if (has_capability('mod/workshop:viewallsubmissions', $workshop->context)) {
$canviewsubmission = true;
if (groups_get_activity_groupmode($workshop->cm) == SEPARATEGROUPS) {
// user must have accessallgroups or share at least one group with the submission author
if (!has_capability('moodle/site:accessallgroups', $workshop->context)) {
$usersgroups = groups_get_activity_allowed_groups($workshop->cm);
$authorsgroups = groups_get_all_groups($workshop->course->id, $user->id, $workshop->cm->groupingid, 'g.id');
$sharedgroups = array_intersect_key($usersgroups, $authorsgroups);
if (empty($sharedgroups)) {
$canviewsubmission = false;
}
}
}
if ($canviewsubmission and $submission = $workshop->get_submission_by_author($user->id)) {
$title = format_string($submission->title);
$url = $workshop->submission_url($submission->id);
$link = html_writer::link($url, $title);
$info = get_string('submission', 'workshop').': '.$link;
echo html_writer::tag('li', $info, array('class'=>'submission'));
}
}
if (has_capability('mod/workshop:viewallassessments', $workshop->context)) {
if ($assessments = $workshop->get_assessments_by_reviewer($user->id)) {
foreach ($assessments as $assessment) {
$a = new stdclass();
$a->submissionurl = $workshop->submission_url($assessment->submissionid)->out();
$a->assessmenturl = $workshop->assess_url($assessment->id)->out();
$a->submissiontitle = s($assessment->submissiontitle);
echo html_writer::tag('li', get_string('assessmentofsubmission', 'workshop', $a));
}
}
}
}
/**
* Given a course and a time, this module should find recent activity
* that has occurred in workshop activities and print it out.
* Return true if there was output, or false is there was none.
*
* @param stdClass $course
* @param bool $viewfullnames
* @param int $timestart
* @return boolean
*/
function workshop_print_recent_activity($course, $viewfullnames, $timestart) {
global $CFG, $USER, $DB, $OUTPUT;
$authoramefields = get_all_user_name_fields(true, 'author', null, 'author');
$reviewerfields = get_all_user_name_fields(true, 'reviewer', null, 'reviewer');
$sql = "SELECT s.id AS submissionid, s.title AS submissiontitle, s.timemodified AS submissionmodified,
author.id AS authorid, $authoramefields, a.id AS assessmentid, a.timemodified AS assessmentmodified,
reviewer.id AS reviewerid, $reviewerfields, cm.id AS cmid
FROM {workshop} w
INNER JOIN {course_modules} cm ON cm.instance = w.id
INNER JOIN {modules} md ON md.id = cm.module
INNER JOIN {workshop_submissions} s ON s.workshopid = w.id
INNER JOIN {user} author ON s.authorid = author.id
LEFT JOIN {workshop_assessments} a ON a.submissionid = s.id
LEFT JOIN {user} reviewer ON a.reviewerid = reviewer.id
WHERE cm.course = ?
AND md.name = 'workshop'
AND s.example = 0
AND (s.timemodified > ? OR a.timemodified > ?)
ORDER BY s.timemodified";
$rs = $DB->get_recordset_sql($sql, array($course->id, $timestart, $timestart));
$modinfo = get_fast_modinfo($course); // reference needed because we might load the groups
$submissions = array(); // recent submissions indexed by submission id
$assessments = array(); // recent assessments indexed by assessment id
$users = array();
foreach ($rs as $activity) {
if (!array_key_exists($activity->cmid, $modinfo->cms)) {
// this should not happen but just in case
continue;
}
$cm = $modinfo->cms[$activity->cmid];
if (!$cm->uservisible) {
continue;
}
// remember all user names we can use later
if (empty($users[$activity->authorid])) {
$u = new stdclass();
$users[$activity->authorid] = username_load_fields_from_object($u, $activity, 'author');
}
if ($activity->reviewerid and empty($users[$activity->reviewerid])) {
$u = new stdclass();
$users[$activity->reviewerid] = username_load_fields_from_object($u, $activity, 'reviewer');
}
$context = context_module::instance($cm->id);
$groupmode = groups_get_activity_groupmode($cm, $course);
if ($activity->submissionmodified > $timestart and empty($submissions[$activity->submissionid])) {
$s = new stdclass();
$s->title = $activity->submissiontitle;
$s->authorid = $activity->authorid;
$s->timemodified = $activity->submissionmodified;
$s->cmid = $activity->cmid;
if ($activity->authorid == $USER->id || has_capability('mod/workshop:viewauthornames', $context)) {
$s->authornamevisible = true;
} else {
$s->authornamevisible = false;
}
// the following do-while wrapper allows to break from deeply nested if-statements
do {
if ($s->authorid === $USER->id) {
// own submissions always visible
$submissions[$activity->submissionid] = $s;
break;
}
if (has_capability('mod/workshop:viewallsubmissions', $context)) {
if ($groupmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
if (isguestuser()) {
// shortcut - guest user does not belong into any group
break;
}
// this might be slow - show only submissions by users who share group with me in this cm
if (!$modinfo->get_groups($cm->groupingid)) {
break;
}
$authorsgroups = groups_get_all_groups($course->id, $s->authorid, $cm->groupingid);
if (is_array($authorsgroups)) {
$authorsgroups = array_keys($authorsgroups);
$intersect = array_intersect($authorsgroups, $modinfo->get_groups($cm->groupingid));
if (empty($intersect)) {
break;
} else {
// can see all submissions and shares a group with the author
$submissions[$activity->submissionid] = $s;
break;
}
}
} else {
// can see all submissions from all groups
$submissions[$activity->submissionid] = $s;
}
}
} while (0);
}
if ($activity->assessmentmodified > $timestart and empty($assessments[$activity->assessmentid])) {
$a = new stdclass();
$a->submissionid = $activity->submissionid;
$a->submissiontitle = $activity->submissiontitle;
$a->reviewerid = $activity->reviewerid;
$a->timemodified = $activity->assessmentmodified;
$a->cmid = $activity->cmid;
if ($activity->reviewerid == $USER->id || has_capability('mod/workshop:viewreviewernames', $context)) {
$a->reviewernamevisible = true;
} else {
$a->reviewernamevisible = false;
}
// the following do-while wrapper allows to break from deeply nested if-statements
do {
if ($a->reviewerid === $USER->id) {
// own assessments always visible
$assessments[$activity->assessmentid] = $a;
break;
}
if (has_capability('mod/workshop:viewallassessments', $context)) {
if ($groupmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
if (isguestuser()) {
// shortcut - guest user does not belong into any group
break;
}
// this might be slow - show only submissions by users who share group with me in this cm
if (!$modinfo->get_groups($cm->groupingid)) {
break;
}
$reviewersgroups = groups_get_all_groups($course->id, $a->reviewerid, $cm->groupingid);
if (is_array($reviewersgroups)) {
$reviewersgroups = array_keys($reviewersgroups);
$intersect = array_intersect($reviewersgroups, $modinfo->get_groups($cm->groupingid));
if (empty($intersect)) {
break;
} else {
// can see all assessments and shares a group with the reviewer
$assessments[$activity->assessmentid] = $a;
break;
}
}
} else {
// can see all assessments from all groups
$assessments[$activity->assessmentid] = $a;
}
}
} while (0);
}
}
$rs->close();
$shown = false;
if (!empty($submissions)) {
$shown = true;
echo $OUTPUT->heading(get_string('recentsubmissions', 'workshop'), 3);
foreach ($submissions as $id => $submission) {
$link = new moodle_url('/mod/workshop/submission.php', array('id'=>$id, 'cmid'=>$submission->cmid));
if ($submission->authornamevisible) {
$author = $users[$submission->authorid];
} else {
$author = null;
}
print_recent_activity_note($submission->timemodified, $author, $submission->title, $link->out(), false, $viewfullnames);
}
}
if (!empty($assessments)) {
$shown = true;
echo $OUTPUT->heading(get_string('recentassessments', 'workshop'), 3);
core_collator::asort_objects_by_property($assessments, 'timemodified');
foreach ($assessments as $id => $assessment) {
$link = new moodle_url('/mod/workshop/assessment.php', array('asid' => $id));
if ($assessment->reviewernamevisible) {
$reviewer = $users[$assessment->reviewerid];
} else {
$reviewer = null;
}
print_recent_activity_note($assessment->timemodified, $reviewer, $assessment->submissiontitle, $link->out(), false, $viewfullnames);
}
}
if ($shown) {
return true;
}
return false;
}
/**
* Returns all activity in course workshops since a given time
*
* @param array $activities sequentially indexed array of objects
* @param int $index
* @param int $timestart
* @param int $courseid
* @param int $cmid
* @param int $userid defaults to 0
* @param int $groupid defaults to 0
* @return void adds items into $activities and increases $index
*/
function workshop_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) {
global $CFG, $COURSE, $USER, $DB;
if ($COURSE->id == $courseid) {
$course = $COURSE;
} else {
$course = $DB->get_record('course', array('id'=>$courseid));
}
$modinfo = get_fast_modinfo($course);
$cm = $modinfo->cms[$cmid];
$params = array();
if ($userid) {
$userselect = "AND (author.id = :authorid OR reviewer.id = :reviewerid)";
$params['authorid'] = $userid;
$params['reviewerid'] = $userid;
} else {
$userselect = "";
}
if ($groupid) {
$groupselect = "AND (authorgroupmembership.groupid = :authorgroupid OR reviewergroupmembership.groupid = :reviewergroupid)";
$groupjoin = "LEFT JOIN {groups_members} authorgroupmembership ON authorgroupmembership.userid = author.id
LEFT JOIN {groups_members} reviewergroupmembership ON reviewergroupmembership.userid = reviewer.id";
$params['authorgroupid'] = $groupid;
$params['reviewergroupid'] = $groupid;
} else {
$groupselect = "";
$groupjoin = "";
}
$params['cminstance'] = $cm->instance;
$params['submissionmodified'] = $timestart;
$params['assessmentmodified'] = $timestart;
$authornamefields = get_all_user_name_fields(true, 'author', null, 'author');
$reviewerfields = get_all_user_name_fields(true, 'reviewer', null, 'reviewer');
$sql = "SELECT s.id AS submissionid, s.title AS submissiontitle, s.timemodified AS submissionmodified,
author.id AS authorid, $authornamefields, author.picture AS authorpicture, author.imagealt AS authorimagealt,
author.email AS authoremail, a.id AS assessmentid, a.timemodified AS assessmentmodified,
reviewer.id AS reviewerid, $reviewerfields, reviewer.picture AS reviewerpicture,
reviewer.imagealt AS reviewerimagealt, reviewer.email AS revieweremail
FROM {workshop_submissions} s
INNER JOIN {workshop} w ON s.workshopid = w.id
INNER JOIN {user} author ON s.authorid = author.id
LEFT JOIN {workshop_assessments} a ON a.submissionid = s.id
LEFT JOIN {user} reviewer ON a.reviewerid = reviewer.id
$groupjoin
WHERE w.id = :cminstance
AND s.example = 0
$userselect $groupselect
AND (s.timemodified > :submissionmodified OR a.timemodified > :assessmentmodified)
ORDER BY s.timemodified ASC, a.timemodified ASC";
$rs = $DB->get_recordset_sql($sql, $params);
$groupmode = groups_get_activity_groupmode($cm, $course);
$context = context_module::instance($cm->id);
$grader = has_capability('moodle/grade:viewall', $context);
$accessallgroups = has_capability('moodle/site:accessallgroups', $context);
$viewauthors = has_capability('mod/workshop:viewauthornames', $context);
$viewreviewers = has_capability('mod/workshop:viewreviewernames', $context);
$submissions = array(); // recent submissions indexed by submission id
$assessments = array(); // recent assessments indexed by assessment id
$users = array();
foreach ($rs as $activity) {
// remember all user names we can use later
if (empty($users[$activity->authorid])) {
$u = new stdclass();
$additionalfields = explode(',', user_picture::fields());
$u = username_load_fields_from_object($u, $activity, 'author', $additionalfields);
$users[$activity->authorid] = $u;
}
if ($activity->reviewerid and empty($users[$activity->reviewerid])) {
$u = new stdclass();
$additionalfields = explode(',', user_picture::fields());
$u = username_load_fields_from_object($u, $activity, 'reviewer', $additionalfields);
$users[$activity->reviewerid] = $u;
}
if ($activity->submissionmodified > $timestart and empty($submissions[$activity->submissionid])) {
$s = new stdclass();
$s->id = $activity->submissionid;
$s->title = $activity->submissiontitle;
$s->authorid = $activity->authorid;
$s->timemodified = $activity->submissionmodified;
if ($activity->authorid == $USER->id || has_capability('mod/workshop:viewauthornames', $context)) {
$s->authornamevisible = true;
} else {
$s->authornamevisible = false;
}
// the following do-while wrapper allows to break from deeply nested if-statements
do {
if ($s->authorid === $USER->id) {
// own submissions always visible
$submissions[$activity->submissionid] = $s;
break;
}
if (has_capability('mod/workshop:viewallsubmissions', $context)) {
if ($groupmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
if (isguestuser()) {
// shortcut - guest user does not belong into any group
break;
}
// this might be slow - show only submissions by users who share group with me in this cm
if (!$modinfo->get_groups($cm->groupingid)) {
break;
}
$authorsgroups = groups_get_all_groups($course->id, $s->authorid, $cm->groupingid);
if (is_array($authorsgroups)) {
$authorsgroups = array_keys($authorsgroups);
$intersect = array_intersect($authorsgroups, $modinfo->get_groups($cm->groupingid));
if (empty($intersect)) {
break;
} else {
// can see all submissions and shares a group with the author
$submissions[$activity->submissionid] = $s;
break;
}
}
} else {
// can see all submissions from all groups
$submissions[$activity->submissionid] = $s;
}
}
} while (0);
}
if ($activity->assessmentmodified > $timestart and empty($assessments[$activity->assessmentid])) {
$a = new stdclass();
$a->id = $activity->assessmentid;
$a->submissionid = $activity->submissionid;
$a->submissiontitle = $activity->submissiontitle;
$a->reviewerid = $activity->reviewerid;
$a->timemodified = $activity->assessmentmodified;
if ($activity->reviewerid == $USER->id || has_capability('mod/workshop:viewreviewernames', $context)) {
$a->reviewernamevisible = true;
} else {
$a->reviewernamevisible = false;
}
// the following do-while wrapper allows to break from deeply nested if-statements
do {
if ($a->reviewerid === $USER->id) {
// own assessments always visible
$assessments[$activity->assessmentid] = $a;
break;
}
if (has_capability('mod/workshop:viewallassessments', $context)) {
if ($groupmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
if (isguestuser()) {
// shortcut - guest user does not belong into any group
break;
}
// this might be slow - show only submissions by users who share group with me in this cm
if (!$modinfo->get_groups($cm->groupingid)) {
break;
}
$reviewersgroups = groups_get_all_groups($course->id, $a->reviewerid, $cm->groupingid);
if (is_array($reviewersgroups)) {
$reviewersgroups = array_keys($reviewersgroups);
$intersect = array_intersect($reviewersgroups, $modinfo->get_groups($cm->groupingid));
if (empty($intersect)) {
break;
} else {
// can see all assessments and shares a group with the reviewer
$assessments[$activity->assessmentid] = $a;
break;
}
}
} else {
// can see all assessments from all groups
$assessments[$activity->assessmentid] = $a;
}
}
} while (0);
}
}
$rs->close();
$workshopname = format_string($cm->name, true);
if ($grader) {
require_once($CFG->libdir.'/gradelib.php');
$grades = grade_get_grades($courseid, 'mod', 'workshop', $cm->instance, array_keys($users));
}
foreach ($submissions as $submission) {
$tmpactivity = new stdclass();
$tmpactivity->type = 'workshop';
$tmpactivity->cmid = $cm->id;
$tmpactivity->name = $workshopname;
$tmpactivity->sectionnum = $cm->sectionnum;
$tmpactivity->timestamp = $submission->timemodified;
$tmpactivity->subtype = 'submission';
$tmpactivity->content = $submission;
if ($grader) {
$tmpactivity->grade = $grades->items[0]->grades[$submission->authorid]->str_long_grade;
}
if ($submission->authornamevisible and !empty($users[$submission->authorid])) {
$tmpactivity->user = $users[$submission->authorid];
}
$activities[$index++] = $tmpactivity;
}
foreach ($assessments as $assessment) {
$tmpactivity = new stdclass();
$tmpactivity->type = 'workshop';
$tmpactivity->cmid = $cm->id;
$tmpactivity->name = $workshopname;
$tmpactivity->sectionnum = $cm->sectionnum;
$tmpactivity->timestamp = $assessment->timemodified;
$tmpactivity->subtype = 'assessment';
$tmpactivity->content = $assessment;
if ($grader) {
$tmpactivity->grade = $grades->items[1]->grades[$assessment->reviewerid]->str_long_grade;
}
if ($assessment->reviewernamevisible and !empty($users[$assessment->reviewerid])) {
$tmpactivity->user = $users[$assessment->reviewerid];
}
$activities[$index++] = $tmpactivity;
}
}
/**
* Print single activity item prepared by {@see workshop_get_recent_mod_activity()}
*/
function workshop_print_recent_mod_activity($activity, $courseid, $detail, $modnames, $viewfullnames) {
global $CFG, $OUTPUT;
if (!empty($activity->user)) {
echo html_writer::tag('div', $OUTPUT->user_picture($activity->user, array('courseid'=>$courseid)),
array('style' => 'float: left; padding: 7px;'));
}
if ($activity->subtype == 'submission') {
echo html_writer::start_tag('div', array('class'=>'submission', 'style'=>'padding: 7px; float:left;'));
if ($detail) {
echo html_writer::start_tag('h4', array('class'=>'workshop'));
$url = new moodle_url('/mod/workshop/view.php', array('id'=>$activity->cmid));
$name = s($activity->name);
echo $OUTPUT->image_icon('icon', $name, $activity->type);
echo ' ' . $modnames[$activity->type];
echo html_writer::link($url, $name, array('class'=>'name', 'style'=>'margin-left: 5px'));
echo html_writer::end_tag('h4');
}
echo html_writer::start_tag('div', array('class'=>'title'));
$url = new moodle_url('/mod/workshop/submission.php', array('cmid'=>$activity->cmid, 'id'=>$activity->content->id));
$name = s($activity->content->title);
echo html_writer::tag('strong', html_writer::link($url, $name));
echo html_writer::end_tag('div');
if (!empty($activity->user)) {
echo html_writer::start_tag('div', array('class'=>'user'));
$url = new moodle_url('/user/view.php', array('id'=>$activity->user->id, 'course'=>$courseid));
$name = fullname($activity->user);
$link = html_writer::link($url, $name);
echo get_string('submissionby', 'workshop', $link);
echo ' - '.userdate($activity->timestamp);
echo html_writer::end_tag('div');
} else {
echo html_writer::start_tag('div', array('class'=>'anonymous'));
echo get_string('submission', 'workshop');
echo ' - '.userdate($activity->timestamp);
echo html_writer::end_tag('div');
}
echo html_writer::end_tag('div');
}
if ($activity->subtype == 'assessment') {
echo html_writer::start_tag('div', array('class'=>'assessment', 'style'=>'padding: 7px; float:left;'));
if ($detail) {
echo html_writer::start_tag('h4', array('class'=>'workshop'));
$url = new moodle_url('/mod/workshop/view.php', array('id'=>$activity->cmid));
$name = s($activity->name);
echo $OUTPUT->image_icon('icon', $name, $activity->type);
echo ' ' . $modnames[$activity->type];
echo html_writer::link($url, $name, array('class'=>'name', 'style'=>'margin-left: 5px'));
echo html_writer::end_tag('h4');
}
echo html_writer::start_tag('div', array('class'=>'title'));
$url = new moodle_url('/mod/workshop/assessment.php', array('asid'=>$activity->content->id));
$name = s($activity->content->submissiontitle);
echo html_writer::tag('em', html_writer::link($url, $name));
echo html_writer::end_tag('div');
if (!empty($activity->user)) {
echo html_writer::start_tag('div', array('class'=>'user'));
$url = new moodle_url('/user/view.php', array('id'=>$activity->user->id, 'course'=>$courseid));
$name = fullname($activity->user);
$link = html_writer::link($url, $name);
echo get_string('assessmentbyfullname', 'workshop', $link);
echo ' - '.userdate($activity->timestamp);
echo html_writer::end_tag('div');
} else {
echo html_writer::start_tag('div', array('class'=>'anonymous'));
echo get_string('assessment', 'workshop');
echo ' - '.userdate($activity->timestamp);
echo html_writer::end_tag('div');
}
echo html_writer::end_tag('div');
}
echo html_writer::empty_tag('br', array('style'=>'clear:both'));
}
/**
* Is a given scale used by the instance of workshop?
*
* The function asks all installed grading strategy subplugins. The workshop
* core itself does not use scales. Both grade for submission and grade for
* assessments do not use scales.
*
* @param int $workshopid id of workshop instance
* @param int $scaleid id of the scale to check
* @return bool
*/
function workshop_scale_used($workshopid, $scaleid) {
global $CFG; // other files included from here
$strategies = core_component::get_plugin_list('workshopform');
foreach ($strategies as $strategy => $strategypath) {
$strategylib = $strategypath . '/lib.php';
if (is_readable($strategylib)) {
require_once($strategylib);
} else {
throw new coding_exception('the grading forms subplugin must contain library ' . $strategylib);
}
$classname = 'workshop_' . $strategy . '_strategy';
if (method_exists($classname, 'scale_used')) {
if (call_user_func_array(array($classname, 'scale_used'), array($scaleid, $workshopid))) {
// no need to include any other files - scale is used
return true;
}
}
}
return false;
}
/**
* Is a given scale used by any instance of workshop?
*
* The function asks all installed grading strategy subplugins. The workshop
* core itself does not use scales. Both grade for submission and grade for
* assessments do not use scales.
*
* @param int $scaleid id of the scale to check
* @return bool
*/
function workshop_scale_used_anywhere($scaleid) {
global $CFG; // other files included from here
$strategies = core_component::get_plugin_list('workshopform');
foreach ($strategies as $strategy => $strategypath) {
$strategylib = $strategypath . '/lib.php';
if (is_readable($strategylib)) {
require_once($strategylib);
} else {
throw new coding_exception('the grading forms subplugin must contain library ' . $strategylib);
}
$classname = 'workshop_' . $strategy . '_strategy';
if (method_exists($classname, 'scale_used')) {
if (call_user_func(array($classname, 'scale_used'), $scaleid)) {
// no need to include any other files - scale is used
return true;
}
}
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
// Gradebook API //
////////////////////////////////////////////////////////////////////////////////
/**
* Creates or updates grade items for the give workshop instance
*
* Needed by grade_update_mod_grades() in lib/gradelib.php. Also used by
* {@link workshop_update_grades()}.
*
* @param stdClass $workshop instance object with extra cmidnumber property
* @param stdClass $submissiongrades data for the first grade item
* @param stdClass $assessmentgrades data for the second grade item
* @return void
*/
function workshop_grade_item_update(stdclass $workshop, $submissiongrades=null, $assessmentgrades=null) {
global $CFG;
require_once($CFG->libdir.'/gradelib.php');
$a = new stdclass();
$a->workshopname = clean_param($workshop->name, PARAM_NOTAGS);
$item = array();
$item['itemname'] = get_string('gradeitemsubmission', 'workshop', $a);
$item['gradetype'] = GRADE_TYPE_VALUE;
$item['grademax'] = $workshop->grade;
$item['grademin'] = 0;
grade_update('mod/workshop', $workshop->course, 'mod', 'workshop', $workshop->id, 0, $submissiongrades , $item);
$item = array();
$item['itemname'] = get_string('gradeitemassessment', 'workshop', $a);
$item['gradetype'] = GRADE_TYPE_VALUE;
$item['grademax'] = $workshop->gradinggrade;
$item['grademin'] = 0;
grade_update('mod/workshop', $workshop->course, 'mod', 'workshop', $workshop->id, 1, $assessmentgrades, $item);
}
/**
* Update workshop grades in the gradebook
*
* Needed by grade_update_mod_grades() in lib/gradelib.php
*
* @category grade
* @param stdClass $workshop instance object with extra cmidnumber and modname property
* @param int $userid update grade of specific user only, 0 means all participants
* @return void
*/
function workshop_update_grades(stdclass $workshop, $userid=0) {
global $CFG, $DB;
require_once($CFG->libdir.'/gradelib.php');
$whereuser = $userid ? ' AND authorid = :userid' : '';
$params = array('workshopid' => $workshop->id, 'userid' => $userid);
$sql = 'SELECT authorid, grade, gradeover, gradeoverby, feedbackauthor, feedbackauthorformat, timemodified, timegraded
FROM {workshop_submissions}
WHERE workshopid = :workshopid AND example=0' . $whereuser;
$records = $DB->get_records_sql($sql, $params);
$submissiongrades = array();
foreach ($records as $record) {
$grade = new stdclass();
$grade->userid = $record->authorid;
if (!is_null($record->gradeover)) {
$grade->rawgrade = grade_floatval($workshop->grade * $record->gradeover / 100);
$grade->usermodified = $record->gradeoverby;
} else {
$grade->rawgrade = grade_floatval($workshop->grade * $record->grade / 100);
}
$grade->feedback = $record->feedbackauthor;
$grade->feedbackformat = $record->feedbackauthorformat;
$grade->datesubmitted = $record->timemodified;
$grade->dategraded = $record->timegraded;
$submissiongrades[$record->authorid] = $grade;
}
$whereuser = $userid ? ' AND userid = :userid' : '';
$params = array('workshopid' => $workshop->id, 'userid' => $userid);
$sql = 'SELECT userid, gradinggrade, timegraded
FROM {workshop_aggregations}
WHERE workshopid = :workshopid' . $whereuser;
$records = $DB->get_records_sql($sql, $params);
$assessmentgrades = array();
foreach ($records as $record) {
$grade = new stdclass();
$grade->userid = $record->userid;
$grade->rawgrade = grade_floatval($workshop->gradinggrade * $record->gradinggrade / 100);
$grade->dategraded = $record->timegraded;
$assessmentgrades[$record->userid] = $grade;
}
workshop_grade_item_update($workshop, $submissiongrades, $assessmentgrades);
}
/**
* Update the grade items categories if they are changed via mod_form.php
*
* We must do it manually here in the workshop module because modedit supports only
* single grade item while we use two.
*
* @param stdClass $workshop An object from the form in mod_form.php
*/
function workshop_grade_item_category_update($workshop) {
$gradeitems = grade_item::fetch_all(array(
'itemtype' => 'mod',
'itemmodule' => 'workshop',
'iteminstance' => $workshop->id,
'courseid' => $workshop->course));
if (!empty($gradeitems)) {
foreach ($gradeitems as $gradeitem) {
if ($gradeitem->itemnumber == 0) {
if (isset($workshop->submissiongradepass) &&
$gradeitem->gradepass != $workshop->submissiongradepass) {
$gradeitem->gradepass = $workshop->submissiongradepass;
$gradeitem->update();
}
if ($gradeitem->categoryid != $workshop->gradecategory) {
$gradeitem->set_parent($workshop->gradecategory);
}
} else if ($gradeitem->itemnumber == 1) {
if (isset($workshop->gradinggradepass) &&
$gradeitem->gradepass != $workshop->gradinggradepass) {
$gradeitem->gradepass = $workshop->gradinggradepass;
$gradeitem->update();
}
if ($gradeitem->categoryid != $workshop->gradinggradecategory) {
$gradeitem->set_parent($workshop->gradinggradecategory);
}
}
}
}
}
////////////////////////////////////////////////////////////////////////////////
// File API //
////////////////////////////////////////////////////////////////////////////////
/**
* Returns the lists of all browsable file areas within the given module context
*
* The file area workshop_intro for the activity introduction field is added automatically
* by {@link file_browser::get_file_info_context_module()}
*
* @package mod_workshop
* @category files
*
* @param stdClass $course
* @param stdClass $cm
* @param stdClass $context
* @return array of [(string)filearea] => (string)description
*/
function workshop_get_file_areas($course, $cm, $context) {
$areas = array();
$areas['instructauthors'] = get_string('areainstructauthors', 'workshop');
$areas['instructreviewers'] = get_string('areainstructreviewers', 'workshop');
$areas['submission_content'] = get_string('areasubmissioncontent', 'workshop');
$areas['submission_attachment'] = get_string('areasubmissionattachment', 'workshop');
$areas['conclusion'] = get_string('areaconclusion', 'workshop');
$areas['overallfeedback_content'] = get_string('areaoverallfeedbackcontent', 'workshop');
$areas['overallfeedback_attachment'] = get_string('areaoverallfeedbackattachment', 'workshop');
return $areas;
}
/**
* Serves the files from the workshop file areas
*
* Apart from module intro (handled by pluginfile.php automatically), workshop files may be
* media inserted into submission content (like images) and submission attachments. For these two,
* the fileareas submission_content and submission_attachment are used.
* Besides that, areas instructauthors, instructreviewers and conclusion contain the media
* embedded using the mod_form.php.
*
* @package mod_workshop
* @category files
*
* @param stdClass $course the course object
* @param stdClass $cm the course module object
* @param stdClass $context the workshop's context
* @param string $filearea the name of the file area
* @param array $args extra arguments (itemid, path)
* @param bool $forcedownload whether or not force download
* @param array $options additional options affecting the file serving
* @return bool false if the file not found, just send the file otherwise and do not return anything
*/
function workshop_pluginfile($course, $cm, $context, $filearea, array $args, $forcedownload, array $options=array()) {
global $DB, $CFG, $USER;
if ($context->contextlevel != CONTEXT_MODULE) {
return false;
}
require_login($course, true, $cm);
if ($filearea === 'instructauthors' or $filearea === 'instructreviewers' or $filearea === 'conclusion') {
// The $args are supposed to contain just the path, not the item id.
$relativepath = implode('/', $args);
$fullpath = "/$context->id/mod_workshop/$filearea/0/$relativepath";
$fs = get_file_storage();
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {
send_file_not_found();
}
send_stored_file($file, null, 0, $forcedownload, $options);
} else if ($filearea === 'submission_content' or $filearea === 'submission_attachment') {
$itemid = (int)array_shift($args);
if (!$workshop = $DB->get_record('workshop', array('id' => $cm->instance))) {
return false;
}
if (!$submission = $DB->get_record('workshop_submissions', array('id' => $itemid, 'workshopid' => $workshop->id))) {
return false;
}
// make sure the user is allowed to see the file
if (empty($submission->example)) {
if ($USER->id != $submission->authorid) {
if ($submission->published == 1 and $workshop->phase == 50
and has_capability('mod/workshop:viewpublishedsubmissions', $context)) {
// Published submission, we can go (workshop does not take the group mode
// into account in this case yet).
} else if (!$DB->record_exists('workshop_assessments', array('submissionid' => $submission->id, 'reviewerid' => $USER->id))) {
if (!has_capability('mod/workshop:viewallsubmissions', $context)) {
send_file_not_found();
} else {
$gmode = groups_get_activity_groupmode($cm, $course);
if ($gmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
// check there is at least one common group with both the $USER
// and the submission author
$sql = "SELECT 'x'
FROM {workshop_submissions} s
JOIN {user} a ON (a.id = s.authorid)
JOIN {groups_members} agm ON (a.id = agm.userid)
JOIN {user} u ON (u.id = ?)
JOIN {groups_members} ugm ON (u.id = ugm.userid)
WHERE s.example = 0 AND s.workshopid = ? AND s.id = ? AND agm.groupid = ugm.groupid";
$params = array($USER->id, $workshop->id, $submission->id);
if (!$DB->record_exists_sql($sql, $params)) {
send_file_not_found();
}
}
}
}
}
}
$fs = get_file_storage();
$relativepath = implode('/', $args);
$fullpath = "/$context->id/mod_workshop/$filearea/$itemid/$relativepath";
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {
return false;
}
// finally send the file
// these files are uploaded by students - forcing download for security reasons
send_stored_file($file, 0, 0, true, $options);
} else if ($filearea === 'overallfeedback_content' or $filearea === 'overallfeedback_attachment') {
$itemid = (int)array_shift($args);
if (!$workshop = $DB->get_record('workshop', array('id' => $cm->instance))) {
return false;
}
if (!$assessment = $DB->get_record('workshop_assessments', array('id' => $itemid))) {
return false;
}
if (!$submission = $DB->get_record('workshop_submissions', array('id' => $assessment->submissionid, 'workshopid' => $workshop->id))) {
return false;
}
if ($USER->id == $assessment->reviewerid) {
// Reviewers can always see their own files.
} else if ($USER->id == $submission->authorid and $workshop->phase == 50) {
// Authors can see the feedback once the workshop is closed.
} else if (!empty($submission->example) and $assessment->weight == 1) {
// Reference assessments of example submissions can be displayed.
} else if (!has_capability('mod/workshop:viewallassessments', $context)) {
send_file_not_found();
} else {
$gmode = groups_get_activity_groupmode($cm, $course);
if ($gmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
// Check there is at least one common group with both the $USER
// and the submission author.
$sql = "SELECT 'x'
FROM {workshop_submissions} s
JOIN {user} a ON (a.id = s.authorid)
JOIN {groups_members} agm ON (a.id = agm.userid)
JOIN {user} u ON (u.id = ?)
JOIN {groups_members} ugm ON (u.id = ugm.userid)
WHERE s.example = 0 AND s.workshopid = ? AND s.id = ? AND agm.groupid = ugm.groupid";
$params = array($USER->id, $workshop->id, $submission->id);
if (!$DB->record_exists_sql($sql, $params)) {
send_file_not_found();
}
}
}
$fs = get_file_storage();
$relativepath = implode('/', $args);
$fullpath = "/$context->id/mod_workshop/$filearea/$itemid/$relativepath";
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {
return false;
}
// finally send the file
// these files are uploaded by students - forcing download for security reasons
send_stored_file($file, 0, 0, true, $options);
}
return false;
}
/**
* File browsing support for workshop file areas
*
* @package mod_workshop
* @category files
*
* @param file_browser $browser
* @param array $areas
* @param stdClass $course
* @param stdClass $cm
* @param stdClass $context
* @param string $filearea
* @param int $itemid
* @param string $filepath
* @param string $filename
* @return file_info instance or null if not found
*/
function workshop_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {
global $CFG, $DB, $USER;
/** @var array internal cache for author names */
static $submissionauthors = array();
$fs = get_file_storage();
if ($filearea === 'submission_content' or $filearea === 'submission_attachment') {
if (!has_capability('mod/workshop:viewallsubmissions', $context)) {
return null;
}
if (is_null($itemid)) {
// no itemid (submissionid) passed, display the list of all submissions
require_once($CFG->dirroot . '/mod/workshop/fileinfolib.php');
return new workshop_file_info_submissions_container($browser, $course, $cm, $context, $areas, $filearea);
}
// make sure the user can see the particular submission in separate groups mode
$gmode = groups_get_activity_groupmode($cm, $course);
if ($gmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
// check there is at least one common group with both the $USER
// and the submission author (this is not expected to be a frequent
// usecase so we can live with pretty ineffective one query per submission here...)
$sql = "SELECT 'x'
FROM {workshop_submissions} s
JOIN {user} a ON (a.id = s.authorid)
JOIN {groups_members} agm ON (a.id = agm.userid)
JOIN {user} u ON (u.id = ?)
JOIN {groups_members} ugm ON (u.id = ugm.userid)
WHERE s.example = 0 AND s.workshopid = ? AND s.id = ? AND agm.groupid = ugm.groupid";
$params = array($USER->id, $cm->instance, $itemid);
if (!$DB->record_exists_sql($sql, $params)) {
return null;
}
}
// we are inside some particular submission container
$filepath = is_null($filepath) ? '/' : $filepath;
$filename = is_null($filename) ? '.' : $filename;
if (!$storedfile = $fs->get_file($context->id, 'mod_workshop', $filearea, $itemid, $filepath, $filename)) {
if ($filepath === '/' and $filename === '.') {
$storedfile = new virtual_root_file($context->id, 'mod_workshop', $filearea, $itemid);
} else {
// not found
return null;
}
}
// Checks to see if the user can manage files or is the owner.
// TODO MDL-33805 - Do not use userid here and move the capability check above.
if (!has_capability('moodle/course:managefiles', $context) && $storedfile->get_userid() != $USER->id) {
return null;
}
// let us display the author's name instead of itemid (submission id)
if (isset($submissionauthors[$itemid])) {
$topvisiblename = $submissionauthors[$itemid];
} else {
$userfields = get_all_user_name_fields(true, 'u');
$sql = "SELECT s.id, $userfields
FROM {workshop_submissions} s
JOIN {user} u ON (s.authorid = u.id)
WHERE s.example = 0 AND s.workshopid = ?";
$params = array($cm->instance);
$rs = $DB->get_recordset_sql($sql, $params);
foreach ($rs as $submissionauthor) {
$title = s(fullname($submissionauthor)); // this is generally not unique...
$submissionauthors[$submissionauthor->id] = $title;
}
$rs->close();
if (!isset($submissionauthors[$itemid])) {
// should not happen
return null;
} else {
$topvisiblename = $submissionauthors[$itemid];
}
}
$urlbase = $CFG->wwwroot . '/pluginfile.php';
// do not allow manual modification of any files!
return new file_info_stored($browser, $context, $storedfile, $urlbase, $topvisiblename, true, true, false, false);
}
if ($filearea === 'overallfeedback_content' or $filearea === 'overallfeedback_attachment') {
if (!has_capability('mod/workshop:viewallassessments', $context)) {
return null;
}
if (is_null($itemid)) {
// No itemid (assessmentid) passed, display the list of all assessments.
require_once($CFG->dirroot . '/mod/workshop/fileinfolib.php');
return new workshop_file_info_overallfeedback_container($browser, $course, $cm, $context, $areas, $filearea);
}
// Make sure the user can see the particular assessment in separate groups mode.
$gmode = groups_get_activity_groupmode($cm, $course);
if ($gmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
// Check there is at least one common group with both the $USER
// and the submission author.
$sql = "SELECT 'x'
FROM {workshop_submissions} s
JOIN {user} a ON (a.id = s.authorid)
JOIN {groups_members} agm ON (a.id = agm.userid)
JOIN {user} u ON (u.id = ?)
JOIN {groups_members} ugm ON (u.id = ugm.userid)
WHERE s.example = 0 AND s.workshopid = ? AND s.id = ? AND agm.groupid = ugm.groupid";
$params = array($USER->id, $cm->instance, $itemid);
if (!$DB->record_exists_sql($sql, $params)) {
return null;
}
}
// We are inside a particular assessment container.
$filepath = is_null($filepath) ? '/' : $filepath;
$filename = is_null($filename) ? '.' : $filename;
if (!$storedfile = $fs->get_file($context->id, 'mod_workshop', $filearea, $itemid, $filepath, $filename)) {
if ($filepath === '/' and $filename === '.') {
$storedfile = new virtual_root_file($context->id, 'mod_workshop', $filearea, $itemid);
} else {
// Not found
return null;
}
}
// Check to see if the user can manage files or is the owner.
if (!has_capability('moodle/course:managefiles', $context) and $storedfile->get_userid() != $USER->id) {
return null;
}
$urlbase = $CFG->wwwroot . '/pluginfile.php';
// Do not allow manual modification of any files.
return new file_info_stored($browser, $context, $storedfile, $urlbase, $itemid, true, true, false, false);
}
if ($filearea == 'instructauthors' or $filearea == 'instructreviewers' or $filearea == 'conclusion') {
// always only itemid 0
$filepath = is_null($filepath) ? '/' : $filepath;
$filename = is_null($filename) ? '.' : $filename;
$urlbase = $CFG->wwwroot.'/pluginfile.php';
if (!$storedfile = $fs->get_file($context->id, 'mod_workshop', $filearea, 0, $filepath, $filename)) {
if ($filepath === '/' and $filename === '.') {
$storedfile = new virtual_root_file($context->id, 'mod_workshop', $filearea, 0);
} else {
// not found
return null;
}
}
return new file_info_stored($browser, $context, $storedfile, $urlbase, $areas[$filearea], false, true, true, false);
}
}
////////////////////////////////////////////////////////////////////////////////
// Navigation API //
////////////////////////////////////////////////////////////////////////////////
/**
* Extends the global navigation tree by adding workshop nodes if there is a relevant content
*
* This can be called by an AJAX request so do not rely on $PAGE as it might not be set up properly.
*
* @param navigation_node $navref An object representing the navigation tree node of the workshop module instance
* @param stdClass $course
* @param stdClass $module
* @param cm_info $cm
*/
function workshop_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {
global $CFG;
if (has_capability('mod/workshop:submit', context_module::instance($cm->id))) {
$url = new moodle_url('/mod/workshop/submission.php', array('cmid' => $cm->id));
$mysubmission = $navref->add(get_string('mysubmission', 'workshop'), $url);
$mysubmission->mainnavonly = true;
}
}
/**
* Extends the settings navigation with the Workshop settings
* This function is called when the context for the page is a workshop module. This is not called by AJAX
* so it is safe to rely on the $PAGE.
*
* @param settings_navigation $settingsnav {@link settings_navigation}
* @param navigation_node $workshopnode {@link navigation_node}
*/
function workshop_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $workshopnode=null) {
global $PAGE;
//$workshopobject = $DB->get_record("workshop", array("id" => $PAGE->cm->instance));
if (has_capability('mod/workshop:editdimensions', $PAGE->cm->context)) {
$url = new moodle_url('/mod/workshop/editform.php', array('cmid' => $PAGE->cm->id));
$workshopnode->add(get_string('editassessmentform', 'workshop'), $url, settings_navigation::TYPE_SETTING);
}
if (has_capability('mod/workshop:allocate', $PAGE->cm->context)) {
$url = new moodle_url('/mod/workshop/allocation.php', array('cmid' => $PAGE->cm->id));
$workshopnode->add(get_string('allocate', 'workshop'), $url, settings_navigation::TYPE_SETTING);
}
}
/**
* Return a list of page types
* @param string $pagetype current page type
* @param stdClass $parentcontext Block's parent context
* @param stdClass $currentcontext Current context of block
*/
function workshop_page_type_list($pagetype, $parentcontext, $currentcontext) {
$module_pagetype = array('mod-workshop-*'=>get_string('page-mod-workshop-x', 'workshop'));
return $module_pagetype;
}
////////////////////////////////////////////////////////////////////////////////
// Calendar API //
////////////////////////////////////////////////////////////////////////////////
/**
* Updates the calendar events associated to the given workshop
*
* @param stdClass $workshop the workshop instance record
* @param int $cmid course module id
*/
function workshop_calendar_update(stdClass $workshop, $cmid) {
global $DB;
// get the currently registered events so that we can re-use their ids
$currentevents = $DB->get_records('event', array('modulename' => 'workshop', 'instance' => $workshop->id));
// the common properties for all events
$base = new stdClass();
$base->description = format_module_intro('workshop', $workshop, $cmid, false);
$base->courseid = $workshop->course;
$base->groupid = 0;
$base->userid = 0;
$base->modulename = 'workshop';
$base->instance = $workshop->id;
$base->visible = instance_is_visible('workshop', $workshop);
$base->timeduration = 0;
if ($workshop->submissionstart) {
$event = clone($base);
$event->name = get_string('submissionstartevent', 'mod_workshop', $workshop->name);
$event->eventtype = WORKSHOP_EVENT_TYPE_SUBMISSION_OPEN;
$event->type = empty($workshop->submissionend) ? CALENDAR_EVENT_TYPE_ACTION : CALENDAR_EVENT_TYPE_STANDARD;
$event->timestart = $workshop->submissionstart;
$event->timesort = $workshop->submissionstart;
if ($reusedevent = array_shift($currentevents)) {
$event->id = $reusedevent->id;
} else {
// should not be set but just in case
unset($event->id);
}
// update() will reuse a db record if the id field is set
$eventobj = new calendar_event($event);
$eventobj->update($event, false);
}
if ($workshop->submissionend) {
$event = clone($base);
$event->name = get_string('submissionendevent', 'mod_workshop', $workshop->name);
$event->eventtype = WORKSHOP_EVENT_TYPE_SUBMISSION_CLOSE;
$event->type = CALENDAR_EVENT_TYPE_ACTION;
$event->timestart = $workshop->submissionend;
$event->timesort = $workshop->submissionend;
if ($reusedevent = array_shift($currentevents)) {
$event->id = $reusedevent->id;
} else {
// should not be set but just in case
unset($event->id);
}
// update() will reuse a db record if the id field is set
$eventobj = new calendar_event($event);
$eventobj->update($event, false);
}
if ($workshop->assessmentstart) {
$event = clone($base);
$event->name = get_string('assessmentstartevent', 'mod_workshop', $workshop->name);
$event->eventtype = WORKSHOP_EVENT_TYPE_ASSESSMENT_OPEN;
$event->type = empty($workshop->assessmentend) ? CALENDAR_EVENT_TYPE_ACTION : CALENDAR_EVENT_TYPE_STANDARD;
$event->timestart = $workshop->assessmentstart;
$event->timesort = $workshop->assessmentstart;
if ($reusedevent = array_shift($currentevents)) {
$event->id = $reusedevent->id;
} else {
// should not be set but just in case
unset($event->id);
}
// update() will reuse a db record if the id field is set
$eventobj = new calendar_event($event);
$eventobj->update($event, false);
}
if ($workshop->assessmentend) {
$event = clone($base);
$event->name = get_string('assessmentendevent', 'mod_workshop', $workshop->name);
$event->eventtype = WORKSHOP_EVENT_TYPE_ASSESSMENT_CLOSE;
$event->type = CALENDAR_EVENT_TYPE_ACTION;
$event->timestart = $workshop->assessmentend;
$event->timesort = $workshop->assessmentend;
if ($reusedevent = array_shift($currentevents)) {
$event->id = $reusedevent->id;
} else {
// should not be set but just in case
unset($event->id);
}
// update() will reuse a db record if the id field is set
$eventobj = new calendar_event($event);
$eventobj->update($event, false);
}
// delete any leftover events
foreach ($currentevents as $oldevent) {
$oldevent = calendar_event::load($oldevent);
$oldevent->delete();
}
}
/**
* This function receives a calendar event and returns the action associated with it, or null if there is none.
*
* This is used by block_myoverview in order to display the event appropriately. If null is returned then the event
* is not displayed on the block.
*
* @param calendar_event $event
* @param \core_calendar\action_factory $factory
* @return \core_calendar\local\event\entities\action_interface|null
*/
function mod_workshop_core_calendar_provide_event_action(calendar_event $event,
\core_calendar\action_factory $factory) {
$cm = get_fast_modinfo($event->courseid)->instances['workshop'][$event->instance];
return $factory->create_instance(
get_string('viewworkshopsummary', 'workshop'),
new \moodle_url('/mod/workshop/view.php', array('id' => $cm->id)),
1,
true
);
}
/**
* This function calculates the minimum and maximum cutoff values for the timestart of
* the given event.
*
* It will return an array with two values, the first being the minimum cutoff value and
* the second being the maximum cutoff value. Either or both values can be null, which
* indicates there is no minimum or maximum, respectively.
*
* If a cutoff is required then the function must return an array containing the cutoff
* timestamp and error string to display to the user if the cutoff value is violated.
*
* A minimum and maximum cutoff return value will look like:
* [
* [1505704373, 'The date must be after this date'],
* [1506741172, 'The date must be before this date']
* ]
*
* @param calendar_event $event The calendar event to get the time range for
* @param stdClass $workshop The module instance to get the range from
* @return array Returns an array with min and max date.
*/
function mod_workshop_core_calendar_get_valid_event_timestart_range(\calendar_event $event, \stdClass $workshop) : array {
$mindate = null;
$maxdate = null;
$phasesubmissionend = max($workshop->submissionstart, $workshop->submissionend);
$phaseassessmentstart = min($workshop->assessmentstart, $workshop->assessmentend);
if ($phaseassessmentstart == 0) {
$phaseassessmentstart = max($workshop->assessmentstart, $workshop->assessmentend);
}
switch ($event->eventtype) {
case WORKSHOP_EVENT_TYPE_SUBMISSION_OPEN:
if (!empty($workshop->submissionend)) {
$maxdate = [
$workshop->submissionend - 1, // The submissionstart and submissionend cannot be exactly the same.
get_string('submissionendbeforestart', 'mod_workshop')
];
} else if ($phaseassessmentstart) {
$maxdate = [
$phaseassessmentstart,
get_string('phasesoverlap', 'mod_workshop')
];
}
break;
case WORKSHOP_EVENT_TYPE_SUBMISSION_CLOSE:
if (!empty($workshop->submissionstart)) {
$mindate = [
$workshop->submissionstart + 1, // The submissionstart and submissionend cannot be exactly the same.
get_string('submissionendbeforestart', 'mod_workshop')
];
}
if ($phaseassessmentstart) {
$maxdate = [
$phaseassessmentstart,
get_string('phasesoverlap', 'mod_workshop')
];
}
break;
case WORKSHOP_EVENT_TYPE_ASSESSMENT_OPEN:
if ($phasesubmissionend) {
$mindate = [
$phasesubmissionend,
get_string('phasesoverlap', 'mod_workshop')
];
}
if (!empty($workshop->assessmentend)) {
$maxdate = [
$workshop->assessmentend - 1, // The assessmentstart and assessmentend cannot be exactly the same.
get_string('assessmentendbeforestart', 'mod_workshop')
];
}
break;
case WORKSHOP_EVENT_TYPE_ASSESSMENT_CLOSE:
if (!empty($workshop->assessmentstart)) {
$mindate = [
$workshop->assessmentstart + 1, // The assessmentstart and assessmentend cannot be exactly the same.
get_string('assessmentendbeforestart', 'mod_workshop')
];
} else if ($phasesubmissionend) {
$mindate = [
$phasesubmissionend,
get_string('phasesoverlap', 'mod_workshop')
];
}
break;
}
return [$mindate, $maxdate];
}
/**
* This function will update the workshop module according to the
* event that has been modified.
*
* @param \calendar_event $event
* @param stdClass $workshop The module instance to get the range from
*/
function mod_workshop_core_calendar_event_timestart_updated(\calendar_event $event, \stdClass $workshop) : void {
global $DB;
$courseid = $event->courseid;
$modulename = $event->modulename;
$instanceid = $event->instance;
// Something weird going on. The event is for a different module so
// we should ignore it.
if ($modulename != 'workshop') {
return;
}
if ($workshop->id != $instanceid) {
return;
}
if (!in_array(
$event->eventtype,
[
WORKSHOP_EVENT_TYPE_SUBMISSION_OPEN,
WORKSHOP_EVENT_TYPE_SUBMISSION_CLOSE,
WORKSHOP_EVENT_TYPE_ASSESSMENT_OPEN,
WORKSHOP_EVENT_TYPE_ASSESSMENT_CLOSE
]
)) {
return;
}
$coursemodule = get_fast_modinfo($courseid)->instances[$modulename][$instanceid];
$context = context_module::instance($coursemodule->id);
// The user does not have the capability to modify this activity.
if (!has_capability('moodle/course:manageactivities', $context)) {
return;
}
$modified = false;
switch ($event->eventtype) {
case WORKSHOP_EVENT_TYPE_SUBMISSION_OPEN:
if ($event->timestart != $workshop->submissionstart) {
$workshop->submissionstart = $event->timestart;
$modified = true;
}
break;
case WORKSHOP_EVENT_TYPE_SUBMISSION_CLOSE:
if ($event->timestart != $workshop->submissionend) {
$workshop->submissionend = $event->timestart;
$modified = true;
}
break;
case WORKSHOP_EVENT_TYPE_ASSESSMENT_OPEN:
if ($event->timestart != $workshop->assessmentstart) {
$workshop->assessmentstart = $event->timestart;
$modified = true;
}
break;
case WORKSHOP_EVENT_TYPE_ASSESSMENT_CLOSE:
if ($event->timestart != $workshop->assessmentend) {
$workshop->assessmentend = $event->timestart;
$modified = true;
}
break;
}
if ($modified) {
$workshop->timemodified = time();
// Persist the assign instance changes.
$DB->update_record('workshop', $workshop);
$event = \core\event\course_module_updated::create_from_cm($coursemodule, $context);
$event->trigger();
}
}
////////////////////////////////////////////////////////////////////////////////
// Course reset API //
////////////////////////////////////////////////////////////////////////////////
/**
* Extends the course reset form with workshop specific settings.
*
* @param MoodleQuickForm $mform
*/
function workshop_reset_course_form_definition($mform) {
$mform->addElement('header', 'workshopheader', get_string('modulenameplural', 'mod_workshop'));
$mform->addElement('advcheckbox', 'reset_workshop_submissions', get_string('resetsubmissions', 'mod_workshop'));
$mform->addHelpButton('reset_workshop_submissions', 'resetsubmissions', 'mod_workshop');
$mform->addElement('advcheckbox', 'reset_workshop_assessments', get_string('resetassessments', 'mod_workshop'));
$mform->addHelpButton('reset_workshop_assessments', 'resetassessments', 'mod_workshop');
$mform->disabledIf('reset_workshop_assessments', 'reset_workshop_submissions', 'checked');
$mform->addElement('advcheckbox', 'reset_workshop_phase', get_string('resetphase', 'mod_workshop'));
$mform->addHelpButton('reset_workshop_phase', 'resetphase', 'mod_workshop');
}
/**
* Provides default values for the workshop settings in the course reset form.
*
* @param stdClass $course The course to be reset.
*/
function workshop_reset_course_form_defaults(stdClass $course) {
$defaults = array(
'reset_workshop_submissions' => 1,
'reset_workshop_assessments' => 1,
'reset_workshop_phase' => 1,
);
return $defaults;
}
/**
* Performs the reset of all workshop instances in the course.
*
* @param stdClass $data The actual course reset settings.
* @return array List of results, each being array[(string)component, (string)item, (string)error]
*/
function workshop_reset_userdata(stdClass $data) {
global $CFG, $DB;
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
shift_course_mod_dates('workshop', array('submissionstart', 'submissionend', 'assessmentstart', 'assessmentend'),
$data->timeshift, $data->courseid);
$status = array();
$status[] = array('component' => get_string('modulenameplural', 'workshop'), 'item' => get_string('datechanged'),
'error' => false);
if (empty($data->reset_workshop_submissions)
and empty($data->reset_workshop_assessments)
and empty($data->reset_workshop_phase) ) {
// Nothing to do here.
return $status;
}
$workshoprecords = $DB->get_records('workshop', array('course' => $data->courseid));
if (empty($workshoprecords)) {
// What a boring course - no workshops here!
return $status;
}
require_once($CFG->dirroot . '/mod/workshop/locallib.php');
$course = $DB->get_record('course', array('id' => $data->courseid), '*', MUST_EXIST);
foreach ($workshoprecords as $workshoprecord) {
$cm = get_coursemodule_from_instance('workshop', $workshoprecord->id, $course->id, false, MUST_EXIST);
$workshop = new workshop($workshoprecord, $cm, $course);
$status = array_merge($status, $workshop->reset_userdata($data));
}
return $status;
}
/**
* Get icon mapping for font-awesome.
*/
function mod_workshop_get_fontawesome_icon_map() {
return [
'mod_workshop:userplan/task-info' => 'fa-info text-info',
'mod_workshop:userplan/task-todo' => 'fa-square-o',
'mod_workshop:userplan/task-done' => 'fa-check text-success',
'mod_workshop:userplan/task-fail' => 'fa-remove text-danger',
];
}
/**
* Check if the module has any update that affects the current user since a given time.
*
* @param cm_info $cm course module data
* @param int $from the time to check updates from
* @param array $filter if we need to check only specific updates
* @return stdClass an object with the different type of areas indicating if they were updated or not
* @since Moodle 3.4
*/
function workshop_check_updates_since(cm_info $cm, $from, $filter = array()) {
global $DB, $USER;
$updates = course_check_module_updates_since($cm, $from, array('instructauthors', 'instructreviewers', 'conclusion'), $filter);
// Check if there are new submissions, assessments or assessments grades in the workshop.
$updates->submissions = (object) array('updated' => false);
$updates->assessments = (object) array('updated' => false);
$updates->assessmentgrades = (object) array('updated' => false);
$select = 'workshopid = ? AND authorid = ? AND (timecreated > ? OR timegraded > ? OR timemodified > ?)';
$params = array($cm->instance, $USER->id, $from, $from, $from);
$submissions = $DB->get_records_select('workshop_submissions', $select, $params, '', 'id');
if (!empty($submissions)) {
$updates->submissions->updated = true;
$updates->submissions->itemids = array_keys($submissions);
}
// Get assessments updates (both submissions reviewed by me or reviews by others).
$select = "SELECT a.id
FROM {workshop_assessments} a
JOIN {workshop_submissions} s ON a.submissionid = s.id
WHERE s.workshopid = ? AND (a.timecreated > ? OR a.timemodified > ?) AND (s.authorid = ? OR a.reviewerid = ?)";
$params = array($cm->instance, $from, $from, $USER->id, $USER->id);
$assessments = $DB->get_records_sql($select, $params);
if (!empty($assessments)) {
$updates->assessments->updated = true;
$updates->assessments->itemids = array_keys($assessments);
}
// Finally assessment aggregated grades.
$select = 'workshopid = ? AND userid = ? AND timegraded > ?';
$params = array($cm->instance, $USER->id, $from);
$assessmentgrades = $DB->get_records_select('workshop_aggregations', $select, $params, '', 'id');
if (!empty($assessmentgrades)) {
$updates->assessmentgrades->updated = true;
$updates->assessmentgrades->itemids = array_keys($assessmentgrades);
}
// Now, teachers should see other students updates.
$canviewallsubmissions = has_capability('mod/workshop:viewallsubmissions', $cm->context);
$canviewallassessments = has_capability('mod/workshop:viewallassessments', $cm->context);
if ($canviewallsubmissions || $canviewallassessments) {
$insql = '';
$inparams = array();
// To filter by users in my groups when separated groups are forced.
if (groups_get_activity_groupmode($cm) == SEPARATEGROUPS) {
$groupusers = array_keys(groups_get_activity_shared_group_members($cm));
if (empty($groupusers)) {
return $updates;
}
list($insql, $inparams) = $DB->get_in_or_equal($groupusers);
}
if ($canviewallsubmissions) {
$updates->usersubmissions = (object) array('updated' => false);
$select = 'workshopid = ? AND (timecreated > ? OR timegraded > ? OR timemodified > ?)';
$params = array($cm->instance, $from, $from, $from);
if (!empty($insql)) {
$select .= " AND authorid $insql";
$params = array_merge($params, $inparams);
}
$usersubmissions = $DB->get_records_select('workshop_submissions', $select, $params, '', 'id');
if (!empty($usersubmissions)) {
$updates->usersubmissions->updated = true;
$updates->usersubmissions->itemids = array_keys($usersubmissions);
}
}
if ($canviewallassessments) {
$updates->userassessments = (object) array('updated' => false);
$select = "SELECT a.id
FROM {workshop_assessments} a
JOIN {workshop_submissions} s ON a.submissionid = s.id
WHERE s.workshopid = ? AND (a.timecreated > ? OR a.timemodified > ?)";
$params = array($cm->instance, $from, $from);
if (!empty($insql)) {
$select .= " AND s.reviewerid $insql";
$params = array_merge($params, $inparams);
}
$userassessments = $DB->get_records_sql($select, $params);
if (!empty($userassessments)) {
$updates->userassessments->updated = true;
$updates->userassessments->itemids = array_keys($userassessments);
}
$updates->userassessmentgrades = (object) array('updated' => false);
$select = 'workshopid = ? AND timegraded > ?';
$params = array($cm->instance, $USER->id);
if (!empty($insql)) {
$select .= " AND userid $insql";
$params = array_merge($params, $inparams);
}
$userassessmentgrades = $DB->get_records_select('workshop_aggregations', $select, $params, '', 'id');
if (!empty($userassessmentgrades)) {
$updates->userassessmentgrades->updated = true;
$updates->userassessmentgrades->itemids = array_keys($userassessmentgrades);
}
}
}
return $updates;
}
|
ak4t0sh/moodle
|
mod/workshop/lib.php
|
PHP
|
gpl-3.0
| 95,466 |
Clazz.declarePackage ("J.adapter.readers.cif");
Clazz.load (["J.adapter.readers.cif.CifReader"], "J.adapter.readers.cif.MMCifReader", ["java.util.Hashtable", "JU.BS", "$.Lst", "$.M4", "$.P3", "$.PT", "$.Rdr", "$.SB", "J.adapter.smarter.Atom", "$.Structure", "J.c.STR", "JU.Logger"], function () {
c$ = Clazz.decorateAsClass (function () {
this.isBiomolecule = false;
this.byChain = false;
this.bySymop = false;
this.chainAtomMap = null;
this.chainAtomCounts = null;
this.vBiomolecules = null;
this.thisBiomolecule = null;
this.htBiomts = null;
this.htSites = null;
this.assemblyIdAtoms = null;
this.thisChain = -1;
this.chainSum = null;
this.chainAtomCount = null;
this.isLigandBondBug = false;
this.assem = null;
this.hetatmData = null;
this.htHetero = null;
Clazz.instantialize (this, arguments);
}, J.adapter.readers.cif, "MMCifReader", J.adapter.readers.cif.CifReader);
Clazz.overrideMethod (c$, "initSubclass",
function () {
this.setIsPDB ();
this.isMMCIF = true;
this.byChain = this.checkFilterKey ("BYCHAIN");
this.bySymop = this.checkFilterKey ("BYSYMOP");
this.isCourseGrained = this.byChain || this.bySymop;
if (this.isCourseGrained) {
this.chainAtomMap = new java.util.Hashtable ();
this.chainAtomCounts = new java.util.Hashtable ();
}if (this.checkFilterKey ("BIOMOLECULE")) this.filter = JU.PT.rep (this.filter, "BIOMOLECULE", "ASSEMBLY");
this.isBiomolecule = this.checkFilterKey ("ASSEMBLY");
this.isLigandBondBug = (this.stateScriptVersionInt >= 140204 && this.stateScriptVersionInt <= 140208 || this.stateScriptVersionInt >= 140304 && this.stateScriptVersionInt <= 140308);
});
Clazz.overrideMethod (c$, "finalizeSubclass",
function () {
if (this.byChain && !this.isBiomolecule) for (var id, $id = this.chainAtomMap.keySet ().iterator (); $id.hasNext () && ((id = $id.next ()) || true);) this.createParticle (id);
if (!this.isCourseGrained && this.asc.ac == this.nAtoms) {
this.asc.removeCurrentAtomSet ();
} else {
if ((this.validation != null || this.addedData != null) && !this.isCourseGrained) {
var vs = (this.getInterface ("J.adapter.readers.cif.MMCifValidationParser")).set (this);
var note = null;
if (this.addedData == null) {
note = vs.finalizeValidations (this.modelMap);
} else if (this.addedDataKey.equals ("_rna3d")) {
note = vs.finalizeRna3d (this.modelMap);
} else {
this.reader = JU.Rdr.getBR (this.addedData);
this.processDSSR (this, this.htGroup1);
}if (note != null) this.appendLoadNote (note);
}if (!this.isCourseGrained) this.applySymmetryAndSetTrajectory ();
}if (this.htSites != null) this.addSites (this.htSites);
if (this.vBiomolecules != null && this.vBiomolecules.size () == 1 && (this.isCourseGrained || this.asc.ac > 0)) {
this.asc.setAtomSetAuxiliaryInfo ("biomolecules", this.vBiomolecules);
var ht = this.vBiomolecules.get (0);
this.appendLoadNote ("Constructing " + ht.get ("name"));
this.setBiomolecules (ht);
if (this.thisBiomolecule != null) {
this.asc.getXSymmetry ().applySymmetryBio (this.thisBiomolecule, this.notionalUnitCell, this.applySymmetryToBonds, this.filter);
this.asc.xtalSymmetry = null;
}}});
Clazz.overrideMethod (c$, "processSubclassEntry",
function () {
if (this.key.startsWith ("_pdbx_entity_nonpoly")) this.processDataNonpoly ();
else if (this.key.startsWith ("_pdbx_struct_assembly_gen")) this.processDataAssemblyGen ();
else if (this.key.equals ("_rna3d") || this.key.equals ("_dssr")) this.processAddedData ();
});
Clazz.defineMethod (c$, "processAddedData",
function () {
this.addedData = this.data;
this.addedDataKey = this.key;
});
Clazz.defineMethod (c$, "processSequence",
function () {
this.parseLoopParameters (J.adapter.readers.cif.MMCifReader.structRefFields);
while (this.parser.getData ()) {
var g1 = null;
var g3 = null;
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
switch (this.fieldProperty (i)) {
case 0:
g3 = this.field;
break;
case 1:
if (this.field.length == 1) g1 = this.field.toLowerCase ();
}
}
if (g1 != null && g3 != null) {
if (this.htGroup1 == null) this.asc.setInfo ("htGroup1", this.htGroup1 = new java.util.Hashtable ());
this.htGroup1.put (g3, g1);
}}
return true;
});
Clazz.defineMethod (c$, "processDataNonpoly",
function () {
if (this.hetatmData == null) this.hetatmData = new Array (3);
for (var i = J.adapter.readers.cif.MMCifReader.nonpolyFields.length; --i >= 0; ) if (this.key.equals (J.adapter.readers.cif.MMCifReader.nonpolyFields[i])) {
this.hetatmData[i] = this.data;
break;
}
if (this.hetatmData[1] == null || this.hetatmData[2] == null) return;
this.addHetero (this.hetatmData[2], this.hetatmData[1]);
this.hetatmData = null;
});
Clazz.defineMethod (c$, "processDataAssemblyGen",
function () {
if (this.assem == null) this.assem = new Array (3);
if (this.key.indexOf ("assembly_id") >= 0) this.assem[0] = this.parser.fullTrim (this.data);
else if (this.key.indexOf ("oper_expression") >= 0) this.assem[1] = this.parser.fullTrim (this.data);
else if (this.key.indexOf ("asym_id_list") >= 0) this.assem[2] = this.parser.fullTrim (this.data);
if (this.assem[0] != null && this.assem[1] != null && this.assem[2] != null) this.addAssembly ();
});
Clazz.defineMethod (c$, "processAssemblyGenBlock",
function () {
this.parseLoopParametersFor ("_pdbx_struct_assembly_gen", J.adapter.readers.cif.MMCifReader.assemblyFields);
while (this.parser.getData ()) {
this.assem = new Array (3);
var count = 0;
var p;
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
switch (p = this.fieldProperty (i)) {
case 0:
case 1:
case 2:
count++;
this.assem[p] = this.field;
break;
}
}
if (count == 3) this.addAssembly ();
}
this.assem = null;
return true;
});
Clazz.defineMethod (c$, "addAssembly",
function () {
var id = this.assem[0];
var iMolecule = this.parseIntStr (id);
var list = this.assem[2];
this.appendLoadNote ("found biomolecule " + id + ": " + list);
if (!this.checkFilterKey ("ASSEMBLY " + id + ";") && !this.checkFilterKey ("ASSEMBLY=" + id + ";")) return;
if (this.vBiomolecules == null) {
this.vBiomolecules = new JU.Lst ();
}var info = new java.util.Hashtable ();
info.put ("name", "biomolecule " + id);
info.put ("molecule", iMolecule == -2147483648 ? id : Integer.$valueOf (iMolecule));
info.put ("assemblies", "$" + list.$replace (',', '$'));
info.put ("operators", this.decodeAssemblyOperators (this.assem[1]));
info.put ("biomts", new JU.Lst ());
this.thisBiomolecule = info;
JU.Logger.info ("assembly " + id + " operators " + this.assem[1] + " ASYM_IDs " + this.assem[2]);
this.vBiomolecules.addLast (info);
this.assem = null;
});
Clazz.defineMethod (c$, "decodeAssemblyOperators",
function (ops) {
var pt = ops.indexOf (")(");
if (pt >= 0) return this.crossBinary (this.decodeAssemblyOperators (ops.substring (0, pt + 1)), this.decodeAssemblyOperators (ops.substring (pt + 1)));
if (ops.startsWith ("(")) {
if (ops.indexOf ("-") >= 0) ops = JU.BS.unescape ("({" + ops.substring (1, ops.length - 1).$replace ('-', ':') + "})").toJSON ();
ops = JU.PT.rep (ops, " ", "");
ops = ops.substring (1, ops.length - 1);
}return ops;
}, "~S");
Clazz.defineMethod (c$, "crossBinary",
function (ops1, ops2) {
var sb = new JU.SB ();
var opsLeft = JU.PT.split (ops1, ",");
var opsRight = JU.PT.split (ops2, ",");
for (var i = 0; i < opsLeft.length; i++) for (var j = 0; j < opsRight.length; j++) sb.append (",").append (opsLeft[i]).append ("|").append (opsRight[j]);
return sb.toString ().substring (1);
}, "~S,~S");
Clazz.defineMethod (c$, "processStructOperListBlock",
function () {
this.parseLoopParametersFor ("_pdbx_struct_oper_list", J.adapter.readers.cif.MMCifReader.operFields);
var m = Clazz.newFloatArray (16, 0);
m[15] = 1;
while (this.parser.getData ()) {
var count = 0;
var id = null;
var xyz = null;
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
var p = this.fieldProperty (i);
switch (p) {
case -1:
break;
case 12:
id = this.field;
break;
case 13:
xyz = this.field;
break;
default:
m[p] = this.parseFloatStr (this.field);
++count;
}
}
if (id != null && (count == 12 || xyz != null && this.symmetry != null)) {
JU.Logger.info ("assembly operator " + id + " " + xyz);
var m4 = new JU.M4 ();
if (count != 12) {
this.symmetry.getMatrixFromString (xyz, m, false, 0);
m[3] *= this.symmetry.getUnitCellInfoType (0) / 12;
m[7] *= this.symmetry.getUnitCellInfoType (1) / 12;
m[11] *= this.symmetry.getUnitCellInfoType (2) / 12;
}m4.setA (m);
if (this.htBiomts == null) this.htBiomts = new java.util.Hashtable ();
this.htBiomts.put (id, m4);
}}
return true;
});
Clazz.defineMethod (c$, "processChemCompLoopBlock",
function () {
this.parseLoopParameters (J.adapter.readers.cif.MMCifReader.chemCompFields);
while (this.parser.getData ()) {
var groupName = null;
var hetName = null;
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
switch (this.fieldProperty (i)) {
case -1:
break;
case 0:
groupName = this.field;
break;
case 1:
hetName = this.field;
break;
}
}
if (groupName != null && hetName != null) this.addHetero (groupName, hetName);
}
return true;
});
Clazz.defineMethod (c$, "processNonpolyLoopBlock",
function () {
this.parseLoopParameters (J.adapter.readers.cif.MMCifReader.nonpolyFields);
while (this.parser.getData ()) {
var groupName = null;
var hetName = null;
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
switch (this.fieldProperty (i)) {
case -1:
case 0:
break;
case 2:
groupName = this.field;
break;
case 1:
hetName = this.field;
break;
}
}
if (groupName == null || hetName == null) return false;
this.addHetero (groupName, hetName);
}
return true;
});
Clazz.defineMethod (c$, "addHetero",
function (groupName, hetName) {
if (!this.vwr.getJBR ().isHetero (groupName)) return;
if (this.htHetero == null) this.htHetero = new java.util.Hashtable ();
this.htHetero.put (groupName, hetName);
if (JU.Logger.debugging) {
JU.Logger.debug ("hetero: " + groupName + " = " + hetName);
}}, "~S,~S");
Clazz.defineMethod (c$, "processStructConfLoopBlock",
function () {
this.parseLoopParametersFor ("_struct_conf", J.adapter.readers.cif.MMCifReader.structConfFields);
for (var i = this.propertyCount; --i >= 0; ) if (this.fieldOf[i] == -1) {
JU.Logger.warn ("?que? missing property: " + J.adapter.readers.cif.MMCifReader.structConfFields[i]);
return false;
}
while (this.parser.getData ()) {
var structure = new J.adapter.smarter.Structure (-1, J.c.STR.HELIX, J.c.STR.HELIX, null, 0, 0);
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
switch (this.fieldProperty (i)) {
case -1:
break;
case 0:
if (this.field.startsWith ("TURN")) structure.structureType = structure.substructureType = J.c.STR.TURN;
else if (!this.field.startsWith ("HELX")) structure.structureType = structure.substructureType = J.c.STR.NONE;
break;
case 1:
structure.startChainStr = this.field;
structure.startChainID = this.vwr.getChainID (this.field, true);
break;
case 2:
structure.startSequenceNumber = this.parseIntStr (this.field);
break;
case 3:
structure.startInsertionCode = this.firstChar;
break;
case 4:
structure.endChainStr = this.field;
structure.endChainID = this.vwr.getChainID (this.field, true);
break;
case 5:
structure.endSequenceNumber = this.parseIntStr (this.field);
break;
case 9:
structure.substructureType = J.adapter.smarter.Structure.getHelixType (this.parseIntStr (this.field));
break;
case 6:
structure.endInsertionCode = this.firstChar;
break;
case 7:
structure.structureID = this.field;
break;
case 8:
structure.serialID = this.parseIntStr (this.field);
break;
}
}
this.asc.addStructure (structure);
}
return true;
});
Clazz.defineMethod (c$, "processStructSheetRangeLoopBlock",
function () {
this.parseLoopParametersFor ("_struct_sheet_range", J.adapter.readers.cif.MMCifReader.structSheetRangeFields);
for (var i = this.propertyCount; --i >= 0; ) if (this.fieldOf[i] == -1) {
JU.Logger.warn ("?que? missing property:" + J.adapter.readers.cif.MMCifReader.structSheetRangeFields[i]);
return false;
}
while (this.parser.getData ()) {
var structure = new J.adapter.smarter.Structure (-1, J.c.STR.SHEET, J.c.STR.SHEET, null, 0, 0);
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
switch (this.fieldProperty (i)) {
case 1:
structure.startChainID = this.vwr.getChainID (this.field, true);
break;
case 2:
structure.startSequenceNumber = this.parseIntStr (this.field);
break;
case 3:
structure.startInsertionCode = this.firstChar;
break;
case 4:
structure.endChainID = this.vwr.getChainID (this.field, true);
break;
case 5:
structure.endSequenceNumber = this.parseIntStr (this.field);
break;
case 6:
structure.endInsertionCode = this.firstChar;
break;
case 0:
structure.strandCount = 1;
structure.structureID = this.field;
break;
case 7:
structure.serialID = this.parseIntStr (this.field);
break;
}
}
this.asc.addStructure (structure);
}
return true;
});
Clazz.defineMethod (c$, "processStructSiteBlock",
function () {
this.parseLoopParametersFor ("_struct_site_gen", J.adapter.readers.cif.MMCifReader.structSiteFields);
for (var i = 3; --i >= 0; ) if (this.fieldOf[i] == -1) {
JU.Logger.warn ("?que? missing property: " + J.adapter.readers.cif.MMCifReader.structSiteFields[i]);
return false;
}
var siteID = "";
var seqNum = "";
var insCode = "";
var chainID = "";
var resID = "";
var group = "";
var htSite = null;
this.htSites = new java.util.Hashtable ();
while (this.parser.getData ()) {
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
switch (this.fieldProperty (i)) {
case 0:
if (group !== "") {
var groups = htSite.get ("groups");
groups += (groups.length == 0 ? "" : ",") + group;
group = "";
htSite.put ("groups", groups);
}siteID = this.field;
htSite = this.htSites.get (siteID);
if (htSite == null) {
htSite = new java.util.Hashtable ();
htSite.put ("groups", "");
this.htSites.put (siteID, htSite);
}seqNum = "";
insCode = "";
chainID = "";
resID = "";
break;
case 1:
resID = this.field;
break;
case 2:
chainID = this.field;
break;
case 3:
seqNum = this.field;
break;
case 4:
insCode = this.field;
break;
}
if (seqNum !== "" && resID !== "") group = "[" + resID + "]" + seqNum + (insCode.length > 0 ? "^" + insCode : "") + (chainID.length > 0 ? ":" + chainID : "");
}
}
if (group !== "") {
var groups = htSite.get ("groups");
groups += (groups.length == 0 ? "" : ",") + group;
group = "";
htSite.put ("groups", groups);
}return true;
});
Clazz.defineMethod (c$, "setBiomolecules",
function (biomolecule) {
if (!this.isBiomolecule || this.assemblyIdAtoms == null && this.chainAtomCounts == null) return;
var mident = JU.M4.newM4 (null);
var ops = JU.PT.split (biomolecule.get ("operators"), ",");
var assemblies = biomolecule.get ("assemblies");
var biomts = new JU.Lst ();
biomolecule.put ("biomts", biomts);
biomts.addLast (mident);
for (var j = 0; j < ops.length; j++) {
var m = this.getOpMatrix (ops[j]);
if (m != null && !m.equals (mident)) biomts.addLast (m);
}
var bsAll = new JU.BS ();
var sum = new JU.P3 ();
var count = 0;
var nAtoms = 0;
var ids = JU.PT.split (assemblies, "$");
for (var j = 1; j < ids.length; j++) {
var id = ids[j];
if (this.assemblyIdAtoms != null) {
var bs = this.assemblyIdAtoms.get (id);
if (bs != null) {
bsAll.or (bs);
}} else if (this.isCourseGrained) {
var asum = this.chainAtomMap.get (id);
var c = this.chainAtomCounts.get (id)[0];
if (asum != null) {
if (this.bySymop) {
sum.add (asum);
count += c;
} else {
this.createParticle (id);
nAtoms++;
}}}}
if (this.isCourseGrained) {
if (this.bySymop) {
nAtoms = 1;
var a1 = new J.adapter.smarter.Atom ();
a1.setT (sum);
a1.scale (1 / count);
a1.radius = 16;
this.asc.addAtom (a1);
}} else {
nAtoms = bsAll.cardinality ();
if (nAtoms < this.asc.ac) this.asc.bsAtoms = bsAll;
}biomolecule.put ("atomCount", Integer.$valueOf (nAtoms * ops.length));
}, "java.util.Map");
Clazz.defineMethod (c$, "createParticle",
function (id) {
var asum = this.chainAtomMap.get (id);
var c = this.chainAtomCounts.get (id)[0];
var a = new J.adapter.smarter.Atom ();
a.setT (asum);
a.scale (1 / c);
a.elementSymbol = "Pt";
this.setChainID (a, id);
a.radius = 16;
this.asc.addAtom (a);
}, "~S");
Clazz.defineMethod (c$, "getOpMatrix",
function (ops) {
if (this.htBiomts == null) return JU.M4.newM4 (null);
var pt = ops.indexOf ("|");
if (pt >= 0) {
var m = JU.M4.newM4 (this.htBiomts.get (ops.substring (0, pt)));
m.mul (this.htBiomts.get (ops.substring (pt + 1)));
return m;
}return this.htBiomts.get (ops);
}, "~S");
Clazz.defineMethod (c$, "processLigandBondLoopBlock",
function () {
this.parseLoopParametersFor ("_chem_comp_bond", J.adapter.readers.cif.MMCifReader.chemCompBondFields);
if (this.isLigandBondBug) return false;
for (var i = this.propertyCount; --i >= 0; ) if (this.fieldOf[i] == -1) {
JU.Logger.warn ("?que? missing property: " + J.adapter.readers.cif.MMCifReader.chemCompBondFields[i]);
return false;
}
var order = 0;
var isAromatic = false;
while (this.parser.getData ()) {
var atom1 = null;
var atom2 = null;
order = 0;
isAromatic = false;
var n = this.parser.getFieldCount ();
for (var i = 0; i < n; ++i) {
switch (this.fieldProperty (i)) {
case 0:
atom1 = this.asc.getAtomFromName (this.field);
break;
case 1:
atom2 = this.asc.getAtomFromName (this.field);
break;
case 3:
isAromatic = (this.field.charAt (0) == 'Y');
break;
case 2:
order = this.getBondOrder (this.field);
break;
}
}
if (isAromatic) switch (order) {
case 1:
order = 513;
break;
case 2:
order = 514;
break;
}
this.asc.addNewBondWithOrderA (atom1, atom2, order);
}
return true;
});
Clazz.overrideMethod (c$, "processSubclassAtom",
function (atom, assemblyId, strChain) {
if (this.byChain && !this.isBiomolecule) {
if (this.thisChain != atom.chainID) {
this.thisChain = atom.chainID;
var id = "" + atom.chainID;
this.chainSum = this.chainAtomMap.get (id);
if (this.chainSum == null) {
this.chainAtomMap.put (id, this.chainSum = new JU.P3 ());
this.chainAtomCounts.put (id, this.chainAtomCount = Clazz.newIntArray (1, 0));
}}this.chainSum.add (atom);
this.chainAtomCount[0]++;
return false;
}if (this.isBiomolecule && this.isCourseGrained) {
var sum = this.chainAtomMap.get (assemblyId);
if (sum == null) {
this.chainAtomMap.put (assemblyId, sum = new JU.P3 ());
this.chainAtomCounts.put (assemblyId, Clazz.newIntArray (1, 0));
}this.chainAtomCounts.get (assemblyId)[0]++;
sum.add (atom);
return false;
}if (assemblyId != null) {
if (this.assemblyIdAtoms == null) this.assemblyIdAtoms = new java.util.Hashtable ();
var bs = this.assemblyIdAtoms.get (assemblyId);
if (bs == null) this.assemblyIdAtoms.put (assemblyId, bs = new JU.BS ());
bs.set (this.ac);
}if (atom.isHetero && this.htHetero != null) {
this.asc.setAtomSetAuxiliaryInfo ("hetNames", this.htHetero);
this.asc.setInfo ("hetNames", this.htHetero);
this.htHetero = null;
}return true;
}, "J.adapter.smarter.Atom,~S,~S");
Clazz.overrideMethod (c$, "processSubclassLoopBlock",
function () {
if (this.key.startsWith ("_pdbx_struct_oper_list")) return this.processStructOperListBlock ();
if (this.key.startsWith ("_pdbx_struct_assembly_gen")) return this.processAssemblyGenBlock ();
if (this.key.startsWith ("_struct_ref_seq_dif")) return this.processSequence ();
if (this.isCourseGrained) return false;
if (this.key.startsWith ("_struct_site_gen")) return this.processStructSiteBlock ();
if (this.key.startsWith ("_chem_comp_bond")) return this.processLigandBondLoopBlock ();
if (this.key.startsWith ("_chem_comp")) return this.processChemCompLoopBlock ();
if (this.key.startsWith ("_pdbx_entity_nonpoly")) return this.processNonpolyLoopBlock ();
if (this.key.startsWith ("_struct_conf") && !this.key.startsWith ("_struct_conf_type")) return this.processStructConfLoopBlock ();
if (this.key.startsWith ("_struct_sheet_range")) return this.processStructSheetRangeLoopBlock ();
return false;
});
Clazz.defineStatics (c$,
"OPER_ID", 12,
"OPER_XYZ", 13,
"FAMILY_OPER", "_pdbx_struct_oper_list",
"operFields", ["*_matrix[1][1]", "*_matrix[1][2]", "*_matrix[1][3]", "*_vector[1]", "*_matrix[2][1]", "*_matrix[2][2]", "*_matrix[2][3]", "*_vector[2]", "*_matrix[3][1]", "*_matrix[3][2]", "*_matrix[3][3]", "*_vector[3]", "*_id", "*_symmetry_operation"],
"ASSEM_ID", 0,
"ASSEM_OPERS", 1,
"ASSEM_LIST", 2,
"FAMILY_ASSEM", "_pdbx_struct_assembly_gen",
"assemblyFields", ["*_assembly_id", "*_oper_expression", "*_asym_id_list"],
"STRUCT_REF_G3", 0,
"STRUCT_REF_G1", 1,
"structRefFields", ["_struct_ref_seq_dif_mon_id", "_struct_ref_seq_dif.db_mon_id"],
"NONPOLY_ENTITY_ID", 0,
"NONPOLY_NAME", 1,
"NONPOLY_COMP_ID", 2,
"nonpolyFields", ["_pdbx_entity_nonpoly_entity_id", "_pdbx_entity_nonpoly_name", "_pdbx_entity_nonpoly_comp_id"],
"CHEM_COMP_ID", 0,
"CHEM_COMP_NAME", 1,
"chemCompFields", ["_chem_comp_id", "_chem_comp_name"],
"CONF_TYPE_ID", 0,
"BEG_ASYM_ID", 1,
"BEG_SEQ_ID", 2,
"BEG_INS_CODE", 3,
"END_ASYM_ID", 4,
"END_SEQ_ID", 5,
"END_INS_CODE", 6,
"STRUCT_ID", 7,
"SERIAL_NO", 8,
"HELIX_CLASS", 9,
"structConfFields", ["*_conf_type_id", "*_beg_auth_asym_id", "*_beg_auth_seq_id", "*_pdbx_beg_pdb_ins_code", "*_end_auth_asym_id", "*_end_auth_seq_id", "*_pdbx_end_pdb_ins_code", "*_id", "*_pdbx_pdb_helix_id", "*_pdbx_pdb_helix_class"],
"FAMILY_STRUCTCONF", "_struct_conf",
"SHEET_ID", 0,
"STRAND_ID", 7,
"FAMILY_SHEET", "_struct_sheet_range",
"structSheetRangeFields", ["*_sheet_id", "*_beg_auth_asym_id", "*_beg_auth_seq_id", "*_pdbx_beg_pdb_ins_code", "*_end_auth_asym_id", "*_end_auth_seq_id", "*_pdbx_end_pdb_ins_code", "*_id"],
"SITE_ID", 0,
"SITE_COMP_ID", 1,
"SITE_ASYM_ID", 2,
"SITE_SEQ_ID", 3,
"SITE_INS_CODE", 4,
"FAMILY_STRUCSITE", "_struct_site_gen",
"structSiteFields", ["*_site_id", "*_auth_comp_id", "*_auth_asym_id", "*_auth_seq_id", "*_label_alt_id"],
"CHEM_COMP_BOND_ATOM_ID_1", 0,
"CHEM_COMP_BOND_ATOM_ID_2", 1,
"CHEM_COMP_BOND_VALUE_ORDER", 2,
"CHEM_COMP_BOND_AROMATIC_FLAG", 3,
"FAMILY_COMPBOND", "_chem_comp_bond",
"chemCompBondFields", ["*_atom_id_1", "*_atom_id_2", "*_value_order", "*_pdbx_aromatic_flag"]);
});
|
mmagnus/rna-pdb-tools
|
rna_tools/tools/webserver-engine/app/static/app/jsmol/j2s/J/adapter/readers/cif/MMCifReader.js
|
JavaScript
|
gpl-3.0
| 22,439 |
/* This file is part of Eternity II Editor.
*
* Eternity II Editor 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.
*
* Eternity II Editor 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 Eternity II Editor. If not, see <http://www.gnu.org/licenses/>.
*
* Eternity II Editor project is hosted on SourceForge:
* http://sourceforge.net/projects/eternityii/
* and maintained by Yannick Kirschhoffer <[email protected]>
*/
package org.alcibiade.eternity.editor.gui.action;
import java.awt.event.ActionEvent;
import org.alcibiade.eternity.editor.gui.EditableStatusProvider;
import org.alcibiade.eternity.editor.model.GridModel;
public class ShuffleGridAction extends GridUpdateAction {
private static final long serialVersionUID = 1L;
private GridModel gridModel;
public ShuffleGridAction(GridModel grid, EditableStatusProvider editable) {
super("Shuffle", editable);
gridModel = grid;
}
public void actionPerformed(ActionEvent e) {
BackgroundActionRunner.run(new Runnable() {
@Override
public void run() {
gridModel.shuffle();
}
});
}
}
|
Aerylia/SE2Assignment
|
src/main/java/org/alcibiade/eternity/editor/gui/action/ShuffleGridAction.java
|
Java
|
gpl-3.0
| 1,540 |
# $Id: PositionProxy.pm,v 1.9.4.1 2006/10/02 23:10:28 sendu Exp $
#
# BioPerl module for Bio::SeqFeature::PositionProxy
#
# Cared for by Ewan Birney <[email protected]>
#
# Copyright Ewan Birney
#
# You may distribute this module under the same terms as perl itself
# POD documentation - main docs before the code
=head1 NAME
Bio::SeqFeature::PositionProxy - handle features when truncation/revcom sequences span a feature
=head1 SYNOPSIS
$proxy = new Bio::SeqFeature::PositionProxy ( -loc => $loc,
-parent => $basefeature);
$seq->add_SeqFeature($feat);
=head1 DESCRIPTION
PositionProxy is a Proxy Sequence Feature to handle truncation
and revcomp without duplicating all the data within the sequence features.
It holds a new location for a sequence feature and the original feature
it came from to provide the additional annotation information.
=head1 FEEDBACK
=head2 Mailing Lists
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to one
of the Bioperl mailing lists. Your participation is much appreciated.
[email protected] - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
=head2 Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution. Bug reports can be submitted via the
web:
http://bugzilla.open-bio.org/
=head1 AUTHOR - Ewan Birney
Ewan Birney E<lt>[email protected]<gt>
=head1 DEVELOPERS
This class has been written with an eye out of inheritence. The fields
the actual object hash are:
_gsf_tag_hash = reference to a hash for the tags
_gsf_sub_array = reference to an array for sub arrays
_gsf_start = scalar of the start point
_gsf_end = scalar of the end point
_gsf_strand = scalar of the strand
=head1 APPENDIX
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _
=cut
# Let the code begin...
package Bio::SeqFeature::PositionProxy;
use strict;
use Bio::Tools::GFF;
use base qw(Bio::Root::Root Bio::SeqFeatureI);
sub new {
my ($caller, @args) = @_;
my $self = $caller->SUPER::new(@args);
my ($feature,$location) = $self->_rearrange([qw(PARENT LOC)],@args);
if( !defined $feature || !ref $feature || !$feature->isa('Bio::SeqFeatureI') ) {
$self->throw("Must have a parent feature, not a [$feature]");
}
if( $feature->isa("Bio::SeqFeature::PositionProxy") ) {
$feature = $feature->parent();
}
if( !defined $location || !ref $location || !$location->isa('Bio::LocationI') ) {
$self->throw("Must have a location, not a [$location]");
}
return $self;
}
=head2 location
Title : location
Usage : my $location = $seqfeature->location()
Function: returns a location object suitable for identifying location
of feature on sequence or parent feature
Returns : Bio::LocationI object
Args : none
=cut
sub location {
my($self, $value ) = @_;
if (defined($value)) {
unless (ref($value) and $value->isa('Bio::LocationI')) {
$self->throw("object $value pretends to be a location but ".
"does not implement Bio::LocationI");
}
$self->{'_location'} = $value;
}
elsif (! $self->{'_location'}) {
# guarantees a real location object is returned every time
$self->{'_location'} = Bio::Location::Simple->new();
}
return $self->{'_location'};
}
=head2 parent
Title : parent
Usage : my $sf = $proxy->parent()
Function: returns the seqfeature parent of this proxy
Returns : Bio::SeqFeatureI object
Args : none
=cut
sub parent {
my($self, $value ) = @_;
if (defined($value)) {
unless (ref($value) and $value->isa('Bio::SeqFeatureI')) {
$self->throw("object $value pretends to be a location but ".
"does not implement Bio::SeqFeatureI");
}
$self->{'_parent'} = $value;
}
return $self->{'_parent'};
}
=head2 start
Title : start
Usage : $start = $feat->start
$feat->start(20)
Function: Get
Returns : integer
Args : none
=cut
sub start {
my ($self,$value) = @_;
return $self->location->start($value);
}
=head2 end
Title : end
Usage : $end = $feat->end
$feat->end($end)
Function: get
Returns : integer
Args : none
=cut
sub end {
my ($self,$value) = @_;
return $self->location->end($value);
}
=head2 length
Title : length
Usage :
Function:
Example :
Returns :
Args :
=cut
sub length {
my ($self) = @_;
return $self->end - $self->start() + 1;
}
=head2 strand
Title : strand
Usage : $strand = $feat->strand()
$feat->strand($strand)
Function: get/set on strand information, being 1,-1 or 0
Returns : -1,1 or 0
Args : none
=cut
sub strand {
my ($self,$value) = @_;
return $self->location->strand($value);
}
=head2 attach_seq
Title : attach_seq
Usage : $sf->attach_seq($seq)
Function: Attaches a Bio::Seq object to this feature. This
Bio::Seq object is for the *entire* sequence: ie
from 1 to 10000
Example :
Returns : TRUE on success
Args :
=cut
sub attach_seq {
my ($self, $seq) = @_;
if ( !defined $seq || !ref $seq || ! $seq->isa("Bio::PrimarySeqI") ) {
$self->throw("Must attach Bio::PrimarySeqI objects to SeqFeatures");
}
$self->{'_gsf_seq'} = $seq;
# attach to sub features if they want it
foreach my $sf ( $self->sub_SeqFeature() ) {
if ( $sf->can("attach_seq") ) {
$sf->attach_seq($seq);
}
}
return 1;
}
=head2 seq
Title : seq
Usage : $tseq = $sf->seq()
Function: returns the truncated sequence (if there) for this
Example :
Returns : sub seq on attached sequence bounded by start & end
Args : none
=cut
sub seq {
my ($self, $arg) = @_;
if ( defined $arg ) {
$self->throw("Calling SeqFeature::PositionProxy->seq with an argument. You probably want attach_seq");
}
if ( ! exists $self->{'_gsf_seq'} ) {
return;
}
# assumming our seq object is sensible, it should not have to yank
# the entire sequence out here.
my $seq = $self->{'_gsf_seq'}->trunc($self->start(), $self->end());
if ( $self->strand == -1 ) {
$seq = $seq->revcom;
}
return $seq;
}
=head2 entire_seq
Title : entire_seq
Usage : $whole_seq = $sf->entire_seq()
Function: gives the entire sequence that this seqfeature is attached to
Example :
Returns :
Args :
=cut
sub entire_seq {
my ($self) = @_;
return unless exists($self->{'_gsf_seq'});
return $self->{'_gsf_seq'};
}
=head2 seqname
Title : seqname
Usage : $obj->seq_id($newval)
Function: There are many cases when you make a feature that you
do know the sequence name, but do not know its actual
sequence. This is an attribute such that you can store
the seqname.
This attribute should *not* be used in GFF dumping, as
that should come from the collection in which the seq
feature was found.
Returns : value of seqname
Args : newvalue (optional)
=cut
sub seqname {
my ($obj,$value) = @_;
if ( defined $value ) {
$obj->{'_gsf_seqname'} = $value;
}
return $obj->{'_gsf_seqname'};
}
=head2 Proxies
These functions chain back to the parent for all non sequence related stuff.
=cut
=head2 primary_tag
Title : primary_tag
Usage : $tag = $feat->primary_tag()
Function: Returns the primary tag for a feature,
eg 'exon'
Returns : a string
Args : none
=cut
sub primary_tag{
my ($self,@args) = @_;
return $self->parent->primary_tag();
}
=head2 source_tag
Title : source_tag
Usage : $tag = $feat->source_tag()
Function: Returns the source tag for a feature,
eg, 'genscan'
Returns : a string
Args : none
=cut
sub source_tag{
my ($self) = @_;
return $self->parent->source_tag();
}
=head2 has_tag
Title : has_tag
Usage : $tag_exists = $self->has_tag('some_tag')
Function:
Returns : TRUE if the specified tag exists, and FALSE otherwise
Args :
=cut
sub has_tag{
my ($self,$tag) = @_;
return $self->parent->has_tag($tag);
}
=head2 each_tag_value
Title : each_tag_value
Usage : @values = $self->each_tag_value('some_tag')
Function:
Returns : An array comprising the values of the specified tag.
Args :
=cut
sub each_tag_value {
my ($self,$tag) = @_;
return $self->parent->each_tag_value($tag);
}
=head2 all_tags
Title : all_tags
Usage : @tags = $feat->all_tags()
Function: gives all tags for this feature
Returns : an array of strings
Args : none
=cut
sub all_tags{
my ($self) = @_;
return $self->parent->all_tags();
}
1;
|
vinuesa/get_phylomarkers
|
lib/perl/bioperl-1.5.2_102/Bio/SeqFeature/PositionProxy.pm
|
Perl
|
gpl-3.0
| 8,912 |
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// Load Balancing Service API
//
// API for the Load Balancing Service
//
package loadbalancer
import (
"github.com/oracle/oci-go-sdk/common"
)
// HealthCheckerDetails The health check policy's configuration details.
type HealthCheckerDetails struct {
// The protocol the health check must use; either HTTP or TCP.
// Example: `HTTP`
Protocol *string `mandatory:"true" json:"protocol"`
// The interval between health checks, in milliseconds.
// Example: `30000`
IntervalInMillis *int `mandatory:"false" json:"intervalInMillis"`
// The backend server port against which to run the health check. If the port is not specified, the load balancer uses the
// port information from the `Backend` object.
// Example: `8080`
Port *int `mandatory:"false" json:"port"`
// A regular expression for parsing the response body from the backend server.
// Example: `^(500|40[1348])$`
ResponseBodyRegex *string `mandatory:"false" json:"responseBodyRegex"`
// The number of retries to attempt before a backend server is considered "unhealthy".
// Example: `3`
Retries *int `mandatory:"false" json:"retries"`
// The status code a healthy backend server should return.
// Example: `200`
ReturnCode *int `mandatory:"false" json:"returnCode"`
// The maximum time, in milliseconds, to wait for a reply to a health check. A health check is successful only if a reply
// returns within this timeout period.
// Example: `6000`
TimeoutInMillis *int `mandatory:"false" json:"timeoutInMillis"`
// The path against which to run the health check.
// Example: `/healthcheck`
UrlPath *string `mandatory:"false" json:"urlPath"`
}
func (m HealthCheckerDetails) String() string {
return common.PointerString(m)
}
|
ChrisLundquist/packer
|
vendor/github.com/oracle/oci-go-sdk/loadbalancer/health_checker_details.go
|
GO
|
mpl-2.0
| 1,831 |
/**
* @fileoverview Test for call_Function rule
* @author ScanJS contributors
* @copyright 2015 Mozilla Corporation. All rights reserved
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
var rule = require("../../lib/rules/call_Function");
var RuleTester = require('eslint').RuleTester;
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
var eslintTester = new RuleTester();
eslintTester.run("call_Function", rule, {
valid: [
{ code: "Function" }
], // Examples of code that should trigger the rule
invalid: [
{
code: "Function('jsCode'+usercontrolledVal ) ",
errors: [
{ message: "The function Function can be unsafe" }
]
},
{
code: " Function('arg','arg2','jsCode'+usercontrolledVal )",
errors: [
{ message: "The function Function can be unsafe" }
]
},
]
}); // auto-generated from scanjs rules.json
|
mozfreddyb/eslint-plugin-scanjs-rules
|
tests/rules/call_Function.js
|
JavaScript
|
mpl-2.0
| 1,161 |
#pragma once
#include "Classes.h"
//////////////////////////////////////////////////////////////////////////////////////////
// cStars -- simple starfield model, simulating appearance of starry sky
class cStars {
friend opengl_renderer;
friend opengl33_renderer;
public:
// types:
// methods:
void init();
// constructors:
cStars() = default;
// deconstructor:
// members:
private:
// types:
// methods:
// members:
float m_longitude{ 19.0f }; // geograpic coordinates hardcoded roughly to Poland location, for the time being
float m_latitude{ 52.0f };
TModel3d *m_stars { nullptr };
};
|
tmj-fstate/maszyna
|
stars.h
|
C
|
mpl-2.0
| 626 |
/**
* Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved.
*
* This file is part of SeedStack, An enterprise-oriented full development stack.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.seedstack.seed.rest.fixtures;
import javax.ws.rs.Path;
@Path("/lists/persons")
public class PersonsListResource extends ListResourceTemplate<PersonRepresentation> {
}
|
jin19910624/seed
|
rest-support/core/src/it/java/org/seedstack/seed/rest/fixtures/PersonsListResource.java
|
Java
|
mpl-2.0
| 553 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
Uses of Class org.apache.poi.xwpf.usermodel.BodyType (POI API Documentation)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.poi.xwpf.usermodel.BodyType (POI API Documentation)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/poi/xwpf/usermodel/\class-useBodyType.html" target="_top"><B>FRAMES</B></A>
<A HREF="BodyType.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.poi.xwpf.usermodel.BodyType</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.poi.xwpf.usermodel"><B>org.apache.poi.xwpf.usermodel</B></A></TD>
<TD> </TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.poi.xwpf.usermodel"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A> in <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/package-summary.html">org.apache.poi.xwpf.usermodel</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/package-summary.html">org.apache.poi.xwpf.usermodel</A> that return <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>XWPFTableCell.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/XWPFTableCell.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>XWPFTable.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/XWPFTable.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
returns the partType of the bodyPart which owns the bodyElement</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>XWPFParagraph.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/XWPFParagraph.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
returns the partType of the bodyPart which owns the bodyElement</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>XWPFHeader.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/XWPFHeader.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
get the PartType of the body</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>XWPFFootnote.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/XWPFFootnote.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
get the PartType of the body</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>XWPFFooter.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/XWPFFooter.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
get the PartType of the body</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>XWPFDocument.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/XWPFDocument.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
get the PartType of the body, for example
DOCUMENT, HEADER, FOOTER, FOOTNOTE,</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>IBodyElement.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/IBodyElement.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>IBody.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/IBody.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
get the PartType of the body, for example
DOCUMENT, HEADER, FOOTER, FOOTNOTE,</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>AbstractXWPFSDT.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/AbstractXWPFSDT.html#getPartType()">getPartType</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A></CODE></FONT></TD>
<TD><CODE><B>BodyType.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html#valueOf(java.lang.String)">valueOf</A></B>(java.lang.String name)</CODE>
<BR>
Returns the enum constant of this type with the specified name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel">BodyType</A>[]</CODE></FONT></TD>
<TD><CODE><B>BodyType.</B><B><A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html#values()">values</A></B>()</CODE>
<BR>
Returns an array containing the constants of this enum type, in
the order they are declared.</TD>
</TR>
</TABLE>
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/poi/xwpf/usermodel/BodyType.html" title="enum in org.apache.poi.xwpf.usermodel"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/poi/xwpf/usermodel/\class-useBodyType.html" target="_top"><B>FRAMES</B></A>
<A HREF="BodyType.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright 2015 The Apache Software Foundation or
its licensors, as applicable.</i>
</BODY>
</HTML>
|
claywebb/java-bulletin
|
poi-3.13/docs/apidocs/org/apache/poi/xwpf/usermodel/class-use/BodyType.html
|
HTML
|
mpl-2.0
| 14,185 |
/**
* Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved.
*
* This file is part of SeedStack, An enterprise-oriented full development stack.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.seedstack.seed.web;
import org.seedstack.seed.it.AbstractSeedWebIT;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import java.net.URL;
import static com.jayway.restassured.RestAssured.expect;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
public class WebResourcesDefaultsIT extends AbstractSeedWebIT {
@Deployment
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class).addAsWebResource("META-INF/resources/resources/test.js", "/resources/docroot-test.js").addAsWebResource("META-INF/resources/resources/test.js.gz", "/resources/docroot-test.js.gz").addAsWebResource("META-INF/resources/resources/test.min.js", "/resources/docroot-test.min.js").addAsWebResource("META-INF/resources/resources/test.min.js.gz", "/resources/docroot-test.min.js.gz").addAsWebResource("META-INF/resources/resources/test2.js", "/resources/docroot-test2.js").setWebXML("WEB-INF/web.xml");
}
@Test
@RunAsClient
public void classpath_webresources_with_default_configuration_are_gzipped_and_minified(@ArquillianResource URL baseURL) throws Exception {
expect().statusCode(200).header("Content-Encoding", equalTo("gzip")).body(containsString("var minifiedJS = {};")).when().get(baseURL.toString() + "resources/test.js");
}
@Test
@RunAsClient
public void docroot_webresources_with_default_configuration_are_gzipped_and_minified(@ArquillianResource URL baseURL) throws Exception {
expect().statusCode(200).header("Content-Encoding", equalTo("gzip")).body(containsString("var minifiedJS = {};")).when().get(baseURL.toString() + "resources/docroot-test.js");
}
@Test
@RunAsClient
public void classpath_webresources_with_default_configuration_are_gzipped_on_the_fly(@ArquillianResource URL baseURL) throws Exception {
expect().statusCode(200).header("Content-Encoding", equalTo("gzip")).body(containsString("var JS2 = {};")).when().get(baseURL.toString() + "resources/test2.js");
}
@Test
@RunAsClient
public void docroot_webresources_with_default_configuration_are_gzipped_on_the_fly(@ArquillianResource URL baseURL) throws Exception {
expect().statusCode(200).header("Content-Encoding", equalTo("gzip")).body(containsString("var JS2 = {};")).when().get(baseURL.toString() + "resources/docroot-test2.js");
}
@Test
@RunAsClient
public void non_existent_resource_is_404(@ArquillianResource URL baseURL) throws Exception {
expect().statusCode(404).when().get(baseURL.toString() + "resources/non-existent-resource");
}
@Test
@RunAsClient
public void not_pregzipped_resource_is_gzipped_on_the_fly_twice(@ArquillianResource URL baseURL) throws Exception {
expect().statusCode(200).header("Content-Encoding", equalTo("gzip")).body(containsString("var JS2 = {};")).when().get(baseURL.toString() + "resources/docroot-test2.js");
expect().statusCode(200).header("Content-Encoding", equalTo("gzip")).body(containsString("var JS2 = {};")).when().get(baseURL.toString() + "resources/docroot-test2.js");
}
}
|
jin19910624/seed
|
web-support/core/src/it/java/org/seedstack/seed/web/WebResourcesDefaultsIT.java
|
Java
|
mpl-2.0
| 3,758 |
docLayer.modules.define("findinpage", {
/* this needs to be appended to the navbar, not the body, so it needs a custom insert */
customhtml: '\
<span class="findinpage-to-right">\
<button title="Back to document" class="icon-button" id="findinpage-exit"><i class="icon-arrow-back"></i></button>\
<span id="findinpage-inputs">\
<span class="findinpage-input-area">\
<input title="Enter text to find" type="text" id="find-input" class="text-input findinpage-input" placeholder="Find something..."/>\
<span class="findinpage-count"></span>\
</span>\
<span class="findinpage-input-area">\
<input title="Replace text" type="text" id="replace-input" class="text-input findinpage-input" placeholder="Replace with..."/>\
</span>\
</span>\
<button title="Search for text in the document" class="icon-button" id="findinpage-button"><i class="icon-search"></i></button>\
</span>\
',
startsearch: function () {
this.findinpagecount.html("");
this.inputs.find.val("");
this.inputs.replace.val("");
this.inputs.find.removeClass("no-matches");
$(document.body).addClass("find-in-page");
this.inputs.find.focus();
docLayer.editregion.attr("contenteditable", "false"); //temp fix for firefox bug
},
endsearch: function () {
$(document.body).removeClass("find-in-page");
docLayer.editregion.removeHighlight();
docLayer.editregion.attr("contenteditable", "true"); //temp fix for firefox bug
docLayer.editregion.get(0).focus(); //the jquery focus method doesn't work on contenteditable, so the native method must be used instead
},
highlightmatches: function () {
docLayer.editregion.removeHighlight();
docLayer.editregion.highlight(this.inputs.find.val());
var highlights = $(".highlight");
var matches = highlights.length
this.findinpagecount.html(matches);
if (matches == 0 && this.inputs.find.val() != "") {
this.inputs.find.addClass("no-matches")
} else {
this.inputs.find.removeClass("no-matches");
}
//scroll to the closest match
var $window = $(window);
var closestEl;
var distance = 99999999999;
var windowscroll = $window.scrollTop();
highlights.each(function () {
var $this = $(this);
var newdistance = Math.abs($this.position().top - windowscroll);
if (newdistance < distance) {
distance = newdistance;
closestEl = $this;
}
});
if (closestEl) { //make sure we don't throw an error if there are no highlights
$(window).scrollTop(closestEl.offset().top - 100);
}
},
replace: function () {
this.highlightmatches();
var newText = this.inputs.replace.val();
if (newText) {
$(".highlight").text(newText);
} else {
$(".highlight").remove();
}
this.endsearch();
},
init: function () {
var _ = this;
$(".editor-toolbar").append(this.customhtml);
//cache elements
this.button = $("#findinpage-button");
this.findinpagecontainer = $(".findinpage");
this.inputs = {};
this.inputs.find = $("#find-input");
this.inputs.replace = $("#replace-input");
this.findinpagecount = $(".findinpage-count");
// Bind functions
this.startsearch = this.startsearch.bind(this);
this.endsearch = this.endsearch.bind(this);
this.highlightmatches = this.highlightmatches.bind(this);
this.replace = this.replace.bind(this);
// Event listeners
this.button.click(this.startsearch);
docLayer.editregion.click(this.endsearch);
$("#findinpage-exit").click(this.endsearch);
this.inputs.find.keyup(this.highlightmatches);
this.inputs.replace.keyup(function (e) {
if (e.keyCode == 13) {
_.replace();
}
});
docLayer.keybindings.addBinding("mod+f", function () {
_.startsearch();
});
}
});
|
PalmerAL/DocLayer
|
editor/js/findinpage.js
|
JavaScript
|
mpl-2.0
| 3,681 |
{% load tethys_gizmos %}
<div>
<table class="table table-striped table-condensed">
<thead>
<th>Edit</th>
<th>Delete</th>
<th>Watershed Name</th>
<th>Subbasin Name</th>
</thead>
<tbody>
{% for watershed in watersheds %}
<tr>
<td class="table-button"><div class=" btn-group"><a name="submit-edit-watershed" class="btn btn-warning submit-edit-watershed" data-toggle="modal" data-target="#edit_watershed_modal" role="button">
<span class="glyphicon glyphicon-pencil"></span> Edit </a>
</div>
</td>
<td class="table-button"><div class=" btn-group"><a name="submit-delete-watershed" class="btn btn-danger submit-delete-watershed" role="button">
<span class="glyphicon glyphicon-remove"></span> Delete </a>
</div>
</td>
<td class="watershed-name" data-watershed_id="{{watershed.id}}">{{watershed.watershed_name}}</td>
<td class="subbasin-name">{{watershed.subbasin_name}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="row" style="margin: auto; padding: 15px">
<div style="margin-left: auto;margin-right: auto">
<div class="col-md-4" style="text-align:right">{% gizmo button_group prev_button %}</div>
<div class="col-md-3" id="display-info" style="text-align: center"></div>
<div class="col-md-5" style="text-align:left">{% gizmo button_group next_button %}</div>
</div>
</div>
|
CI-WATER/tethysapp-erfp_tool
|
tethysapp/erfp_tool/templates/erfp_tool/manage_watersheds_table.html
|
HTML
|
mpl-2.0
| 1,624 |
/*
* Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
* retains certain rights in this software.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* * Neither the name of Sandia Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*****************************************************************************
*
* exgpa - ex_get_prop_array: read object property array
*
* entry conditions -
* input parameters:
* int exoid exodus file id
* int obj_type type of object (element block, node
* set or side set)
* char* prop_name name of the property for which the
* values will be read
*
* exit conditions -
* int* values returned array of property values
*
* revision history -
*
*
*****************************************************************************/
#include <stdio.h> // for sprintf
#include <string.h> // for strcpy, memset, strcmp
#include "exodusII.h" // for exerrval, ex_err, etc
#include "exodusII_int.h" // for EX_FATAL, ATT_PROP_NAME, etc
#include "netcdf.h" // for NC_NOERR, nc_get_att_text, etc
/*!
The function ex_get_prop_array() reads an array of integer property
values for all element blocks, node sets, or side sets. The order of
the values in the array correspond to the order in which the element
blocks, node sets, or side sets were introduced into the file. Before
this function is invoked, memory must be allocated for the returned
array of(\c num_elem_blk, \c num_node_sets, or {num_side_sets})
integer values.
This function can be used in place of
- ex_get_elem_blk_ids(),
- ex_get_node_set_ids(), and
- ex_get_side_set_ids()
to get element block, node set, and side set IDs, respectively, by
requesting the property name \b ID. One should also note that this
same function can be accomplished with multiple calls to
ex_get_prop().
\return In case of an error, ex_get_prop_array() returns a negative
number; a warning will return a positive number. Possible causes of
errors include:
- data file not properly opened with call to ex_create() or ex_open()
- invalid object type specified.
- a warning value is returned if a property with the specified name is not found.
\param[in] exoid exodus file ID returned from a previous call to ex_create() or ex_open().
\param[in] obj_type Type of object; use one of the options in the table below.
\param[in] prop_name The name of the property (maximum length of \p MAX_STR_LENGTH )
for which the values are desired.
\param[out] values Returned array of property values.
<table>
<tr><td> \c EX_NODE_SET </td><td> Node Set entity type </td></tr>
<tr><td> \c EX_EDGE_BLOCK </td><td> Edge Block entity type </td></tr>
<tr><td> \c EX_EDGE_SET </td><td> Edge Set entity type </td></tr>
<tr><td> \c EX_FACE_BLOCK </td><td> Face Block entity type </td></tr>
<tr><td> \c EX_FACE_SET </td><td> Face Set entity type </td></tr>
<tr><td> \c EX_ELEM_BLOCK </td><td> Element Block entity type</td></tr>
<tr><td> \c EX_ELEM_SET </td><td> Element Set entity type </td></tr>
<tr><td> \c EX_SIDE_SET </td><td> Side Set entity type </td></tr>
<tr><td> \c EX_ELEM_MAP </td><td> Element Map entity type </td></tr>
<tr><td> \c EX_NODE_MAP </td><td> Node Map entity type </td></tr>
<tr><td> \c EX_EDGE_MAP </td><td> Edge Map entity type </td></tr>
<tr><td> \c EX_FACE_MAP </td><td> Face Map entity type </td></tr>
</table>
For an example of code to read an array of object properties, refer to
the description for ex_get_prop_names().
*/
int ex_get_prop_array (int exoid,
ex_entity_type obj_type,
const char *prop_name,
void_int *values)
{
int num_props, i, propid, status;
int found = EX_FALSE;
char name[MAX_VAR_NAME_LENGTH+1];
char tmpstr[MAX_STR_LENGTH+1];
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
/* open appropriate variable, depending on obj_type and prop_name */
num_props = ex_get_num_props(exoid, obj_type);
for (i=1; i<=num_props; i++)
{
switch (obj_type){
case EX_ELEM_BLOCK:
strcpy (name, VAR_EB_PROP(i));
break;
case EX_EDGE_BLOCK:
strcpy (name, VAR_ED_PROP(i));
break;
case EX_FACE_BLOCK:
strcpy (name, VAR_FA_PROP(i));
break;
case EX_NODE_SET:
strcpy (name, VAR_NS_PROP(i));
break;
case EX_EDGE_SET:
strcpy (name, VAR_ES_PROP(i));
break;
case EX_FACE_SET:
strcpy (name, VAR_FS_PROP(i));
break;
case EX_ELEM_SET:
strcpy (name, VAR_ELS_PROP(i));
break;
case EX_SIDE_SET:
strcpy (name, VAR_SS_PROP(i));
break;
case EX_ELEM_MAP:
strcpy (name, VAR_EM_PROP(i));
break;
case EX_FACE_MAP:
strcpy (name, VAR_FAM_PROP(i));
break;
case EX_EDGE_MAP:
strcpy (name, VAR_EDM_PROP(i));
break;
case EX_NODE_MAP:
strcpy (name, VAR_NM_PROP(i));
break;
default:
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: object type %d not supported; file id %d",
obj_type, exoid);
ex_err("ex_get_prop_array",errmsg,exerrval);
return(EX_FATAL);
}
if ((status = nc_inq_varid(exoid, name, &propid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to locate property array %s in file id %d",
name, exoid);
ex_err("ex_get_prop_array",errmsg,exerrval);
return (EX_FATAL);
}
/* compare stored attribute name with passed property name */
memset(tmpstr, 0, MAX_STR_LENGTH+1);
if ((status = nc_get_att_text(exoid, propid, ATT_PROP_NAME, tmpstr)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get property name in file id %d", exoid);
ex_err("ex_get_prop_array",errmsg,exerrval);
return (EX_FATAL);
}
if (strcmp(tmpstr, prop_name) == 0) {
found = EX_TRUE;
break;
}
}
/* if property is not found, return warning */
if (!found) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
"Warning: object type %d, property %s not defined in file id %d",
obj_type, prop_name, exoid);
ex_err("ex_get_prop_array",errmsg,exerrval);
return (EX_WARN);
}
/* read num_obj values from property variable */
if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
status = nc_get_var_longlong(exoid, propid, values);
} else {
status = nc_get_var_int(exoid, propid, values);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to read values in %s property array in file id %d",
ex_name_of_object(obj_type), exoid);
ex_err("ex_get_prop_array",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
}
|
polymec/polyglot-dev
|
3rdparty/exodus/exodus/cbind/src/ex_get_prop_array.c
|
C
|
mpl-2.0
| 8,770 |
window.LogoHeaderAnimation = {};
;(function (window, LogoHeaderAnimation, $, undefined) {
function enter(prefix){
TweenLite.set($(prefix + " #animation1"),{display: 'block'})
TweenLite.set($(prefix + " #animation2"),{display: 'block'})
$(prefix + " #animation1 > g").each(function(i,e){
TweenLite.set(e, {opacity: 0, scale: 1.6, rotation: (Math.random() * 180)-90, transformOrigin: 'center center'})
})
$(prefix + " #animation2 > g").each(function(i,e){
TweenLite.set(e, {opacity: 0, scale: 1.6, rotation: (Math.random() * 180)-90, transformOrigin: 'center center'})
})
TweenLite.set($(prefix + " #animation1 > #start_o"),{opacity: 1, scale: 1})
TweenLite.set($(prefix + " #animation2 > #start_o"),{opacity: 1, scale: 1})
_animate(prefix + " #animation1 > g", .6, .8, 3)
_animate(prefix + " #animation2 > g", .6, .95, 3)
function _animate (group, startTime, delay, elements) {
function _reduceto (array, num) {
var arr = array.toArray()
var temp_o = arr.shift()
var temp_f = arr.pop()
if (arr.length > num) {
// shuffle
var j, x, i;
for (i = arr.length; i; i -= 1) {
j = Math.floor(Math.random() * i);
x = arr[i - 1];
arr[i - 1] = arr[j];
arr[j] = x;
}
// get n elements
arr = arr.splice(0, num)
}
// re add first and last elements
arr.unshift(temp_o)
arr.push(temp_f)
return arr
}
group = _reduceto($(group), elements)
$(group).each(function (d, elem) {
TweenLite.to(elem, .3, {
opacity: 1,
delay: startTime + (d+1) * delay
})
TweenLite.to(elem, .8, {
scale: 1,
transformOrigin: 'center center',
rotation: 0,
delay: startTime + (d+1) * delay,
ease: Elastic.easeInOut,
onComplete: function () {
if (elem !== _.last($(group))) {
TweenLite.to(elem, .4, {
scale: 0,
transformOrigin: 'center center',
ease: Expo.easeInOut
})
}
}
})
})
}
}
function exit(prefix){
TweenLite.killTweensOf(prefix + " #animation1 > g")
TweenLite.killTweensOf(prefix + " #animation2 > g")
}
LogoHeaderAnimation.enter = enter
LogoHeaderAnimation.exit = exit
})(window, window.LogoHeaderAnimation, window.jQuery);
|
todotoit/cryptoloji
|
assets/js/logo-header-animation.js
|
JavaScript
|
mpl-2.0
| 2,575 |
package com.servinglynk.hmis.warehouse.restful.model;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class StringList
{
private List<String> data;
public StringList() {
}
public StringList(List<String> data) {
this.data = data;
}
public List<String> getData() {
return data;
}
public void setData(List<String> data) {
this.data = data;
}
}
|
servinglynk/hmis-lynk-open-source
|
hmis-core-common/src/main/java/com/servinglynk/hmis/warehouse/restful/model/StringList.java
|
Java
|
mpl-2.0
| 456 |
#!/bin/bash
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The primary maintainer of this project is
# Arezqui Belaid <[email protected]>
#
#
# To download and run the script on your server :
#
# >> Install with Master script :
# cd /usr/src/ ; rm install-newfies.sh ; wget --no-check-certificate https://raw.github.com/Star2Billing/newfies-dialer/master/install/install-newfies.sh ; chmod +x install-newfies.sh ; ./install-newfies.sh
#
# >> Install with develop script :
# cd /usr/src/ ; rm install-newfies.sh ; wget --no-check-certificate https://raw.github.com/Star2Billing/newfies-dialer/develop/install/install-newfies.sh ; chmod +x install-newfies.sh ; ./install-newfies.sh
#
#Set branch to install develop / master
BRANCH='master'
#Get Scripts dependencies
cd /usr/src/
rm newfies-dialer-functions.sh
wget --no-check-certificate https://raw.github.com/Star2Billing/newfies-dialer/$BRANCH/install/newfies-dialer-functions.sh -O newfies-dialer-functions.sh
#Include cdr-stats install functions
source newfies-dialer-functions.sh
#Menu Section for Script
show_menu_newfies() {
clear
echo " > Newfies-Dialer Installation Menu"
echo "====================================="
echo " 1) Install All"
echo " 2) Install Newfies-Dialer Web Frontend"
echo " 3) Install Newfies-Dialer Backend / Celery"
echo " 0) Quit"
echo -n "(0-3) : "
read OPTION < /dev/tty
}
# * * * * * * * * * * * * Start Script * * * * * * * * * * * *
#Identify the OS
func_identify_os
#Request the user to accept the license
func_accept_license
echo "========================================================================="
echo ""
echo "Newfies-Dialer installation will start now!"
echo ""
echo "Press Enter to continue or CTRL-C to exit"
echo ""
read INPUT
func_install_frontend
func_install_landing_page
func_install_backend
# ExitFinish=0
# while [ $ExitFinish -eq 0 ]; do
# # Show menu with Installation items
# show_menu_newfies
# case $OPTION in
# 1)
# func_install_frontend
# func_install_landing_page
# func_install_backend
# echo done
# ;;
# 2)
# func_install_frontend
# func_install_landing_page
# ;;
# 3)
# func_install_backend
# ;;
# 0)
# ExitFinish=1
# ;;
# *)
# esac
# done
# Clean the system
#=================
# deactivate ; rm -rf /usr/share/newfies ; rm -rf /var/log/newfies ; rmvirtualenv newfies-dialer ; rm -rf /etc/init.d/newfies-celer* ; rm -rf /etc/default/newfies-celeryd ; rm /etc/apache2/sites-enabled/newfies.conf
|
Star2Billing/newfies-dialer
|
install/install-newfies.sh
|
Shell
|
mpl-2.0
| 2,920 |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* LightweightThemeListener will append the current lightweight theme's header
* image to the background-image for each of the following rulesets.
*/
/* Lightweight theme on tabs */
.tabbrowser-tab[selected="true"]:-moz-lwtheme {
background-attachment: scroll, fixed;
background-color: transparent;
background-size: calc(100% + 4px) calc(100% + 2px), auto auto;
background-position: -2px -2px, right top;
background-repeat: no-repeat, no-repeat;
background-origin: padding-box;
}
.tabbrowser-tab[selected="true"]:-moz-lwtheme-darktext{
background-image: -moz-linear-gradient(rgba(250,250,250,.875), rgba(250,250,250,.875));/*, lwtHeader;*/
}
.tabbrowser-tab[selected="true"]:-moz-lwtheme-brighttext{
text-shadow: 1px 1px 1.5px black;
background-image: -moz-linear-gradient(rgba(5,5,5,.875), rgba(5,5,5,.875));/*, lwtHeader;*/
}
.tabbrowser-tab[usercontextid][selected="true"]:-moz-lwtheme {
background-image: var(--container-gradient), var(--tabbrowser-tab-selected-background-image);/*, lwtHeader;*/
background-attachment: scroll, scroll, fixed;
background-size: auto 2px, calc(100% - 2px) calc(100% - 2px), auto auto;
background-position: 1px 2px, 1px 2px, right top;
background-origin: border-box, border-box, padding-box;
background-repeat: no-repeat, no-repeat, no-repeat;
}
|
johngraciliano/simplewhite
|
whitefox/browser/browser-lightweightTheme.css
|
CSS
|
mpl-2.0
| 1,574 |
<html>
<head>
<link rel="stylesheet" href="../../skin/help.css">
</head>
<body>
<div class="navigation">
<a class="navlink" href="about.html">About</a>
<a class="navlink" href="tutorial.html">Tutorial</a>
<span class="navsel">Options</span>
<a class="navlink" href="dialog.html">Dialog</a>
<a class="navlink" href="portable.html">Portable</a>
<a class="navlink" href="faq.html">FAQ</a>
<a class="navlink" href="changes.html">Changes</a>
<a class="navlink" href="http://wijjo.com/passhash/" target="_content">Home</a>
</div>
<h1>Security Levels</h1>
<ul>
<li>
<strong>Light</strong> maximizes convenience by guessing site tags,
remembering entries, and revealing fields as plain text. It is secure from
remote hackers, but less secure from people with physical access to your
machine and browser.
</li>
<li>
<strong>Medium</strong> improves protection by hiding the hash word and
forcing you to re-enter the master key each time. This is the default.
</li>
<li>
<strong>Heavy</strong> maximizes security by remembering nothing and hiding
everything. You must enter the site tag and master key each time and
manually unmask fields to see their content.
</li>
<li>
<strong>Custom</strong> allows you to specify individual security options.
Tip - choose light, medium or heavy before selecting custom to start with a
reasonable set of checked options.
</li>
</ul>
<h1>Display Options</h1>
<ul>
<li>
<strong>Password field markers</strong> are small
<img alt="[#]" src="../../skin/marker.png"/>
symbols inserted next to password fields for one-click access to the
Password Hasher dialog.
</li>
<li>
<strong>Password unmasking markers</strong> are small
<img alt="[*]" src="../../skin/unmask.png"/>
symbols inserted next to password fields for one-click unmasking
(revealing as plain text) of password fields.
</li>
<li>
<strong>Guess full domain</strong> causes guessed site tags to use the
entire domain name, e.g. including ".com", ".org", etc., making it
easier to have separate logins for sites sharing the same base name.
It does result in longer site tags, when you have to type them.
</li>
</ul>
<h1>Default Requirements</h1>
<p>
These settings affect the default options for assuring generated hash words
satisfy certain requirements.
</p>
<ul>
<li>
<strong>Digit</strong> forces hash words to have at least one digit
character.
</li>
<li>
<strong>Punctuation</strong> forces hash words to have at least one
punctuation character.
</li>
<li>
<strong>Both upper and lower-case letters</strong> forces hash words to
have at least one of each case letter.
</li>
</ul>
<h1>Default Size</h1>
<p>
This setting chooses the default hash word length, i.e. number of characters.
</p>
<h1>Portable Page</h1>
<p>
This button produces a self-contained/portable web page to generate hash
words when this extension is unavailable. It asks you where to save the
file and then loads it in a browser tab. More information is available
in the FAQ, the <a href="portable.html">Portable</a> help page, and notes
on the bottom of the generated portable page.
</p>
</body>
</html>
|
wijjo/passhash
|
locale/en-US/options.html
|
HTML
|
mpl-2.0
| 3,624 |
pub use self::os::{timespec};
pub use self::os::{tm};
pub use self::os::{itimerspec};
pub use self::os::{CLOCKS_PER_SEC};
pub use self::os::{CLOCK_MONOTONIC};
pub use self::os::{CLOCK_PROCESS_CPUTIME_ID};
pub use self::os::{CLOCK_REALTIME};
pub use self::os::{CLOCK_THREAD_CPUTIME_ID};
pub use self::os::{TIMER_ABSTIME};
pub use self::os::{getdate_err};
use {int_t, char_t, long_t, NTStr, size_t, double_t};
use sys::types::{pid_t, clock_t, clockid_t, time_t, timer_t};
use locale::{locale_t};
use signal::{sigevent};
#[cfg(target_os = "linux")]
#[path = "linux/mod.rs"]
mod os;
pub fn clock() -> clock_t {
extern { fn clock() -> clock_t; }
unsafe { clock() }
}
pub fn clock_getcpuclockid(pid: pid_t,
clock_id: &mut clockid_t) -> int_t {
extern {
fn clock_getcpuclockid(pid: pid_t,
clock_id: *mut clockid_t) -> int_t;
}
unsafe { clock_getcpuclockid(pid, clock_id as *mut _) }
}
pub fn clock_getres(id: clockid_t, res: &mut timespec) -> int_t {
extern {
fn clock_getres(id: clockid_t, res: *mut timespec) -> int_t;
}
unsafe { clock_getres(id, res as *mut _) }
}
pub fn clock_gettime(id: clockid_t, res: &mut timespec) -> int_t {
extern {
fn clock_gettime(id: clockid_t, res: *mut timespec) -> int_t;
}
unsafe { clock_gettime(id, res as *mut _) }
}
pub fn clock_nanosleep(id: clockid_t, flags: int_t, req: ×pec,
remain: Option<&mut timespec>) -> int_t {
extern {
fn clock_nanosleep(clock_id: clockid_t, flags: int_t,
req: *const timespec, rem: *mut timespec) -> int_t;
}
match remain {
Some(p) => unsafe { clock_nanosleep(id, flags, req as *const _, p as *mut _) },
_ => unsafe { clock_nanosleep(id, flags, req as *const _, 0 as *mut _) },
}
}
pub fn clock_settime(id: clockid_t, res: ×pec) -> int_t {
extern {
fn clock_settime(id: clockid_t, res: *const timespec) -> int_t;
}
unsafe { clock_settime(id, res as *const _) }
}
pub fn difftime(time1: time_t, time0: time_t) -> f64 {
extern {
fn difftime(time1: time_t,
time0: time_t) -> double_t;
}
unsafe { difftime(time1, time0) }
}
pub fn gmtime_r(timep: &time_t, res: &mut tm) {
extern {
fn gmtime_r(timer: *const time_t, tp: *mut tm) -> *mut tm;
}
unsafe { gmtime_r(timep as *const _, res as *mut _); }
}
pub fn localtime_r(timep: &time_t, res: &mut tm) {
extern {
fn localtime_r(timer: *const time_t, tp: *mut tm) -> *mut tm;
}
unsafe { localtime_r(timep as *const _, res as *mut _); }
}
pub fn mktime(tm: &mut tm) -> time_t {
extern {
fn mktime(tp: *mut tm) -> time_t;
}
unsafe { mktime(tm as *mut _) }
}
pub fn nanosleep(req: ×pec, remain: Option<&mut timespec>) -> int_t {
extern {
fn nanosleep(req: *const timespec, rem: *mut timespec) -> int_t;
}
match remain {
Some(p) => unsafe { nanosleep(req as *const _, p as *mut _) },
_ => unsafe { nanosleep(req as *const _, 0 as *mut _) },
}
}
pub fn strftime<T: NTStr>(dst: &mut [u8], fmt: &T, tm: &tm) -> size_t {
extern {
fn strftime(s: *mut char_t, max: size_t, format: *const char_t,
tp: *const tm) -> size_t;
}
unsafe { strftime(dst.as_mut_ptr() as *mut _, dst.len() as size_t, fmt.as_ptr(),
tm as *const _) }
}
pub fn strftime_l<T: NTStr>(dst: &mut [u8], fmt: &T, tm: &tm,
locale: locale_t) -> size_t {
extern {
fn strftime_l(s: *mut char_t, max: size_t, format: *const char_t,
tp: *const tm, locale: locale_t) -> size_t;
}
unsafe { strftime_l(dst.as_mut_ptr() as *mut _, dst.len() as size_t, fmt.as_ptr(),
tm as *const _, locale) }
}
pub fn strptime<T: NTStr, U: NTStr>(src: &T, fmt: &T, dst: &mut tm) -> usize {
extern {
fn strptime(src: *const char_t, fmt: *const char_t,
dst: *mut tm) -> *mut char_t;
}
let r = unsafe { strptime(src.as_ptr(), fmt.as_ptr(), dst as *mut _) };
r as usize - src.as_ptr() as usize
}
pub fn time() -> time_t {
extern { fn time(timer: *mut time_t) -> time_t; }
unsafe { time(0 as *mut _) }
}
pub fn timer_create(id: clockid_t, evp: &mut sigevent,
timerid: &mut timer_t) -> int_t {
extern {
fn timer_create(clock_id: clockid_t, evp: *mut sigevent,
timerid: *mut timer_t) -> int_t;
}
unsafe { timer_create(id, evp as *mut _, timerid as *mut _) }
}
pub fn timer_delete(timerid: timer_t) -> int_t {
extern { fn timer_delete(timerid: timer_t) -> int_t; }
unsafe { timer_delete(timerid) }
}
pub fn timer_getoverrun(timerid: timer_t) -> int_t {
extern { fn timer_getoverrun(timerid: timer_t) -> int_t; }
unsafe { timer_getoverrun(timerid) }
}
pub fn timer_gettime(timerid: timer_t, tm: &mut itimerspec) -> int_t {
extern {
fn timer_gettime(timerid: timer_t,
value: *mut itimerspec) -> int_t;
}
unsafe { timer_gettime(timerid, tm as *mut _) }
}
pub fn timre_settime(id: timer_t, flags: int_t, v: &itimerspec,
o: Option<&mut itimerspec>) -> int_t {
extern {
fn timer_settime(timerid: timer_t, flags: int_t,
value: *const itimerspec, ovalue: *mut itimerspec) -> int_t;
}
match o {
Some(p) => unsafe { timer_settime(id, flags, v as *const _, p as *mut _) },
_ => unsafe { timer_settime(id, flags, v as *const _, 0 as *mut _) },
}
}
pub fn tzset() {
extern { fn tzset(); }
unsafe{ tzset() }
}
extern "C" {
pub static mut tzname: [*mut char_t; 2usize];
pub static mut daylight: int_t;
pub static mut timezone: long_t;
pub fn asctime(tp: *const tm) -> *mut char_t;
pub fn asctime_r(tp: *const tm, buf: *mut char_t) -> *mut char_t;
pub fn ctime(timer: *const time_t) -> *mut char_t;
pub fn ctime_r(timer: *const time_t, buf: *mut char_t) -> *mut char_t;
pub fn getdate(string: *const char_t) -> *mut tm;
pub fn gmtime(timer: *const time_t) -> *mut tm;
pub fn localtime(timer: *const time_t) -> *mut tm;
}
|
baist0/posix.rs
|
src/time/mod.rs
|
Rust
|
mpl-2.0
| 6,306 |
/*
* (C) YANDEX LLC, 2014-2016
*
* The Source Code called "YoctoDB" available at
* https://github.com/yandex/yoctodb is subject to the terms of the
* Mozilla Public License, v. 2.0 (hereinafter referred to as the "License").
*
* A copy of the License is also available at http://mozilla.org/MPL/2.0/.
*/
package com.yandex.yoctodb.util.mutable.impl;
import com.google.common.collect.TreeMultimap;
import com.yandex.yoctodb.util.mutable.IndexToIndexMultiMap;
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertTrue;
/**
* Unit tests for {@link BitSetIndexToIndexMultiMap}
*
* @author incubos
*/
public class BitSetIndexToIndexMultiMapTest {
@Test(expected = IllegalArgumentException.class)
public void negativeDocuments() {
new BitSetIndexToIndexMultiMap(
Collections.<Collection<Integer>>emptyList(),
-1);
}
@Test(expected = AssertionError.class)
public void wrongDocument() throws IOException {
new BitSetIndexToIndexMultiMap(
singletonList(singletonList(1)),
1)
.writeTo(new ByteArrayOutputStream());
}
@Test(expected = IllegalArgumentException.class)
public void negativeValue() throws IOException {
new BitSetIndexToIndexMultiMap(
singletonList(singletonList(1)),
-1)
.writeTo(new ByteArrayOutputStream());
}
@Test
public void string() {
final TreeMultimap<Integer, Integer> elements = TreeMultimap.create();
final int documents = 10;
for (int i = 0; i < documents; i++)
elements.put(i / 2, i);
final IndexToIndexMultiMap set =
new BitSetIndexToIndexMultiMap(
elements.asMap().values(),
documents);
final String text = set.toString();
assertTrue(text.contains(Integer.toString(documents / 2)));
assertTrue(text.contains(Integer.toString(documents)));
set.getSizeInBytes();
assertTrue(text.contains(Integer.toString(documents / 2)));
assertTrue(text.contains(Integer.toString(documents)));
}
}
|
incubos/yoctodb
|
core/src/test/java/com/yandex/yoctodb/util/mutable/impl/BitSetIndexToIndexMultiMapTest.java
|
Java
|
mpl-2.0
| 2,358 |
/*!
Theme: Humanoid light
Author: Thomas (tasmo) Friese
License: ~ MIT (or more permissive) [via base16-schemes-source]
Maintainer: @highlightjs/core-team
Version: 2021.05.0
*/
/*
WARNING: DO NOT EDIT THIS FILE DIRECTLY.
This theme file was auto-generated from the Base16 scheme humanoid-light
by the Highlight.js Base16 template builder.
- https://github.com/highlightjs/base16-highlightjs
*/
/*
base00 #f8f8f2 Default Background
base01 #efefe9 Lighter Background (Used for status bars, line number and folding marks)
base02 #deded8 Selection Background
base03 #c0c0bd Comments, Invisibles, Line Highlighting
base04 #60615d Dark Foreground (Used for status bars)
base05 #232629 Default Foreground, Caret, Delimiters, Operators
base06 #2f3337 Light Foreground (Not often used)
base07 #070708 Light Background (Not often used)
base08 #b0151a Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
base09 #ff3d00 Integers, Boolean, Constants, XML Attributes, Markup Link Url
base0A #ffb627 Classes, Markup Bold, Search Text Background
base0B #388e3c Strings, Inherited Class, Markup Code, Diff Inserted
base0C #008e8e Support, Regular Expressions, Escape Characters, Markup Quotes
base0D #0082c9 Functions, Methods, Attribute IDs, Headings
base0E #700f98 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #b27701 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
code.hljs {
padding: 3px 5px;
}
.hljs {
color: #232629;
background: #f8f8f2;
}
.hljs ::selection {
color: #deded8;
}
/* purposely do not highlight these things */
.hljs-formula,
.hljs-params,
.hljs-property
{}
/* base03 - #c0c0bd - Comments, Invisibles, Line Highlighting */
.hljs-comment {
color: #c0c0bd;
}
/* base04 - #60615d - Dark Foreground (Used for status bars) */
.hljs-tag {
color: #60615d;
}
/* base05 - #232629 - Default Foreground, Caret, Delimiters, Operators */
.hljs-subst,
.hljs-punctuation,
.hljs-operator {
color: #232629;
}
.hljs-operator {
opacity: 0.7;
}
/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */
.hljs-bullet,
.hljs-variable,
.hljs-template-variable,
.hljs-selector-tag,
.hljs-name,
.hljs-deletion {
color: #b0151a;
}
/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */
.hljs-symbol,
.hljs-number,
.hljs-link,
.hljs-attr,
.hljs-variable.constant_,
.hljs-literal {
color: #ff3d00;
}
/* base0A - Classes, Markup Bold, Search Text Background */
.hljs-title,
.hljs-class .hljs-title,
.hljs-title.class_
{
color: #ffb627;
}
.hljs-strong {
font-weight:bold;
color: #ffb627;
}
/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */
.hljs-code,
.hljs-addition,
.hljs-title.class_.inherited__,
.hljs-string {
color: #388e3c;
}
/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */
.hljs-built_in,
.hljs-doctag, /* guessing */
.hljs-quote,
.hljs-keyword.hljs-atrule,
.hljs-regexp {
color: #008e8e;
}
/* base0D - Functions, Methods, Attribute IDs, Headings */
.hljs-function .hljs-title,
.hljs-attribute,
.ruby .hljs-property,
.hljs-title.function_,
.hljs-section {
color: #0082c9;
}
/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */
.hljs-type,
/* .hljs-selector-id, */
/* .hljs-selector-class, */
/* .hljs-selector-attr, */
/* .hljs-selector-pseudo, */
.hljs-template-tag,
.diff .hljs-meta,
.hljs-keyword {
color: #700f98;
}
.hljs-emphasis {
color: #700f98;
font-style: italic;
}
/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?> */
.hljs-meta,
/*
prevent top level .keyword and .string scopes
from leaking into meta by accident
*/
.hljs-meta .hljs-keyword,
.hljs-meta .hljs-string
{
color: #b27701;
}
.hljs-meta .hljs-keyword,
/* for v10 compatible themes */
.hljs-meta-keyword {
font-weight: bold;
}
|
Qeole/Enlight
|
hljs/styles/base16/humanoid-light.css
|
CSS
|
mpl-2.0
| 3,967 |
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//-----------------------------------------------------------------------------
var BUGNUMBER = 462071;
var summary = 'Do not assert: !ti->stackTypeMap.matches(ti_other->stackTypeMap)';
var actual = '';
var expect = '';
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
for each (let i in [{}, 0, 0, {}, 0, {}, 0]) { }
reportCompare(expect, actual, summary);
exitFunc ('test');
}
|
cstipkovic/spidermonkey-research
|
js/src/tests/js1_7/regress/regress-462071.js
|
JavaScript
|
mpl-2.0
| 869 |
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* _ _
* _ __ ___ ___ __| | ___ ___| | mod_ssl
* | '_ ` _ \ / _ \ / _` | / __/ __| | Apache Interface to OpenSSL
* | | | | | | (_) | (_| | \__ \__ \ |
* |_| |_| |_|\___/ \__,_|___|___/___/_|
* |_____|
* ssl_expr_eval.c
* Expression Evaluation
*/
/* ``Make love,
not software!''
-- Unknown */
#include "ssl_private.h"
/* _________________________________________________________________
**
** Expression Evaluation
** _________________________________________________________________
*/
static BOOL ssl_expr_eval_comp(request_rec *, ssl_expr *);
static char *ssl_expr_eval_word(request_rec *, ssl_expr *);
static BOOL ssl_expr_eval_oid(request_rec *r, const char *word, const char *oidstr);
static char *ssl_expr_eval_func_file(request_rec *, char *);
static int ssl_expr_eval_strcmplex(char *, char *);
BOOL ssl_expr_eval(request_rec *r, ssl_expr *node)
{
switch (node->node_op) {
case op_True: {
return TRUE;
}
case op_False: {
return FALSE;
}
case op_Not: {
ssl_expr *e = (ssl_expr *)node->node_arg1;
return (!ssl_expr_eval(r, e));
}
case op_Or: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
return (ssl_expr_eval(r, e1) || ssl_expr_eval(r, e2));
}
case op_And: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
return (ssl_expr_eval(r, e1) && ssl_expr_eval(r, e2));
}
case op_Comp: {
ssl_expr *e = (ssl_expr *)node->node_arg1;
return ssl_expr_eval_comp(r, e);
}
default: {
ssl_expr_error = "Internal evaluation error: Unknown expression node";
return FALSE;
}
}
}
static BOOL ssl_expr_eval_comp(request_rec *r, ssl_expr *node)
{
switch (node->node_op) {
case op_EQ: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
return (strcmp(ssl_expr_eval_word(r, e1), ssl_expr_eval_word(r, e2)) == 0);
}
case op_NE: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
return (strcmp(ssl_expr_eval_word(r, e1), ssl_expr_eval_word(r, e2)) != 0);
}
case op_LT: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
return (ssl_expr_eval_strcmplex(ssl_expr_eval_word(r, e1), ssl_expr_eval_word(r, e2)) < 0);
}
case op_LE: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
return (ssl_expr_eval_strcmplex(ssl_expr_eval_word(r, e1), ssl_expr_eval_word(r, e2)) <= 0);
}
case op_GT: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
return (ssl_expr_eval_strcmplex(ssl_expr_eval_word(r, e1), ssl_expr_eval_word(r, e2)) > 0);
}
case op_GE: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
return (ssl_expr_eval_strcmplex(ssl_expr_eval_word(r, e1), ssl_expr_eval_word(r, e2)) >= 0);
}
case op_IN: {
ssl_expr *e1 = (ssl_expr *)node->node_arg1;
ssl_expr *e2 = (ssl_expr *)node->node_arg2;
ssl_expr *e3;
char *w1 = ssl_expr_eval_word(r, e1);
BOOL found = FALSE;
do {
ssl_expr_node_op op = e2->node_op;
e3 = (ssl_expr *)e2->node_arg1;
e2 = (ssl_expr *)e2->node_arg2;
if (op == op_OidListElement) {
char *w3 = ssl_expr_eval_word(r, e3);
found = ssl_expr_eval_oid(r, w1, w3);
/* There will be no more nodes on the list, so the result is authoritative */
break;
}
if (strcmp(w1, ssl_expr_eval_word(r, e3)) == 0) {
found = TRUE;
break;
}
} while (e2 != NULL);
return found;
}
case op_REG: {
ssl_expr *e1;
ssl_expr *e2;
char *word;
ap_regex_t *regex;
e1 = (ssl_expr *)node->node_arg1;
e2 = (ssl_expr *)node->node_arg2;
word = ssl_expr_eval_word(r, e1);
regex = (ap_regex_t *)(e2->node_arg1);
return (ap_regexec(regex, word, 0, NULL, 0) == 0);
}
case op_NRE: {
ssl_expr *e1;
ssl_expr *e2;
char *word;
ap_regex_t *regex;
e1 = (ssl_expr *)node->node_arg1;
e2 = (ssl_expr *)node->node_arg2;
word = ssl_expr_eval_word(r, e1);
regex = (ap_regex_t *)(e2->node_arg1);
return !(ap_regexec(regex, word, 0, NULL, 0) == 0);
}
default: {
ssl_expr_error = "Internal evaluation error: Unknown expression node";
return FALSE;
}
}
}
static char *ssl_expr_eval_word(request_rec *r, ssl_expr *node)
{
switch (node->node_op) {
case op_Digit: {
char *string = (char *)node->node_arg1;
return string;
}
case op_String: {
char *string = (char *)node->node_arg1;
return string;
}
case op_Var: {
char *var = (char *)node->node_arg1;
char *val = ssl_var_lookup(r->pool, r->server, r->connection, r, var);
return (val == NULL ? "" : val);
}
case op_Func: {
char *name = (char *)node->node_arg1;
ssl_expr *args = (ssl_expr *)node->node_arg2;
if (strEQ(name, "file"))
return ssl_expr_eval_func_file(r, (char *)(args->node_arg1));
else {
ssl_expr_error = "Internal evaluation error: Unknown function name";
return "";
}
}
default: {
ssl_expr_error = "Internal evaluation error: Unknown expression node";
return FALSE;
}
}
}
#define NUM_OID_ELTS 8 /* start with 8 oid slots, resize when needed */
apr_array_header_t *ssl_extlist_by_oid(request_rec *r, const char *oidstr)
{
int count = 0, j;
X509 *xs = NULL;
ASN1_OBJECT *oid;
apr_array_header_t *val_array;
SSLConnRec *sslconn = myConnConfig(r->connection);
/* trivia */
if (oidstr == NULL || sslconn == NULL || sslconn->ssl == NULL)
return NULL;
/* Determine the oid we are looking for */
if ((oid = OBJ_txt2obj(oidstr, 1)) == NULL) {
ERR_clear_error();
return NULL;
}
/* are there any extensions in the cert? */
if ((xs = SSL_get_peer_certificate(sslconn->ssl)) == NULL ||
(count = X509_get_ext_count(xs)) == 0) {
return NULL;
}
val_array = apr_array_make(r->pool, NUM_OID_ELTS, sizeof(char *));
/* Loop over all extensions, extract the desired oids */
for (j = 0; j < count; j++) {
X509_EXTENSION *ext = X509_get_ext(xs, j);
if (OBJ_cmp(ext->object, oid) == 0) {
BIO *bio = BIO_new(BIO_s_mem());
if (X509V3_EXT_print(bio, ext, 0, 0) == 1) {
BUF_MEM *buf;
char **new = apr_array_push(val_array);
BIO_get_mem_ptr(bio, &buf);
*new = apr_pstrmemdup(r->pool, buf->data, buf->length);
}
BIO_vfree(bio);
}
}
X509_free(xs);
ERR_clear_error();
if (val_array->nelts == 0)
return NULL;
else
return val_array;
}
static BOOL ssl_expr_eval_oid(request_rec *r, const char *word, const char *oidstr)
{
int j;
BOOL result = FALSE;
apr_array_header_t *oid_array;
char **oid_value;
if (NULL == (oid_array = ssl_extlist_by_oid(r, oidstr))) {
return FALSE;
}
oid_value = (char **) oid_array->elts;
for (j = 0; j < oid_array->nelts; j++) {
if (strcmp(word, oid_value[j]) == 0) {
result = TRUE;
break;
}
}
return result;
}
static char *ssl_expr_eval_func_file(request_rec *r, char *filename)
{
apr_file_t *fp;
char *buf;
apr_off_t offset;
apr_size_t len;
apr_finfo_t finfo;
if (apr_file_open(&fp, filename, APR_READ|APR_BUFFERED,
APR_OS_DEFAULT, r->pool) != APR_SUCCESS) {
ssl_expr_error = "Cannot open file";
return "";
}
apr_file_info_get(&finfo, APR_FINFO_SIZE, fp);
if ((finfo.size + 1) != ((apr_size_t)finfo.size + 1)) {
ssl_expr_error = "Huge file cannot be read";
apr_file_close(fp);
return "";
}
len = (apr_size_t)finfo.size;
if (len == 0) {
buf = (char *)apr_palloc(r->pool, sizeof(char) * 1);
*buf = NUL;
}
else {
if ((buf = (char *)apr_palloc(r->pool, sizeof(char)*(len+1))) == NULL) {
ssl_expr_error = "Cannot allocate memory";
apr_file_close(fp);
return "";
}
offset = 0;
apr_file_seek(fp, APR_SET, &offset);
if (apr_file_read(fp, buf, &len) != APR_SUCCESS) {
ssl_expr_error = "Cannot read from file";
apr_file_close(fp);
return "";
}
buf[len] = NUL;
}
apr_file_close(fp);
return buf;
}
/* a variant of strcmp(3) which works correctly also for number strings */
static int ssl_expr_eval_strcmplex(char *cpNum1, char *cpNum2)
{
int i, n1, n2;
if (cpNum1 == NULL)
return -1;
if (cpNum2 == NULL)
return +1;
n1 = strlen(cpNum1);
n2 = strlen(cpNum2);
if (n1 > n2)
return 1;
if (n1 < n2)
return -1;
for (i = 0; i < n1; i++) {
if (cpNum1[i] > cpNum2[i])
return 1;
if (cpNum1[i] < cpNum2[i])
return -1;
}
return 0;
}
|
mozilla/stoneridge
|
apache/src/modules/ssl/ssl_expr_eval.c
|
C
|
mpl-2.0
| 11,132 |
Uploaded files must never be executed or evaluated.
|
Jessevanbekkum/skf-flask
|
skf/markdown/checklists/52--CS_basic_audit--13--.md
|
Markdown
|
agpl-3.0
| 51 |
# HList, a hierarchial listbox widget.
use Tk::HList;
use Cwd;
use subs qw/show_dir/;
use vars qw/$TOP $FILEIMG $FOLDIMG/;
sub HList {
my($demo) = @_;
$TOP = $MW->WidgetDemo(
-name => $demo,
-text => 'HList - A hierarchial listbox widget.',
-geometry_manager => 'grid',
);
my $h = $TOP->Scrolled(qw\HList -separator / -selectmode extended -width 30
-height 20 -indent 35 -scrollbars se
-itemtype imagetext \
)->grid(qw/-sticky nsew/);
$h->configure(-command => sub {
print "Double click $_[0], size=", $h->info('data', $_[0]) ,".\n";
});
$FILEIMG = $TOP->Bitmap(-file => Tk->findINC('file.xbm'));
$FOLDIMG = $TOP->Bitmap(-file => Tk->findINC('folder.xbm'));
my $root = Tk->findINC('demos');
my $olddir = getcwd;
chdir $root;
show_dir '.', $root, $h;
chdir $olddir;
my $b = $TOP->Button(-text => 'Select All', -command => [\&select_all, $h]);
Tk::grid($b);
}
sub select_all
{
my $h = shift;
my @list = $h->infoChildren(@_);
if (@list)
{
$h->selectionSet($list[0],$list[-1]);
foreach my $e (@list)
{
select_all($h,$e);
}
}
}
sub show_dir {
my($entry_path, $text, $h) = @_;
opendir H, $entry_path;
my(@dirent) = grep ! /^\.\.?$/, sort(readdir H);
closedir H;
$h->add($entry_path, -text => $text, -image => $FOLDIMG, -data => 'DIR');
while ($_ = shift @dirent) {
my $file = "$entry_path/$_";
if (-d $file) {
show_dir $file, $_, $h;
} else {
my $size = -s $file;
$h->add($file, -text => $_, -image => $FILEIMG, -data => $size);
}
}
} # end show_dir
|
efabless/proton
|
lib64/perl5/x86_64-linux-thread-multi/Tk/demos/widget_lib/HList.pl
|
Perl
|
agpl-3.0
| 1,622 |
/*******************************************************************************
* HELIUM V, Open Source ERP software for sustained success
* at small and medium-sized enterprises.
* Copyright (C) 2004 - 2015 HELIUM V IT-Solutions GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of theLicense, or
* (at your option) any later version.
*
* According to sec. 7 of the GNU Affero General Public License, version 3,
* the terms of the AGPL are supplemented with the following terms:
*
* "HELIUM V" and "HELIUM 5" are registered trademarks of
* HELIUM V IT-Solutions GmbH. The licensing of the program under the
* AGPL does not imply a trademark license. Therefore any rights, title and
* interest in our trademarks remain entirely with us. If you want to propagate
* modified versions of the Program under the name "HELIUM V" or "HELIUM 5",
* you may only do so if you have a written permission by HELIUM V IT-Solutions
* GmbH (to acquire a permission please contact HELIUM V IT-Solutions
* at [email protected]).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contact: [email protected]
******************************************************************************/
package com.lp.client.zutritt;
import com.lp.client.pc.LPMain;
import com.lp.client.util.fastlanereader.gui.QueryType;
import com.lp.server.personal.service.ZutrittscontrollerFac;
import com.lp.server.util.Facade;
import com.lp.server.util.fastlanereader.service.query.FilterKriterium;
import com.lp.server.util.fastlanereader.service.query.FilterKriteriumDirekt;
@SuppressWarnings("static-access")
public class ZutrittFilterFactory
{
private static ZutrittFilterFactory filterFactory = null;
private ZutrittFilterFactory() {
// Singleton.
}
static public ZutrittFilterFactory getInstance() {
if (filterFactory == null) {
filterFactory = new ZutrittFilterFactory();
}
return filterFactory;
}
/**
* Filterkriterium fuer Filter "mandant_c_nr".
*
* @return FilterKriterium[] die Filter Kriterien
* @throws Throwable
*/
public FilterKriterium[] createFKZutrittsklasse(boolean bHauptmandat)
throws Throwable {
FilterKriterium[] kriterien = null;
if(bHauptmandat){
return null;} else{
kriterien = new FilterKriterium[1];
FilterKriterium krit1 = new FilterKriterium(
"mandant_c_nr",
true,
"'" + LPMain.getInstance().getTheClient().getMandant() + "'",
FilterKriterium.OPERATOR_EQUAL, false);
kriterien[0] = krit1;
}
return kriterien;
}
/**
* Filterkriterium fuer Filter "mandant_c_nr_objekt".
*
* @return FilterKriterium[] die Filter Kriterien
* @throws Throwable
*/
public FilterKriterium[] createFKZutrittsprotokoll(boolean bHauptmandat)
throws Throwable {
FilterKriterium[] kriterien = null;
if(bHauptmandat){
return null;
} else{
kriterien = new FilterKriterium[1];
FilterKriterium krit1 = new FilterKriterium(
ZutrittscontrollerFac.FLR_ZUTRITTSLOG_MANDANT_C_NR_OBJEKT,
true,
"'" + LPMain.getInstance().getTheClient().getMandant() + "'",
FilterKriterium.OPERATOR_EQUAL, false);
kriterien[0] = krit1;
}
return kriterien;
}
public FilterKriterium[] createFKDaueroffen()
throws Throwable {
FilterKriterium[] kriterien = null;
kriterien = new FilterKriterium[1];
FilterKriterium krit1 = new FilterKriterium(
ZutrittscontrollerFac.FLR_ZUTRITTDAUEROFFEN_FLRZUTRITTSOBJEKT+ ".mandant_c_nr",
true,
"'" + LPMain.getInstance().getTheClient().getMandant() + "'",
FilterKriterium.OPERATOR_EQUAL, false);
kriterien[0] = krit1;
return kriterien;
}
public FilterKriterium[] createFKZutrittmodelltag(Integer zutrittmodell_i_id) {
FilterKriterium[] kriterien = new FilterKriterium[1];
FilterKriterium krit1 = new FilterKriterium(ZutrittscontrollerFac.
FLR_ZUTRITTSMODELLTAG_FLRZUTRITTSMODELL + ".i_id",
true,
zutrittmodell_i_id + "",
FilterKriterium.OPERATOR_EQUAL, false);
kriterien[0] = krit1;
return kriterien;
}
public FilterKriterium[] createFKZutrittsobjektverwendung(Integer zutrittsobjektIId) {
FilterKriterium[] kriterien = new FilterKriterium[1];
kriterien[0] = new FilterKriterium(ZutrittscontrollerFac.
FLR_ZUTRITTSOBJEKTVERWENDUNG_FLRZUTRITTSOBJEKT+".i_id",
true,
zutrittsobjektIId + "",
FilterKriterium.OPERATOR_EQUAL, false);
return kriterien;
}
public FilterKriterium[] createFKZutrittsklasseobjekt(Integer zutrittsklasse_i_id) {
FilterKriterium[] kriterien = new FilterKriterium[1];
FilterKriterium krit1 = new FilterKriterium(ZutrittscontrollerFac.
FLR_ZUTRITTSKLASSEOBJEKT_ZUTRITTSKLASSE_I_ID,
true,
zutrittsklasse_i_id + "",
FilterKriterium.OPERATOR_EQUAL, false);
kriterien[0] = krit1;
return kriterien;
}
public FilterKriterium[] createFKZutrittsmodelltagdetail(Integer zutrittmodelltag_i_id) {
FilterKriterium[] kriterien = new FilterKriterium[1];
FilterKriterium krit1 = new FilterKriterium(ZutrittscontrollerFac.
FLR_ZUTRITTSMODELLTAGDETAIL_FLRZUTRITTSMODELLTAG +
".i_id",
true,
zutrittmodelltag_i_id + "",
FilterKriterium.OPERATOR_EQUAL, false);
kriterien[0] = krit1;
return kriterien;
}
/**
* Filterkriterium fuer Filter "mandant_c_nr".
*
* @return FilterKriterium[] die Filter Kriterien
* @throws Throwable
*/
public FilterKriterium[] createFKMandantCNr()
throws Throwable {
FilterKriterium[] kriterien = new FilterKriterium[1];
FilterKriterium krit1 = new FilterKriterium(
"mandant_c_nr",
true,
"'" + LPMain.getInstance().getTheClient().getMandant() + "'",
FilterKriterium.OPERATOR_EQUAL, false);
kriterien[0] = krit1;
return kriterien;
}
public FilterKriteriumDirekt createFKDZutrittslogObjekt()
throws Throwable {
return new FilterKriteriumDirekt(
ZutrittscontrollerFac.FLR_ZUTRITTSLOG_C_ZUTRITTSOBJEKT,
"",
FilterKriterium.OPERATOR_LIKE,
LPMain.getInstance().getTextRespectUISPr("pers.zutritt.zutrittsobjekt"),
FilterKriteriumDirekt.PROZENT_TRAILING,
true, true, Facade.MAX_UNBESCHRAENKT);
}
public FilterKriteriumDirekt createFKDZutrittslogPersonal()
throws Throwable {
return new FilterKriteriumDirekt(
ZutrittscontrollerFac.FLR_ZUTRITTSLOG_C_PERSON,
"",
FilterKriterium.OPERATOR_LIKE,
LPMain.getInstance().getTextRespectUISPr("label.personal"),
FilterKriteriumDirekt.PROZENT_BOTH,
true, true, Facade.MAX_UNBESCHRAENKT);
}
public FilterKriteriumDirekt createFKDZutrittsklasseobjektObjekt()
throws Throwable {
return new FilterKriteriumDirekt(
ZutrittscontrollerFac.FLR_ZUTRITTSKLASSEOBJEKT_FLRZUTRITTSOBJEKT+".c_nr",
"",
FilterKriterium.OPERATOR_LIKE,
LPMain.getInstance().getTextRespectUISPr("pers.zutritt.zutrittsobjekt"),
FilterKriteriumDirekt.PROZENT_LEADING,
true, true, Facade.MAX_UNBESCHRAENKT);
}
public FilterKriteriumDirekt createFKDZutrittsklasseobjektModell()
throws Throwable {
return new FilterKriteriumDirekt(
ZutrittscontrollerFac.FLR_ZUTRITTSKLASSEOBJEKT_FLRZUTRITTSMODELL+".c_nr",
"",
FilterKriterium.OPERATOR_LIKE,
LPMain.getInstance().getTextRespectUISPr("pers.zutritt.zutrittsmodell"),
FilterKriteriumDirekt.PROZENT_LEADING,
true, true, Facade.MAX_UNBESCHRAENKT);
}
public QueryType[] createQTZutrittsmodell() {
QueryType[] types = new QueryType[1];
FilterKriterium f1 = new FilterKriterium("c_nr", true, "",
FilterKriterium.OPERATOR_LIKE, true);
types[0] = new QueryType(LPMain.getInstance().getTextRespectUISPr("lp.zeitmodell"),
f1,
new String[] {
FilterKriterium.OPERATOR_EQUAL}
,
true, true);
return types;
}
}
|
erdincay/lpclientpc
|
src/com/lp/client/zutritt/ZutrittFilterFactory.java
|
Java
|
agpl-3.0
| 9,447 |
<?php
require_once dirname(__FILE__) . '/accesscheck.php';
## fetch updated translation
#var_dump($LANGUAGES);
if (!Sql_Table_exists($GLOBALS['tables']['i18n'])) {
include dirname(__FILE__) . '/structure.php';
Sql_Create_Table($GLOBALS['tables']['i18n'], $DBstruct['i18n']);
}
if (isset($_GET['lan'])) { ## Non-JS version
include 'actions/updatetranslation.php';
}
$force = !empty($_GET['force']);
$LU = getTranslationUpdates();
if (!$LU || !is_object($LU)) {
print Error(s('Unable to fetch list of languages, please check your network or try again later'));
return;
}
#var_dump($LU);
print '<ul>';
foreach ($LU->translation as $lan) {
# var_dump($lan);
$lastupdated = getConfig('lastlanguageupdate-' . $lan->iso);
if (!empty($LANGUAGES[(string)$lan->iso])) {
$lan_name = $LANGUAGES[(string)$lan->iso][0];
} else {
$lan_name = $lan->name;
}
if ($force || ($lan->iso == $_SESSION['adminlanguage']['iso'] && $lan->lastmodified > $lastupdated)) {
$updateLink = pageLinkAjax('updatetranslation&lan=' . $lan->iso, $lan_name);
} else {
$updateLink = $lan_name;
}
if (empty($lastupdated)) {
$lastupdated = s('Never');
} else {
$lastupdated = date('Y-m-d', $lastupdated);
}
$count = Sql_Fetch_Row_Query(sprintf('select count(*) from %s where lan = "%s" and original = "language-name"',
$tables['i18n'], $lan->iso));
if ($count[0] == 0) {
## insert a dummy translation entry, so to record the language
# print '<h1>'.$count[0].'</h1>';
Sql_Query(sprintf('insert into %s (lan,original,translation) values("%s","%s","%s")', $tables['i18n'],
$lan->iso, 'language-name', $lan->name));
}
if ($lan->iso == $_SESSION['adminlanguage']['iso']) {
printf('<li><strong>%s %s: %s, %s: %s</strong></li>', $updateLink, s('Last updated'), $lastupdated,
s('Last modified'), date('Y-m-d', (int)$lan->lastmodified));
} else {
printf('<li>%s %s: %s, %s: %s</li>', $updateLink, s('Last updated'), $lastupdated, s('Last modified'),
date('Y-m-d', (int)$lan->lastmodified));
}
}
print '</ul>';
|
tarekdj/phplist3
|
public_html/lists/admin/updatetranslation.php
|
PHP
|
agpl-3.0
| 2,185 |
/*
* RapidMiner
*
* Copyright (C) 2001-2014 by RapidMiner and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapidminer.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.rapidminer.gui.tools.dialogs.wizards.dataimport.csv;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
/**
* A helper class for reading line based data formats
*
* @author Tobias Malbrecht
*/
public class LineReader {
private BufferedReader reader = null;
public LineReader(File file) throws FileNotFoundException {
reader = new BufferedReader((new InputStreamReader(new FileInputStream(file))));
}
public LineReader(File file, Charset encoding) throws FileNotFoundException {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));
}
public LineReader(InputStream stream, Charset encoding) {
reader = new BufferedReader(new InputStreamReader(stream, encoding));
}
public String readLine() throws IOException {
return reader.readLine();
}
public void close() throws IOException {
reader.close();
}
}
|
rapidminer/rapidminer-5
|
src/com/rapidminer/gui/tools/dialogs/wizards/dataimport/csv/LineReader.java
|
Java
|
agpl-3.0
| 1,940 |
/*
* jPOS Project [http://jpos.org]
* Copyright (C) 2000-2015 Alejandro P. Revilla
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.jpos.iso;
/**
* Channels that can use socket factories need to implement this.
*
* @author <a href="mailto:[email protected]">Alwyn Schoeman</a>
* @version $Revision$ $Date$
*/
public interface FactoryChannel {
/**
* @param sfac a socket factory
*/
public void setSocketFactory(ISOClientSocketFactory sfac);
}
|
imam-san/jPOS-1
|
jpos/src/main/java/org/jpos/iso/FactoryChannel.java
|
Java
|
agpl-3.0
| 1,113 |
//#############################################################################
//# #
//# Copyright (C) <2015> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.scheduling.vo;
/**
* Linked to Scheduling.Booking_Appointment business object (ID: 1055100007).
*/
public class AppointmentUndoClockImpactVo extends ims.scheduling.vo.Booking_AppointmentRefVo implements ims.vo.ImsCloneable, Comparable
{
private static final long serialVersionUID = 1L;
public AppointmentUndoClockImpactVo()
{
}
public AppointmentUndoClockImpactVo(Integer id, int version)
{
super(id, version);
}
public AppointmentUndoClockImpactVo(ims.scheduling.vo.beans.AppointmentUndoClockImpactVoBean bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.appointmentdate = bean.getAppointmentDate() == null ? null : bean.getAppointmentDate().buildDate();
this.apptstarttime = bean.getApptStartTime() == null ? null : bean.getApptStartTime().buildTime();
this.apptstatus = bean.getApptStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatus());
this.apptstatusreas = bean.getApptStatusReas() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatusReas());
this.bookedrttclockimpact = bean.getBookedRTTClockImpact() == null ? null : new ims.pathways.vo.PathwaysRTTClockImpactRefVo(new Integer(bean.getBookedRTTClockImpact().getId()), bean.getBookedRTTClockImpact().getVersion());
}
public void populate(ims.vo.ValueObjectBeanMap map, ims.scheduling.vo.beans.AppointmentUndoClockImpactVoBean bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.appointmentdate = bean.getAppointmentDate() == null ? null : bean.getAppointmentDate().buildDate();
this.apptstarttime = bean.getApptStartTime() == null ? null : bean.getApptStartTime().buildTime();
this.apptstatus = bean.getApptStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatus());
this.apptstatusreas = bean.getApptStatusReas() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatusReas());
this.bookedrttclockimpact = bean.getBookedRTTClockImpact() == null ? null : new ims.pathways.vo.PathwaysRTTClockImpactRefVo(new Integer(bean.getBookedRTTClockImpact().getId()), bean.getBookedRTTClockImpact().getVersion());
}
public ims.vo.ValueObjectBean getBean()
{
return this.getBean(new ims.vo.ValueObjectBeanMap());
}
public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
{
ims.scheduling.vo.beans.AppointmentUndoClockImpactVoBean bean = null;
if(map != null)
bean = (ims.scheduling.vo.beans.AppointmentUndoClockImpactVoBean)map.getValueObjectBean(this);
if (bean == null)
{
bean = new ims.scheduling.vo.beans.AppointmentUndoClockImpactVoBean();
map.addValueObjectBean(this, bean);
bean.populate(map, this);
}
return bean;
}
public Object getFieldValueByFieldName(String fieldName)
{
if(fieldName == null)
throw new ims.framework.exceptions.CodingRuntimeException("Invalid field name");
fieldName = fieldName.toUpperCase();
if(fieldName.equals("APPOINTMENTDATE"))
return getAppointmentDate();
if(fieldName.equals("APPTSTARTTIME"))
return getApptStartTime();
if(fieldName.equals("APPTSTATUS"))
return getApptStatus();
if(fieldName.equals("APPTSTATUSREAS"))
return getApptStatusReas();
if(fieldName.equals("BOOKEDRTTCLOCKIMPACT"))
return getBookedRTTClockImpact();
return super.getFieldValueByFieldName(fieldName);
}
public boolean getAppointmentDateIsNotNull()
{
return this.appointmentdate != null;
}
public ims.framework.utils.Date getAppointmentDate()
{
return this.appointmentdate;
}
public void setAppointmentDate(ims.framework.utils.Date value)
{
this.isValidated = false;
this.appointmentdate = value;
}
public boolean getApptStartTimeIsNotNull()
{
return this.apptstarttime != null;
}
public ims.framework.utils.Time getApptStartTime()
{
return this.apptstarttime;
}
public void setApptStartTime(ims.framework.utils.Time value)
{
this.isValidated = false;
this.apptstarttime = value;
}
public boolean getApptStatusIsNotNull()
{
return this.apptstatus != null;
}
public ims.scheduling.vo.lookups.Status_Reason getApptStatus()
{
return this.apptstatus;
}
public void setApptStatus(ims.scheduling.vo.lookups.Status_Reason value)
{
this.isValidated = false;
this.apptstatus = value;
}
public boolean getApptStatusReasIsNotNull()
{
return this.apptstatusreas != null;
}
public ims.scheduling.vo.lookups.Status_Reason getApptStatusReas()
{
return this.apptstatusreas;
}
public void setApptStatusReas(ims.scheduling.vo.lookups.Status_Reason value)
{
this.isValidated = false;
this.apptstatusreas = value;
}
public boolean getBookedRTTClockImpactIsNotNull()
{
return this.bookedrttclockimpact != null;
}
public ims.pathways.vo.PathwaysRTTClockImpactRefVo getBookedRTTClockImpact()
{
return this.bookedrttclockimpact;
}
public void setBookedRTTClockImpact(ims.pathways.vo.PathwaysRTTClockImpactRefVo value)
{
this.isValidated = false;
this.bookedrttclockimpact = value;
}
public boolean isValidated()
{
if(this.isBusy)
return true;
this.isBusy = true;
if(!this.isValidated)
{
this.isBusy = false;
return false;
}
this.isBusy = false;
return true;
}
public String[] validate()
{
return validate(null);
}
public String[] validate(String[] existingErrors)
{
if(this.isBusy)
return null;
this.isBusy = true;
java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
if(existingErrors != null)
{
for(int x = 0; x < existingErrors.length; x++)
{
listOfErrors.add(existingErrors[x]);
}
}
int errorCount = listOfErrors.size();
if(errorCount == 0)
{
this.isBusy = false;
this.isValidated = true;
return null;
}
String[] result = new String[errorCount];
for(int x = 0; x < errorCount; x++)
result[x] = (String)listOfErrors.get(x);
this.isBusy = false;
this.isValidated = false;
return result;
}
public void clearIDAndVersion()
{
this.id = null;
this.version = 0;
}
public Object clone()
{
if(this.isBusy)
return this;
this.isBusy = true;
AppointmentUndoClockImpactVo clone = new AppointmentUndoClockImpactVo(this.id, this.version);
if(this.appointmentdate == null)
clone.appointmentdate = null;
else
clone.appointmentdate = (ims.framework.utils.Date)this.appointmentdate.clone();
if(this.apptstarttime == null)
clone.apptstarttime = null;
else
clone.apptstarttime = (ims.framework.utils.Time)this.apptstarttime.clone();
if(this.apptstatus == null)
clone.apptstatus = null;
else
clone.apptstatus = (ims.scheduling.vo.lookups.Status_Reason)this.apptstatus.clone();
if(this.apptstatusreas == null)
clone.apptstatusreas = null;
else
clone.apptstatusreas = (ims.scheduling.vo.lookups.Status_Reason)this.apptstatusreas.clone();
clone.bookedrttclockimpact = this.bookedrttclockimpact;
clone.isValidated = this.isValidated;
this.isBusy = false;
return clone;
}
public int compareTo(Object obj)
{
return compareTo(obj, true);
}
public int compareTo(Object obj, boolean caseInsensitive)
{
if (obj == null)
{
return -1;
}
if(caseInsensitive); // this is to avoid eclipse warning only.
if (!(AppointmentUndoClockImpactVo.class.isAssignableFrom(obj.getClass())))
{
throw new ClassCastException("A AppointmentUndoClockImpactVo object cannot be compared an Object of type " + obj.getClass().getName());
}
if (this.id == null)
return 1;
if (((AppointmentUndoClockImpactVo)obj).getBoId() == null)
return -1;
return this.id.compareTo(((AppointmentUndoClockImpactVo)obj).getBoId());
}
public synchronized static int generateValueObjectUniqueID()
{
return ims.vo.ValueObject.generateUniqueID();
}
public int countFieldsWithValue()
{
int count = 0;
if(this.appointmentdate != null)
count++;
if(this.apptstarttime != null)
count++;
if(this.apptstatus != null)
count++;
if(this.apptstatusreas != null)
count++;
if(this.bookedrttclockimpact != null)
count++;
return count;
}
public int countValueObjectFields()
{
return 5;
}
protected ims.framework.utils.Date appointmentdate;
protected ims.framework.utils.Time apptstarttime;
protected ims.scheduling.vo.lookups.Status_Reason apptstatus;
protected ims.scheduling.vo.lookups.Status_Reason apptstatusreas;
protected ims.pathways.vo.PathwaysRTTClockImpactRefVo bookedrttclockimpact;
private boolean isValidated = false;
private boolean isBusy = false;
}
|
FreudianNM/openMAXIMS
|
Source Library/openmaxims_workspace/ValueObjects/src/ims/scheduling/vo/AppointmentUndoClockImpactVo.java
|
Java
|
agpl-3.0
| 10,875 |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.sName" );
/* This has no effect at all in DOM methods - so we just check that it has applied the name */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"bServerSide": true,
"sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
"aoColumns": [
null,
null,
null,
{ "sName": 'unit test' },
null
]
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
"Names are stored in the columns object",
null,
function () { return oSettings.aoColumns[3].sName =="unit test"; }
);
oTest.fnComplete();
} );
|
DannyArends/genenetwork2
|
wqflask/wqflask/static/new/packages/DataTables/unit_testing/tests_onhold/4_server-side/aoColumns.sName.js
|
JavaScript
|
agpl-3.0
| 669 |
<?php
// Start of xsl v.0.1
/**
* @link https://php.net/manual/en/class.xsltprocessor.php
*/
class XSLTProcessor {
/**
* Import stylesheet
* @link https://php.net/manual/en/xsltprocessor.importstylesheet.php
* @param object $stylesheet <p>
* The imported style sheet as a <b>DOMDocument</b> or
* <b>SimpleXMLElement</b> object.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function importStylesheet ($stylesheet) {}
/**
* Transform to a DOMDocument
* @link https://php.net/manual/en/xsltprocessor.transformtodoc.php
* @param DOMNode $doc <p>
* The node to be transformed.
* </p>
* @return DOMDocument|false The resulting <b>DOMDocument</b> or <b>FALSE</b> on error.
*/
public function transformToDoc (DOMNode $doc) {}
/**
* Transform to URI
* @link https://php.net/manual/en/xsltprocessor.transformtouri.php
* @param DOMDocument|SimpleXMLElement $doc <p>
* The document to transform.
* </p>
* @param string $uri <p>
* The target URI for the transformation.
* </p>
* @return int|false the number of bytes written or <b>FALSE</b> if an error occurred.
*/
public function transformToUri ($doc, $uri) {}
/**
* Transform to XML
* @link https://php.net/manual/en/xsltprocessor.transformtoxml.php
* @param DOMDocument|SimpleXMLElement $doc <p>
* The transformed document.
* </p>
* @return string|false The result of the transformation as a string or <b>FALSE</b> on error.
*/
public function transformToXml ($doc) {}
/**
* Set value for a parameter
* @link https://php.net/manual/en/xsltprocessor.setparameter.php
* @param string $namespace <p>
* The namespace URI of the XSLT parameter.
* </p>
* @param string $name <p>
* The local name of the XSLT parameter.
* </p>
* @param string $value <p>
* The new value of the XSLT parameter.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function setParameter ($namespace, $name, $value) {}
/**
* Get value of a parameter
* @link https://php.net/manual/en/xsltprocessor.getparameter.php
* @param string $namespaceURI <p>
* The namespace URI of the XSLT parameter.
* </p>
* @param string $localName <p>
* The local name of the XSLT parameter.
* </p>
* @return string|false The value of the parameter (as a string), or <b>FALSE</b> if it's not set.
*/
public function getParameter ($namespaceURI, $localName) {}
/**
* Remove parameter
* @link https://php.net/manual/en/xsltprocessor.removeparameter.php
* @param string $namespaceURI <p>
* The namespace URI of the XSLT parameter.
* </p>
* @param string $localName <p>
* The local name of the XSLT parameter.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function removeParameter ($namespaceURI, $localName) {}
/**
* Determine if PHP has EXSLT support
* @link https://php.net/manual/en/xsltprocessor.hasexsltsupport.php
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 5.0.4
*/
public function hasExsltSupport () {}
/**
* Enables the ability to use PHP functions as XSLT functions
* @link https://php.net/manual/en/xsltprocessor.registerphpfunctions.php
* @param mixed $restrict [optional] <p>
* Use this parameter to only allow certain functions to be called from
* XSLT.
* </p>
* <p>
* This parameter can be either a string (a function name) or an array of
* functions.
* </p>
* @return void No value is returned.
* @since 5.0.4
*/
public function registerPHPFunctions ($restrict = null) {}
/**
* Sets profiling output file
* @link https://php.net/manual/en/xsltprocessor.setprofiling.php
* @param string $filename <p>
* Path to the file to dump profiling information.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function setProfiling ($filename) {}
/**
* Set security preferences
* @link https://php.net/manual/en/xsltprocessor.setsecurityprefs.php
* @param int $securityPrefs
* @return int
* @since 5.4
*/
public function setSecurityPrefs ($securityPrefs) {}
/**
* Get security preferences
* @link https://php.net/manual/en/xsltprocessor.getsecurityprefs.php
* @return int
* @since 5.4
*/
public function getSecurityPrefs () {}
}
define ('XSL_CLONE_AUTO', 0);
define ('XSL_CLONE_NEVER', -1);
define ('XSL_CLONE_ALWAYS', 1);
/** @link https://php.net/manual/en/xsl.constants.php */
define ('XSL_SECPREF_NONE', 0);
/** @link https://php.net/manual/en/xsl.constants.php */
define ('XSL_SECPREF_READ_FILE', 2);
/** @link https://php.net/manual/en/xsl.constants.php */
define ('XSL_SECPREF_WRITE_FILE', 4);
/** @link https://php.net/manual/en/xsl.constants.php */
define ('XSL_SECPREF_CREATE_DIRECTORY', 8);
/** @link https://php.net/manual/en/xsl.constants.php */
define ('XSL_SECPREF_READ_NETWORK', 16);
/** @link https://php.net/manual/en/xsl.constants.php */
define ('XSL_SECPREF_WRITE_NETWORK', 32);
/** @link https://php.net/manual/en/xsl.constants.php */
define ('XSL_SECPREF_DEFAULT', 44);
/**
* libxslt version like 10117. Available as of PHP 5.1.2.
* @link https://php.net/manual/en/xsl.constants.php
*/
define ('LIBXSLT_VERSION', 10128);
/**
* libxslt version like 1.1.17. Available as of PHP 5.1.2.
* @link https://php.net/manual/en/xsl.constants.php
*/
define ('LIBXSLT_DOTTED_VERSION', "1.1.28");
/**
* libexslt version like 813. Available as of PHP 5.1.2.
* @link https://php.net/manual/en/xsl.constants.php
*/
define ('LIBEXSLT_VERSION', 817);
/**
* libexslt version like 1.1.17. Available as of PHP 5.1.2.
* @link https://php.net/manual/en/xsl.constants.php
*/
define ('LIBEXSLT_DOTTED_VERSION', "1.1.28");
// End of xsl v.0.1
?>
|
andreas-p/nextcloud-server
|
build/stubs/xsl.php
|
PHP
|
agpl-3.0
| 5,767 |
angular.module('main').
directive('fudgedYear', [function() {
return {
restrict: 'E',
templateUrl: 'templates/main/ftrees/fudged-year.html',
scope: true,
scope: {
searchParam: '=',
labelTextEn: '@',
labelTextHe: '@'
},
link: function(scope, element, attrs) {
var parts;
scope.fudge_options = [
{id: '0', label: {'en': 'exact', 'he': 'תאריך מדויק'}},
{id: '1', label: {'en': '+/- year', 'he': 'טווח שנים: 1 +/-'}},
{id: '2', label: {'en': '+/-2 years', 'he': 'טווח שנים: 2 +/-'}}
];
if (scope.searchParam) {
parts = scope.searchParam.split(':');
}
else {
parts = [undefined, '2']
}
parts[0] = parseInt(parts[0]) || undefined;
function joinParts(scope, parts) {
if (scope.fudge.id > 0 && !isNaN(scope.year))
return parts.join(':')
else
return parts[0];
}
Object.defineProperty(scope, 'year', {
get: function() {
return parts[0];
},
set: function(newVal) {
parts[0] = newVal;
if(!newVal) {
scope.searchParam = '';
}
else {
scope.searchParam = joinParts(scope, parts);
}
}
});
Object.defineProperty(scope, 'fudge', {
get: function() {
return scope.fudge_options[parseInt(parts[1]||0)];
},
set: function(newVal) {
parts[1] = newVal.id;
scope.searchParam = joinParts(scope, parts);
}
});
}
};
}]);
|
Beit-Hatfutsot/dbs-front
|
js/modules/main/src/directives/fudgedYearDirective.js
|
JavaScript
|
agpl-3.0
| 1,488 |
<template name="MasterLayout">
{{> Navbar}}
{{> yield}}
</template>
|
bdunnette/quizzling
|
app/client/templates/layouts/master_layout/master_layout.html
|
HTML
|
agpl-3.0
| 72 |
//#############################################################################
//# #
//# Copyright (C) <2015> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//# #
//#############################################################################
//#EOH
/*
* This code was generated
* Copyright (C) 1995-2004 IMS MAXIMS plc. All rights reserved.
* IMS Development Environment (version 1.80 build 5589.25814)
* WARNING: DO NOT MODIFY the content of this file
* Generated: 12/10/2015, 13:28
*
*/
package ims.nursing.assessmenttools.domain.objects;
/**
*
* @author Sinead McDermott
* Generated.
*/
public class MiniNutritionalAssessmentDetails extends ims.domain.DomainObject implements java.io.Serializable {
public static final int CLASSID = 1013100001;
private static final long serialVersionUID = 1013100001L;
public static final String CLASSVERSION = "${ClassVersion}";
@Override
public boolean shouldCapQuery()
{
return true;
}
private Integer assessment;
private Boolean select;
public MiniNutritionalAssessmentDetails (Integer id, int ver)
{
super(id, ver);
}
public MiniNutritionalAssessmentDetails ()
{
super();
}
public MiniNutritionalAssessmentDetails (Integer id, int ver, Boolean includeRecord)
{
super(id, ver, includeRecord);
}
public Class getRealDomainClass()
{
return ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessmentDetails.class;
}
public Integer getAssessment() {
return assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public Boolean isSelect() {
return select;
}
public void setSelect(Boolean select) {
this.select = select;
}
/**
* isConfigurationObject
* Taken from the Usage property of the business object, this method will return
* a boolean indicating whether this is a configuration object or not
* Configuration = true, Instantiation = false
*/
public static boolean isConfigurationObject()
{
if ( "Instantiation".equals("Configuration") )
return true;
else
return false;
}
public int getClassId() {
return CLASSID;
}
public String getClassVersion()
{
return CLASSVERSION;
}
public String toAuditString()
{
StringBuffer auditStr = new StringBuffer();
auditStr.append("\r\n*assessment* :");
auditStr.append(assessment);
auditStr.append("; ");
auditStr.append("\r\n*select* :");
auditStr.append(select);
auditStr.append("; ");
return auditStr.toString();
}
public String toXMLString()
{
return toXMLString(new java.util.HashMap());
}
public String toXMLString(java.util.HashMap domMap)
{
StringBuffer sb = new StringBuffer();
sb.append("<class type=\"" + this.getClass().getName() + "\" ");
sb.append(" id=\"" + this.getId() + "\"");
sb.append(" source=\"" + ims.configuration.EnvironmentConfig.getImportExportSourceName() + "\" ");
sb.append(" classVersion=\"" + this.getClassVersion() + "\" ");
sb.append(" component=\"" + this.getIsComponentClass() + "\" >");
if (domMap.get(this) == null)
{
domMap.put(this, this);
sb.append(this.fieldsToXMLString(domMap));
}
sb.append("</class>");
String keyClassName = "MiniNutritionalAssessmentDetails";
String externalSource = ims.configuration.EnvironmentConfig.getImportExportSourceName();
ims.configuration.ImportedObject impObj = (ims.configuration.ImportedObject)domMap.get(keyClassName + "_" + externalSource + "_" + this.getId());
if (impObj == null)
{
impObj = new ims.configuration.ImportedObject();
impObj.setExternalId(this.getId());
impObj.setExternalSource(externalSource);
impObj.setDomainObject(this);
impObj.setLocalId(this.getId());
impObj.setClassName(keyClassName);
domMap.put(keyClassName + "_" + externalSource + "_" + this.getId(), impObj);
}
return sb.toString();
}
public String fieldsToXMLString(java.util.HashMap domMap)
{
StringBuffer sb = new StringBuffer();
if (this.getAssessment() != null)
{
sb.append("<assessment>");
sb.append(ims.framework.utils.StringUtils.encodeXML(this.getAssessment().toString()));
sb.append("</assessment>");
}
if (this.isSelect() != null)
{
sb.append("<select>");
sb.append(ims.framework.utils.StringUtils.encodeXML(this.isSelect().toString()));
sb.append("</select>");
}
return sb.toString();
}
public static java.util.List fromListXMLString(org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.List list, java.util.HashMap domMap) throws Exception
{
if (list == null)
list = new java.util.ArrayList();
fillListFromXMLString(list, el, factory, domMap);
return list;
}
public static java.util.Set fromSetXMLString(org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.Set set, java.util.HashMap domMap) throws Exception
{
if (set == null)
set = new java.util.HashSet();
fillSetFromXMLString(set, el, factory, domMap);
return set;
}
private static void fillSetFromXMLString(java.util.Set set, org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.HashMap domMap) throws Exception
{
if (el == null)
return;
java.util.List cl = el.elements("class");
int size = cl.size();
java.util.Set newSet = new java.util.HashSet();
for(int i=0; i<size; i++)
{
org.dom4j.Element itemEl = (org.dom4j.Element)cl.get(i);
MiniNutritionalAssessmentDetails domainObject = getMiniNutritionalAssessmentDetailsfromXML(itemEl, factory, domMap);
if (domainObject == null)
{
continue;
}
//Trying to avoid the hibernate collection being marked as dirty via its public interface methods. (like add)
if (!set.contains(domainObject))
set.add(domainObject);
newSet.add(domainObject);
}
java.util.Set removedSet = new java.util.HashSet();
java.util.Iterator iter = set.iterator();
//Find out which objects need to be removed
while (iter.hasNext())
{
ims.domain.DomainObject o = (ims.domain.DomainObject)iter.next();
if ((o == null || o.getIsRIE() == null || !o.getIsRIE().booleanValue()) && !newSet.contains(o))
{
removedSet.add(o);
}
}
iter = removedSet.iterator();
//Remove the unwanted objects
while (iter.hasNext())
{
set.remove(iter.next());
}
}
private static void fillListFromXMLString(java.util.List list, org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.HashMap domMap) throws Exception
{
if (el == null)
return;
java.util.List cl = el.elements("class");
int size = cl.size();
for(int i=0; i<size; i++)
{
org.dom4j.Element itemEl = (org.dom4j.Element)cl.get(i);
MiniNutritionalAssessmentDetails domainObject = getMiniNutritionalAssessmentDetailsfromXML(itemEl, factory, domMap);
if (domainObject == null)
{
continue;
}
int domIdx = list.indexOf(domainObject);
if (domIdx == -1)
{
list.add(i, domainObject);
}
else if (i != domIdx && i < list.size())
{
Object tmp = list.get(i);
list.set(i, list.get(domIdx));
list.set(domIdx, tmp);
}
}
//Remove all ones in domList where index > voCollection.size() as these should
//now represent the ones removed from the VO collection. No longer referenced.
int i1=list.size();
while (i1 > size)
{
list.remove(i1-1);
i1=list.size();
}
}
public static MiniNutritionalAssessmentDetails getMiniNutritionalAssessmentDetailsfromXML(String xml, ims.domain.DomainFactory factory, java.util.HashMap domMap) throws Exception
{
org.dom4j.Document doc = new org.dom4j.io.SAXReader().read(new org.xml.sax.InputSource(xml));
return getMiniNutritionalAssessmentDetailsfromXML(doc.getRootElement(), factory, domMap);
}
public static MiniNutritionalAssessmentDetails getMiniNutritionalAssessmentDetailsfromXML(org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.HashMap domMap) throws Exception
{
if (el == null)
return null;
String className = el.attributeValue("type");
if (!MiniNutritionalAssessmentDetails.class.getName().equals(className))
{
Class clz = Class.forName(className);
if (!MiniNutritionalAssessmentDetails.class.isAssignableFrom(clz))
throw new Exception("Element of type = " + className + " cannot be imported using the MiniNutritionalAssessmentDetails class");
String shortClassName = className.substring(className.lastIndexOf(".")+1);
String methodName = "get" + shortClassName + "fromXML";
java.lang.reflect.Method m = clz.getMethod(methodName, new Class[]{org.dom4j.Element.class, ims.domain.DomainFactory.class, java.util.HashMap.class});
return (MiniNutritionalAssessmentDetails)m.invoke(null, new Object[]{el, factory, domMap});
}
String impVersion = el.attributeValue("classVersion");
if(!impVersion.equals(MiniNutritionalAssessmentDetails.CLASSVERSION))
{
throw new Exception("Incompatible class structure found. Cannot import instance.");
}
MiniNutritionalAssessmentDetails ret = null;
int extId = Integer.parseInt(el.attributeValue("id"));
String externalSource = el.attributeValue("source");
ret = (MiniNutritionalAssessmentDetails)factory.getImportedDomainObject(MiniNutritionalAssessmentDetails.class, externalSource, extId);
if (ret == null)
{
ret = new MiniNutritionalAssessmentDetails();
}
String keyClassName = "MiniNutritionalAssessmentDetails";
ims.configuration.ImportedObject impObj = (ims.configuration.ImportedObject)domMap.get(keyClassName + "_" + externalSource + "_" + extId);
if (impObj != null)
{
return (MiniNutritionalAssessmentDetails)impObj.getDomainObject();
}
else
{
impObj = new ims.configuration.ImportedObject();
impObj.setExternalId(extId);
impObj.setExternalSource(externalSource);
impObj.setDomainObject(ret);
domMap.put(keyClassName + "_" + externalSource + "_" + extId, impObj);
}
fillFieldsfromXML(el, factory, ret, domMap);
return ret;
}
public static void fillFieldsfromXML(org.dom4j.Element el, ims.domain.DomainFactory factory, MiniNutritionalAssessmentDetails obj, java.util.HashMap domMap) throws Exception
{
org.dom4j.Element fldEl;
fldEl = el.element("assessment");
if(fldEl != null)
{
obj.setAssessment(new Integer(fldEl.getTextTrim()));
}
fldEl = el.element("select");
if(fldEl != null)
{
obj.setSelect(new Boolean(fldEl.getTextTrim()));
}
}
public static String[] getCollectionFields()
{
return new String[]{
};
}
public static class FieldNames
{
public static final String ID = "id";
public static final String Assessment = "assessment";
public static final String Select = "select";
}
}
|
FreudianNM/openMAXIMS
|
Source Library/openmaxims_workspace/DomainObjects/src/ims/nursing/assessmenttools/domain/objects/MiniNutritionalAssessmentDetails.java
|
Java
|
agpl-3.0
| 12,648 |
<?php
// Copyright (C) 2010-2012 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Localized data
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('EN US', 'English', 'English', array(
'Menu:ChangeManagement' => 'Change management',
'Menu:Change:Overview' => 'Overview',
'Menu:Change:Overview+' => '',
'Menu:NewChange' => 'New change',
'Menu:NewChange+' => 'Create a new change ticket',
'Menu:SearchChanges' => 'Search for changes',
'Menu:SearchChanges+' => 'Search for change tickets',
'Menu:Change:Shortcuts' => 'Shortcuts',
'Menu:Change:Shortcuts+' => '',
'Menu:WaitingAcceptance' => 'Changes awaiting acceptance',
'Menu:WaitingAcceptance+' => '',
'Menu:WaitingApproval' => 'Changes awaiting approval',
'Menu:WaitingApproval+' => '',
'Menu:Changes' => 'Open changes',
'Menu:Changes+' => 'All open changes',
'Menu:MyChanges' => 'Changes assigned to me',
'Menu:MyChanges+' => 'Changes assigned to me (as Agent)',
'UI-ChangeManagementOverview-ChangeByCategory-last-7-days' => 'Changes by category for the last 7 days',
'UI-ChangeManagementOverview-Last-7-days' => 'Number of changes for the last 7 days',
'UI-ChangeManagementOverview-ChangeByDomain-last-7-days' => 'Changes by domain for the last 7 days',
'UI-ChangeManagementOverview-ChangeByStatus-last-7-days' => 'Changes by status for the last 7 days',
));
// Dictionnay conventions
// Class:<class_name>
// Class:<class_name>+
// Class:<class_name>/Attribute:<attribute_code>
// Class:<class_name>/Attribute:<attribute_code>+
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+
// Class:<class_name>/Stimulus:<stimulus_code>
// Class:<class_name>/Stimulus:<stimulus_code>+
//
// Class: Change
//
Dict::Add('EN US', 'English', 'English', array(
'Class:Change' => 'Change',
'Class:Change+' => '',
'Class:Change/Attribute:status' => 'Status',
'Class:Change/Attribute:status+' => '',
'Class:Change/Attribute:status/Value:new' => 'New',
'Class:Change/Attribute:status/Value:new+' => '',
'Class:Change/Attribute:status/Value:validated' => 'Validated',
'Class:Change/Attribute:status/Value:validated+' => '',
'Class:Change/Attribute:status/Value:rejected' => 'Rejected',
'Class:Change/Attribute:status/Value:rejected+' => '',
'Class:Change/Attribute:status/Value:assigned' => 'Assigned',
'Class:Change/Attribute:status/Value:assigned+' => '',
'Class:Change/Attribute:status/Value:plannedscheduled' => 'Planned and scheduled',
'Class:Change/Attribute:status/Value:plannedscheduled+' => '',
'Class:Change/Attribute:status/Value:approved' => 'Approved',
'Class:Change/Attribute:status/Value:approved+' => '',
'Class:Change/Attribute:status/Value:notapproved' => 'Not approved',
'Class:Change/Attribute:status/Value:notapproved+' => '',
'Class:Change/Attribute:status/Value:implemented' => 'Implemented',
'Class:Change/Attribute:status/Value:implemented+' => '',
'Class:Change/Attribute:status/Value:monitored' => 'Monitored',
'Class:Change/Attribute:status/Value:monitored+' => '',
'Class:Change/Attribute:status/Value:closed' => 'Closed',
'Class:Change/Attribute:status/Value:closed+' => '',
'Class:Change/Attribute:reason' => 'Reject reason',
'Class:Change/Attribute:reason+' => '',
'Class:Change/Attribute:requestor_id' => 'Requestor',
'Class:Change/Attribute:requestor_id+' => '',
'Class:Change/Attribute:requestor_email' => 'Requestor email',
'Class:Change/Attribute:requestor_email+' => '',
'Class:Change/Attribute:creation_date' => 'Creation date',
'Class:Change/Attribute:creation_date+' => '',
'Class:Change/Attribute:impact' => 'Impact',
'Class:Change/Attribute:impact+' => '',
'Class:Change/Attribute:supervisor_group_id' => 'Supervisor team',
'Class:Change/Attribute:supervisor_group_id+' => '',
'Class:Change/Attribute:supervisor_group_name' => 'Supervisor team name',
'Class:Change/Attribute:supervisor_group_name+' => '',
'Class:Change/Attribute:supervisor_id' => 'Supervisor',
'Class:Change/Attribute:supervisor_id+' => '',
'Class:Change/Attribute:supervisor_email' => 'Supervisor email',
'Class:Change/Attribute:supervisor_email+' => '',
'Class:Change/Attribute:manager_group_id' => 'Manager team',
'Class:Change/Attribute:manager_group_id+' => '',
'Class:Change/Attribute:manager_group_name' => 'Manager team name',
'Class:Change/Attribute:manager_group_name+' => '',
'Class:Change/Attribute:manager_id' => 'Manager',
'Class:Change/Attribute:manager_id+' => '',
'Class:Change/Attribute:manager_email' => 'Manager email',
'Class:Change/Attribute:manager_email+' => '',
'Class:Change/Attribute:outage' => 'Outage',
'Class:Change/Attribute:outage+' => '',
'Class:Change/Attribute:outage/Value:no' => 'No',
'Class:Change/Attribute:outage/Value:no+' => '',
'Class:Change/Attribute:outage/Value:yes' => 'Yes',
'Class:Change/Attribute:outage/Value:yes+' => '',
'Class:Change/Attribute:fallback' => 'Fallback plan',
'Class:Change/Attribute:fallback+' => '',
'Class:Change/Attribute:parent_id' => 'Parent change',
'Class:Change/Attribute:parent_id+' => '',
'Class:Change/Attribute:parent_name' => 'Parent change Ref',
'Class:Change/Attribute:parent_name+' => '',
'Class:Change/Attribute:related_request_list' => 'Related requests',
'Class:Change/Attribute:related_request_list+' => 'All the user requests linked to this change',
'Class:Change/Attribute:related_problems_list' => 'Related problems',
'Class:Change/Attribute:related_problems_list+' => 'All the problems linked to this change',
'Class:Change/Attribute:related_incident_list' => 'Related incidents',
'Class:Change/Attribute:related_incident_list+' => 'All the incidents linked to this change',
'Class:Change/Attribute:child_changes_list' => 'Child changes',
'Class:Change/Attribute:child_changes_list+' => 'All the sub changes linked to this change',
'Class:Change/Attribute:parent_id_friendlyname' => 'Parent friendly name',
'Class:Change/Attribute:parent_id_friendlyname+' => '',
'Class:Change/Attribute:parent_id_finalclass_recall' => 'Change type',
'Class:Change/Attribute:parent_id_finalclass_recall+' => '',
'Class:Change/Stimulus:ev_validate' => 'Validate',
'Class:Change/Stimulus:ev_validate+' => '',
'Class:Change/Stimulus:ev_reject' => 'Reject',
'Class:Change/Stimulus:ev_reject+' => '',
'Class:Change/Stimulus:ev_assign' => 'Assign',
'Class:Change/Stimulus:ev_assign+' => '',
'Class:Change/Stimulus:ev_reopen' => 'Reopen',
'Class:Change/Stimulus:ev_reopen+' => '',
'Class:Change/Stimulus:ev_plan' => 'Plan',
'Class:Change/Stimulus:ev_plan+' => '',
'Class:Change/Stimulus:ev_approve' => 'Approve',
'Class:Change/Stimulus:ev_approve+' => '',
'Class:Change/Stimulus:ev_replan' => 'Replan',
'Class:Change/Stimulus:ev_replan+' => '',
'Class:Change/Stimulus:ev_notapprove' => 'Reject',
'Class:Change/Stimulus:ev_notapprove+' => '',
'Class:Change/Stimulus:ev_implement' => 'Implement',
'Class:Change/Stimulus:ev_implement+' => '',
'Class:Change/Stimulus:ev_monitor' => 'Monitor',
'Class:Change/Stimulus:ev_monitor+' => '',
'Class:Change/Stimulus:ev_finish' => 'Finish',
'Class:Change/Stimulus:ev_finish+' => '',
));
//
// Class: RoutineChange
//
Dict::Add('EN US', 'English', 'English', array(
'Class:RoutineChange' => 'Routine Change',
'Class:RoutineChange+' => '',
'Class:RoutineChange/Stimulus:ev_validate' => 'Validate',
'Class:RoutineChange/Stimulus:ev_validate+' => '',
'Class:RoutineChange/Stimulus:ev_reject' => 'Reject',
'Class:RoutineChange/Stimulus:ev_reject+' => '',
'Class:RoutineChange/Stimulus:ev_assign' => 'Assign',
'Class:RoutineChange/Stimulus:ev_assign+' => '',
'Class:RoutineChange/Stimulus:ev_reopen' => 'Reopen',
'Class:RoutineChange/Stimulus:ev_reopen+' => '',
'Class:RoutineChange/Stimulus:ev_plan' => 'Plan',
'Class:RoutineChange/Stimulus:ev_plan+' => '',
'Class:RoutineChange/Stimulus:ev_approve' => 'Approve',
'Class:RoutineChange/Stimulus:ev_approve+' => '',
'Class:RoutineChange/Stimulus:ev_replan' => 'Replan',
'Class:RoutineChange/Stimulus:ev_replan+' => '',
'Class:RoutineChange/Stimulus:ev_notapprove' => 'Do Not Approve',
'Class:RoutineChange/Stimulus:ev_notapprove+' => '',
'Class:RoutineChange/Stimulus:ev_implement' => 'Implement',
'Class:RoutineChange/Stimulus:ev_implement+' => '',
'Class:RoutineChange/Stimulus:ev_monitor' => 'Monitor',
'Class:RoutineChange/Stimulus:ev_monitor+' => '',
'Class:RoutineChange/Stimulus:ev_finish' => 'Finish',
'Class:RoutineChange/Stimulus:ev_finish+' => '',
));
//
// Class: ApprovedChange
//
Dict::Add('EN US', 'English', 'English', array(
'Class:ApprovedChange' => 'Approved Changes',
'Class:ApprovedChange+' => '',
'Class:ApprovedChange/Attribute:approval_date' => 'Approval Date',
'Class:ApprovedChange/Attribute:approval_date+' => '',
'Class:ApprovedChange/Attribute:approval_comment' => 'Approval comment',
'Class:ApprovedChange/Attribute:approval_comment+' => '',
'Class:ApprovedChange/Stimulus:ev_validate' => 'Validate',
'Class:ApprovedChange/Stimulus:ev_validate+' => '',
'Class:ApprovedChange/Stimulus:ev_reject' => 'Reject',
'Class:ApprovedChange/Stimulus:ev_reject+' => '',
'Class:ApprovedChange/Stimulus:ev_assign' => 'Assign',
'Class:ApprovedChange/Stimulus:ev_assign+' => '',
'Class:ApprovedChange/Stimulus:ev_reopen' => 'Reopen',
'Class:ApprovedChange/Stimulus:ev_reopen+' => '',
'Class:ApprovedChange/Stimulus:ev_plan' => 'Plan',
'Class:ApprovedChange/Stimulus:ev_plan+' => '',
'Class:ApprovedChange/Stimulus:ev_approve' => 'Approve',
'Class:ApprovedChange/Stimulus:ev_approve+' => '',
'Class:ApprovedChange/Stimulus:ev_replan' => 'Replan',
'Class:ApprovedChange/Stimulus:ev_replan+' => '',
'Class:ApprovedChange/Stimulus:ev_notapprove' => 'Reject approval',
'Class:ApprovedChange/Stimulus:ev_notapprove+' => '',
'Class:ApprovedChange/Stimulus:ev_implement' => 'Implement',
'Class:ApprovedChange/Stimulus:ev_implement+' => '',
'Class:ApprovedChange/Stimulus:ev_monitor' => 'Monitor',
'Class:ApprovedChange/Stimulus:ev_monitor+' => '',
'Class:ApprovedChange/Stimulus:ev_finish' => 'Finish',
'Class:ApprovedChange/Stimulus:ev_finish+' => '',
));
//
// Class: NormalChange
//
Dict::Add('EN US', 'English', 'English', array(
'Class:NormalChange' => 'Normal Change',
'Class:NormalChange+' => '',
'Class:NormalChange/Attribute:acceptance_date' => 'Acceptance date',
'Class:NormalChange/Attribute:acceptance_date+' => '',
'Class:NormalChange/Attribute:acceptance_comment' => 'Acceptance comment',
'Class:NormalChange/Attribute:acceptance_comment+' => '',
'Class:NormalChange/Stimulus:ev_validate' => 'Validate',
'Class:NormalChange/Stimulus:ev_validate+' => '',
'Class:NormalChange/Stimulus:ev_reject' => 'Reject',
'Class:NormalChange/Stimulus:ev_reject+' => '',
'Class:NormalChange/Stimulus:ev_assign' => 'Assign',
'Class:NormalChange/Stimulus:ev_assign+' => '',
'Class:NormalChange/Stimulus:ev_reopen' => 'Reopen',
'Class:NormalChange/Stimulus:ev_reopen+' => '',
'Class:NormalChange/Stimulus:ev_plan' => 'Plan',
'Class:NormalChange/Stimulus:ev_plan+' => '',
'Class:NormalChange/Stimulus:ev_approve' => 'Approve',
'Class:NormalChange/Stimulus:ev_approve+' => '',
'Class:NormalChange/Stimulus:ev_replan' => 'Replan',
'Class:NormalChange/Stimulus:ev_replan+' => '',
'Class:NormalChange/Stimulus:ev_notapprove' => 'Reject approval',
'Class:NormalChange/Stimulus:ev_notapprove+' => '',
'Class:NormalChange/Stimulus:ev_implement' => 'Implement',
'Class:NormalChange/Stimulus:ev_implement+' => '',
'Class:NormalChange/Stimulus:ev_monitor' => 'Monitor',
'Class:NormalChange/Stimulus:ev_monitor+' => '',
'Class:NormalChange/Stimulus:ev_finish' => 'Finish',
'Class:NormalChange/Stimulus:ev_finish+' => '',
));
//
// Class: EmergencyChange
//
Dict::Add('EN US', 'English', 'English', array(
'Class:EmergencyChange' => 'Emergency Change',
'Class:EmergencyChange+' => '',
'Class:EmergencyChange/Stimulus:ev_validate' => 'Validate',
'Class:EmergencyChange/Stimulus:ev_validate+' => '',
'Class:EmergencyChange/Stimulus:ev_reject' => 'Reject',
'Class:EmergencyChange/Stimulus:ev_reject+' => '',
'Class:EmergencyChange/Stimulus:ev_assign' => 'Assign',
'Class:EmergencyChange/Stimulus:ev_assign+' => '',
'Class:EmergencyChange/Stimulus:ev_reopen' => 'Reopen',
'Class:EmergencyChange/Stimulus:ev_reopen+' => '',
'Class:EmergencyChange/Stimulus:ev_plan' => 'Plan',
'Class:EmergencyChange/Stimulus:ev_plan+' => '',
'Class:EmergencyChange/Stimulus:ev_approve' => 'Approve',
'Class:EmergencyChange/Stimulus:ev_approve+' => '',
'Class:EmergencyChange/Stimulus:ev_replan' => 'Replan',
'Class:EmergencyChange/Stimulus:ev_replan+' => '',
'Class:EmergencyChange/Stimulus:ev_notapprove' => 'Reject approval',
'Class:EmergencyChange/Stimulus:ev_notapprove+' => '',
'Class:EmergencyChange/Stimulus:ev_implement' => 'Implement',
'Class:EmergencyChange/Stimulus:ev_implement+' => '',
'Class:EmergencyChange/Stimulus:ev_monitor' => 'Monitor',
'Class:EmergencyChange/Stimulus:ev_monitor+' => '',
'Class:EmergencyChange/Stimulus:ev_finish' => 'Finish',
'Class:EmergencyChange/Stimulus:ev_finish+' => '',
));
?>
|
dflaven/itop
|
datamodels/2.x/itop-change-mgmt-itil/en.dict.itop-change-mgmt-itil.php
|
PHP
|
agpl-3.0
| 14,138 |
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
#define playerMenuDialog 55500
#define playerMenuPlayerSkin 55501
#define playerMenuPlayerGun 55502
#define playerMenuPlayerItems 55503
#define playerMenuPlayerPos 55504
#define playerMenuPlayerList 55505
#define playerMenuSpectateButton 55506
#define playerMenuPlayerObject 55507
#define playerMenuPlayerHealth 55508
#define playerMenuWarnMessage 55509
#define playerMenuPlayerUID 55510
class PlayersMenu
{
idd = playerMenuDialog;
movingEnable = false;
enableSimulation = true;
class controlsBackground {
class MainBackground: w_RscPicture
{
idc = -1;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0,0,0,0};
text = "#(argb,8,8,3)color(0,0,0,0.6)";
x = 0.1875 * safezoneW + safezoneX;
y = 0.15 * safezoneH + safezoneY;
w = 0.60 * safezoneW;
h = 0.661111 * safezoneH;
};
class TopBar: w_RscPicture
{
idc = -1;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0,0,0,0};
text = "#(argb,8,8,3)color(0.45,0.005,0,1)";
x = 0.1875 * safezoneW + safezoneX;
y = 0.15 * safezoneH + safezoneY;
w = 0.60 * safezoneW;
h = 0.05 * safezoneH;
};
class DialogTitleText: w_RscText
{
idc = -1;
text = "Player Menu";
font = "PuristaMedium";
sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
x = 0.20 * safezoneW + safezoneX;
y = 0.155 * safezoneH + safezoneY;
w = 0.0844792 * safezoneW;
h = 0.0448148 * safezoneH;
};
class PlayerUIDText: w_RscText
{
idc = playerMenuPlayerUID;
text = "UID:";
sizeEx = 0.030;
x = 0.52 * safezoneW + safezoneX;
y = 0.215 * safezoneH + safezoneY;
w = 0.25 * safezoneW;
h = 0.04 * safezoneH;
};
class PlayerObjectText: w_RscText
{
idc = playerMenuPlayerObject;
text = "Slot:";
sizeEx = 0.030;
x = 0.52 * safezoneW + safezoneX;
y = 0.235 * safezoneH + safezoneY;
w = 0.25 * safezoneW;
h = 0.04 * safezoneH;
};
class PlayerSkinText: w_RscText
{
idc = playerMenuPlayerSkin;
text = "Skin:";
sizeEx = 0.030;
x = 0.52 * safezoneW + safezoneX;
y = 0.255 * safezoneH + safezoneY;
w = 0.25 * safezoneW;
h = 0.04 * safezoneH;
};
class PlayerGunText: w_RscText
{
idc = playerMenuPlayerGun;
text = "Money:";
sizeEx = 0.030;
x = 0.52 * safezoneW + safezoneX;
y = 0.275 * safezoneH + safezoneY;
w = 0.25 * safezoneW;
h = 0.04 * safezoneH;
};
class PlayerItemsText: w_RscText
{
idc = playerMenuPlayerItems;
text = "Items:";
sizeEx = 0.030;
x = 0.52 * safezoneW + safezoneX;
y = 0.295 * safezoneH + safezoneY;
w = 0.40 * safezoneW;
h = 0.04 * safezoneH;
};
class PlayerHealthText: w_RscText
{
idc = playerMenuPlayerHealth;
text = "Health:";
sizeEx = 0.030;
x = 0.52 * safezoneW + safezoneX;
y = 0.315 * safezoneH + safezoneY;
w = 0.25 * safezoneW;
h = 0.04 * safezoneH;
};
class PlayerPosistionText: w_RscText
{
idc = playerMenuPlayerPos;
text = "Position:";
sizeEx = 0.030;
x = 0.52 * safezoneW + safezoneX;
y = 0.335 * safezoneH + safezoneY;
w = 0.25 * safezoneW;
h = 0.04 * safezoneH;
};
};
class controls {
class PlayerEditBox:w_RscEdit
{
idc=playerMenuWarnMessage;
x = 0.60 * safezoneW + safezoneX;
y = 0.745 * safezoneH + safezoneY;
w = 0.175 * safezoneW;
h = 0.045 * safezoneH;
colorDisabled[] = {1,1,1,0.3};
};
class PlayerListBox: w_RscList
{
idc = playerMenuPlayerList;
onLBSelChanged="[2,_this select 1] execVM ""client\systems\adminPanel\importvalues.sqf"";";
x = 0.2 * safezoneW + safezoneX;
y = 0.225 * safezoneH + safezoneY;
w = 0.315 * safezoneW;
h = 0.45 * safezoneH;
};
class SpectateButton: w_RscButton
{
idc = playerMenuSpectateButton;
text = "Spectate";
onButtonClick = "[0] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.2 * safezoneW + safezoneX;
y = 0.70 * safezoneH + safezoneY;
w = 0.05 * safezoneW;
h = 0.04 * safezoneH;
};
/* class SlayButton: w_RscButton
{
idc = -1;
text = "Slay";
onButtonClick = "[2] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.2 * safezoneW + safezoneX;
y = 0.748 * safezoneH + safezoneY;
w = 0.05 * safezoneW;
h = 0.04 * safezoneH;
};*/
class UnlockTeamSwitchButton: w_RscButton
{
idc = -1;
text = "Unlock Team Switch";
onButtonClick = "[3] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.255 * safezoneW + safezoneX;
y = 0.70 * safezoneH + safezoneY;
w = 0.11 * safezoneW;
h = 0.04 * safezoneH;
};
class UnlockTeamKillerButton: w_RscButton
{
idc = -1;
text = "Unlock Team Kill";
onButtonClick = "[4] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.255 * safezoneW + safezoneX;
y = 0.748 * safezoneH + safezoneY;
w = 0.11 * safezoneW;
h = 0.04 * safezoneH;
};
class RemoveAllMoneyButton: w_RscButton
{
idc = -1;
text = "Remove Money";
onButtonClick = "[5] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.3705 * safezoneW + safezoneX;
y = 0.70 * safezoneH + safezoneY;
w = 0.105 * safezoneW;
h = 0.04 * safezoneH;
};
/*class RemoveAllWeaponsButton: w_RscButton
{
idc = -1;
text = "Remove Weapons";
onButtonClick = "[6] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.3705 * safezoneW + safezoneX;
y = 0.748 * safezoneH + safezoneY;
w = 0.105 * safezoneW;
h = 0.04 * safezoneH;
};*/
/*class CheckPlayerGearButton: w_RscButton
{
idc = -1;
text = "Gear";
onButtonClick = "[7] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.482 * safezoneW + safezoneX;
y = 0.748 * safezoneH + safezoneY;
w = 0.05 * safezoneW;
h = 0.04 * safezoneH;
};*/
class WarnButton: w_RscButton
{
idc = -1;
text = "Warn";
onButtonClick = "[1] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.600 * safezoneW + safezoneX;
y = 0.70 * safezoneH + safezoneY;
w = 0.05 * safezoneW;
h = 0.04 * safezoneH;
};
/*class DonationButton: w_RscButton
{
idc = -1;
text = "Donation";
onButtonClick = "[8] execVM 'client\systems\adminPanel\playerSelect.sqf'";
x = 0.655 * safezoneW + safezoneX;
y = 0.70 * safezoneH + safezoneY;
w = 0.05 * safezoneW;
h = 0.04 * safezoneH;
};*/
};
};
|
jeskr/ArmA3_Wasteland_1.1e.Stratis-master-150701
|
client/systems/adminPanel/dialog/playerMenu.hpp
|
C++
|
agpl-3.0
| 6,595 |
/*
* RapidMiner
*
* Copyright (C) 2001-2014 by RapidMiner and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapidminer.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.rapidminer.operator.features.transformation;
import java.io.Serializable;
/**
* This class holds information about one eigenvector and eigenvalue.
*
* @author Ingo Mierswa
*/
public interface ComponentVector extends Comparable<ComponentVector>, Serializable {
public double[] getVector();
public double getEigenvalue();
}
|
rapidminer/rapidminer-5
|
src/com/rapidminer/operator/features/transformation/ComponentVector.java
|
Java
|
agpl-3.0
| 1,231 |
<?php
/*
* Copyright 2007-2017 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <https://pydio.com>.
*/
// spanish translation: Ion Rey Bakaikoa <[email protected]>, 2010
// spanish corrections: Cristóbal Sabroe Yde <cristyde at gmail.com>, 2010
// spanish translation: Salva Gómez <salva.gomez at gmail.com>, 2015
$mess=array(
"title"=> "Inicio",
"desc" => "Página de bienvenida",
"39"=> "Seleccione un repositorio",
"40"=> "Bienvenido/a, %s",
"41"=> "Usar este repositorio por defecto",
"42"=> "Entrar",
"43"=> "Mi perfil",
"43t"=> "Todos mis datos personales",
"44"=> "Mi cuenta",
"45"=> "Datos personales",
"46"=> "Libreta de direcciones",
"47"=> "Usuarios y equipos que ha creado",
"48"=> "Mis usuarios",
"49"=> "Usuarios externos que ha creado",
"50"=> "Mis equipos",
"51"=> "Equipos de usuarios, usados como accesos directos al compartir",
"52"=> "¿Está seguro de que desea eliminar este equipo? Esta acción no eliminará ningún usuario.",
"53"=> "Empezando",
"54"=> "Comience con APPLICATION_TITLE siguiendo estos videos How-to",
"55"=> "¿Necesita ayuda para <a>empezar?</a>",
"56"=> "¿Primeros pasos con APPLICATION_TITLE? ¡Aquí tiene algunos videos!",
"57"=> "Descargar APPLICATION_TITLE para...",
"58"=> "Android",
"59"=> "iPhone/iPad",
"60"=>"Mac OS (Beta)",
"61"=>"Windows (Beta)",
"62"=> "<h2>¿Qué es un Workspace?</h2>
Este vídeo explica que son los Workspaces en APPLICATION_TITLE
<ul>
<li>¿Por qué APPLICATION_TITLE se centra en los Workspaces?</li>
<li>¿Qué son los Workspaces desde una perspectiva técnica?</li>
<li>¿Cómo te permiten organizar tus datos?</li>
</ul>
",
"63"=> "<h2>Subir archivos a APPLICATION_TITLE</h2>
Cómo subir archivos a APPLICATION_TITLE
<ul>
<li>Arrastra y suelta archivos en APPLICATION_TITLE</li>
<li>Crear un nuevo directorio</li>
<li>Renombrar archivos y directorios</li>
<li>Descargar archivos en tu ordenador</li>
</ul>
",
"64"=> "<h2>Busca, explora y gestiona tus archivos</h2>
Este vídeo muestra varios consejos para gestionar tus archivos en APPLICATION_TITLE
<ul>
<li>Barra de búsqueda para todos los Workspaces</li>
<li>Modos de visualización de contenidos, Atajos de teclado</li>
<li>Ordenar archivos</li>
<li>Metadatos, Favoritos</li>
</ul>
",
"79"=> "<h2>Compartiendo archivos y carpetas</h2>
Este tutorial muestra como compartir archivos y carpetas interna o externamente
<ul>
<li>Creando enlaces para compartir externamente</li>
<li>Compartiendo archivos y directorios con colaboradores internos</li>
<li>Compartiendo un directorio como Workspace</li>
<li>Opciones de disposición para directorios compartidos</li>
<li>Creando un directorio «blind drop»</li>
<li>Gestionando usuarios y permisos de archivos compartidos</li>
</ul>
",
"80"=> "<h2>Compartiendo: seguridad</h2>
Este video muestra opciones para compartir que ayudaran a hacer más seguros tus intercambios
<ul>
<li>Protección con contraseña</li>
<li>Tiempo de expiración</li>
<li>Limitar el número de descargas</li>
</ul>
",
"81"=> "<h2>Personaliza tus enlaces</h2>
Aprende como personalizar la URL de tus enlaces de intercambio para hacerlos más amigables
",
"82"=> "<h2>Shared links custom rights</h2>
Este vídeo muestra como gestionar los permisos de tus archivos compartidos
<ul>
<li>Previsualizar</li>
<li>Descargar</li>
<li>Subir / Editar</li>
</ul>
",
"83"=> "<h2>Idioma</h2>
APPLICATION_TITLE está disponible en 28 idiomas. Este vídeo muestra como cambiar el idioma de APPLICATION_TITLE
",
"84"=> "<h2>Alertas</h2>
Aprende como configurar alertas en un archivo para ver cuando se modifica o se consulta.
Learn how to set alerts on a file, in order to see when it has been modified or consulted.
",
"85"=> "<h2>Edición Colaborativa</h2>
Este vídeo muestra como colaborar en documentos Office gracias a Collabora Online Office Suite
<ul>
<li>Trabaja con documentos de texto, presentaciónes y tablas</li>
<li>Edita documentos de forma colaborativa en tiempo real</li>
<li>Crear documentos nuevos desde tu navegador</li>
</ul>
",
"65"=> "¡Descubre más en el canal de APPLICATION_TITLE!",
"66"=>"<h2>Usar APPLICATION_TITLE en dispositivos iOS</h2>
Este video muestra como usar la aplicación APPLICATION_TITLE (disponible en el App Store). El proceso es bastante similar en Android.
<ul>
<li>Configurar la conexión del servidor</li>
<li>Navegar a través de los archivos</li>
<li>Mantener los archivos fuera de línea y la interacción con aplicaciones externas</li>
<li>Protegiendo la aplicación mediante un código PIN</li>
<li>Usando marcadores y el motor de búsqueda</li></ul>",
"67"=> "¿No eres %s? %logout",
"68"=> "Descargar el Cliente de Sincronización para Windows",
"69"=> "Descargar el Cliente de Sincronización para Mac",
"70"=> "Descargar la aplicación nativa para dispositivos iOS",
"71"=> "Descargar la aplicación nativa para dispositivos Android",
"72" => "QRCode del Servidor",
"73" => "Conecta fácilmente a tu aplicación móvil",
"74" => "Escanéa este QRCode con tu aplicación móvil para configurar fácilmente la conexión",
"75"=> "Buscar todos los archivos...",
"76" => "Acceder al %1 a través de el menú superior derecho",
"77" => "panel de administrador",
"78" => "Seleccionar un workspace",
"86" => "Reproducir vídeo",
"87" => "Historia Reciente",
"88" => "Suelta un archivo aquí desde tu escritorio",
"89" => "Seleccionado archivo para subir",
"90" => "Seleccionar workspace de destino",
"91" => "Archivos offline con Desktop Sync Client",
"92" => "Applications Download",
"93" => "Quick Upload",
"94" => "Video Tutorial",
);
|
pydio/pydio-core
|
core/src/plugins/access.ajxp_home/res/i18n/es.php
|
PHP
|
agpl-3.0
| 7,281 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://localhost/" />
<title>CreateUser</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">CreateUser</td></tr>
</thead><tbody>
<tr>
<td>setTimeout</td>
<td>45000</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>index.php/users/default/configurationEdit?id=1</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForCondition</td>
<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
<td>30000</td>
</tr>
<tr>
<td>click</td>
<td>id=UserConfigurationForm_defaultPermissionSetting_1</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>UserConfigurationForm_defaultPermissionGroupSetting</td>
<td>label=West Channel Sales</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Save</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>index.php/users/default/configurationEdit?id=1</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForCondition</td>
<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
<td>30000</td>
</tr>
<tr>
<td>assertValue</td>
<td>id=UserConfigurationForm_defaultPermissionSetting_1</td>
<td>on</td>
</tr>
<tr>
<td>assertSelectedLabel</td>
<td>UserConfigurationForm_defaultPermissionGroupSetting</td>
<td>West Channel Sales</td>
</tr>
<tr>
<td>click</td>
<td>id=UserConfigurationForm_defaultPermissionSetting_0</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Save</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>index.php/users/default/configurationEdit?id=1</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForCondition</td>
<td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td>
<td>30000</td>
</tr>
<tr>
<td>assertValue</td>
<td>id=UserConfigurationForm_defaultPermissionSetting_0</td>
<td>on</td>
</tr>
<tr>
<td>assertSelectedLabel</td>
<td>UserConfigurationForm_defaultPermissionGroupSetting</td>
<td>East</td>
</tr>
</tbody></table>
</body>
</html>
|
jhuymaier/zurmo
|
app/protected/modules/users/tests/functional/cases/CheckDefaultPermissionsSave.html
|
HTML
|
agpl-3.0
| 2,591 |
/*
* Funambol is a mobile platform developed by Funambol, Inc.
* Copyright (C) 2003 - 2007 Funambol, Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by
* the Free Software Foundation with the addition of the following permission
* added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
* WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE
* WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License
* along with this program; if not, see http://www.gnu.org/licenses or write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA.
*
* You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite
* 305, Redwood City, CA 94063, USA, or at email address [email protected].
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License
* version 3, these Appropriate Legal Notices must retain the display of the
* "Powered by Funambol" logo. If the display of the logo is not reasonably
* feasible for technical reasons, the Appropriate Legal Notices must display
* the words "Powered by Funambol".
*/
package com.funambol.foundation.synclet;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.funambol.framework.core.*;
import com.funambol.framework.core.Map;
import com.funambol.framework.engine.pipeline.*;
import com.funambol.framework.logging.FunambolLogger;
import com.funambol.framework.logging.FunambolLoggerFactory;
import com.funambol.framework.tools.CoreUtil;
/**
* This class changes the input message client source URI with a correspondent
* server source URI
*
* This is done in order to allow any client to sync with different source URI
* using the same SyncSource. For example into phone is possible to write
* ./contact or only contact to synchorized with the same contact SyncSource.
*
* If specified an headerPatterns map, the processing is performed only if the headers
* specified in the MessageProcessinContext match with at least one entry of the
* headerPatterns that contains couples of HTTPHeader-pattern
*
* @version $Id: ChangeSourceUriSynclet.java,v 1.1.1.1 2008-03-20 21:38:42 stefano_fornari Exp $
*/
public class ChangeSourceUriSynclet
implements InputMessageProcessor, OutputMessageProcessor {
// --------------------------------------------------------------- Constants
private static final String SYNCLET_NAME =
ChangeSourceUriSynclet.class.getName();
private static final String PROPERTY_SOURCENAME_CHANGED =
"funambol.foundation.changesourcename.SOURCENAME_CHANGED";
// -------------------------------------------------------------- Properties
/** This map contains couples HTTPheader-pattern */
private java.util.Map headerPatterns = null;
public java.util.Map getHeaderPatterns() {
return headerPatterns;
}
public void setHeaderPatterns(java.util.Map headerPatterns) {
this.headerPatterns = headerPatterns;
}
// ------------------------------------------------------------ Private data
private static final FunambolLogger log =
FunambolLoggerFactory.getLogger("engine.pipeline");
private HashMap sourceNameMapping = null;
// ---------------------------------------------------------- Public methods
/**
* Process input message and set MessageProcessingContext property.
*
* @param processingContext the message processing context
* @param message the message to be processed
* @throws Sync4jException
*/
public void preProcessMessage(MessageProcessingContext processingContext,
SyncML message )
throws Sync4jException {
if (!isDeviceToProcess(processingContext)) {
return;
}
if (log.isTraceEnabled()) {
log.trace(SYNCLET_NAME + ".preProcessMessage(...)");
}
HashMap sourceReplacedMap =
(HashMap)processingContext.getSessionProperty(
PROPERTY_SOURCENAME_CHANGED);
if (sourceReplacedMap == null) {
sourceReplacedMap = new HashMap();
processingContext.setSessionProperty(PROPERTY_SOURCENAME_CHANGED,
sourceReplacedMap );
}
//
// Store and change the source uri into commands
//
manageInputAlert (message, sourceReplacedMap);
manageInputStatus(message, sourceReplacedMap);
manageInputSync (message, sourceReplacedMap);
manageInputMap (message, sourceReplacedMap);
}
/**
* Process and manipulate the output message.
*
* @param processingContext the message processing context
* @param message the message to be processed
* @throws Sync4jException
*/
public void postProcessMessage(MessageProcessingContext processingContext,
SyncML message) throws Sync4jException {
if (!isDeviceToProcess(processingContext)) {
return;
}
if (log.isTraceEnabled()) {
log.trace(SYNCLET_NAME + ".postProcessMessage(...)");
}
HashMap sourceReplacedMap =
(HashMap)processingContext.getSessionProperty(
PROPERTY_SOURCENAME_CHANGED);
if (sourceReplacedMap == null) {
return;
}
if (!sourceReplacedMap.isEmpty()) {
//
// Replace original source uri into commands
//
manageOutputStatus (message, sourceReplacedMap);
manageOutputResults(message, sourceReplacedMap);
manageOutputAlert (message, sourceReplacedMap);
manageOutputSync (message, sourceReplacedMap);
}
}
/**
* Set the hashmap with sources name's to change
*
* @param map
*/
public void setSourceNameMapping(HashMap map) {
this.sourceNameMapping = map;
}
/**
* Get the hashmap with sources name's to change
*
* @return the map
*/
public HashMap getSourceNameMapping() {
return this.sourceNameMapping;
}
// --------------------------------------------------------- Private Methods
/**
* Store and change Target URI into Alert commands
*
* @param message the client message
* @param sourceReplacedMap the HashMap in which store uri to replace
*/
private void manageInputAlert(SyncML message, HashMap sourceReplacedMap) {
SyncBody syncBody = message.getSyncBody();
AbstractCommand[] allClientCommands =
(AbstractCommand[])syncBody.getCommands().toArray(
new AbstractCommand[0]);
ArrayList alertList =
CoreUtil.filterCommands(allClientCommands, Alert.class);
Iterator itAlertList = alertList.iterator();
Alert alert = null;
ArrayList items = null;
Iterator itItem = null;
Item item = null;
Target target = null;
String targetUri = null;
while (itAlertList.hasNext()) {
alert = (Alert)itAlertList.next();
items = alert.getItems();
itItem = items.iterator();
while (itItem.hasNext()) {
item = (Item)itItem.next();
target = item.getTarget();
if (target != null) {
targetUri = target.getLocURI();
if (sourceNameMapping.containsKey(targetUri)) {
String targetNew =
(String)sourceNameMapping.get(targetUri);
target.setLocURI(targetNew);
sourceReplacedMap.put(targetNew, targetUri);
}
}
}
}
}
/**
* Store and change SourceRef into Status commmads
*
* @param message the client message
* @param sourceReplacedMap the HashMap in which store uri to replace
*/
private void manageInputStatus(SyncML message, HashMap sourceReplacedMap) {
SyncBody syncBody = message.getSyncBody();
AbstractCommand[] allClientCommands =
(AbstractCommand[])syncBody.getCommands().toArray(
new AbstractCommand[0]);
ArrayList statusList =
CoreUtil.filterCommands(allClientCommands, Status.class);
Iterator itStatusList = statusList.iterator();
Status status = null;
while (itStatusList.hasNext()) {
status = (Status)itStatusList.next();
SourceRef[] srefs =
(SourceRef[])status.getSourceRef().toArray(new SourceRef[0]);
int s = srefs.length;
for(int i=0;i<s;i++) {
SourceRef sr = (SourceRef)srefs[i];
String sourceRef = sr.getValue();
if (sourceNameMapping.containsKey(sourceRef)) {
String sourceRefNew =
(String)sourceNameMapping.get(sr.getValue());
sr.setValue(sourceRefNew);
sourceReplacedMap.put(sourceRefNew, sourceRef);
}
}
}
}
/**
* Store and change Target into Sync commands
*
* @param message the client message
* @param sourceReplacedMap the HashMap in which store uri to replace
*/
private void manageInputSync(SyncML message, HashMap sourceReplacedMap) {
SyncBody syncBody = message.getSyncBody();
AbstractCommand[] allClientCommands =
(AbstractCommand[])syncBody.getCommands().toArray(
new AbstractCommand[0]);
ArrayList syncList =
CoreUtil.filterCommands(allClientCommands, Sync.class);
Iterator itList = syncList.iterator();
Sync sync = null;
String targetUri = null;
while (itList.hasNext()) {
sync = (Sync)itList.next();
targetUri = sync.getTarget().getLocURI();
if (sourceNameMapping.containsKey(targetUri)) {
String targetNew = (String)sourceNameMapping.get(targetUri);
sync.getTarget().setLocURI(targetNew);
sourceReplacedMap.put(targetNew, targetUri);
}
}
}
/**
* Store and change Target into Map commands
*
* @param message the client message
* @param sourceReplacedMap the HashMap in which store uri to replace
*/
private void manageInputMap(SyncML message, HashMap sourceReplacedMap) {
SyncBody syncBody = message.getSyncBody();
AbstractCommand[] allClientCommands =
(AbstractCommand[])syncBody.getCommands().toArray(
new AbstractCommand[0]);
ArrayList mapList =
CoreUtil.filterCommands(allClientCommands, Map.class);
Iterator itList = mapList.iterator();
Map map = null;
String targetUri = null;
while (itList.hasNext()) {
map = (Map)itList.next();
targetUri = map.getTarget().getLocURI();
if (sourceNameMapping.containsKey(targetUri)) {
String targetNew = (String)sourceNameMapping.get(targetUri);
map.getTarget().setLocURI(targetNew);
sourceReplacedMap.put(targetNew, targetUri);
}
}
}
/**
* Replace TargetRef into Status commands
*
* @param message the client message
* @param sourceReplacedMap the HashMap with the uri to replace
*/
private void manageOutputStatus(SyncML message, HashMap sourceReplacedMap) {
SyncBody syncBody = message.getSyncBody();
AbstractCommand[] allServerCommands =
(AbstractCommand[])syncBody.getCommands().toArray(
new AbstractCommand[0]);
ArrayList statusList =
CoreUtil.filterCommands(allServerCommands, Status.class);
Iterator itStatusList = statusList.iterator();
Status status = null;
ArrayList items = null;
Iterator itItem = null;
Item item = null;
Target target = null;
String targetUri = null;
while (itStatusList.hasNext()) {
status = (Status)itStatusList.next();
if (status.getTargetRef() == null) {
continue;
}
TargetRef[] trefs =
(TargetRef[])status.getTargetRef().toArray(new TargetRef[0]);
int s = trefs.length;
for(int i=0;i<s;i++) {
TargetRef tr = (TargetRef)trefs[i];
if (sourceReplacedMap.containsKey(tr.getValue())) {
tr.setValue((String)sourceReplacedMap.get(tr.getValue()));
}
}
//-------------------
items = status.getItems();
itItem = items.iterator();
while (itItem.hasNext()) {
item = (Item)itItem.next();
target = item.getTarget();
if (target != null) {
targetUri = target.getLocURI();
if (sourceReplacedMap.containsKey(targetUri)) {
target.setLocURI((String)sourceReplacedMap.get(targetUri));
}
}
}
//-------------------
}
}
/**
* Replace Source into Alert commands
*
* @param message the client message
* @param sourceReplacedMap the HashMap with the uri to replace
*/
private void manageOutputAlert(SyncML message, HashMap sourceReplacedMap) {
SyncBody syncBody = message.getSyncBody();
AbstractCommand[] allServerCommands =
(AbstractCommand[])syncBody.getCommands().toArray(
new AbstractCommand[0]);
ArrayList alertList =
CoreUtil.filterCommands(allServerCommands, Alert.class);
Iterator itAlertList = alertList.iterator();
Alert alert = null;
ArrayList items = null;
Iterator itItem = null;
Item item = null;
Source source = null;
String sourceUri = null;
while (itAlertList.hasNext()) {
alert = (Alert)itAlertList.next();
items = alert.getItems();
itItem = items.iterator();
while (itItem.hasNext()) {
item = (Item)itItem.next();
source = item.getSource();
if (source != null) {
sourceUri = source.getLocURI();
if (sourceReplacedMap.containsKey(sourceUri)) {
//
// Here we have to create a new Source object because
// the Alert can contain the same Source used in the
// engine/sessionHandler to handle the Database.
// If here we change the source object of the alert we
// change also the source of the database because it's
// the same object!!.
//
//
Source newSource = new Source(
(String)sourceReplacedMap.get(sourceUri),
source.getLocName()
);
item.setSource(newSource);
}
}
}
}
}
/**
* Replace SourceRef into Results command
*
* @param message the client message
* @param sourceReplacedMap the HashMap with the uri to replace
*/
private void manageOutputResults(SyncML message, HashMap sourceReplacedMap) {
SyncBody syncBody = message.getSyncBody();
AbstractCommand[] allServerCommands =
(AbstractCommand[])syncBody.getCommands().toArray(
new AbstractCommand[0]);
List list =
CoreUtil.filterCommands(allServerCommands, Results.class);
if (list.isEmpty()) {
return;
}
Results results = (Results)list.get(0);
Item[] items = (Item[])results.getItems().toArray(new Item[0]);
if (items != null && items.length > 0) {
if (items[0] instanceof DevInfItem) {
DevInfItem item = (DevInfItem) items[0];
ArrayList dss = item.getDevInfData().getDevInf().getDataStores();
int s = dss.size();
for (int i = 0; i < s; i++) {
DataStore ds = (DataStore) dss.get(i);
String sourceRef = ds.getSourceRef().getValue();
if (sourceReplacedMap.containsKey(sourceRef)) {
ds.getSourceRef().setValue((String) sourceReplacedMap.
get(sourceRef));
}
}
}
}
}
/**
* Replace Source into Sync commands
*
* @param message the client message
* @param sourceReplacedMap the HashMap with the uri to replace
*/
private void manageOutputSync(SyncML message, HashMap sourceReplacedMap) {
SyncBody syncBody = message.getSyncBody();
AbstractCommand[] allServerCommands =
(AbstractCommand[])syncBody.getCommands().toArray(
new AbstractCommand[0]);
ArrayList syncList =
CoreUtil.filterCommands(allServerCommands, Sync.class);
Iterator itSyncList = syncList.iterator();
Sync sync = null;
Source source = null;
String sourceUri = null;
while (itSyncList.hasNext()) {
sync = (Sync) itSyncList.next();
source = sync.getSource();
if (source != null) {
sourceUri = source.getLocURI();
if (sourceReplacedMap.containsKey(sourceUri)) {
//
// Here we have to create a new Source object because
// the Sync can contain the same Source used in the
// engine/sessionHandler to handle the Database.
// If here we change the source object of the sync commands we
// change also the source of the database because it's
// the same object!!.
//
//
Source newSource = new Source(
(String) sourceReplacedMap.get(sourceUri),
source.getLocName()
);
sync.setSource(newSource);
}
}
}
}
/**
* Searches a match for the configured <code>headerPatterns</code> with the HTTP
* headers specified in the context.
*
* @param context message processing context
*
* @return true if the device must be proced by this synclet, false otherwise
*/
private boolean isDeviceToProcess(MessageProcessingContext context) {
if (headerPatterns == null || headerPatterns.size() == 0) {
return true;
}
Iterator i = headerPatterns.keySet().iterator();
while (i.hasNext()) {
String header = (String)i.next();
String pattern = (String)headerPatterns.get(header);
if (isDeviceToProcess(context, header, pattern)) {
return true;
}
}
return false;
}
/**
* Searches a match for the configured <code>pattern</code> with the HTTP
* header specified by <code>header</code>.
* If header or pattern is empty, isDeviceToProcess() returns always true.
* If the client does not provide the specified header, isDeviceToProcess()
* returns false.
*
* @param context message processing context
*
* @param header the header to check
* @param pattern the pattern
* @return true if the device must be proced by this synclet, false otherwise
*/
private boolean isDeviceToProcess(MessageProcessingContext context,
String header,
String pattern) {
if ((pattern == null || pattern.trim().length() == 0) ||
(header == null || header.trim().length() == 0)) {
return true;
}
java.util.Map headers =
(java.util.Map)context.getRequestProperty(MessageProcessingContext.PROPERTY_REQUEST_HEADERS);
//
// Search for the requested header value
//
String value = null;
Iterator i = headers.keySet().iterator();
while (i.hasNext()) {
String h = (String)i.next();
if (header.equalsIgnoreCase(h)) {
value = (String)headers.get(h);
break;
}
}
if ((value == null) || (value.trim().length() == 0)) {
//
// Header not found or not specified
//
return false;
}
Pattern p = Pattern.compile(pattern);
Matcher m = p.matcher(value);
return m.find();
}
}
|
accesstest3/cfunambol
|
modules/foundation/foundation-core/src/main/java/com/funambol/foundation/synclet/ChangeSourceUriSynclet.java
|
Java
|
agpl-3.0
| 21,955 |
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.db.transaction import atomic
from django.http.response import JsonResponse
from django.shortcuts import get_object_or_404
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from django.views.generic import DetailView, ListView, View
from django.views.generic.detail import SingleObjectMixin
from shuup.core.excs import ProductNotOrderableProblem
from shuup.core.models import OrderLineType, Product
from shuup.core.utils.users import real_user_or_none
from shuup.front.models import StoredBasket
class CartViewMixin(object):
model = StoredBasket
def get_queryset(self):
qs = super(CartViewMixin, self).get_queryset()
return qs.filter(persistent=True, deleted=False, customer=self.request.customer, shop=self.request.shop)
class CartListView(CartViewMixin, ListView):
template_name = 'shuup/saved_carts/cart_list.jinja'
context_object_name = 'carts'
class CartDetailView(CartViewMixin, DetailView):
template_name = 'shuup/saved_carts/cart_detail.jinja'
context_object_name = 'cart'
def get_queryset(self):
qs = super(CartDetailView, self).get_queryset()
return qs.prefetch_related("products")
def get_context_data(self, **kwargs):
context = super(CartDetailView, self).get_context_data(**kwargs)
lines = []
product_dict = {}
for product in self.object.products.all():
product_dict[product.id] = product
for line in self.object.data.get("lines", []):
if line.get("type", None) != OrderLineType.PRODUCT:
continue
product = product_dict[line["product_id"]]
quantity = line.get("quantity", 0)
lines.append({
"product": product,
"quantity": quantity,
})
context["lines"] = lines
return context
class CartSaveView(View):
def post(self, request, *args, **kwargs):
title = request.POST.get("title", "")
basket = request.basket
if not request.customer:
return JsonResponse({"ok": False}, status=403)
if not title:
return JsonResponse({"ok": False, "error": force_text(_("Please enter a basket title."))}, status=400)
if basket.product_count == 0:
return JsonResponse({"ok": False, "error": force_text(_("Cannot save an empty basket."))}, status=400)
saved_basket = StoredBasket(
shop=basket.shop,
customer=basket.customer,
orderer=basket.orderer,
creator=real_user_or_none(basket.creator),
currency=basket.currency,
prices_include_tax=basket.prices_include_tax,
persistent=True,
title=title,
data=basket.storage.load(basket=basket),
product_count=basket.product_count)
saved_basket.save()
saved_basket.products = set(basket.product_ids)
return JsonResponse({"ok": True}, status=200)
class CartAddAllProductsView(CartViewMixin, SingleObjectMixin, View):
def get_object(self):
return get_object_or_404(self.get_queryset(), pk=self.kwargs.get("pk"))
def _get_supplier(self, shop_product, supplier_id):
if supplier_id:
supplier = shop_product.suppliers.filter(pk=supplier_id).first()
else:
supplier = shop_product.suppliers.first()
return supplier
@atomic
def post(self, request, *args, **kwargs):
cart = self.get_object()
basket = request.basket
product_ids_to_quantities = basket.get_product_ids_and_quantities()
errors = []
quantity_added = 0
for line in cart.data.get('lines', []):
if line.get("type", None) != OrderLineType.PRODUCT:
continue
product = Product.objects.get(id=line.get("product_id", None))
shop_product = product.get_shop_instance(shop=request.shop)
if not shop_product:
errors.append({"product": line.text, "message": _("Product not available in this shop")})
continue
supplier = self._get_supplier(shop_product, line.get("supplier_id"))
if not supplier:
errors.append({"product": line.text, "message": _("Invalid supplier")})
continue
try:
quantity = line.get("quantity", 0)
quantity_added += quantity
product_quantity = quantity + product_ids_to_quantities.get(line["product_id"], 0)
shop_product.raise_if_not_orderable(
supplier=supplier,
quantity=product_quantity,
customer=request.customer)
basket.add_product(
supplier=supplier,
shop=request.shop,
product=product,
quantity=quantity)
except ProductNotOrderableProblem as e:
errors.append({"product": line["text"], "message": force_text(e.message)})
return JsonResponse({
"errors": errors,
"success": force_text(_("%d product(s) added to cart" % quantity_added))
}, status=200)
class CartDeleteView(CartViewMixin, SingleObjectMixin, View):
def post(self, request, *args, **kwargs):
cart = self.get_object()
cart.deleted = True
cart.save()
return JsonResponse({"status": "success"}, status=200)
|
hrayr-artunyan/shuup
|
shuup/front/apps/saved_carts/views.py
|
Python
|
agpl-3.0
| 5,738 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.emergency.vo.lookups;
import ims.framework.cn.data.TreeModel;
import ims.framework.cn.data.TreeNode;
import ims.vo.LookupInstanceCollection;
import ims.vo.LookupInstVo;
public class TrackingStatusCollection extends LookupInstanceCollection implements ims.vo.ImsCloneable, TreeModel
{
private static final long serialVersionUID = 1L;
public void add(TrackingStatus value)
{
super.add(value);
}
public int indexOf(TrackingStatus instance)
{
return super.indexOf(instance);
}
public boolean contains(TrackingStatus instance)
{
return indexOf(instance) >= 0;
}
public TrackingStatus get(int index)
{
return (TrackingStatus)super.getIndex(index);
}
public void remove(TrackingStatus instance)
{
if(instance != null)
{
int index = indexOf(instance);
if(index >= 0)
remove(index);
}
}
public Object clone()
{
TrackingStatusCollection newCol = new TrackingStatusCollection();
TrackingStatus item;
for (int i = 0; i < super.size(); i++)
{
item = this.get(i);
newCol.add(new TrackingStatus(item.getID(), item.getText(), item.isActive(), item.getParent(), item.getImage(), item.getColor(), item.getOrder()));
}
for (int i = 0; i < newCol.size(); i++)
{
item = newCol.get(i);
if (item.getParent() != null)
{
int parentIndex = this.indexOf(item.getParent());
if(parentIndex >= 0)
item.setParent(newCol.get(parentIndex));
else
item.setParent((TrackingStatus)item.getParent().clone());
}
}
return newCol;
}
public TrackingStatus getInstance(int instanceId)
{
return (TrackingStatus)super.getInstanceById(instanceId);
}
public TreeNode[] getRootNodes()
{
LookupInstVo[] roots = super.getRoots();
TreeNode[] nodes = new TreeNode[roots.length];
System.arraycopy(roots, 0, nodes, 0, roots.length);
return nodes;
}
public TrackingStatus[] toArray()
{
TrackingStatus[] arr = new TrackingStatus[this.size()];
super.toArray(arr);
return arr;
}
public static TrackingStatusCollection buildFromBeanCollection(java.util.Collection beans)
{
TrackingStatusCollection coll = new TrackingStatusCollection();
if(beans == null)
return coll;
java.util.Iterator iter = beans.iterator();
while(iter.hasNext())
{
coll.add(TrackingStatus.buildLookup((ims.vo.LookupInstanceBean)iter.next()));
}
return coll;
}
public static TrackingStatusCollection buildFromBeanCollection(ims.vo.LookupInstanceBean[] beans)
{
TrackingStatusCollection coll = new TrackingStatusCollection();
if(beans == null)
return coll;
for(int x = 0; x < beans.length; x++)
{
coll.add(TrackingStatus.buildLookup(beans[x]));
}
return coll;
}
}
|
openhealthcare/openMAXIMS
|
openmaxims_workspace/ValueObjects/src/ims/emergency/vo/lookups/TrackingStatusCollection.java
|
Java
|
agpl-3.0
| 4,452 |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
*/
package org.phenotips.data.internal.controller;
import org.phenotips.data.DictionaryPatientData;
import org.phenotips.data.IndexedPatientData;
import org.phenotips.data.Patient;
import org.phenotips.data.PatientData;
import org.phenotips.data.PatientDataController;
import org.phenotips.data.PatientWritePolicy;
import org.xwiki.component.manager.ComponentLookupException;
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.test.mockito.MockitoComponentMockingRule;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.inject.Provider;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.doc.XWikiDocument;
import com.xpn.xwiki.objects.BaseObject;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
/**
* Tests for the {@link AllergiesController} Component, implementation of the
* {@link org.phenotips.data.PatientDataController} interface.
*/
public class AllergiesControllerTest
{
private static final String NKDA = "NKDA";
private static final String ALLERGY_1 = "allergy1";
private static final String ALLERGY_2 = "allergy2";
private static final String ALLERGY_3 = "allergy3";
private static final String ALLERGY_4 = "allergy4";
@Rule
public MockitoComponentMockingRule<PatientDataController<String>> mocker =
new MockitoComponentMockingRule<>(AllergiesController.class);
@Mock
private XWikiContext xcontext;
@Mock
private Patient patient;
@Mock
private XWikiDocument doc;
@Mock
private BaseObject dataHolder;
private PatientDataController<String> component;
@Before
public void setUp() throws ComponentLookupException
{
MockitoAnnotations.initMocks(this);
this.component = this.mocker.getComponentUnderTest();
final Provider<XWikiContext> xcp = this.mocker.getInstance(XWikiContext.TYPE_PROVIDER);
when(xcp.get()).thenReturn(this.xcontext);
final DocumentReference patientDocRef = new DocumentReference("wiki", "patient", "00000001");
when(this.patient.getDocumentReference()).thenReturn(patientDocRef);
when(this.patient.getXDocument()).thenReturn(this.doc);
when(this.doc.getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext)).thenReturn(this.dataHolder);
}
@Test
public void saveDoesNothingWhenPatientHasAllergiesClass()
{
when(this.doc.getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext)).thenReturn(null);
this.component.save(this.patient);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verifyNoMoreInteractions(this.doc);
verifyZeroInteractions(this.dataHolder);
}
@Test
public void saveDoesNothingWhenPatientDataHasWrongFormat()
{
final PatientData<String> data = new DictionaryPatientData<>(this.component.getName(), Collections.emptyMap());
doReturn(data).when(this.patient).getData(this.component.getName());
this.component.save(this.patient);
}
@Test
public void saveDoesNothingWhenPatientDataIsNullAndPolicyIsUpdate()
{
when(this.patient.getData(this.component.getName())).thenReturn(null);
this.component.save(this.patient, PatientWritePolicy.UPDATE);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verifyNoMoreInteractions(this.doc);
verifyZeroInteractions(this.dataHolder);
}
@Test
public void saveDoesNothingWhenPatientDataIsNullAndPolicyIsMerge()
{
when(this.patient.getData(this.component.getName())).thenReturn(null);
this.component.save(this.patient, PatientWritePolicy.MERGE);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verifyNoMoreInteractions(this.doc);
verifyZeroInteractions(this.dataHolder);
}
@Test
public void saveNullsStoredDataWhenPatientDataIsNullAndPolicyIsReplace()
{
when(this.patient.getData(this.component.getName())).thenReturn(null);
this.component.save(this.patient, PatientWritePolicy.REPLACE);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verify(this.dataHolder, times(1)).setIntValue(NKDA, 0);
verify(this.dataHolder, times(1)).setDBStringListValue(this.component.getName(), null);
verifyNoMoreInteractions(this.doc, this.dataHolder);
}
@Test
public void saveClearsExistingDataWhenPatientDataIsEmptyAndPolicyIsUpdate()
{
final PatientData<String> data = new IndexedPatientData<>(this.component.getName(), Collections.emptyList());
doReturn(data).when(this.patient).getData(this.component.getName());
this.component.save(this.patient, PatientWritePolicy.UPDATE);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verify(this.dataHolder, times(1)).setIntValue(NKDA, 0);
verify(this.dataHolder, times(1)).setDBStringListValue(this.component.getName(), null);
verifyNoMoreInteractions(this.doc, this.dataHolder);
}
@Test
public void saveKeepsExistingDataWhenPatientDataIsEmptyAndPolicyIsMerge()
{
final PatientData<String> data = new IndexedPatientData<>(this.component.getName(), Collections.emptyList());
doReturn(data).when(this.patient).getData(this.component.getName());
final BaseObject storedObject = mock(BaseObject.class);
when(this.doc.getXObject(AllergiesController.CLASS_REFERENCE)).thenReturn(storedObject);
when(storedObject.getListValue(this.component.getName())).thenReturn(Arrays.asList(NKDA, ALLERGY_1, ALLERGY_2));
this.component.save(this.patient, PatientWritePolicy.MERGE);
final List<String> resultList = Arrays.asList(ALLERGY_1, ALLERGY_2);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE);
verify(this.dataHolder, times(1)).setIntValue(NKDA, 1);
verify(this.dataHolder, times(1)).setDBStringListValue(this.component.getName(), resultList);
verifyNoMoreInteractions(this.doc, this.dataHolder);
}
@Test
public void saveClearsExistingDataWhenPatientDataIsEmptyAndPolicyIsReplace()
{
final PatientData<String> data = spy(new IndexedPatientData<>(this.component.getName(),
Collections.emptyList()));
doReturn(data).when(this.patient).getData(this.component.getName());
this.component.save(this.patient, PatientWritePolicy.REPLACE);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verify(this.dataHolder, times(1)).setIntValue(NKDA, 0);
verify(this.dataHolder, times(1)).setDBStringListValue(this.component.getName(), null);
verifyNoMoreInteractions(this.doc, this.dataHolder);
}
@Test
public void saveReplacesOldDataWhenNewDataIsProvidedAndPolicyIsUpdate()
{
final List<String> allergyArray = Arrays.asList(ALLERGY_3, ALLERGY_4, NKDA);
final PatientData<String> data = new IndexedPatientData<>(this.component.getName(), allergyArray);
doReturn(data).when(this.patient).getData(this.component.getName());
this.component.save(this.patient, PatientWritePolicy.UPDATE);
final List<String> resultList = Arrays.asList(ALLERGY_3, ALLERGY_4);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verify(this.dataHolder, times(1)).setIntValue(NKDA, 1);
verify(this.dataHolder, times(1)).setDBStringListValue(this.component.getName(), resultList);
verifyNoMoreInteractions(this.doc, this.dataHolder);
}
@Test
public void saveMergesWithOldDataWhenNewDataIsProvidedAndPolicyIsMerge()
{
final List<String> allergyArray = Arrays.asList(ALLERGY_3, ALLERGY_4);
final PatientData<String> data = new IndexedPatientData<>(this.component.getName(), allergyArray);
doReturn(data).when(this.patient).getData(this.component.getName());
final BaseObject storedObject = mock(BaseObject.class);
when(this.doc.getXObject(AllergiesController.CLASS_REFERENCE)).thenReturn(storedObject);
when(storedObject.getListValue(this.component.getName())).thenReturn(Arrays.asList(ALLERGY_1, ALLERGY_2));
this.component.save(this.patient, PatientWritePolicy.MERGE);
final List<String> resultList = Arrays.asList(ALLERGY_1, ALLERGY_2, ALLERGY_3, ALLERGY_4);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE);
verify(this.dataHolder, times(1)).setIntValue(NKDA, 0);
verify(this.dataHolder, times(1)).setDBStringListValue(this.component.getName(), resultList);
verifyNoMoreInteractions(this.doc, this.dataHolder);
}
@Test
public void saveReplacesOldDataWhenNewDataIsProvidedAndPolicyIsReplace()
{
final List<String> allergyArray = Arrays.asList(ALLERGY_3, ALLERGY_4, NKDA);
final PatientData<String> data = new IndexedPatientData<>(this.component.getName(), allergyArray);
doReturn(data).when(this.patient).getData(this.component.getName());
this.component.save(this.patient, PatientWritePolicy.REPLACE);
final List<String> resultList = Arrays.asList(ALLERGY_3, ALLERGY_4);
verify(this.doc, times(1)).getXObject(AllergiesController.CLASS_REFERENCE, true, this.xcontext);
verify(this.dataHolder, times(1)).setIntValue(NKDA, 1);
verify(this.dataHolder, times(1)).setDBStringListValue(this.component.getName(), resultList);
verifyNoMoreInteractions(this.doc, this.dataHolder);
}
}
|
teyden/phenotips
|
components/patient-data/impl/src/test/java/org/phenotips/data/internal/controller/AllergiesControllerTest.java
|
Java
|
agpl-3.0
| 11,278 |
Lineaire Regressie
==========================
Met een lineaire regressie kan een lineaire relatie tussen een of meer verklarende pariabele(n) (predictoren) en een continue afhankelijke (respons) variabele worden geëvalueerd.
### Assumpties
---
- Continue response variabele.
- Lineariteit en additiviteit: De responsvariabele is lineair gerelateerd aan alle predictoren en de effecten van de predictoren zijn additief.
- Onafhankelijkheid van de residuen: De residuen zijn niet gecorreleerd met elkaar
- Homoskedastischiteit: De fout variantie van elke predictor is constant over alle waarden van de predictor.
- Normaliteit van residuen: De residuen zijn normaal verdeeld met een gemiddelde van 0.
### Invoer
---
#### Invoerveld
- Afhankelijk: Afhankelijke (respons) variabele.
- Methode: Specificeer de volgorde waarin de predictoren aan het model worden toegevoegd (i.e., hiërarchische regressie analyse). Een blok van een of meer predictor(en) representeert een stap in de hiërarchie.
*Let op*: De huidige versie an JASP staat niet meer dan een blok toe.
- Toevoegen: Alle predictoren worden tegelijk toegevoegd aan het model (forced entry).
- Achterwaarts: Alle predictoren worden tegelijk toegevoegd, en daarna sequentieel verwijderd gebaseerd op het criterium in "criterium stapsgewijze methode".
- Voorwaarts: Predictoren worden sequentieel toegevoegd op basis van het criterium gespecificeerd in "criterium stapsgewijze methode".
- Stapsgewijs: Predictoren worden sequentieel toegevoegd op basis van het criterium gespecificeerd in "criterium stapsgewijze methode"; na elke stap wordt de minst nuttige predictor verwijderd.
- Covariaten: Predictor variabele(n).
- WLS gewichten: De gewichten die worden gebruikt voor de laagste-kwadratenregressie.
### Model
- Neem intercept mee:
- Neem het intercept mee in het model.
- Componenten en model termen:
- Componenten: Alle onafhankelijke variabelen die in het model worden meegenomen.
- Model termen: De onafhankelijke variabelen in het model. De standaardoptie is om de hoofdeffecten van de gespecificeerde onafhankelijke variabelen in het model te betrekken. Vink meerdere variabelen aan om interacties mee te nemen (bijv., door de ctrl/cmd knop op uw toetsenbord ingedrukt te houden terwijl u klikt, en sleep de variabelen naar het `Model Termen` veld.
- Voeg toe aan nul model: De onafhankelijke variabelen in het model kunnen ook aan het nulmodel worden toegevoegd.
### Statistieken
- Regressiecoëfficiënten:
- Schattingen: Ongestandaardiseerde en gestandaardiseerde schattingen van de coëfficiënten, standaardafwijkingen, t-waarden en de corresponderende p-waarden.
- Fan `...` bootstraps: Als u deze optie selecteert wordt ge-bootsttrapte schatting toegepast. De standaardoptie voor het aantal replicaties is 1000. Dit kan tot behoeven worden aangepast.
- Betrouwbaarheidsintervallen: Door deze optie te selecteren worden betrouwbaarheidsintervallen voor het geschatte gemiddelde verschil toegevoegd. De standaardoptie is 95%. Dit kan naar behoeven worden aangepast.
- Covariantie matrix: geef de covariantie matrix van de predictoren per model weer.
- Vovk-Selke maximum p-ratio: De grens 1/(-e p log(p)) wordt afgeleid van de vorm van de verdeling van de p-waarden. Onder de nulhypothese (H<sub>0</sub>) is het uniform (0,1) en onder de alternatieve hypothese (H<sub>1</sub>) neemt hij af in p, bijv. een beta (α, 1) verdeling waar 0 < α < 1. De Vovk-Selke MPR wordt verkregen door het vorm van α onder de alternative hypothese te kiezen zodat de p-waarde maximaal diagnostisch is. De waarde is dan de ratio van de dichtheid op punt p onder H<sub>0</sub> en H<sub>1</sub>. Als de tweezijdige p-waarde bijvoorbeeld .05 is, is de Vovk-Sellke MPR 2.46. Dit geeft aan dat deze p-waarde maximaal 2.46 zo waarschijnlijk is onder H1 dan onder H<sub>0</sub>. Meer informatie hier: href="https://jasp-stats.org/2017/06/12/mysterious-vs-mpr/">blogpost</a>.
- Model passing: Aparte ANOVA tabel voor elk model (bijv., elke stap in achterwaartse, voorwaartse en stapsgewijze regressie).
- R-Kwadraat verschil: Het verschil in R-Kwadraat tussen verschillende stappen in achterwaartse, voorwaartse en stapsgewijze regressie, met corresponderende significantie toetsen (bijv., F-waarde, df1, df2, p-waarde).
- Beschrijvende statistieken: Steekproefgrootte, gemiddelde standaardafwijking en standaardfout van het gemiddelde.
- Part en partiële correlaties: De semipartiële en partiële correlaties.
- Collineariteits diagnostieken: Collineariteits statistieken, eigenwaarden, conditie indicaties en proporties variantie.
- Residuen:
- Statistieken: Geef beschrijvende statistieken over de residuen en voorspelde waarden.
- Durbin-Watson: Durbin-Watson statistiek om autocorrelatie van de residuen te toetsen.
- Diagnostieken per observatie: Gevalsgewijze en samengevatte diagnostieken voor de residuen.
- Gestandaardiseerd residu > 3: Uitschieters buiten x standaardafwijkingen: Geef diagnostieken weer voor waarnemingen waar de absolute waarde voor het gestandaardiseerde residu groter is dan x; de standaardoptie is x=3.
- Cook's afstand > 1: Geef diagnostieken weer voor waarnemingen waar de waarde van Cook's afstand groter is dan x; de standaardoptie is x=1.
- Alle waarnemingen: Geef diagnostieken voor alle waarnemingen weer.
### Specificatie van Methode
- Stapsgewijze methode criteria:
- Gebruik p-waarde: Gebruikt p-waarde als criterium voor het toevoegen en verwijderen van predictoren in achterwaartse, voorwaartse en stapsgewijze regressie.
- Toevoegen: Voeg predictor toe als p-waarde van regressiecoëfficiënt < x. Standaard is x=0.05.
- Verwijderen: Verwijder predictor als p-waarde van regressiecoëfficiënt > x. Standaard is x=0.1.
- Gebruik F waarde: Gebruik F-waarde als criterium voor het verwijderen en toevoegen van predictoren.
- toevoegen: Voeg predictor toe als de F waarde van de regressiecoëfficiënt > x. standaard is x=3.84.
- Verwijderen: Verwijder predictor als de F waarde van de regressiecoëfficiënt < x. Standaard is x=2.71.
### Grafieken
- Residu grafieken: Als de assumpties van het lineaire regressiemodel houdbaar zijn moeten de residuen aselect rond een horizontale lijn liggen. Elk systematisch patroon of clustering van residuen wijst op een schending.
- Residuen vs afhankelijk: Spreidingsdiagrammen van de waarden van de residuen tegen de afhankelijke variabele.
- Residuen vs covariaten: Spreidingsdiagram van de waarden van de residuen tegen de predictor variabele(n).
- Residuen vs histogram: Histogram van de waarden van de residuen.
- Gestandaardiseerde residuen: Gebruikt de gestandaardiseerde in plaats van de absolute residuen.
- Q-Q grafiek: Gestandaardiseerde residuen: Checkt de validiteit van de verdelingsassumpties. Om precies te zijn laat de plot zien of de residuen normaal zijn verdeeld.
- Partiële grafieken: Deze grafieken zijn spreidingsdiagrammen van dde residuen van 2 regressies - regressie van de afhankelijke variabele op alle predictoren, en regressie van een predictor (als afhankelijke variabele) op alle andere predictoren -- daarna worden de residuen tegen elkaar afgezet.
### Uitvoer
---
#### Lineaire regressie
Samenvatting van het model:
- Model: Regressie model (één voor elke stap in achterwaartse, voorwaartse en stapsgewijze regressie).
- R: Meerdere correlatie coëfficiënten R.
- Determinatiecoëfficient: Determinatiecoëfficient waarde. De proportie van variantie dee wordt verklaard door het regressiemodel.
- Bijgestelde determinatiecoëfficient: Bijgestelde determinatiecoëfficient waarde.
- RMSE: Root-mean-square error.
- Verandering determinatiecoëfficient: verandering in determinatiecoëfficient waarde.
- F verandering: Verandering in F-waarde.
- df1: Noemer vrijheidsgrafen van verandering in F-waarde.
- df2: Teller vrijheidsgrafen van verandering in F-waarde.
- p: p-waarde Van de varandering in F-waarde.
- Durbin-Watson: Durbin-Watson statistiek.
ANOVA:
- Model: Regressie model (één voor elke stap in achterwaartse, voorwaartse en stapsgewijze regressie.
- Kwadratensom: De kwadratensom voor het regressiemodel (regressie) en het residu (Residu), en de totale kwadratensom (totaal).
- vg: De vrijheidsgraden voor het regressiemodel (regressie) en het residu (Residu), en de totale vrijheidsgraden (totaal).
- Mean square: Gekwadrateerde gemiddelde voor het regressiemodel (regressie) en het residu (residu).
- F: F-waarde.
- p: p-waarde.
Coëfficiënten
- Model: Regressiemodel (één voor elke stap in achterwaartse, voorwaartse en stapsgewijze regressie).
- Ongestandaardiseerd: Ongestandaardiseerde coëfficiënten.
- Standaardfout: De standaardfout van de regressiecoëfficiënten.
- Gestandaardiseerd: Gestandaardiseerde coëfficiënten.
- T-waarde: T-waarde voor het toetsen van de nulhypothese dat de populatie regressiecoëfficiënt 0 is.
- P: P-waarde.
- % BI: Het betrouwbaarheidsinterval voor de ongestandaardiseerde coëfficiënten. Standaard is 95%.
- Onder: De ondergrens van het betrouwbaarheidsinterval.
- Boven: De bovengrens van het betrouwbaarheidsinterval.
- Collineariteit statistieken:
- Tolerantie: Omgekeerde van de Variantie Inflatie Factor (VIF).
- VIF: Variantie Inflatie Factor; grote waarden wijzen op multicollineariteit.
Ge-bootstrapte Coëfficiënten.
- Model: Regressiemodel (één voor elke stap in achterwaartse, voorwaartse en stapsgewijze regressie).
- Ongestandaardiseerd: Ongestandaardiseerde coëfficiënten.
- Bias: Gestandaardiseerde coëfficiënten.
- Standaardfout: De standaardfout van de regressiecoëfficiënten.
- % BI: Het ge-bootstrapte betrouwbaarheidsinterval voor de ongestandaardiseerde coëfficiënten. Standaard is 95%.
- Onder: De ondergrens van het betrouwbaarheidsinterval.
- Boven: De bovengrens van het betrouwbaarheidsinterval.
Beschrijvende statistieken.
- N: Steekproefgrootte.
- Gem: Gemiddelde.
- SD: Standaardafwijking.
- Std. Fout: Standaardfout van het gemiddelde.
Part en Partiële correlaties:
- Model: Regressie model (één voor elke stap in achterwaartse, voorwaartse en stapsgewijze regressie).
- Partieel: Partiële correlaties tussen de predictor variabelen en de afhankelijke variabele.
- Part: Semipartiële correlates tussen de predictor variabelen en de afhankelijke variabele.
Coëfficiënten
- [onder]%: Ondergrens van het gespecificeerde x% betrouwbaarheidsinterval voor de regressiecoëfficiënten.
- [boven]%: Bovengrens van het gespecificeerde x% betrouwbaarheidsinterval voor de regressiecoëfficiënten.
Coëfficiënten Covariantie Matrix:
- Geeft de covariantie matrix van de coëfficiënten van de predictoren voor elk regressiemodel weer (Model).
Collineariteit Diagnostieken:
- Geeft voor elk regressiemodel (model) en voor elk element van de geschaalde, niet gecentreerde kruisproduct matrix het volgende weer:
- Eigenwaarde.
- Conditie index.
- Proportie variantie voor elke term in de regressie formule.
Stapsgewijze Diagnostieken:
- Voor elk gemarkeerd geval (Geval nummer) geeft dit het volgende weer:
- Gestandaardiseerd residu.
- De waarde van de afhankelijke variabele.
- De voorspelde waarde.
- Residu
- Cook's afstand.
Residu statistieken:
- Geeft het minimum, maximum, gemiddelde, standaardafwijking en de steekproefgrootte voor:
- De voorspelde waarde.
- Het residu.
- Gestandaardiseerde voorspelde waarde.
- Gestandaardiseerde residu.
### Referenties
-------
- Field, A.P., Miles, J., & Field, Z. (2012). *Discovering statistics using R*. London: Sage.
- Moore, D.S., McCabe, G.P., & Craig, B.A. (2012). *Introduction to the practice of statistics (7th ed.)*. New York, NY: W.H. Freeman and Company.
- Sellke, T., Bayarri, M. J., & Berger, J. O. (2001). Calibration of *p* values for testing precise null hypotheses. *The American Statistician, 55*(1), 62-71.
- Stevens, J.P. (2009). *Applied multivariate statistics for the social sciences (5th ed.)*. New York, NY: Routledge.
### R Packages
----
- boot
- car
- ggplot2
- lmtest
- matrixStats
- stats
|
vankesteren/jasp-desktop
|
Resources/Help/analyses/regressionlinear_nl.md
|
Markdown
|
agpl-3.0
| 12,102 |
use 5.006_001; # for (defined ref) and $#$v and our
package Dumpvalue;
use strict;
our $VERSION = '1.13';
our(%address, $stab, @stab, %stab, %subs);
# documentation nits, handle complex data structures better by chromatic
# translate control chars to ^X - Randal Schwartz
# Modifications to print types by Peter Gordon v1.0
# Ilya Zakharevich -- patches after 5.001 (and some before ;-)
# Won't dump symbol tables and contents of debugged files by default
# (IZ) changes for objectification:
# c) quote() renamed to method set_quote();
# d) unctrlSet() renamed to method set_unctrl();
# f) Compiles with `use strict', but in two places no strict refs is needed:
# maybe more problems are waiting...
my %defaults = (
globPrint => 0,
printUndef => 1,
tick => "auto",
unctrl => 'quote',
subdump => 1,
dumpReused => 0,
bareStringify => 1,
hashDepth => '',
arrayDepth => '',
dumpDBFiles => '',
dumpPackages => '',
quoteHighBit => '',
usageOnly => '',
compactDump => '',
veryCompact => '',
stopDbSignal => '',
);
sub new {
my $class = shift;
my %opt = (%defaults, @_);
bless \%opt, $class;
}
sub set {
my $self = shift;
my %opt = @_;
@$self{keys %opt} = values %opt;
}
sub get {
my $self = shift;
wantarray ? @$self{@_} : $$self{pop @_};
}
sub dumpValue {
my $self = shift;
die "usage: \$dumper->dumpValue(value)" unless @_ == 1;
local %address;
local $^W=0;
(print "undef\n"), return unless defined $_[0];
(print $self->stringify($_[0]), "\n"), return unless ref $_[0];
$self->unwrap($_[0],0);
}
sub dumpValues {
my $self = shift;
local %address;
local $^W=0;
(print "undef\n"), return unless defined $_[0];
$self->unwrap(\@_,0);
}
# This one is good for variable names:
sub unctrl {
local($_) = @_;
return \$_ if ref \$_ eq "GLOB";
s/([\001-\037\177])/'^'.pack('c',ord($1)^64)/eg;
$_;
}
sub stringify {
my $self = shift;
local $_ = shift;
my $noticks = shift;
my $tick = $self->{tick};
return 'undef' unless defined $_ or not $self->{printUndef};
return $_ . "" if ref \$_ eq 'GLOB';
{ no strict 'refs';
$_ = &{'overload::StrVal'}($_)
if $self->{bareStringify} and ref $_
and %overload:: and defined &{'overload::StrVal'};
}
if ($tick eq 'auto') {
if (/[\000-\011\013-\037\177]/) {
$tick = '"';
} else {
$tick = "'";
}
}
if ($tick eq "'") {
s/([\'\\])/\\$1/g;
} elsif ($self->{unctrl} eq 'unctrl') {
s/([\"\\])/\\$1/g ;
s/([\000-\037\177])/'^'.pack('c',ord($1)^64)/eg;
s/([\200-\377])/'\\0x'.sprintf('%2X',ord($1))/eg
if $self->{quoteHighBit};
} elsif ($self->{unctrl} eq 'quote') {
s/([\"\\\$\@])/\\$1/g if $tick eq '"';
s/\033/\\e/g;
s/([\000-\037\177])/'\\c'.chr(ord($1)^64)/eg;
}
s/([\200-\377])/'\\'.sprintf('%3o',ord($1))/eg if $self->{quoteHighBit};
($noticks || /^\d+(\.\d*)?\Z/)
? $_
: $tick . $_ . $tick;
}
sub DumpElem {
my ($self, $v) = (shift, shift);
my $short = $self->stringify($v, ref $v);
my $shortmore = '';
if ($self->{veryCompact} && ref $v
&& (ref $v eq 'ARRAY' and !grep(ref $_, @$v) )) {
my $depth = $#$v;
($shortmore, $depth) = (' ...', $self->{arrayDepth} - 1)
if $self->{arrayDepth} and $depth >= $self->{arrayDepth};
my @a = map $self->stringify($_), @$v[0..$depth];
print "0..$#{$v} @a$shortmore\n";
} elsif ($self->{veryCompact} && ref $v
&& (ref $v eq 'HASH') and !grep(ref $_, values %$v)) {
my @a = sort keys %$v;
my $depth = $#a;
($shortmore, $depth) = (' ...', $self->{hashDepth} - 1)
if $self->{hashDepth} and $depth >= $self->{hashDepth};
my @b = map {$self->stringify($_) . " => " . $self->stringify($$v{$_})}
@a[0..$depth];
local $" = ', ';
print "@b$shortmore\n";
} else {
print "$short\n";
$self->unwrap($v,shift);
}
}
sub unwrap {
my $self = shift;
return if $DB::signal and $self->{stopDbSignal};
my ($v) = shift ;
my ($s) = shift ; # extra no of spaces
my $sp;
my (%v,@v,$address,$short,$fileno);
$sp = " " x $s ;
$s += 3 ;
# Check for reused addresses
if (ref $v) {
my $val = $v;
{ no strict 'refs';
$val = &{'overload::StrVal'}($v)
if %overload:: and defined &{'overload::StrVal'};
}
($address) = $val =~ /(0x[0-9a-f]+)\)$/ ;
if (!$self->{dumpReused} && defined $address) {
$address{$address}++ ;
if ( $address{$address} > 1 ) {
print "${sp}-> REUSED_ADDRESS\n" ;
return ;
}
}
} elsif (ref \$v eq 'GLOB') {
$address = "$v" . ""; # To avoid a bug with globs
$address{$address}++ ;
if ( $address{$address} > 1 ) {
print "${sp}*DUMPED_GLOB*\n" ;
return ;
}
}
if (ref $v eq 'Regexp') {
my $re = "$v";
$re =~ s,/,\\/,g;
print "$sp-> qr/$re/\n";
return;
}
if ( UNIVERSAL::isa($v, 'HASH') ) {
my @sortKeys = sort keys(%$v) ;
my $more;
my $tHashDepth = $#sortKeys ;
$tHashDepth = $#sortKeys < $self->{hashDepth}-1 ? $#sortKeys : $self->{hashDepth}-1
unless $self->{hashDepth} eq '' ;
$more = "....\n" if $tHashDepth < $#sortKeys ;
my $shortmore = "";
$shortmore = ", ..." if $tHashDepth < $#sortKeys ;
$#sortKeys = $tHashDepth ;
if ($self->{compactDump} && !grep(ref $_, values %{$v})) {
$short = $sp;
my @keys;
for (@sortKeys) {
push @keys, $self->stringify($_) . " => " . $self->stringify($v->{$_});
}
$short .= join ', ', @keys;
$short .= $shortmore;
(print "$short\n"), return if length $short <= $self->{compactDump};
}
for my $key (@sortKeys) {
return if $DB::signal and $self->{stopDbSignal};
my $value = $ {$v}{$key} ;
print $sp, $self->stringify($key), " => ";
$self->DumpElem($value, $s);
}
print "$sp empty hash\n" unless @sortKeys;
print "$sp$more" if defined $more ;
} elsif ( UNIVERSAL::isa($v, 'ARRAY') ) {
my $tArrayDepth = $#{$v} ;
my $more ;
$tArrayDepth = $#$v < $self->{arrayDepth}-1 ? $#$v : $self->{arrayDepth}-1
unless $self->{arrayDepth} eq '' ;
$more = "....\n" if $tArrayDepth < $#{$v} ;
my $shortmore = "";
$shortmore = " ..." if $tArrayDepth < $#{$v} ;
if ($self->{compactDump} && !grep(ref $_, @{$v})) {
if ($#$v >= 0) {
$short = $sp . "0..$#{$v} " .
join(" ",
map {exists $v->[$_] ? $self->stringify($v->[$_]) : "empty"} ($[..$tArrayDepth)
) . "$shortmore";
} else {
$short = $sp . "empty array";
}
(print "$short\n"), return if length $short <= $self->{compactDump};
}
for my $num ($[ .. $tArrayDepth) {
return if $DB::signal and $self->{stopDbSignal};
print "$sp$num ";
if (exists $v->[$num]) {
$self->DumpElem($v->[$num], $s);
} else {
print "empty slot\n";
}
}
print "$sp empty array\n" unless @$v;
print "$sp$more" if defined $more ;
} elsif ( UNIVERSAL::isa($v, 'SCALAR') or ref $v eq 'REF' ) {
print "$sp-> ";
$self->DumpElem($$v, $s);
} elsif ( UNIVERSAL::isa($v, 'CODE') ) {
print "$sp-> ";
$self->dumpsub(0, $v);
} elsif ( UNIVERSAL::isa($v, 'GLOB') ) {
print "$sp-> ",$self->stringify($$v,1),"\n";
if ($self->{globPrint}) {
$s += 3;
$self->dumpglob('', $s, "{$$v}", $$v, 1);
} elsif (defined ($fileno = fileno($v))) {
print( (' ' x ($s+3)) . "FileHandle({$$v}) => fileno($fileno)\n" );
}
} elsif (ref \$v eq 'GLOB') {
if ($self->{globPrint}) {
$self->dumpglob('', $s, "{$v}", $v, 1);
} elsif (defined ($fileno = fileno(\$v))) {
print( (' ' x $s) . "FileHandle({$v}) => fileno($fileno)\n" );
}
}
}
sub matchvar {
$_[0] eq $_[1] or
($_[1] =~ /^([!~])(.)([\x00-\xff]*)/) and
($1 eq '!') ^ (eval {($_[2] . "::" . $_[0]) =~ /$2$3/});
}
sub compactDump {
my $self = shift;
$self->{compactDump} = shift if @_;
$self->{compactDump} = 6*80-1
if $self->{compactDump} and $self->{compactDump} < 2;
$self->{compactDump};
}
sub veryCompact {
my $self = shift;
$self->{veryCompact} = shift if @_;
$self->compactDump(1) if !$self->{compactDump} and $self->{veryCompact};
$self->{veryCompact};
}
sub set_unctrl {
my $self = shift;
if (@_) {
my $in = shift;
if ($in eq 'unctrl' or $in eq 'quote') {
$self->{unctrl} = $in;
} else {
print "Unknown value for `unctrl'.\n";
}
}
$self->{unctrl};
}
sub set_quote {
my $self = shift;
if (@_ and $_[0] eq '"') {
$self->{tick} = '"';
$self->{unctrl} = 'quote';
} elsif (@_ and $_[0] eq 'auto') {
$self->{tick} = 'auto';
$self->{unctrl} = 'quote';
} elsif (@_) { # Need to set
$self->{tick} = "'";
$self->{unctrl} = 'unctrl';
}
$self->{tick};
}
sub dumpglob {
my $self = shift;
return if $DB::signal and $self->{stopDbSignal};
my ($package, $off, $key, $val, $all) = @_;
local(*stab) = $val;
my $fileno;
if (($key !~ /^_</ or $self->{dumpDBFiles}) and defined $stab) {
print( (' ' x $off) . "\$", &unctrl($key), " = " );
$self->DumpElem($stab, 3+$off);
}
if (($key !~ /^_</ or $self->{dumpDBFiles}) and @stab) {
print( (' ' x $off) . "\@$key = (\n" );
$self->unwrap(\@stab,3+$off) ;
print( (' ' x $off) . ")\n" );
}
if ($key ne "main::" && $key ne "DB::" && %stab
&& ($self->{dumpPackages} or $key !~ /::$/)
&& ($key !~ /^_</ or $self->{dumpDBFiles})
&& !($package eq "Dumpvalue" and $key eq "stab")) {
print( (' ' x $off) . "\%$key = (\n" );
$self->unwrap(\%stab,3+$off) ;
print( (' ' x $off) . ")\n" );
}
if (defined ($fileno = fileno(*stab))) {
print( (' ' x $off) . "FileHandle($key) => fileno($fileno)\n" );
}
if ($all) {
if (defined &stab) {
$self->dumpsub($off, $key);
}
}
}
sub CvGV_name {
my $self = shift;
my $in = shift;
return if $self->{skipCvGV}; # Backdoor to avoid problems if XS broken...
$in = \&$in; # Hard reference...
eval {require Devel::Peek; 1} or return;
my $gv = Devel::Peek::CvGV($in) or return;
*$gv{PACKAGE} . '::' . *$gv{NAME};
}
sub dumpsub {
my $self = shift;
my ($off,$sub) = @_;
my $ini = $sub;
my $s;
$sub = $1 if $sub =~ /^\{\*(.*)\}$/;
my $subref = defined $1 ? \&$sub : \&$ini;
my $place = $DB::sub{$sub} || (($s = $subs{"$subref"}) && $DB::sub{$s})
|| (($s = $self->CvGV_name($subref)) && $DB::sub{$s})
|| ($self->{subdump} && ($s = $self->findsubs("$subref"))
&& $DB::sub{$s});
$s = $sub unless defined $s;
$place = '???' unless defined $place;
print( (' ' x $off) . "&$s in $place\n" );
}
sub findsubs {
my $self = shift;
return undef unless %DB::sub;
my ($addr, $name, $loc);
while (($name, $loc) = each %DB::sub) {
$addr = \&$name;
$subs{"$addr"} = $name;
}
$self->{subdump} = 0;
$subs{ shift() };
}
sub dumpvars {
my $self = shift;
my ($package,@vars) = @_;
local(%address,$^W);
my ($key,$val);
$package .= "::" unless $package =~ /::$/;
*stab = *main::;
while ($package =~ /(\w+?::)/g) {
*stab = $ {stab}{$1};
}
$self->{TotalStrings} = 0;
$self->{Strings} = 0;
$self->{CompleteTotal} = 0;
while (($key,$val) = each(%stab)) {
return if $DB::signal and $self->{stopDbSignal};
next if @vars && !grep( matchvar($key, $_), @vars );
if ($self->{usageOnly}) {
$self->globUsage(\$val, $key)
if ($package ne 'Dumpvalue' or $key ne 'stab')
and ref(\$val) eq 'GLOB';
} else {
$self->dumpglob($package, 0,$key, $val);
}
}
if ($self->{usageOnly}) {
print <<EOP;
String space: $self->{TotalStrings} bytes in $self->{Strings} strings.
EOP
$self->{CompleteTotal} += $self->{TotalStrings};
print <<EOP;
Grand total = $self->{CompleteTotal} bytes (1 level deep) + overhead.
EOP
}
}
sub scalarUsage {
my $self = shift;
my $size;
if (UNIVERSAL::isa($_[0], 'ARRAY')) {
$size = $self->arrayUsage($_[0]);
} elsif (UNIVERSAL::isa($_[0], 'HASH')) {
$size = $self->hashUsage($_[0]);
} elsif (!ref($_[0])) {
$size = length($_[0]);
}
$self->{TotalStrings} += $size;
$self->{Strings}++;
$size;
}
sub arrayUsage { # array ref, name
my $self = shift;
my $size = 0;
map {$size += $self->scalarUsage($_)} @{$_[0]};
my $len = @{$_[0]};
print "\@$_[1] = $len item", ($len > 1 ? "s" : ""), " (data: $size bytes)\n"
if defined $_[1];
$self->{CompleteTotal} += $size;
$size;
}
sub hashUsage { # hash ref, name
my $self = shift;
my @keys = keys %{$_[0]};
my @values = values %{$_[0]};
my $keys = $self->arrayUsage(\@keys);
my $values = $self->arrayUsage(\@values);
my $len = @keys;
my $total = $keys + $values;
print "\%$_[1] = $len item", ($len > 1 ? "s" : ""),
" (keys: $keys; values: $values; total: $total bytes)\n"
if defined $_[1];
$total;
}
sub globUsage { # glob ref, name
my $self = shift;
local *stab = *{$_[0]};
my $total = 0;
$total += $self->scalarUsage($stab) if defined $stab;
$total += $self->arrayUsage(\@stab, $_[1]) if @stab;
$total += $self->hashUsage(\%stab, $_[1])
if %stab and $_[1] ne "main::" and $_[1] ne "DB::";
#and !($package eq "Dumpvalue" and $key eq "stab"));
$total;
}
1;
=head1 NAME
Dumpvalue - provides screen dump of Perl data.
=head1 SYNOPSIS
use Dumpvalue;
my $dumper = Dumpvalue->new;
$dumper->set(globPrint => 1);
$dumper->dumpValue(\*::);
$dumper->dumpvars('main');
my $dump = $dumper->stringify($some_value);
=head1 DESCRIPTION
=head2 Creation
A new dumper is created by a call
$d = Dumpvalue->new(option1 => value1, option2 => value2)
Recognized options:
=over 4
=item C<arrayDepth>, C<hashDepth>
Print only first N elements of arrays and hashes. If false, prints all the
elements.
=item C<compactDump>, C<veryCompact>
Change style of array and hash dump. If true, short array
may be printed on one line.
=item C<globPrint>
Whether to print contents of globs.
=item C<dumpDBFiles>
Dump arrays holding contents of debugged files.
=item C<dumpPackages>
Dump symbol tables of packages.
=item C<dumpReused>
Dump contents of "reused" addresses.
=item C<tick>, C<quoteHighBit>, C<printUndef>
Change style of string dump. Default value of C<tick> is C<auto>, one
can enable either double-quotish dump, or single-quotish by setting it
to C<"> or C<'>. By default, characters with high bit set are printed
I<as is>. If C<quoteHighBit> is set, they will be quoted.
=item C<usageOnly>
rudimentally per-package memory usage dump. If set,
C<dumpvars> calculates total size of strings in variables in the package.
=item unctrl
Changes the style of printout of strings. Possible values are
C<unctrl> and C<quote>.
=item subdump
Whether to try to find the subroutine name given the reference.
=item bareStringify
Whether to write the non-overloaded form of the stringify-overloaded objects.
=item quoteHighBit
Whether to print chars with high bit set in binary or "as is".
=item stopDbSignal
Whether to abort printing if debugger signal flag is raised.
=back
Later in the life of the object the methods may be queries with get()
method and set() method (which accept multiple arguments).
=head2 Methods
=over 4
=item dumpValue
$dumper->dumpValue($value);
$dumper->dumpValue([$value1, $value2]);
Prints a dump to the currently selected filehandle.
=item dumpValues
$dumper->dumpValues($value1, $value2);
Same as C<< $dumper->dumpValue([$value1, $value2]); >>.
=item stringify
my $dump = $dumper->stringify($value [,$noticks] );
Returns the dump of a single scalar without printing. If the second
argument is true, the return value does not contain enclosing ticks.
Does not handle data structures.
=item dumpvars
$dumper->dumpvars('my_package');
$dumper->dumpvars('my_package', 'foo', '~bar$', '!......');
The optional arguments are considered as literal strings unless they
start with C<~> or C<!>, in which case they are interpreted as regular
expressions (possibly negated).
The second example prints entries with names C<foo>, and also entries
with names which ends on C<bar>, or are shorter than 5 chars.
=item set_quote
$d->set_quote('"');
Sets C<tick> and C<unctrl> options to suitable values for printout with the
given quote char. Possible values are C<auto>, C<'> and C<">.
=item set_unctrl
$d->set_unctrl('unctrl');
Sets C<unctrl> option with checking for an invalid argument.
Possible values are C<unctrl> and C<quote>.
=item compactDump
$d->compactDump(1);
Sets C<compactDump> option. If the value is 1, sets to a reasonable
big number.
=item veryCompact
$d->veryCompact(1);
Sets C<compactDump> and C<veryCompact> options simultaneously.
=item set
$d->set(option1 => value1, option2 => value2);
=item get
@values = $d->get('option1', 'option2');
=back
=cut
|
jondo/paperpile
|
plack/perl5/win32/lib/Dumpvalue.pm
|
Perl
|
agpl-3.0
| 16,901 |
class DropContactResource < ActiveRecord::Migration
def change
drop_table :inst_resources
drop_table :lib_resources
end
end
|
terrellt/alacarte
|
db/migrate/20130912215726_drop_contact_resource.rb
|
Ruby
|
agpl-3.0
| 136 |
package javax.media.protocol;
import java.io.IOException;
import javax.media.Buffer;
import javax.media.Format;
/**
* Complete.
* @author Ken Larson
*
*/
public interface PushBufferStream extends SourceStream
{
public Format getFormat();
public void read(Buffer buffer) throws IOException;
public void setTransferHandler(BufferTransferHandler transferHandler);
}
|
AlienQueen/alienlabs-skeleton-for-wicket-spring-hibernate
|
lib/fmj/src/javax/media/protocol/PushBufferStream.java
|
Java
|
agpl-3.0
| 375 |
<%page args="course, enrollment, show_courseware_link, cert_status, show_email_settings, course_mode_info, show_refund_option, is_paid_course, is_course_blocked, verification_status, course_requirements, dashboard_index" />
<%!
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from django.core.urlresolvers import reverse
from markupsafe import escape
from courseware.courses import course_image_url, get_course_about_section
from course_modes.models import CourseMode
from student.helpers import (
VERIFY_STATUS_NEED_TO_VERIFY,
VERIFY_STATUS_SUBMITTED,
VERIFY_STATUS_APPROVED,
VERIFY_STATUS_MISSED_DEADLINE,
VERIFY_STATUS_NEED_TO_REVERIFY
)
%>
<%
cert_name_short = course.cert_name_short
if cert_name_short == "":
cert_name_short = settings.CERT_NAME_SHORT
cert_name_long = course.cert_name_long
if cert_name_long == "":
cert_name_long = settings.CERT_NAME_LONG
billing_email = settings.PAYMENT_SUPPORT_EMAIL
%>
<%namespace name='static' file='../static_content.html'/>
<li class="course-item">
% if settings.FEATURES.get('ENABLE_VERIFIED_CERTIFICATES'):
<% course_verified_certs = CourseMode.enrollment_mode_display(enrollment.mode, verification_status.get('status')) %>
<%
mode_class = course_verified_certs.get('display_mode', '')
if mode_class != '':
mode_class = ' ' + mode_class ;
%>
% else:
<% mode_class = '' %>
% endif
<article class="course${mode_class}">
<% course_target = reverse('info', args=[unicode(course.id)]) %>
<section class="details">
<div class="wrapper-course-image" aria-hidden="true">
% if show_courseware_link:
% if not is_course_blocked:
<a href="${course_target}" class="cover">
<img src="${course_image_url(course)}" class="course-image" alt="${_('{course_number} {course_name} Home Page').format(course_number=course.number, course_name=course.display_name_with_default) |h}" />
</a>
% else:
<a class="fade-cover">
<img src="${course_image_url(course)}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course.number, course_name=course.display_name_with_default) |h}" />
</a>
% endif
% else:
<a class="cover">
<img src="${course_image_url(course)}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course.number, course_name=course.display_name_with_default) | h}" />
</a>
% endif
% if settings.FEATURES.get('ENABLE_VERIFIED_CERTIFICATES'):
<span class="sts-enrollment" title="${course_verified_certs.get('enrollment_title')}">
<span class="label">${_("Enrolled as: ")}</span>
% if course_verified_certs.get('show_image'):
<img class="deco-graphic" src="${static.url('images/verified-ribbon.png')}" alt="${course_verified_certs.get('image_alt')}" />
% endif
<div class="sts-enrollment-value">${course_verified_certs.get('enrollment_value')}</div>
</span>
% endif
</div>
<div class="wrapper-course-details">
<h3 class="course-title">
% if show_courseware_link:
% if not is_course_blocked:
<a href="${course_target}">${course.display_name_with_default}</a>
% else:
<a class="disable-look">${course.display_name_with_default}</a>
% endif
% else:
<span>${course.display_name_with_default}</span>
% endif
</h3>
<div class="course-info">
<span class="info-university">${get_course_about_section(course, 'university')} - </span>
<span class="info-course-id">${course.display_number_with_default | h}</span>
<span class="info-date-block" data-tooltip="Hi">
% if course.has_ended():
${_("Ended - {end_date}").format(end_date=course.end_datetime_text("SHORT_DATE"))}
% elif course.has_started():
${_("Started - {start_date}").format(start_date=course.start_datetime_text("SHORT_DATE"))}
% elif course.start_date_is_still_default: # Course start date TBD
${_("Coming Soon")}
% else: # hasn't started yet
${_("Starts - {start_date}").format(start_date=course.start_datetime_text("SHORT_DATE"))}
% endif
</span>
</div>
% if show_courseware_link:
<div class="wrapper-course-actions">
<div class="course-actions">
% if course.has_ended():
% if not is_course_blocked:
<a href="${course_target}" class="enter-course archived">${_('View Archived Course')}<span class="sr"> ${course.display_name_with_default}</span></a>
% else:
<a class="enter-course-blocked archived">${_('View Archived Course')}<span class="sr"> ${course.display_name_with_default}</span></a>
% endif
% else:
% if not is_course_blocked:
<a href="${course_target}" class="enter-course">${_('View Course')}<span class="sr"> ${course.display_name_with_default}</span></a>
% else:
<a class="enter-course-blocked">${_('View Course')}<span class="sr"> ${course.display_name_with_default}</span></a>
% endif
% endif
<div class="wrapper-action-more">
<a href="#actions-dropdown-${dashboard_index}" class="action action-more" id="actions-dropdown-link-${dashboard_index}" aria-haspopup="true" aria-expanded="false" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}">
<span class="sr">${_('Course options dropdown')}</span>
<i class="fa fa-cog" aria-hidden="true"></i>
</a>
<div class="actions-dropdown" id="actions-dropdown-${dashboard_index}" aria-label="${_('Additional Actions Menu')}">
<ul class="actions-dropdown-list" id="actions-dropdown-list-${dashboard_index}" aria-label="${_('Available Actions')}" role="menu">
<li class="actions-item" id="actions-item-unenroll-${dashboard_index}">
% if is_paid_course and show_refund_option:
## Translators: The course name will be added to the end of this sentence.
% if not is_course_blocked:
<a href="#unenroll-modal" class="action action-unenroll" rel="leanModal" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from the purchased course")}';
document.getElementById('refund-info').innerHTML=gettext('You will be refunded the amount you paid.')">
${_('Unenroll')}
</a>
% else:
<a class="action action-unenroll is-disabled" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from the purchased course")}';
document.getElementById('refund-info').innerHTML=gettext('You will be refunded the amount you paid.')">
${_('Unenroll')}
</a>
% endif
% elif is_paid_course and not show_refund_option:
## Translators: The course's name will be added to the end of this sentence.
% if not is_course_blocked:
<a href="#unenroll-modal" class="action action-unenroll" rel="leanModal" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from the purchased course")}';
document.getElementById('refund-info').innerHTML=gettext('You will not be refunded the amount you paid.')">
${_('Unenroll')}
</a>
% else:
<a class="action action-unenroll is-disabled" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from the purchased course")}';
document.getElementById('refund-info').innerHTML=gettext('You will not be refunded the amount you paid.')">
${_('Unenroll')}
</a>
% endif
% elif enrollment.mode != "verified":
## Translators: The course's name will be added to the end of this sentence.
% if not is_course_blocked:
<a href="#unenroll-modal" class="action action-unenroll" rel="leanModal" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from")}'; document.getElementById('refund-info').innerHTML=''">
${_('Unenroll')}
</a>
% else:
<a class="action action-unenroll is-disabled" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from")}'; document.getElementById('refund-info').innerHTML=''">
${_('Unenroll')}
</a>
% endif
% elif show_refund_option:
## Translators: The course's name will be added to the end of this sentence.
% if not is_course_blocked:
<a href="#unenroll-modal" class="action action-unenroll" rel="leanModal" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from the verified {cert_name_long} track of").format(cert_name_long=cert_name_long)}';
document.getElementById('refund-info').innerHTML=gettext('You will be refunded the amount you paid.')">
${_('Unenroll')}
</a>
% else:
<a class="action action-unenroll is-disabled" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from the verified {cert_name_long} track of").format(cert_name_long=cert_name_long)}';
document.getElementById('refund-info').innerHTML=gettext('You will be refunded the amount you paid.')">
${_('Unenroll')}
</a>
% endif
% else:
## Translators: The course's name will be added to the end of this sentence.
% if not is_course_blocked:
<a href="#unenroll-modal" class="action action-unenroll" rel="leanModal" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from the verified {cert_name_long} track of").format(cert_name_long=cert_name_long)}';
document.getElementById('refund-info').innerHTML=gettext('The refund deadline for this course has passed, so you will not receive a refund.')">
${_('Unenroll')}
</a>
% else:
<a class="action action-unenroll is-disabled" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" onclick="document.getElementById('track-info').innerHTML='${_("Are you sure you want to unenroll from the verified {cert_name_long} track of").format(cert_name_long=cert_name_long)}';
document.getElementById('refund-info').innerHTML=gettext('The refund deadline for this course has passed, so you will not receive a refund.')">
${_('Unenroll')}
</a>
% endif
% endif
</li>
<li class="actions-item" id="actions-item-email-settings-${dashboard_index}">
% if show_email_settings:
% if not is_course_blocked:
<a href="#email-settings-modal" class="action action-email-settings" rel="leanModal" data-course-id="${course.id | h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" data-optout="${unicode(course.id) in course_optouts}">${_('Email Settings')}</a>
% else:
<a class="action action-email-settings is-disabled" data-course-id="${course.id| h}" data-course-number="${course.number | h}" data-dashboard-index="${dashboard_index}" data-optout="${unicode(course.id) in course_optouts}">${_('Email Settings')}</a>
% endif
% endif
</li>
</ul>
</div>
</div>
</div>
</div>
% endif
</div>
</section>
<footer class="wrapper-messages-primary">
<ul class="messages-list">
% if course.may_certify() and cert_status:
<%include file='_dashboard_certificate_information.html' args='cert_status=cert_status,course=course, enrollment=enrollment'/>
% endif
% if verification_status.get('status') in [VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_APPROVED, VERIFY_STATUS_NEED_TO_REVERIFY] and not is_course_blocked:
<div class="message message-status wrapper-message-primary is-shown">
% if verification_status['status'] == VERIFY_STATUS_NEED_TO_VERIFY:
<div class="verification-reminder">
% if verification_status['days_until_deadline'] is not None:
<h4 class="message-title">${_('Verification not yet complete.')}</h4>
<p class="message-copy">${ungettext(
'You only have {days} day left to verify for this course.',
'You only have {days} days left to verify for this course.',
verification_status['days_until_deadline']
).format(days=verification_status['days_until_deadline'])}</p>
% else:
<h4 class="message-title">${_('Almost there!')}</h4>
<p class="message-copy">${_('You still need to verify for this course.')}</p>
% endif
</div>
<div class="verification-cta">
<a href="${reverse('verify_student_verify_later', kwargs={'course_id': unicode(course.id)})}" class="cta" data-course-id="${course.id | h}">${_('Verify Now')}</a>
</div>
% elif verification_status['status'] == VERIFY_STATUS_SUBMITTED:
<h4 class="message-title">${_('You have already verified your ID!')}</h4>
<p class="message-copy">${_('Thanks for your patience as we process your request.')}</p>
% elif verification_status['status'] == VERIFY_STATUS_APPROVED:
<h4 class="message-title">${_('You have already verified your ID!')}</h4>
% if verification_status['verification_good_until'] is not None:
<p class="message-copy">${_('Your verification status is good until {date}.').format(date=verification_status['verification_good_until'])}
% endif
% elif verification_status['status'] == VERIFY_STATUS_NEED_TO_REVERIFY:
<h4 class="message-title">${_('Your verification will expire soon!')}</h4>
## Translators: start_link and end_link will be replaced with HTML tags;
## please do not translate these.
<p class="message-copy">${_('Your current verification will expire before the verification deadline for this course. {start_link}Re-verify your identity now{end_link} using a webcam and a government-issued ID.').format(start_link='<a href="{href}">'.format(href=reverse('verify_student_reverify')), end_link='</a>')}</p>
% endif
</div>
% endif
% if course_mode_info['show_upsell'] and not is_course_blocked:
<div class="message message-upsell has-actions is-expandable is-shown">
<div class="wrapper-tip">
<h4 class="message-title">
<i class="icon fa fa-caret-right ui-toggle-expansion"></i>
<span class="value">${_("Challenge Yourself!")}</span>
</h4>
<p class="message-copy">${_("Take this course as an ID-verified student.")}</p>
</div>
<div class="wrapper-extended">
<p class="message-copy">${_("You can still sign up for an ID verified {cert_name_long} for this course. If you plan to complete the whole course, it is a great way to recognize your achievement. {link_start}Learn more about the verified {cert_name_long}{link_end}.").format(link_start='<a href="{}">'.format(marketing_link('WHAT_IS_VERIFIED_CERT')), link_end="</a>", cert_name_long=cert_name_long)}</p>
<ul class="actions message-actions">
<li class="action-item">
<a class="action action-upgrade" href="${reverse('verify_student_upgrade_and_verify', kwargs={'course_id': unicode(course.id)})}" data-course-id="${course.id | h}" data-user="${user.username | h}">
<img class="deco-graphic" src="${static.url('images/vcert-ribbon-s.png')}" alt="${_("ID Verified Ribbon/Badge")}">
<span class="wrapper-copy">
<span class="copy" id="upgrade-to-verified">${_("Upgrade to Verified Track")}</span>
</span>
</a>
</li>
</ul>
</div>
</div>
%endif
% if is_course_blocked:
<p id="block-course-msg" class="course-block">
${_("You can no longer access this course because payment has not yet been received. "
"You can {contact_link_start}contact the account holder{contact_link_end} "
"to request payment, or you can "
"{unenroll_link_start}unenroll{unenroll_link_end} "
"from this course").format(
contact_link_start='<a href="#">',
contact_link_end='</a>',
unenroll_link_start=(
'<a id="unregister_block_course" rel="leanModal" '
'data-course-id="{course_id}" data-course-number="{course_number}" '
'href="#unenroll-modal">'.format(
course_id=escape(course.id),
course_number=escape(course.number),
)
),
unenroll_link_end="</a>",
)}
</p>
%endif
% if course_requirements:
## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element
<% prc_target = reverse('about_course', args=[unicode(course_requirements['courses'][0]['key'])]) %>
<li class="prerequisites">
<p class="tip">
${_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.").format(
link_start='<a href="{}">'.format(prc_target),
link_end='</a>',
prc_display=course_requirements['courses'][0]['display'],
)}
</p>
</li>
% endif
</ul>
</footer>
</article>
</li>
<script>
$( document ).ready(function() {
if("${is_course_blocked}" == "True"){
$( "#unregister_block_course" ).click(function() {
$('.disable-look-unregister').click();
});
}
});
</script>
|
eestay/edx-platform
|
lms/templates/dashboard/_dashboard_course_listing.html
|
HTML
|
agpl-3.0
| 20,958 |
/*
* JBILLING CONFIDENTIAL
* _____________________
*
* [2003] - [2012] Enterprise jBilling Software Ltd.
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Enterprise jBilling Software.
* The intellectual and technical concepts contained
* herein are proprietary to Enterprise jBilling Software
* and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden.
*/
package com.sapienter.jbilling.server.pluggableTask;
import com.sapienter.jbilling.server.payment.PaymentDTOEx;
import com.sapienter.jbilling.server.user.CreditCardBL;
import com.sapienter.jbilling.server.user.UserBL;
import com.sapienter.jbilling.server.util.Constants;
import org.apache.log4j.Logger;
/**
* Created with IntelliJ IDEA.
*
* This will check the preferred payment method by default
* If preferred method is not available it will check the next available payment method info
*
* @author Panche.Isajeski
* @since 17/05/12
*/
public class AlternativePaymentInfoTask extends BasicPaymentInfoTask {
private static final Logger LOG = Logger.getLogger(AlternativePaymentInfoTask.class);
@Override
public PaymentDTOEx getPaymentInfo(Integer userId) throws TaskException {
PaymentDTOEx retValue = null;
try {
Integer method = Constants.AUTO_PAYMENT_TYPE_CC; // def to cc
UserBL userBL = new UserBL(userId);
CreditCardBL ccBL = new CreditCardBL();
if (userBL.getEntity().getCustomer() != null) {
// now non-customers only use credit cards
method = userBL.getEntity().getCustomer().getAutoPaymentType();
if (method == null) {
method = Constants.AUTO_PAYMENT_TYPE_CC;
}
}
if (method.equals(Constants.AUTO_PAYMENT_TYPE_CC)) {
if (null == (retValue = processCreditCardInfo(userBL, ccBL))) {
retValue = processACHInfo(userBL);
}
} else if (method.equals(Constants.AUTO_PAYMENT_TYPE_ACH)) {
if (null == (retValue = processACHInfo(userBL))) {
retValue = processCreditCardInfo(userBL, ccBL);
}
}
} catch (Exception e) {
throw new TaskException(e);
}
if (retValue == null) {
LOG.debug("Could not find payment instrument for user " + userId);
}
return retValue;
}
}
|
liquidJbilling/LT-Jbilling-MsgQ-3.1
|
src/java/com/sapienter/jbilling/server/pluggableTask/AlternativePaymentInfoTask.java
|
Java
|
agpl-3.0
| 2,569 |
/**
* Nanocloud turns any traditional software into a cloud solution, without
* changing or redeveloping existing source code.
*
* Copyright (C) 2016 Nanocloud Software
*
* This file is part of Nanocloud.
*
* Nanocloud is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Nanocloud is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General
* Public License
* along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
import DS from 'ember-data';
import Ember from 'ember';
export default DS.Model.extend({
name: DS.attr('string'),
ip: DS.attr('string'),
adminPassword: DS.attr('string'),
progress: DS.attr('number'),
type: DS.attr('string'),
flavor: DS.attr('string'),
isUp: Ember.computed('status', function() {
return this.get('status') === 'running';
}),
endDate: DS.attr('date'),
status: DS.attr('string'),
createdAt: DS.attr('date'),
updatedAt: DS.attr('date'),
isDown: Ember.computed('status', function() {
return this.get('status') === 'down';
}),
isBooting: Ember.computed('status', function() {
return this.get('status') === 'booting';
}),
isDownloading: Ember.computed('status', function() {
return this.get('status') === 'creating';
}),
machineName: Ember.computed('name', function() {
return this.get('name') || 'No name';
}),
image: DS.belongsTo('image'),
user: DS.belongsTo('user'),
});
|
corentindrouet/nanocloud
|
assets/app/machine/model.js
|
JavaScript
|
agpl-3.0
| 1,836 |
# frozen_string_literal: true
require "searchlight"
require "kaminari"
module Decidim
module Debates
# This is the engine that runs on the public interface of `decidim-debates`.
# It mostly handles rendering the created debate associated to a participatory
# process.
class Engine < ::Rails::Engine
isolate_namespace Decidim::Debates
routes do
resources :debates, except: [:destroy] do
member do
post :close
end
resources :versions, only: [:show, :index]
resource :widget, only: :show, path: "embed"
end
root to: "debates#index"
end
initializer "decidim_changes" do
Decidim::SettingsChange.subscribe "debates" do |changes|
Decidim::Debates::SettingsChangeJob.perform_later(
changes[:component_id],
changes[:previous_settings],
changes[:current_settings]
)
end
end
initializer "decidim_meetings.add_cells_view_paths" do
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Debates::Engine.root}/app/cells")
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Debates::Engine.root}/app/views") # for partials
end
initializer "decidim_debates.assets" do |app|
app.config.assets.precompile += %w(decidim_debates_manifest.js)
end
initializer "decidim.debates.commented_debates_badge" do
Decidim::Gamification.register_badge(:commented_debates) do |badge|
badge.levels = [1, 5, 10, 30, 50]
badge.valid_for = [:user, :user_group]
badge.reset = lambda do |user|
debates = Decidim::Comments::Comment.where(
author: user,
decidim_root_commentable_type: "Decidim::Debates::Debate"\
)
debates.pluck(:decidim_root_commentable_id).uniq.count
end
end
Decidim::Comments::CommentCreation.subscribe do |data|
comment = Decidim::Comments::Comment.find(data[:comment_id])
next unless comment.decidim_root_commentable_type == "Decidim::Debates::Debate"
if comment.user_group.present?
comments = Decidim::Comments::Comment.where(
decidim_root_commentable_id: comment.decidim_root_commentable_id,
decidim_root_commentable_type: comment.decidim_root_commentable_type,
user_group: comment.user_group
)
Decidim::Gamification.increment_score(comment.user_group, :commented_debates) if comments.count == 1
elsif comment.author.present?
comments = Decidim::Comments::Comment.where(
decidim_root_commentable_id: comment.decidim_root_commentable_id,
decidim_root_commentable_type: comment.decidim_root_commentable_type,
author: comment.author
)
Decidim::Gamification.increment_score(comment.author, :commented_debates) if comments.count == 1
end
end
end
initializer "decidim_debates.register_metrics" do
Decidim.metrics_registry.register(:debates) do |metric_registry|
metric_registry.manager_class = "Decidim::Debates::Metrics::DebatesMetricManage"
metric_registry.settings do |settings|
settings.attribute :highlighted, type: :boolean, default: false
settings.attribute :scopes, type: :array, default: %w(participatory_process)
settings.attribute :weight, type: :integer, default: 3
settings.attribute :stat_block, type: :string, default: "small"
end
end
Decidim.metrics_operation.register(:participants, :debates) do |metric_operation|
metric_operation.manager_class = "Decidim::Debates::Metrics::DebateParticipantsMetricMeasure"
end
Decidim.metrics_operation.register(:followers, :debates) do |metric_operation|
metric_operation.manager_class = "Decidim::Debates::Metrics::DebateFollowersMetricMeasure"
end
end
end
end
end
|
AjuntamentdeBarcelona/decidim
|
decidim-debates/lib/decidim/debates/engine.rb
|
Ruby
|
agpl-3.0
| 4,088 |
FROM consol/tomcat-7.0
MAINTAINER Friedrich Große <[email protected]>
ENV KUNAGI_VERSION 0.26
EXPOSE 8080
ENV DEPLOY_DIR /kunagi
RUN wget http://kunagi.org/releases/${KUNAGI_VERSION}/kunagi.war --directory-prefix=kunagi
CMD /opt/tomcat/bin/deploy-and-run.sh
|
JavierPeris/kunagi
|
Dockerfile
|
Dockerfile
|
agpl-3.0
| 272 |
/* This file is part of VoltDB.
* Copyright (C) 2008-2014 VoltDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VoltDB. If not, see <http://www.gnu.org/licenses/>.
*/
package org.voltdb.sysprocs.saverestore;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import org.voltcore.logging.VoltLogger;
import org.voltcore.utils.CoreUtils;
import org.voltdb.PrivateVoltTableFactory;
import org.voltdb.VoltDB;
import org.voltdb.utils.VoltTableUtil;
/**
* A utility class for handling duplicates rows found during snapshot restore.
* Converts the row data to CSV and writes them to a per table file at the specified location
*
*/
public class DuplicateRowHandler {
private static final VoltLogger SNAP_LOG = new VoltLogger("SNAPSHOT");
private final File outputPath;
private final ExecutorService es = CoreUtils.getSingleThreadExecutor("Restore duplicate row handler");
private final Map<String, FileChannel> m_outputFiles = new HashMap<String, FileChannel>();
private final String now;
public DuplicateRowHandler(String path, Date now) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd-HH:mm:ss.SSSZ");
this.now = sdf.format(now);
outputPath = new File(path);
if (!outputPath.exists()) {
throw new RuntimeException("Output path for duplicates \"" + outputPath + "\" does not exist");
}
if (!outputPath.canExecute()) {
throw new RuntimeException("Output path for duplicates \"" + outputPath + "\" is not executable");
}
}
public void handleDuplicates(final String tableName, byte duplicates[]) throws IOException {
final byte csvBytes[] = VoltTableUtil.toCSV( PrivateVoltTableFactory.createVoltTableFromBuffer(ByteBuffer.wrap(duplicates), true),
',',
null,
1024 * 512).getSecond();
es.execute(new Runnable() {
@Override
public void run() {
try {
handleDuplicatesInternal(tableName, csvBytes);
} catch (Exception e) {
VoltDB.crashLocalVoltDB("Error handling duplicate rows during snapshot restore", true, e);
}
}
});
}
private void handleDuplicatesInternal(final String tableName, byte csvBytes[]) throws Exception {
FileChannel fc = getTableFile(tableName);
final ByteBuffer buf = ByteBuffer.wrap(csvBytes);
while (buf.hasRemaining()) {
fc.write(buf);
}
}
private FileChannel getTableFile(String tableName) throws Exception {
FileChannel fc = m_outputFiles.get(tableName);
if (fc == null) {
File outfile = new File(outputPath, tableName + "-duplicates-" + now + ".csv");
String message = "Found duplicate rows for table " + tableName + " they will be output to " + outfile;
SNAP_LOG.warn(message);
@SuppressWarnings("resource")
FileOutputStream fos = new FileOutputStream(outfile);
fc = fos.getChannel();
m_outputFiles.put(tableName, fc);
}
return fc;
}
public void close() throws Exception {
es.execute(new Runnable() {
@Override
public void run() {
try {
for (Map.Entry<String, FileChannel> e : m_outputFiles.entrySet()) {
FileChannel fc = e.getValue();
String message = "Output " + fc.size() + " bytes worth of duplicate row data for table " + e.getKey();
SNAP_LOG.warn(message);
fc.force(true);
fc.close();
}
m_outputFiles.clear();
} catch (Exception e) {
VoltDB.crashLocalVoltDB("Error syncing and closing duplicate files during snapshot restore", true, e);
}
}
});
es.shutdown();
es.awaitTermination(365, TimeUnit.DAYS);
}
}
|
zheguang/voltdb
|
src/frontend/org/voltdb/sysprocs/saverestore/DuplicateRowHandler.java
|
Java
|
agpl-3.0
| 4,954 |
local lfs = require("libs/libkoreader-lfs")
local UIManager = require("ui/uimanager")
local Menu = require("ui/widget/menu")
local Screen = require("device").screen
local Device = require("device")
local util = require("ffi/util")
local _ = require("gettext")
local ffi = require("ffi")
ffi.cdef[[
int strcoll (const char *str1, const char *str2);
]]
-- string sort function respecting LC_COLLATE
local function strcoll(str1, str2)
return ffi.C.strcoll(str1, str2) < 0
end
local FileChooser = Menu:extend{
no_title = true,
path = lfs.currentdir(),
parent = nil,
show_hidden = nil,
filter = function(filename) return true end,
exclude_dirs = {"%.sdr$"},
strcoll = strcoll,
collate = "strcoll", -- or collate = "access",
reverse_collate = false,
path_items = {}, -- store last browsed location(item index) for each path
}
function FileChooser:init()
self.width = Screen:getWidth()
-- common dir filter
self.dir_filter = function(dirname)
for _, pattern in ipairs(self.exclude_dirs) do
if dirname:match(pattern) then return end
end
return true
end
self.list = function(path, dirs, files)
-- lfs.dir directory without permission will give error
local ok, iter, dir_obj = pcall(lfs.dir, path)
if ok then
for f in iter, dir_obj do
if self.show_hidden or not string.match(f, "^%.[^.]") then
local filename = path.."/"..f
local attributes = lfs.attributes(filename)
if attributes ~= nil then
if attributes.mode == "directory" and f ~= "." and f~=".." then
if self.dir_filter(filename) then
table.insert(dirs, {name = f, attr = attributes})
end
elseif attributes.mode == "file" then
if self.file_filter == nil or self.file_filter(filename) then
table.insert(files, {name = f, attr = attributes})
end
end
end
end
end
end
end
-- circumvent string collating in Kobo devices. See issue koreader/koreader#686
if Device:isKobo() then
self.strcoll = function(a, b) return a < b end
end
self.item_table = self:genItemTableFromPath(self.path)
Menu.init(self) -- call parent's init()
end
function FileChooser:genItemTableFromPath(path)
local dirs = {}
local files = {}
self.list(path, dirs, files)
local sorting = nil
local reverse = self.reverse_collate
if self.collate == "strcoll" then
if DALPHA_SORT_CASE_INSENSITIVE then
sorting = function(a, b)
return self.strcoll(string.lower(a.name), string.lower(b.name)) == not reverse
end
else
sorting = function(a, b)
return self.strcoll(a.name, b.name) == not reverse
end
end
elseif self.collate == "access" then
sorting = function(a, b)
if reverse then
return a.attr.access < b.attr.access
else
return a.attr.access > b.attr.access
end
end
end
table.sort(dirs, sorting)
if path ~= "/" then table.insert(dirs, 1, {name = ".."}) end
table.sort(files, sorting)
local item_table = {}
for i, dir in ipairs(dirs) do
-- count sume of directories and files inside dir
local sub_dirs = {}
local dir_files = {}
local subdir_path = self.path.."/"..dir.name
self.list(subdir_path, sub_dirs, dir_files)
local items = #sub_dirs + #dir_files
local istr = util.template(
items == 1 and _("1 item")
or _("%1 items"), items)
table.insert(item_table, {
text = dir.name.."/",
mandatory = istr,
path = subdir_path
})
end
for _, file in ipairs(files) do
local full_path = self.path.."/"..file.name
local file_size = lfs.attributes(full_path, "size") or 0
local sstr
if file_size > 1024*1024 then
sstr = string.format("%4.1f MB", file_size/1024/1024)
elseif file_size > 1024 then
sstr = string.format("%4.1f KB", file_size/1024)
else
sstr = string.format("%d B", file_size)
end
table.insert(item_table, {
text = file.name,
mandatory = sstr,
path = full_path
})
end
-- lfs.dir iterated node string may be encoded with some weird codepage on Windows
-- we need to encode them to utf-8
if ffi.os == "Windows" then
for k, v in pairs(item_table) do
if v.text then
v.text = util.multiByteToUTF8(v.text) or ""
end
end
end
return item_table
end
function FileChooser:updateItems(select_number)
Menu.updateItems(self, select_number) -- call parent's updateItems()
self.path_items[self.path] = (self.page - 1) * self.perpage + (select_number or 1)
end
function FileChooser:refreshPath()
self:swithItemTable(nil, self:genItemTableFromPath(self.path), self.path_items[self.path])
end
function FileChooser:changeToPath(path)
path = util.realpath(path)
self.path = path
self:refreshPath()
end
function FileChooser:toggleHiddenFiles()
self.show_hidden = not self.show_hidden
self:refreshPath()
end
function FileChooser:setCollate(collate)
self.collate = collate
self:refreshPath()
end
function FileChooser:toggleReverseCollate()
self.reverse_collate = not self.reverse_collate
self:refreshPath()
end
function FileChooser:onMenuSelect(item)
-- parent directory of dir without permission get nil mode
-- we need to change to parent path in this case
if lfs.attributes(item.path, "mode") == "file" then
self:onFileSelect(item.path)
else
self:changeToPath(item.path)
end
return true
end
function FileChooser:onMenuHold(item)
self:onFileHold(item.path)
return true
end
function FileChooser:onFileSelect(file)
UIManager:close(self)
return true
end
function FileChooser:onFileHold(file)
return true
end
return FileChooser
|
frankyifei/koreader
|
frontend/ui/widget/filechooser.lua
|
Lua
|
agpl-3.0
| 6,386 |
<!doctype html>
<!--[if lt IE 7]><html class="no-js ie6 oldie" lang="[% lang_code %]"><![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="[% lang_code %]"><![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="[% lang_code %]"><![endif]-->
<!--[if IE 9]> <html class="no-js ie9 oldie" lang="[% lang_code %]"><![endif]-->
<!--[if gt IE 9]><!--><html class="no-js" lang="[% lang_code %]"><!--<![endif]-->
<head>
<meta name="viewport" content="initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="HandHeldFriendly" content="true">
<meta name="mobileoptimized" content="0">
[% SET start = c.config.ADMIN_BASE_URL IF admin %]
<link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]">
<link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)">
[% extra_css %]
<!--[if (lt IE 9) & (!IEMobile)]>
<link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]">
<![endif]-->
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/oxfordshire/position_map.js') %]" charset="utf-8"></script>
[% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
[% INCLUDE 'tracking_code.html' %]
[% PROCESS 'header_extra.html' %]
</head>
<body class="[% bodyclass | html IF bodyclass %]">
<div id="oxford-wrapper">
<div id="oxford-header" class="desk-only oxford-left">
<a href="http://www.oxfordshire.gov.uk/" title="Home" class="logo">Oxfordshire County Council<span></span></a>
<span id="oxford-links">
<a href="http://www.oxfordshire.gov.uk/" title="">Oxfordshire County Council home</a>
</span>
<div style="clear:both"></div>
<span class="header"><a href="/">Report a road or street problem</a></span>
[% IF c.user_exists %]
<div class="oxford-user">
<p>
[% tprintf(loc('Hi %s'), c.user.name || c.user.email) %]
<a href="/auth/sign_out">[% loc('Sign out') %]</a>
</p>
</div>
[% END %]
<div id="navigation">
<div class="menubar">
<div class="menu-inner">
<ul class="menu">
<li>
<[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %]>[% "Report" %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]>
</li>
<li>
<[% IF c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) %]span[% ELSE %]a href="/my"[% END
%]>[% loc("Your reports") %]</[% ( c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) ) ? 'span' : 'a' %]>
</li>
<li>
<[% IF c.req.uri.path == '/reports/Oxfordshire' %]span[% ELSE %]a href="/reports/Oxfordshire"[% END
%]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]>
</li>
<li>
<[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
%]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]>
</li>
<li>
<[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
%]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]>
</li>
</ul>
</div>
</div>
</div>
</div> <!-- end of oxford header -->
<div class="wrapper">
<div class="table-cell">
<header id="site-header" role="banner">
<div class="container">
<a href="/" id="site-logo">Oxfordshire FixMyStreet</a>
<a href="#main-nav" id="nav-link">Main Navigation</a>
</div>
</header>
[% IF c.user_exists %]
<div id="user-meta">
<p>
[% tprintf(loc('Hi %s'), c.user.name || c.user.email) %]
<a href="/auth/sign_out">[% loc('sign out') %]</a>
</p>
</div>
[% END %]
[% pre_container_extra %]
<div class="container">
<div class="content[% " $mainclass" | html IF mainclass %]" role="main">
<!-- [% INCLUDE 'debug_header.html' %] -->
|
antoinepemeja/fixmystreet
|
templates/web/oxfordshire/header.html
|
HTML
|
agpl-3.0
| 5,012 |
# coding=utf-8
# Copyright (c) 2001-2016, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
# a non ending quest to the responsive locomotion way of traveling!
#
# LICENCE: This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Stay tuned using
# twitter @navitia
# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org
# https://groups.google.com/d/forum/navitia
# www.navitia.io
from __future__ import absolute_import, print_function, division
import mock
from jormungandr.realtime_schedule.sytral import Sytral
from jormungandr.tests.utils_test import MockRequests
import validators
import datetime
import pytz
import pytest
def make_url_params_test():
sytral = Sytral(id='tata', service_url='http://bob.com/')
# The return is like [(stop_id, val1), (stop_id, val2), (direction_type, val), ...]
params = sytral._make_params(MockRoutePoint(line_code='line_toto', stop_id='stop_tutu'))
assert params == [('stop_id', 'stop_tutu')]
params = sytral._make_params(MockRoutePoint(line_code='line_toto', stop_id=['stop_tutu', 'stop_toto']))
assert params == [('stop_id', 'stop_tutu'), ('stop_id', 'stop_toto')]
params = sytral._make_params(
MockRoutePoint(line_code='line_toto', stop_id='stop_tutu', direction_type='forward')
)
assert params == [('stop_id', 'stop_tutu'), ('direction_type', 'forward')]
def make_url_params_with_invalid_code_test():
"""
test make_url when RoutePoint does not have a mandatory code
we should not get any url
"""
sytral = Sytral(id='tata', service_url='http://bob.com/')
# The return is like [(stop_id, val1), (stop_id, val2), (direction_type, val), ...]
params = sytral._make_params(MockRoutePoint(line_code='line_toto', stop_id=[]))
assert params == None
class MockResponse(object):
def __init__(self, data, status_code, url, *args, **kwargs):
self.data = data
self.status_code = status_code
self.url = url
def json(self):
return self.data
@pytest.fixture(scope="module")
def mock_multiline_response():
return {
"departures": [
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:37:15+02:00",
"type": "E",
"line": "05A",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:38:15+02:00",
"type": "E",
"line": "04",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:45:35+02:00",
"type": "E",
"line": "05B",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:49:35+02:00",
"type": "E",
"line": "04",
"stop": "42",
},
]
}
@pytest.fixture(scope="module")
def mock_good_response():
return {
"departures": [
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:37:15+02:00",
"type": "E",
"line": "05",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:38:15+02:00",
"type": "E",
"line": "04",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:45:35+02:00",
"type": "E",
"line": "05",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:49:35+02:00",
"type": "E",
"line": "04",
"stop": "42",
},
]
}
@pytest.fixture(scope="module")
def mock_direction_type_is_forward_response():
return {
"departures": [
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "forward",
"datetime": "2016-04-11T14:37:15+02:00",
"type": "E",
"line": "05",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "forward",
"datetime": "2016-04-11T14:38:15+02:00",
"type": "E",
"line": "04",
"stop": "42",
},
]
}
@pytest.fixture(scope="module")
def mock_empty_response():
return {}
@pytest.fixture(scope="module")
def mock_no_departure_response():
return {"departures": []}
@pytest.fixture(scope="module")
def mock_missing_line_response():
return {
"departures": [
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:38:15+02:00",
"type": "E",
"line": "04",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:49:35+02:00",
"type": "E",
"line": "04",
"stop": "42",
},
]
}
@pytest.fixture(scope="module")
def mock_theoric_response():
return {
"departures": [
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:37:15+01:00",
"type": "T",
"line": "05",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:38:15+01:00",
"type": "E",
"line": "04",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:45:35+01:00",
"type": "E",
"line": "05",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:49:35+01:00",
"type": "E",
"line": "04",
"stop": "42",
},
]
}
@pytest.fixture(scope="module")
def mock_multi_stop_point_id_response():
return {
"departures": [
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:37:15+01:00",
"type": "T",
"line": "05",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:38:15+01:00",
"type": "E",
"line": "04",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:45:35+01:00",
"type": "E",
"line": "05",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:49:35+01:00",
"type": "E",
"line": "04",
"stop": "42",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:38:15+01:00",
"type": "T",
"line": "05",
"stop": "43",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:38:15+01:00",
"type": "E",
"line": "04",
"stop": "43",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:47:35+01:00",
"type": "E",
"line": "05",
"stop": "43",
},
{
"direction_id": "3341",
"direction_name": "Piscine Chambéry",
"direction_type": "both",
"datetime": "2016-04-11T14:49:35+01:00",
"type": "E",
"line": "04",
"stop": "43",
},
]
}
class MockRoutePoint(object):
def __init__(self, *args, **kwargs):
l = kwargs['line_code']
if isinstance(l, list):
self._hardcoded_line_ids = l
else:
self._hardcoded_line_ids = [l]
l = kwargs['stop_id']
if isinstance(l, list):
self._hardcoded_stop_ids = l
else:
self._hardcoded_stop_ids = [l]
if 'direction_type' in kwargs:
self._hardcoded_direction_type = kwargs['direction_type']
else:
self._hardcoded_direction_type = None
def fetch_all_stop_id(self, object_id_tag):
return self._hardcoded_stop_ids
def fetch_all_line_id(self, object_id_tag):
return self._hardcoded_line_ids
def fetch_direction_type(self):
return self._hardcoded_direction_type
def next_passage_for_route_point_test(mock_good_response):
"""
test the whole next_passage_for_route_point
mock the http call to return a good response, we should get some next_passages
"""
sytral = Sytral(id='tata', service_url='http://bob.com/')
mock_requests = MockRequests({'http://bob.com/?stop_id=42': (mock_good_response, 200)})
route_point = MockRoutePoint(line_code='05', stop_id='42')
with mock.patch('requests.get', mock_requests.get):
passages = sytral.next_passage_for_route_point(route_point)
assert len(passages) == 2
assert passages[0].datetime == datetime.datetime(2016, 4, 11, 12, 37, 15, tzinfo=pytz.UTC)
assert passages[0].is_real_time
assert passages[1].datetime == datetime.datetime(2016, 4, 11, 12, 45, 35, tzinfo=pytz.UTC)
assert passages[1].is_real_time
def next_passage_for_route_point_with_direction_type_test(mock_direction_type_is_forward_response):
"""
test the whole next_passage_for_route_point with direction_type parameter
mock the http call to return a good response, we should get some next_passages
"""
sytral = Sytral(id='tata', service_url='http://bob.com/')
mock_requests = MockRequests(
{'http://bob.com/?direction_type=forward&stop_id=42': (mock_direction_type_is_forward_response, 200)}
)
route_point = MockRoutePoint(line_code='05', stop_id='42', direction_type='forward')
with mock.patch('requests.get', mock_requests.get):
passages = sytral.next_passage_for_route_point(route_point)
assert len(passages) == 1
assert passages[0].datetime == datetime.datetime(2016, 4, 11, 12, 37, 15, tzinfo=pytz.UTC)
assert passages[0].is_real_time
def next_passage_for_empty_response_test(mock_empty_response):
"""
test the whole next_passage_for_route_point
mock the http call to return a empty response, we should get None
"""
sytral = Sytral(id='tata', service_url='http://bob.com/')
mock_requests = MockRequests({'http://bob.com/?stop_id=42': (mock_empty_response, 500)})
route_point = MockRoutePoint(line_code='05', stop_id='42')
with mock.patch('requests.get', mock_requests.get):
passages = sytral.next_passage_for_route_point(route_point)
assert passages is None
def next_passage_for_no_departures_response_test(mock_no_departure_response):
"""
test the whole next_passage_for_route_point
mock the http call to return a response without any departures, we should get no departure
"""
sytral = Sytral(id='tata', service_url='http://bob.com/')
mock_requests = MockRequests({'http://bob.com/?stop_id=42': (mock_no_departure_response, 200)})
route_point = MockRoutePoint(line_code='05', stop_id='42')
with mock.patch('requests.get', mock_requests.get):
passages = sytral.next_passage_for_route_point(route_point)
assert passages == []
def next_passage_for_missing_line_response_test(mock_missing_line_response):
"""
test the whole next_passage_for_route_point
mock the http call to return a response without wanted line we should get no departure
"""
sytral = Sytral(id='tata', service_url='http://bob.com/', service_args={'a': 'bobette', 'b': '12'})
mock_requests = MockRequests({'http://bob.com/?stop_id=42': (mock_missing_line_response, 200)})
route_point = MockRoutePoint(line_code='05', stop_id='42')
with mock.patch('requests.get', mock_requests.get):
passages = sytral.next_passage_for_route_point(route_point)
assert passages == []
def next_passage_with_theoric_time_response_test(mock_theoric_response):
"""
test the whole next_passage_for_route_point
mock the http call to return a response with a theoric time we should get one departure
"""
sytral = Sytral(id='tata', service_url='http://bob.com/', service_args={'a': 'bobette', 'b': '12'})
mock_requests = MockRequests({'http://bob.com/?stop_id=42': (mock_theoric_response, 200)})
route_point = MockRoutePoint(line_code='05', stop_id='42')
with mock.patch('requests.get', mock_requests.get):
passages = sytral.next_passage_for_route_point(route_point)
assert len(passages) == 2
assert passages[0].datetime == datetime.datetime(2016, 4, 11, 13, 37, 15, tzinfo=pytz.UTC)
assert not passages[0].is_real_time
assert passages[1].datetime == datetime.datetime(2016, 4, 11, 13, 45, 35, tzinfo=pytz.UTC)
assert passages[1].is_real_time
def status_test():
sytral = Sytral(
id=u'tata-é$~#@"*!\'`§èû', service_url='http://bob.com/', service_args={'a': 'bobette', 'b': '12'}
)
status = sytral.status()
assert status['id'] == u"tata-é$~#@\"*!'`§èû"
def next_passage_for_route_point_multiline_test(mock_multiline_response):
"""
test the whole next_passage_for_route_point with a routepoint having multiple SAE lines
"""
sytral = Sytral(id='tata', service_url='http://bob.com/')
mock_requests = MockRequests({'http://bob.com/?stop_id=42': (mock_multiline_response, 200)})
route_point = MockRoutePoint(line_code=['05A', '05B'], stop_id='42')
with mock.patch('requests.get', mock_requests.get):
passages = sytral.next_passage_for_route_point(route_point)
assert len(passages) == 2
assert passages[0].datetime == datetime.datetime(2016, 4, 11, 12, 37, 15, tzinfo=pytz.UTC)
assert passages[0].is_real_time
assert passages[1].datetime == datetime.datetime(2016, 4, 11, 12, 45, 35, tzinfo=pytz.UTC)
assert passages[1].is_real_time
def next_passage_for_route_point_multi_stop_point_id_test(mock_multi_stop_point_id_response):
"""
test next_passage for route point with multi stop point ID
"""
sytral = Sytral(id='tata', service_url='http://bob.com/')
mock_requests = MockRequests(
{'http://bob.com/?stop_id=42&stop_id=43': (mock_multi_stop_point_id_response, 200)}
)
route_point = MockRoutePoint(line_code='05', stop_id=['42', '43'])
with mock.patch('requests.get', mock_requests.get):
passages = sytral.next_passage_for_route_point(route_point)
assert len(passages) == 4
# Stop id 42
assert passages[0].datetime == datetime.datetime(2016, 4, 11, 13, 37, 15, tzinfo=pytz.UTC)
assert not passages[0].is_real_time
assert passages[1].datetime == datetime.datetime(2016, 4, 11, 13, 45, 35, tzinfo=pytz.UTC)
assert passages[1].is_real_time
# Stop id 43
assert passages[2].datetime == datetime.datetime(2016, 4, 11, 13, 38, 15, tzinfo=pytz.UTC)
assert not passages[2].is_real_time
assert passages[3].datetime == datetime.datetime(2016, 4, 11, 13, 47, 35, tzinfo=pytz.UTC)
assert passages[3].is_real_time
|
xlqian/navitia
|
source/jormungandr/jormungandr/realtime_schedule/tests/sytral_test.py
|
Python
|
agpl-3.0
| 18,954 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.clinical.domain;
// Generated from form domain impl
public interface SurgicalOperations extends ims.domain.DomainInterface
{
// Generated from form domain interface definition
/**
* will call procedure List Impl to list procedures
*/
public ims.core.vo.ProcedureLiteVoCollection listProcedures(String filterProcedure) throws ims.domain.exceptions.DomainInterfaceException;
// Generated from form domain interface definition
public ims.core.vo.PatientSurgicalOperationVoCollection listClinicalContactSurgicalOperations(ims.core.vo.ClinicalContactShortVo voClinicalContactShort);
// Generated from form domain interface definition
/**
* save an operation and add to the collection for the clinical contact
*/
public ims.core.vo.PatientSurgicalOperationVo savePatientSurgicalOperation(ims.core.vo.PatientSurgicalOperationVo patientOperation, ims.core.patient.vo.PatientRefVo patient, ims.core.vo.CareContextShortVo careContext) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException;
// Generated from form domain interface definition
/**
* pass the clinical contact and the current procedure - get the patient and his coreclinical and list all the charachteristics where the insertion procedure does not match the current procedure
*/
public ims.core.vo.PatientCharacteristicVoCollection listCharchteristic(ims.core.patient.vo.PatientRefVo refVoPatient, ims.core.vo.PatientProcedureVo currentProcedure);
// Generated from form domain interface definition
public ims.core.vo.PatientSurgicalOperationVoCollection listCareContextSurgicalOperations(ims.core.admin.vo.CareContextRefVo refCareContext, Boolean bRIE);
// Generated from form domain interface definition
public ims.core.vo.PatientPastMedicalHistoryVo savePatientPMHRecord(ims.core.vo.PatientPastMedicalHistoryVo voPMH, ims.core.patient.vo.PatientRefVo patient) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException;
// Generated from form domain interface definition
/**
* listHcpLiteByName
*/
public ims.core.vo.HcpLiteVoCollection listHcpLiteByName(String hcpName);
// Generated from form domain interface definition
public ims.core.vo.PatientProcedureVoCollection listCareContextPatientProcedures(ims.core.admin.vo.CareContextRefVo refVoCareContext);
}
|
open-health-hub/openmaxims-linux
|
openmaxims_workspace/Clinical/src/ims/clinical/domain/SurgicalOperations.java
|
Java
|
agpl-3.0
| 4,090 |
package org.kuali.coeus.propdev.impl.sapfeed;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import org.kuali.coeus.sys.framework.model.KcPersistableBusinessObjectBase;
@Entity
@Table(name = "SAP_FEED_ERROR_LOG")
public class SapFeedErrorDetails extends KcPersistableBusinessObjectBase {
@Id
@Column(name = "SAP_FEED_ERROR_ID")
private Long errorId;
@Column(name = "SAP_FEED_BATCH_ID")
private Long sapFeedBatchId;
@Column(name = "BATCH_ID")
private Long batchId;
@Column(name = "FEED_ID")
private Long feedId;
@Column(name = "ERROR_MESSAGE")
private String errorMessage;
public Long getErrorId() {
return errorId;
}
public void setErrorId(Long errorId) {
this.errorId = errorId;
}
public Long getBatchId() {
return batchId;
}
public void setBatchId(Long batchId) {
this.batchId = batchId;
}
public Long getFeedId() {
return feedId;
}
public void setFeedId(Long feedId) {
this.feedId = feedId;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Long getSapFeedBatchId() {
return sapFeedBatchId;
}
public void setSapFeedBatchId(Long sapFeedBatchId) {
this.sapFeedBatchId = sapFeedBatchId;
}
}
|
rashikpolus/MIT_KC
|
coeus-impl/src/main/java/org/kuali/coeus/propdev/impl/sapfeed/SapFeedErrorDetails.java
|
Java
|
agpl-3.0
| 1,360 |
<?php
namespace SPHERE\Application\Billing\Accounting\Debtor;
use SPHERE\Application\IModuleInterface;
use SPHERE\Application\Platform\Gatekeeper\Authorization\Consumer\Consumer;
use SPHERE\Common\Main;
use SPHERE\Common\Window\Navigation\Link;
use SPHERE\System\Database\Link\Identifier;
/**
* Class Debtor
* @package SPHERE\Application\Billing\Accounting\Debtor
*/
class Debtor implements IModuleInterface
{
public static function registerModule()
{
/**
* Register Module
*/
// Error::registerModule();
/**
* Register Navigation
*/
Main::getDisplay()->addApplicationNavigation(
new Link(new Link\Route(__NAMESPACE__), new Link\Name('Beitragszahler'))
);
/**
* Register Route
*/
Main::getDispatcher()->registerRoute(Main::getDispatcher()->createRoute(
__NAMESPACE__, __NAMESPACE__.'/Frontend::frontendDebtor'
));
Main::getDispatcher()->registerRoute(Main::getDispatcher()->createRoute(
__NAMESPACE__.'/View', __NAMESPACE__.'/Frontend::frontendDebtorView'
));
Main::getDispatcher()->registerRoute(Main::getDispatcher()->createRoute(
__NAMESPACE__.'/Edit', __NAMESPACE__.'/Frontend::frontendDebtorEdit'
));
}
/**
* @return Service
*/
public static function useService()
{
return new Service(
new Identifier('Billing', 'Invoice', null, null, Consumer::useService()->getConsumerBySession()),
__DIR__.'/Service/Entity', __NAMESPACE__.'\Service\Entity'
);
}
/**
* @return Frontend
*/
public static function useFrontend()
{
return new Frontend();
}
}
|
BozzaCoon/SPHERE-Framework
|
Application/Billing/Accounting/Debtor/Debtor.php
|
PHP
|
agpl-3.0
| 1,778 |
/*
* RapidMiner
*
* Copyright (C) 2001-2014 by RapidMiner and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapidminer.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.rapidminer.operator.generator;
import com.rapidminer.example.Attribute;
import com.rapidminer.example.Attributes;
import com.rapidminer.example.table.AttributeFactory;
import com.rapidminer.operator.ports.metadata.AttributeMetaData;
import com.rapidminer.operator.ports.metadata.ExampleSetMetaData;
import com.rapidminer.operator.ports.metadata.SetRelation;
import com.rapidminer.tools.Ontology;
import com.rapidminer.tools.RandomGenerator;
import com.rapidminer.tools.math.container.Range;
/** A target function for regression labels, i.e. continous numercial labels.
*
* @author Ingo Mierswa
*/
public abstract class RegressionFunction implements TargetFunction {
private double lower = -10.0d;
private double upper = 10.0d;
protected int numberOfExamples = 0;
protected int numberOfAttributes = 0;
/** Does nothing. */
public void init(RandomGenerator random) {}
public void setLowerArgumentBound(double lower) {
this.lower = lower;
}
public void setUpperArgumentBound(double upper) {
this.upper = upper;
}
public double getLowerArgumentBound() {
return this.lower;
}
public double getUpperArgumentBound() {
return this.upper;
}
public void setTotalNumberOfExamples(int number) {
numberOfExamples = number;
}
public void setTotalNumberOfAttributes(int number) {
numberOfAttributes = number;
}
public Attribute getLabel() {
return AttributeFactory.createAttribute("label", Ontology.REAL);
}
public double[] createArguments(int dimension, RandomGenerator random) throws FunctionException {
double[] args = new double[dimension];
for (int i = 0; i < args.length; i++)
args[i] = random.nextDoubleInRange(lower, upper);
return args;
}
@Override
public ExampleSetMetaData getGeneratedMetaData() {
ExampleSetMetaData emd = new ExampleSetMetaData();
// label
AttributeMetaData amd = new AttributeMetaData("label", Ontology.REAL, Attributes.LABEL_NAME);
amd.setValueRange(new Range(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY), SetRelation.SUBSET);
emd.addAttribute(amd);
// attributes
for (int i = 0; i < numberOfAttributes; i++) {
amd = new AttributeMetaData("att" + (i + 1), Ontology.REAL);
amd.setValueRange(new Range(lower, upper), SetRelation.EQUAL);
emd.addAttribute(amd);
}
emd.setNumberOfExamples(numberOfExamples);
return emd;
}
@Override
public int getMinNumberOfAttributes() {
return 1;
}
@Override
public int getMaxNumberOfAttributes() {
return Integer.MAX_VALUE;
}
}
|
rapidminer/rapidminer-5
|
src/com/rapidminer/operator/generator/RegressionFunction.java
|
Java
|
agpl-3.0
| 3,372 |
# NX500 - Enable Silent Shutter Without Hack
### NOTE: This only works on NX500 at SINGLE frame shooting (not with CONTINUOUS). See [here](https://github.com/ottokiksmaler/nx500_nx1_modding/blob/master/NX500%20Silent%20shooting.md)
This tool is useful to enable silent (full electronic) shooting on your own camera if you don't want to hack it.
u will need a spare SD card for this (any card, size is not important, you can reuse the card afterwards).
Instructions:
- Download this ZIP file: [nx500silent.zip](https://github.com/ottokiksmaler/nx500_nx1_modding/blob/master/nx500silent.zip?raw=true)
- Unpack it to some spare SD card (so that there is a file **info.tg** on the root directory of the SD card, for example, the file ```E:\info.tg``` exists)
- Put the SD card in the camera
- Power on the camera
- Wait a bit
- That's it - now you should have silent shooting enabled
### IMPORTANT - This SD card will start the camera in *"Factory mode"* that has limited touchscreen (and other) functionality.
|
ottokiksmaler/nx500_nx1_modding
|
NX500_Silent_Shutter_Without_Hack.md
|
Markdown
|
agpl-3.0
| 1,024 |
//#############################################################################
//# #
//# Copyright (C) <2015> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.clinicaladmin.vo;
/**
* Linked to clinical.configuration.ProblemHotlistItem business object (ID: 1073100009).
*/
public class ProblemHotlistItemVo extends ims.clinical.configuration.vo.ProblemHotlistItemRefVo implements ims.vo.ImsCloneable, Comparable, ims.vo.interfaces.IHotlistItem
{
private static final long serialVersionUID = 1L;
public ProblemHotlistItemVo()
{
}
public ProblemHotlistItemVo(Integer id, int version)
{
super(id, version);
}
public ProblemHotlistItemVo(ims.clinicaladmin.vo.beans.ProblemHotlistItemVoBean bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.problem = bean.getProblem() == null ? null : bean.getProblem().buildVo();
}
public void populate(ims.vo.ValueObjectBeanMap map, ims.clinicaladmin.vo.beans.ProblemHotlistItemVoBean bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.problem = bean.getProblem() == null ? null : bean.getProblem().buildVo(map);
}
public ims.vo.ValueObjectBean getBean()
{
return this.getBean(new ims.vo.ValueObjectBeanMap());
}
public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
{
ims.clinicaladmin.vo.beans.ProblemHotlistItemVoBean bean = null;
if(map != null)
bean = (ims.clinicaladmin.vo.beans.ProblemHotlistItemVoBean)map.getValueObjectBean(this);
if (bean == null)
{
bean = new ims.clinicaladmin.vo.beans.ProblemHotlistItemVoBean();
map.addValueObjectBean(this, bean);
bean.populate(map, this);
}
return bean;
}
public Object getFieldValueByFieldName(String fieldName)
{
if(fieldName == null)
throw new ims.framework.exceptions.CodingRuntimeException("Invalid field name");
fieldName = fieldName.toUpperCase();
if(fieldName.equals("PROBLEM"))
return getProblem();
return super.getFieldValueByFieldName(fieldName);
}
public boolean getProblemIsNotNull()
{
return this.problem != null;
}
public ims.clinical.vo.ClinicalProblemShortVo getProblem()
{
return this.problem;
}
public void setProblem(ims.clinical.vo.ClinicalProblemShortVo value)
{
this.isValidated = false;
this.problem = value;
}
/**
* IHotlistItem
*/
public ims.vo.interfaces.IGenericItem getIGenericItem()
{
return this.getProblem();
}
public Integer getIHotlistItemID()
{
return this.getID_ProblemHotlistItem();
}
public void setIGenericItem(ims.vo.interfaces.IGenericItem iGenericItem)
{
this.setProblem((ims.clinical.vo.ClinicalProblemShortVo)iGenericItem);
}
public boolean isValidated()
{
if(this.isBusy)
return true;
this.isBusy = true;
if(!this.isValidated)
{
this.isBusy = false;
return false;
}
if(this.problem != null)
{
if(!this.problem.isValidated())
{
this.isBusy = false;
return false;
}
}
this.isBusy = false;
return true;
}
public String[] validate()
{
return validate(null);
}
public String[] validate(String[] existingErrors)
{
if(this.isBusy)
return null;
this.isBusy = true;
java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
if(existingErrors != null)
{
for(int x = 0; x < existingErrors.length; x++)
{
listOfErrors.add(existingErrors[x]);
}
}
if(this.problem != null)
{
String[] listOfOtherErrors = this.problem.validate();
if(listOfOtherErrors != null)
{
for(int x = 0; x < listOfOtherErrors.length; x++)
{
listOfErrors.add(listOfOtherErrors[x]);
}
}
}
int errorCount = listOfErrors.size();
if(errorCount == 0)
{
this.isBusy = false;
this.isValidated = true;
return null;
}
String[] result = new String[errorCount];
for(int x = 0; x < errorCount; x++)
result[x] = (String)listOfErrors.get(x);
this.isBusy = false;
this.isValidated = false;
return result;
}
public void clearIDAndVersion()
{
this.id = null;
this.version = 0;
}
public Object clone()
{
if(this.isBusy)
return this;
this.isBusy = true;
ProblemHotlistItemVo clone = new ProblemHotlistItemVo(this.id, this.version);
if(this.problem == null)
clone.problem = null;
else
clone.problem = (ims.clinical.vo.ClinicalProblemShortVo)this.problem.clone();
clone.isValidated = this.isValidated;
this.isBusy = false;
return clone;
}
public int compareTo(Object obj)
{
return compareTo(obj, true);
}
public int compareTo(Object obj, boolean caseInsensitive)
{
if (obj == null)
{
return -1;
}
if(caseInsensitive); // this is to avoid eclipse warning only.
if (!(ProblemHotlistItemVo.class.isAssignableFrom(obj.getClass())))
{
throw new ClassCastException("A ProblemHotlistItemVo object cannot be compared an Object of type " + obj.getClass().getName());
}
ProblemHotlistItemVo compareObj = (ProblemHotlistItemVo)obj;
int retVal = 0;
if (retVal == 0)
{
if(this.getID_ProblemHotlistItem() == null && compareObj.getID_ProblemHotlistItem() != null)
return -1;
if(this.getID_ProblemHotlistItem() != null && compareObj.getID_ProblemHotlistItem() == null)
return 1;
if(this.getID_ProblemHotlistItem() != null && compareObj.getID_ProblemHotlistItem() != null)
retVal = this.getID_ProblemHotlistItem().compareTo(compareObj.getID_ProblemHotlistItem());
}
return retVal;
}
public synchronized static int generateValueObjectUniqueID()
{
return ims.vo.ValueObject.generateUniqueID();
}
public int countFieldsWithValue()
{
int count = 0;
if(this.problem != null)
count++;
return count;
}
public int countValueObjectFields()
{
return 1;
}
protected ims.clinical.vo.ClinicalProblemShortVo problem;
private boolean isValidated = false;
private boolean isBusy = false;
}
|
FreudianNM/openMAXIMS
|
Source Library/openmaxims_workspace/ValueObjects/src/ims/clinicaladmin/vo/ProblemHotlistItemVo.java
|
Java
|
agpl-3.0
| 7,970 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emmanuel Girardin <[email protected]>
#
# The licence is in the file __manifest__.py
#
##############################################################################
"""
Run this script if you want to compute the best decision threshold for the
class CheckBoxReader. The main is at the end of the file and contains a few
more explanations
"""
import os
import logging
from . import checkboxreader as cbr
_logger = logging.getLogger(__name__)
try:
import cv2
import numpy as np
import matplotlib.pyplot as plt
except ImportError:
_logger.warning('Please install cv2, numpy and matplotlib to use SBC '
'module')
def findmax(x):
m = max(x)
ind = [i for i, val in enumerate(x) if val == m]
return m, ind
def findmin(x):
m = min(x)
ind = [i for i, val in enumerate(x) if val == m]
return m, ind
def plot(img):
fig = plt.figure()
ax = fig.add_subplot(111)
ax.imshow(img, cmap='gray', interpolation='nearest')
plt.pause(1)
def compute_threshold(D1, D2, display=False):
D12 = np.concatenate((D1, D2))
N1 = len(D1)
N2 = len(D2)
bins = range(0, int(max(D12)), int(max(D12)/50.0))
# We define P1 to be the probability of the box to be checked, and P2 the
# probability of being empty with P1 + P2 = 1
P1 = 1.0/6.0
P2 = 5.0/6.0
# The probability distribution function can be computed as an histogram
pdf1, bins1 = np.histogram(D1, bins)
pdf2, bins2 = np.histogram(D2, bins)
# We normalized them in order that their integral is equal to 1
pdf1 = pdf1 / (1.0*N1)
pdf2 = pdf2 / (1.0*N2)
# Know we want to find the threshold 't' minimizing the following error
# probability: PErr(t) = P(D1<t) + P(D2>=t)
# To do so, we will use the cummulative distribution function
cdf1 = np.cumsum(pdf1)
cdf2 = np.cumsum(pdf2)
# cdf1[-1] and cdf2[-1] are supposed to be equal to 1 and
# P(Error) can be computed like this
PErr = P1*cdf1 + P2*(1-cdf2)
# We finally find the minimum Error:
mini, index = findmin(PErr)
threshold = (bins[index[0]]+bins[index[-1]])/2.0
if display:
# Let's plot a few results
fig = plt.figure()
# plot pdfs
hist = fig.add_subplot(121)
hist.plot(bins1[1:], P1*pdf1, 'r-', linewidth=2)
hist.plot(bins2[1:], P2*pdf2, 'b-', linewidth=2)
hist.set_xlabel('Score distribution')
hist.set_ylabel('Probability')
hist.grid(True)
# ROC Curve
roc = fig.add_subplot(122)
roc.plot(1-cdf2, 1-cdf1, linewidth=5)
roc.set_xlabel('False Negative Rate')
roc.set_ylabel('True Positive Rate')
roc.grid(True)
plt.show()
plt.pause(1)
return threshold
def train(folder, indices=None):
D = []
files = os.listdir(folder)
files.sort()
if not indices:
indices = range(len(files))
for index in indices:
img_name = files[index]
img = cv2.imread(folder + '/' + img_name)
cbr_img = cbr.CheckboxReader(img)
score = cbr_img.compute_boxscore(boxsize=17)
D.append(score)
D = np.array(D)
return D
def test(thresh, folder, indices=None):
PR = 0
files = os.listdir(folder)
files.sort()
if not indices:
indices = range(len(files))
for index in indices:
img_name = files[index]
img = cv2.imread(folder + '/' + img_name)
cbr_img = cbr.CheckboxReader(img)
score = cbr_img.compute_boxscore(boxsize=17)
if thresh < score:
PR += 1.0
PR /= (len(indices)*1.0)
return PR
# ----------------------------------------------------------------------------
# ------------------------------- MAIN ---------------------------------------
# ----------------------------------------------------------------------------
# This script read a set of images in a folder. You can find a set of
# checkbox images at on the nas at /it/devel/Scan Lettres S2B/checkboxes
# folder0 contain two sub folder "True" and "False"
# True contains 100 small images of positive checkboxes, and "False"
# contains 100 of negative checkboxes
# Train
folder0 = '/home/openerp/dev/addons/compassion-modules/sbc_compassion/tests' \
'/testdata/checkboxes'
DTrue = train(folder0 + '/True')
DFalse = train(folder0 + '/False')
# we compute the threshold which minimize the probability error. Set
# display to False if you haven't matplotlib installed
thresh = compute_threshold(DTrue, DFalse, display=True)
# pylint: disable=print-used
print('A nice decision threshold would be ' + str(thresh))
# Test:
# We finally test the threshold. It is better to test it on images that you
# didn't used for the training.
# True and False Positive Rates
TruePR = test(thresh, folder0 + '/True')
FalsePR = test(thresh, folder0 + '/False')
# pylint: disable=print-used
print('True Rositive Rate: ' + str(TruePR))
# pylint: disable=print-used
print('False Positive Rate: ' + str(FalsePR))
|
ecino/compassion-modules
|
sbc_compassion/tools/train_checkboxreader.py
|
Python
|
agpl-3.0
| 5,265 |
//#############################################################################
//# #
//# Copyright (C) <2015> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.admin.vo.lookups;
import ims.framework.cn.data.TreeModel;
import ims.framework.cn.data.TreeNode;
import ims.vo.LookupInstanceCollection;
import ims.vo.LookupInstVo;
public class DateExpressionRangeUnitCollection extends LookupInstanceCollection implements ims.vo.ImsCloneable, TreeModel
{
private static final long serialVersionUID = 1L;
public void add(DateExpressionRangeUnit value)
{
super.add(value);
}
public int indexOf(DateExpressionRangeUnit instance)
{
return super.indexOf(instance);
}
public boolean contains(DateExpressionRangeUnit instance)
{
return indexOf(instance) >= 0;
}
public DateExpressionRangeUnit get(int index)
{
return (DateExpressionRangeUnit)super.getIndex(index);
}
public void remove(DateExpressionRangeUnit instance)
{
if(instance != null)
{
int index = indexOf(instance);
if(index >= 0)
remove(index);
}
}
public Object clone()
{
DateExpressionRangeUnitCollection newCol = new DateExpressionRangeUnitCollection();
DateExpressionRangeUnit item;
for (int i = 0; i < super.size(); i++)
{
item = this.get(i);
newCol.add(new DateExpressionRangeUnit(item.getID(), item.getText(), item.isActive(), item.getParent(), item.getImage(), item.getColor(), item.getOrder()));
}
for (int i = 0; i < newCol.size(); i++)
{
item = newCol.get(i);
if (item.getParent() != null)
{
int parentIndex = this.indexOf(item.getParent());
if(parentIndex >= 0)
item.setParent(newCol.get(parentIndex));
else
item.setParent((DateExpressionRangeUnit)item.getParent().clone());
}
}
return newCol;
}
public DateExpressionRangeUnit getInstance(int instanceId)
{
return (DateExpressionRangeUnit)super.getInstanceById(instanceId);
}
public TreeNode[] getRootNodes()
{
LookupInstVo[] roots = super.getRoots();
TreeNode[] nodes = new TreeNode[roots.length];
System.arraycopy(roots, 0, nodes, 0, roots.length);
return nodes;
}
public DateExpressionRangeUnit[] toArray()
{
DateExpressionRangeUnit[] arr = new DateExpressionRangeUnit[this.size()];
super.toArray(arr);
return arr;
}
public static DateExpressionRangeUnitCollection buildFromBeanCollection(java.util.Collection beans)
{
DateExpressionRangeUnitCollection coll = new DateExpressionRangeUnitCollection();
if(beans == null)
return coll;
java.util.Iterator iter = beans.iterator();
while(iter.hasNext())
{
coll.add(DateExpressionRangeUnit.buildLookup((ims.vo.LookupInstanceBean)iter.next()));
}
return coll;
}
public static DateExpressionRangeUnitCollection buildFromBeanCollection(ims.vo.LookupInstanceBean[] beans)
{
DateExpressionRangeUnitCollection coll = new DateExpressionRangeUnitCollection();
if(beans == null)
return coll;
for(int x = 0; x < beans.length; x++)
{
coll.add(DateExpressionRangeUnit.buildLookup(beans[x]));
}
return coll;
}
}
|
FreudianNM/openMAXIMS
|
Source Library/openmaxims_workspace/ValueObjects/src/ims/admin/vo/lookups/DateExpressionRangeUnitCollection.java
|
Java
|
agpl-3.0
| 5,078 |
<?php
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address [email protected].
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/**
* SugarSpriteBuilderTest
*
* This test simply checks that we can run the rebuildSprite function which in turn runs SugarSpriteBuilder
*
*/
class SugarSpriteBuilderTest extends Sugar_PHPUnit_Framework_TestCase
{
var $useSprites;
public function setUp()
{
if(!function_exists('imagecreatetruecolor'))
{
$this->markTestSkipped('imagecreatetruecolor function not found. skipping test');
return;
}
if (empty($GLOBALS['sugar_config']['use_sprites']))
{
$GLOBALS['sugar_config']['use_sprites'] = null;
}
$this->useSprites = $GLOBALS['sugar_config']['use_sprites'];
$GLOBALS['sugar_config']['use_sprites'] = true;
if(file_exists('cache/sprites'))
{
rmdir_recursive('cache/sprites');
}
}
public function tearDown()
{
$GLOBALS['sugar_config']['use_sprites'] = $this->useSprites;
}
public function testSugarSpriteBuilder()
{
require_once('modules/UpgradeWizard/uw_utils.php');
rebuildSprites(true);
$this->assertTrue(file_exists('cache/sprites'), 'Assert that we have built the sprites directory');
$files = glob('cache/sprites/default/*.png');
$this->assertTrue(!empty($files), 'Assert that we have created .png sprite images');
}
}
|
amusarra/sugarcrm_dev_WebServices
|
tests/modules/Administration/SugarSpriteBuilderTest.php
|
PHP
|
agpl-3.0
| 3,263 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Neil McAnaspie using IMS Development Environment (version 1.52 build 2497.19681)
// Copyright (C) 1995-2006 IMS MAXIMS plc. All rights reserved.
package ims.nursing.forms.painbodychart;
import java.io.Serializable;
public final class AccessLogic extends BaseAccessLogic implements Serializable
{
private static final long serialVersionUID = 1L;
public boolean isAccessible()
{
if(!super.isAccessible())
return false;
// TODO: Add your conditions here.
return true;
}
public boolean isReadOnly()
{
if(super.isReadOnly())
return true;
// TODO: Add your conditions here.
return false;
}
}
|
open-health-hub/openmaxims-linux
|
openmaxims_workspace/Nursing/src/ims/nursing/forms/painbodychart/AccessLogic.java
|
Java
|
agpl-3.0
| 2,142 |
//#############################################################################
//# #
//# Copyright (C) <2015> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//# #
//#############################################################################
//#EOH
/*
* This code was generated
* Copyright (C) 1995-2004 IMS MAXIMS plc. All rights reserved.
* IMS Development Environment (version 1.80 build 5589.25814)
* WARNING: DO NOT MODIFY the content of this file
* Generated on 12/10/2015, 13:24
*
*/
package ims.clinical.vo.domain;
import ims.vo.domain.DomainObjectMap;
import java.util.HashMap;
import org.hibernate.proxy.HibernateProxy;
/**
* @author Daniel Laffan
*/
public class PeriOpTimeOutCompleteVoAssembler
{
/**
* Copy one ValueObject to another
* @param valueObjectDest to be updated
* @param valueObjectSrc to copy values from
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVo copy(ims.clinical.vo.PeriOpTimeOutCompleteVo valueObjectDest, ims.clinical.vo.PeriOpTimeOutCompleteVo valueObjectSrc)
{
if (null == valueObjectSrc)
{
return valueObjectSrc;
}
valueObjectDest.setID_PeriOpTimeOutComplete(valueObjectSrc.getID_PeriOpTimeOutComplete());
valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
// TheatreAppointment
valueObjectDest.setTheatreAppointment(valueObjectSrc.getTheatreAppointment());
// TimeOutCompleted
valueObjectDest.setTimeOutCompleted(valueObjectSrc.getTimeOutCompleted());
// RecordedBy
valueObjectDest.setRecordedBy(valueObjectSrc.getRecordedBy());
return valueObjectDest;
}
/**
* Create the ValueObject collection to hold the set of DomainObjects.
* This is a convenience method only.
* It is intended to be used when one called to an Assembler is made.
* If more than one call to an Assembler is made then #createPeriOpTimeOutCompleteVoCollectionFromPeriOpTimeOutComplete(DomainObjectMap, Set) should be used.
* @param domainObjectSet - Set of ims.clinical.domain.objects.PeriOpTimeOutComplete objects.
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVoCollection createPeriOpTimeOutCompleteVoCollectionFromPeriOpTimeOutComplete(java.util.Set domainObjectSet)
{
return createPeriOpTimeOutCompleteVoCollectionFromPeriOpTimeOutComplete(new DomainObjectMap(), domainObjectSet);
}
/**
* Create the ValueObject collection to hold the set of DomainObjects.
* @param map - maps DomainObjects to created ValueObjects
* @param domainObjectSet - Set of ims.clinical.domain.objects.PeriOpTimeOutComplete objects.
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVoCollection createPeriOpTimeOutCompleteVoCollectionFromPeriOpTimeOutComplete(DomainObjectMap map, java.util.Set domainObjectSet)
{
ims.clinical.vo.PeriOpTimeOutCompleteVoCollection voList = new ims.clinical.vo.PeriOpTimeOutCompleteVoCollection();
if ( null == domainObjectSet )
{
return voList;
}
int rieCount=0;
int activeCount=0;
java.util.Iterator iterator = domainObjectSet.iterator();
while( iterator.hasNext() )
{
ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject = (ims.clinical.domain.objects.PeriOpTimeOutComplete) iterator.next();
ims.clinical.vo.PeriOpTimeOutCompleteVo vo = create(map, domainObject);
if (vo != null)
voList.add(vo);
if (domainObject != null)
{
if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
rieCount++;
else
activeCount++;
}
}
voList.setRieCount(rieCount);
voList.setActiveCount(activeCount);
return voList;
}
/**
* Create the ValueObject collection to hold the list of DomainObjects.
* @param domainObjectList - List of ims.clinical.domain.objects.PeriOpTimeOutComplete objects.
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVoCollection createPeriOpTimeOutCompleteVoCollectionFromPeriOpTimeOutComplete(java.util.List domainObjectList)
{
return createPeriOpTimeOutCompleteVoCollectionFromPeriOpTimeOutComplete(new DomainObjectMap(), domainObjectList);
}
/**
* Create the ValueObject collection to hold the list of DomainObjects.
* @param map - maps DomainObjects to created ValueObjects
* @param domainObjectList - List of ims.clinical.domain.objects.PeriOpTimeOutComplete objects.
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVoCollection createPeriOpTimeOutCompleteVoCollectionFromPeriOpTimeOutComplete(DomainObjectMap map, java.util.List domainObjectList)
{
ims.clinical.vo.PeriOpTimeOutCompleteVoCollection voList = new ims.clinical.vo.PeriOpTimeOutCompleteVoCollection();
if ( null == domainObjectList )
{
return voList;
}
int rieCount=0;
int activeCount=0;
for (int i = 0; i < domainObjectList.size(); i++)
{
ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject = (ims.clinical.domain.objects.PeriOpTimeOutComplete) domainObjectList.get(i);
ims.clinical.vo.PeriOpTimeOutCompleteVo vo = create(map, domainObject);
if (vo != null)
voList.add(vo);
if (domainObject != null)
{
if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
rieCount++;
else
activeCount++;
}
}
voList.setRieCount(rieCount);
voList.setActiveCount(activeCount);
return voList;
}
/**
* Create the ims.clinical.domain.objects.PeriOpTimeOutComplete set from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/
public static java.util.Set extractPeriOpTimeOutCompleteSet(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PeriOpTimeOutCompleteVoCollection voCollection)
{
return extractPeriOpTimeOutCompleteSet(domainFactory, voCollection, null, new HashMap());
}
public static java.util.Set extractPeriOpTimeOutCompleteSet(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PeriOpTimeOutCompleteVoCollection voCollection, java.util.Set domainObjectSet, HashMap domMap)
{
int size = (null == voCollection) ? 0 : voCollection.size();
if (domainObjectSet == null)
{
domainObjectSet = new java.util.HashSet();
}
java.util.Set newSet = new java.util.HashSet();
for(int i=0; i<size; i++)
{
ims.clinical.vo.PeriOpTimeOutCompleteVo vo = voCollection.get(i);
ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject = PeriOpTimeOutCompleteVoAssembler.extractPeriOpTimeOutComplete(domainFactory, vo, domMap);
//TODO: This can only occur in the situation of a stale object exception. For now leave it to the Interceptor to handle it.
if (domainObject == null)
{
continue;
}
//Trying to avoid the hibernate collection being marked as dirty via its public interface methods. (like add)
if (!domainObjectSet.contains(domainObject)) domainObjectSet.add(domainObject);
newSet.add(domainObject);
}
java.util.Set removedSet = new java.util.HashSet();
java.util.Iterator iter = domainObjectSet.iterator();
//Find out which objects need to be removed
while (iter.hasNext())
{
ims.domain.DomainObject o = (ims.domain.DomainObject)iter.next();
if ((o == null || o.getIsRIE() == null || !o.getIsRIE().booleanValue()) && !newSet.contains(o))
{
removedSet.add(o);
}
}
iter = removedSet.iterator();
//Remove the unwanted objects
while (iter.hasNext())
{
domainObjectSet.remove(iter.next());
}
return domainObjectSet;
}
/**
* Create the ims.clinical.domain.objects.PeriOpTimeOutComplete list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/
public static java.util.List extractPeriOpTimeOutCompleteList(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PeriOpTimeOutCompleteVoCollection voCollection)
{
return extractPeriOpTimeOutCompleteList(domainFactory, voCollection, null, new HashMap());
}
public static java.util.List extractPeriOpTimeOutCompleteList(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PeriOpTimeOutCompleteVoCollection voCollection, java.util.List domainObjectList, HashMap domMap)
{
int size = (null == voCollection) ? 0 : voCollection.size();
if (domainObjectList == null)
{
domainObjectList = new java.util.ArrayList();
}
for(int i=0; i<size; i++)
{
ims.clinical.vo.PeriOpTimeOutCompleteVo vo = voCollection.get(i);
ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject = PeriOpTimeOutCompleteVoAssembler.extractPeriOpTimeOutComplete(domainFactory, vo, domMap);
//TODO: This can only occur in the situation of a stale object exception. For now leave it to the Interceptor to handle it.
if (domainObject == null)
{
continue;
}
int domIdx = domainObjectList.indexOf(domainObject);
if (domIdx == -1)
{
domainObjectList.add(i, domainObject);
}
else if (i != domIdx && i < domainObjectList.size())
{
Object tmp = domainObjectList.get(i);
domainObjectList.set(i, domainObjectList.get(domIdx));
domainObjectList.set(domIdx, tmp);
}
}
//Remove all ones in domList where index > voCollection.size() as these should
//now represent the ones removed from the VO collection. No longer referenced.
int i1=domainObjectList.size();
while (i1 > size)
{
domainObjectList.remove(i1-1);
i1=domainObjectList.size();
}
return domainObjectList;
}
/**
* Create the ValueObject from the ims.clinical.domain.objects.PeriOpTimeOutComplete object.
* @param domainObject ims.clinical.domain.objects.PeriOpTimeOutComplete
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVo create(ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject)
{
if (null == domainObject)
{
return null;
}
DomainObjectMap map = new DomainObjectMap();
return create(map, domainObject);
}
/**
* Create the ValueObject from the ims.clinical.domain.objects.PeriOpTimeOutComplete object.
* @param map DomainObjectMap of DomainObjects to already created ValueObjects.
* @param domainObject
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVo create(DomainObjectMap map, ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject)
{
if (null == domainObject)
{
return null;
}
// check if the domainObject already has a valueObject created for it
ims.clinical.vo.PeriOpTimeOutCompleteVo valueObject = (ims.clinical.vo.PeriOpTimeOutCompleteVo) map.getValueObject(domainObject, ims.clinical.vo.PeriOpTimeOutCompleteVo.class);
if ( null == valueObject )
{
valueObject = new ims.clinical.vo.PeriOpTimeOutCompleteVo(domainObject.getId(), domainObject.getVersion());
map.addValueObject(domainObject, valueObject);
valueObject = insert(map, valueObject, domainObject);
}
return valueObject;
}
/**
* Update the ValueObject with the Domain Object.
* @param valueObject to be updated
* @param domainObject ims.clinical.domain.objects.PeriOpTimeOutComplete
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVo insert(ims.clinical.vo.PeriOpTimeOutCompleteVo valueObject, ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject)
{
if (null == domainObject)
{
return valueObject;
}
DomainObjectMap map = new DomainObjectMap();
return insert(map, valueObject, domainObject);
}
/**
* Update the ValueObject with the Domain Object.
* @param map DomainObjectMap of DomainObjects to already created ValueObjects.
* @param valueObject to be updated
* @param domainObject ims.clinical.domain.objects.PeriOpTimeOutComplete
*/
public static ims.clinical.vo.PeriOpTimeOutCompleteVo insert(DomainObjectMap map, ims.clinical.vo.PeriOpTimeOutCompleteVo valueObject, ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject)
{
if (null == domainObject)
{
return valueObject;
}
if (null == map)
{
map = new DomainObjectMap();
}
valueObject.setID_PeriOpTimeOutComplete(domainObject.getId());
valueObject.setIsRIE(domainObject.getIsRIE());
// If this is a recordedInError record, and the domainObject
// value isIncludeRecord has not been set, then we return null and
// not the value object
if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord())
return null;
// If this is not a recordedInError record, and the domainObject
// value isIncludeRecord has been set, then we return null and
// not the value object
if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord())
return null;
// TheatreAppointment
if (domainObject.getTheatreAppointment() != null)
{
if(domainObject.getTheatreAppointment() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the id already.
{
HibernateProxy p = (HibernateProxy) domainObject.getTheatreAppointment();
int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString());
valueObject.setTheatreAppointment(new ims.scheduling.vo.Booking_AppointmentRefVo(id, -1));
}
else
{
valueObject.setTheatreAppointment(new ims.scheduling.vo.Booking_AppointmentRefVo(domainObject.getTheatreAppointment().getId(), domainObject.getTheatreAppointment().getVersion()));
}
}
// TimeOutCompleted
java.util.Date TimeOutCompleted = domainObject.getTimeOutCompleted();
if ( null != TimeOutCompleted )
{
valueObject.setTimeOutCompleted(new ims.framework.utils.DateTime(TimeOutCompleted) );
}
// RecordedBy
if (domainObject.getRecordedBy() != null)
{
if(domainObject.getRecordedBy() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the id already.
{
HibernateProxy p = (HibernateProxy) domainObject.getRecordedBy();
int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString());
valueObject.setRecordedBy(new ims.core.resource.people.vo.MemberOfStaffRefVo(id, -1));
}
else
{
valueObject.setRecordedBy(new ims.core.resource.people.vo.MemberOfStaffRefVo(domainObject.getRecordedBy().getId(), domainObject.getRecordedBy().getVersion()));
}
}
return valueObject;
}
/**
* Create the domain object from the value object.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param valueObject - extract the domain object fields from this.
*/
public static ims.clinical.domain.objects.PeriOpTimeOutComplete extractPeriOpTimeOutComplete(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PeriOpTimeOutCompleteVo valueObject)
{
return extractPeriOpTimeOutComplete(domainFactory, valueObject, new HashMap());
}
public static ims.clinical.domain.objects.PeriOpTimeOutComplete extractPeriOpTimeOutComplete(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PeriOpTimeOutCompleteVo valueObject, HashMap domMap)
{
if (null == valueObject)
{
return null;
}
Integer id = valueObject.getID_PeriOpTimeOutComplete();
ims.clinical.domain.objects.PeriOpTimeOutComplete domainObject = null;
if ( null == id)
{
if (domMap.get(valueObject) != null)
{
return (ims.clinical.domain.objects.PeriOpTimeOutComplete)domMap.get(valueObject);
}
// ims.clinical.vo.PeriOpTimeOutCompleteVo ID_PeriOpTimeOutComplete field is unknown
domainObject = new ims.clinical.domain.objects.PeriOpTimeOutComplete();
domMap.put(valueObject, domainObject);
}
else
{
String key = (valueObject.getClass().getName() + "__" + valueObject.getID_PeriOpTimeOutComplete());
if (domMap.get(key) != null)
{
return (ims.clinical.domain.objects.PeriOpTimeOutComplete)domMap.get(key);
}
domainObject = (ims.clinical.domain.objects.PeriOpTimeOutComplete) domainFactory.getDomainObject(ims.clinical.domain.objects.PeriOpTimeOutComplete.class, id );
//TODO: Not sure how this should be handled. Effectively it must be a staleobject exception, but maybe should be handled as that further up.
if (domainObject == null)
return null;
domMap.put(key, domainObject);
}
domainObject.setVersion(valueObject.getVersion_PeriOpTimeOutComplete());
ims.scheduling.domain.objects.Booking_Appointment value1 = null;
if ( null != valueObject.getTheatreAppointment() )
{
if (valueObject.getTheatreAppointment().getBoId() == null)
{
if (domMap.get(valueObject.getTheatreAppointment()) != null)
{
value1 = (ims.scheduling.domain.objects.Booking_Appointment)domMap.get(valueObject.getTheatreAppointment());
}
}
else if (valueObject.getBoVersion() == -1) // RefVo was not modified since obtained from the Assembler, no need to update the BO field
{
value1 = domainObject.getTheatreAppointment();
}
else
{
value1 = (ims.scheduling.domain.objects.Booking_Appointment)domainFactory.getDomainObject(ims.scheduling.domain.objects.Booking_Appointment.class, valueObject.getTheatreAppointment().getBoId());
}
}
domainObject.setTheatreAppointment(value1);
ims.framework.utils.DateTime dateTime2 = valueObject.getTimeOutCompleted();
java.util.Date value2 = null;
if ( dateTime2 != null )
{
value2 = dateTime2.getJavaDate();
}
domainObject.setTimeOutCompleted(value2);
ims.core.resource.people.domain.objects.MemberOfStaff value3 = null;
if ( null != valueObject.getRecordedBy() )
{
if (valueObject.getRecordedBy().getBoId() == null)
{
if (domMap.get(valueObject.getRecordedBy()) != null)
{
value3 = (ims.core.resource.people.domain.objects.MemberOfStaff)domMap.get(valueObject.getRecordedBy());
}
}
else if (valueObject.getBoVersion() == -1) // RefVo was not modified since obtained from the Assembler, no need to update the BO field
{
value3 = domainObject.getRecordedBy();
}
else
{
value3 = (ims.core.resource.people.domain.objects.MemberOfStaff)domainFactory.getDomainObject(ims.core.resource.people.domain.objects.MemberOfStaff.class, valueObject.getRecordedBy().getBoId());
}
}
domainObject.setRecordedBy(value3);
return domainObject;
}
}
|
FreudianNM/openMAXIMS
|
Source Library/openmaxims_workspace/ValueObjects/src/ims/clinical/vo/domain/PeriOpTimeOutCompleteVoAssembler.java
|
Java
|
agpl-3.0
| 20,441 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Catalin Tomozei using IMS Development Environment (version 1.53 build 2648.15910)
// Copyright (C) 1995-2007 IMS MAXIMS plc. All rights reserved.
package ims.oncology.domain.impl;
import ims.admin.domain.MosSearch;
import ims.admin.domain.OrganisationAndLocation;
import ims.admin.domain.impl.MosSearchImpl;
import ims.admin.domain.impl.OrganisationAndLocationImpl;
import ims.ccosched.vo.PatTreatPlanActionLiteVo;
import ims.core.admin.vo.EpisodeOfCareRefVo;
import ims.core.patient.vo.PatientRefVo;
import ims.core.resource.people.vo.HcpRefVo;
import ims.core.resource.place.domain.objects.LocSite;
import ims.core.vo.LocSiteLiteVoCollection;
import ims.core.vo.MedicVo;
import ims.core.vo.MedicVoCollection;
import ims.core.vo.MemberOfStaffShortVo;
import ims.core.vo.MemberOfStaffShortVoCollection;
import ims.core.vo.domain.LocSiteLiteVoAssembler;
import ims.core.vo.domain.MedicVoAssembler;
import ims.core.vo.lookups.LocationType;
import ims.domain.DomainFactory;
import ims.domain.exceptions.DomainInterfaceException;
import ims.domain.exceptions.DomainRuntimeException;
import ims.domain.exceptions.StaleObjectException;
import ims.domain.hibernate3.IMSCriteria;
import ims.domain.lookups.LookupInstance;
import ims.framework.exceptions.CodingRuntimeException;
import ims.oncology.domain.PatientsTreatmentPlanActionsDialog;
import ims.oncology.domain.base.impl.BaseRadioTherapyDetailsImpl;
import ims.oncology.domain.objects.RadiotherapyDetails;
import ims.oncology.vo.PatTreatmentPlanRadiotherapyDialogVoCollection;
import ims.oncology.vo.RadiotherapyDetailsRefVo;
import ims.oncology.vo.RadiotherapyDetailsShortVoCollection;
import ims.oncology.vo.RadiotherapyDetailsVo;
import ims.oncology.vo.domain.RadiotherapyDetailsShortVoAssembler;
import ims.oncology.vo.domain.RadiotherapyDetailsVoAssembler;
import ims.oncology.vo.lookups.DiseaseStatus;
import ims.oncology.vo.lookups.DiseaseStatusCollection;
import java.util.ArrayList;
import java.util.List;
public class RadioTherapyDetailsImpl extends BaseRadioTherapyDetailsImpl
{
private static final long serialVersionUID = 1L;
public RadiotherapyDetailsShortVoCollection list(EpisodeOfCareRefVo episodeOfCare)
{
// Check parameter
if (episodeOfCare == null || !episodeOfCare.getID_EpisodeOfCareIsNotNull())
throw new DomainRuntimeException("Can not search for radiotherapy records for an invalid episode of care");
// Build query (for complex queries - that depend on conditions - remember to change to StringBuilder)
String query = "from RadiotherapyDetails as rtd where rtd.episodeOfCare.id = :EP_ID order by rtd.startDate asc";//WDEV-15546
// Build parameters (names and values)
ArrayList<String> paramNames = new ArrayList<String>();
ArrayList<Object> paramValues = new ArrayList<Object>();
paramNames.add("EP_ID");
paramValues.add(episodeOfCare.getID_EpisodeOfCare());
// Query database, pass results to AssemblerVO, return VO collection results
return RadiotherapyDetailsShortVoAssembler.createRadiotherapyDetailsShortVoCollectionFromRadiotherapyDetails(getDomainFactory().find(query, paramNames, paramValues));
}
public RadiotherapyDetailsVo save(RadiotherapyDetailsVo record) throws DomainInterfaceException, StaleObjectException
{
if (record == null)
throw new DomainRuntimeException("Invalid record");
if (!record.isValidated())
throw new CodingRuntimeException("Record not validated");
DomainFactory factory = getDomainFactory();
RadiotherapyDetails domainRecord = RadiotherapyDetailsVoAssembler.extractRadiotherapyDetails(factory, record);
factory.save(domainRecord);
return RadiotherapyDetailsVoAssembler.create(domainRecord);
}
public MemberOfStaffShortVoCollection listMembersOfStaff(MemberOfStaffShortVo filter)
{
MosSearch mosSearch = (MosSearch) getDomainImpl(MosSearchImpl.class);
return mosSearch.listMembersOfStaff(filter);
}
public RadiotherapyDetailsVo get(RadiotherapyDetailsRefVo record)
{
if (record == null || !record.getID_RadiotherapyDetailsIsNotNull())
return null;
RadiotherapyDetails domainRecord = (RadiotherapyDetails) getDomainFactory().getDomainObject(RadiotherapyDetails.class, record.getID_RadiotherapyDetails().intValue());
return RadiotherapyDetailsVoAssembler.create(domainRecord);
}
public LocSiteLiteVoCollection listLocSite(String locationName)
{
OrganisationAndLocation locSite = (OrganisationAndLocation) getDomainImpl(OrganisationAndLocationImpl.class);
return locSite.listLocSite(locationName);
}
public LocSiteLiteVoCollection listHospitals(String locationName)
{
DomainFactory factory = getDomainFactory();
IMSCriteria imsc = new IMSCriteria(LocSite.class, factory);
imsc.equal("type", getDomLookup(LocationType.HOSP));
imsc.like("name", locationName + "%");
List<?> locations = imsc.find();
if (locations != null)
return LocSiteLiteVoAssembler.createLocSiteLiteVoCollectionFromLocSite(locations);
else
return null;
}
public DiseaseStatusCollection listDiseaseStatus()
{
DomainFactory factory = getDomainFactory();
String query = "from LookupInstance as l where l.type.id = :LookupId and l.parent is null and l.active = 1 order by l.order";
List<?> list = factory.find(query, new String[] {"LookupId"}, new Object[] {new Integer(DiseaseStatus.TYPE_ID)});
if(list == null || list.isEmpty())
return null;
DiseaseStatusCollection coll = new DiseaseStatusCollection();
for(Object look : list)
{
if(look instanceof LookupInstance)
{
LookupInstance disease = (LookupInstance) look;
coll.add(new DiseaseStatus(disease.getId(), disease.getText(), disease.isActive(), null, disease.getImage(), disease.getColor(), disease.getOrder()));
}
}
return coll;
}
public DiseaseStatusCollection listDiseaseStatusByParent(DiseaseStatus diseaseParent)
{
if(diseaseParent == null )
throw new CodingRuntimeException("Can not list DiseaseStatus childrens for null DiseaseStatus parent.");
DomainFactory factory = getDomainFactory();
String query = "from LookupInstance as l where l.type.id = :LookupId and l.parent.id = :Parent and l.active = 1 order by l.order";
List<?> list = factory.find(query, new String[] {"LookupId", "Parent"}, new Object[] {new Integer(DiseaseStatus.TYPE_ID), diseaseParent.getID()});
if(list == null || list.isEmpty())
return null;
DiseaseStatusCollection coll = new DiseaseStatusCollection();
for(Object look : list)
{
if(look instanceof LookupInstance)
{
LookupInstance disease = (LookupInstance) look;
coll.add(new DiseaseStatus(disease.getId(), disease.getText(), disease.isActive(), null, disease.getImage(), disease.getColor(), disease.getOrder()));
}
}
return coll;
}
//wdev-13110
public MedicVo getMedic(HcpRefVo hcpId)
{
if(hcpId == null)
throw new CodingRuntimeException("HCP id must not be null ");
DomainFactory factory = getDomainFactory();
String hql = "from Medic as m1_1 where m1_1.id = :idHCP";
List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {hcpId.getID_Hcp()});
if(list != null && list.size() > 0)
{
MedicVoCollection voColl = MedicVoAssembler.createMedicVoCollectionFromMedic(list);
if(voColl != null && voColl.size() > 0)
return voColl.get(0);
}
return null;
}
public PatTreatmentPlanRadiotherapyDialogVoCollection listActivePatTreatMentPlans(PatientRefVo patient, EpisodeOfCareRefVo episode)
{
PatientsTreatmentPlanActionsDialog impl = (PatientsTreatmentPlanActionsDialog) getDomainImpl(PatientsTreatmentPlanActionsDialogImpl.class);
return impl.listActivePatTreatMentPlans(patient, episode);
}
public Boolean checkIfChosenPlanLinked(PatTreatPlanActionLiteVo patAction)
{
if (patAction == null || patAction.getID_PatAction() == null)
throw new DomainRuntimeException("Can checkIfChosenPlanLinked as Action is null");
DomainFactory factory = getDomainFactory();
String hql;
ArrayList<String> markers = new ArrayList<String>();
ArrayList<Object> values = new ArrayList<Object>();
hql = "select actions.id from RadiotherapyDetails as cd left join cd.associatedTreatmentPlanAction as actions where actions.id = :actID and cd.associatedTreatmentPlanAction is not null)";
markers.add("actID");
values.add(patAction.getID_PatAction());
List ops = factory.find(hql, markers, values);
if (ops != null && ops.size() > 0)
return true;
else
return false;
}
}
|
open-health-hub/openmaxims-linux
|
openmaxims_workspace/Oncology/src/ims/oncology/domain/impl/RadioTherapyDetailsImpl.java
|
Java
|
agpl-3.0
| 10,161 |
# A setting that represents a span of time to live, and evaluates to Numeric
# seconds to live where 0 means shortest possible time to live, a positive numeric value means time
# to live in seconds, and the symbolic entry 'unlimited' is an infinite amount of time.
#
class Puppet::Settings::TTLSetting < Puppet::Settings::BaseSetting
# How we convert from various units to seconds.
UNITMAP = {
# 365 days isn't technically a year, but is sufficient for most purposes
"y" => 365 * 24 * 60 * 60,
"d" => 24 * 60 * 60,
"h" => 60 * 60,
"m" => 60,
"s" => 1
}
# A regex describing valid formats with groups for capturing the value and units
FORMAT = /^(\d+)(y|d|h|m|s)?$/
def type
:ttl
end
# Convert the value to Numeric, parsing numeric string with units if necessary.
def munge(value)
self.class.munge(value, @name)
end
# Convert the value to Numeric, parsing numeric string with units if necessary.
def self.munge(value, param_name)
case
when value.is_a?(Numeric)
if value < 0
raise Puppet::Settings::ValidationError, "Invalid negative 'time to live' #{value.inspect} - did you mean 'unlimited'?"
end
value
when value == 'unlimited'
Float::INFINITY
when (value.is_a?(String) and value =~ FORMAT)
$1.to_i * UNITMAP[$2 || 's']
else
raise Puppet::Settings::ValidationError, "Invalid 'time to live' format '#{value.inspect}' for parameter: #{param_name}"
end
end
end
|
logicminds/puppet-retrospec
|
vendor/pup410/lib/puppet/settings/ttl_setting.rb
|
Ruby
|
agpl-3.0
| 1,491 |
# Copyright (C) 2013 Steve Milner
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
Tests for the managers.PackageManager class.
"""
from . import TestCase
from smizmar.managers import PackageManager
class TestPackageManager(TestCase):
def setUp(self):
"""
Create the PackageManager instance for every test.
"""
self.pm = PackageManager()
def test_info(self):
"""
Verify PackageManager.info() requires overriding.
"""
self.assertRaises(NotImplementedError, self.pm.info, None)
def test_list_packages(self):
"""
Verify PackageManager.list_packages() requires overriding.
"""
self.assertRaises(NotImplementedError, self.pm.list_packages)
def test_install(self):
"""
Verify PackageManager.install() requires overriding.
"""
self.assertRaises(NotImplementedError, self.pm.install, 'packagename')
def test_update(self):
"""
Verify PackageManager.update() requires overriding.
"""
self.assertRaises(NotImplementedError, self.pm.update, 'packagename')
|
ashcrow/smizmar
|
test/test_packagemanager.py
|
Python
|
agpl-3.0
| 1,745 |
#
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require 'securerandom'
class EportfolioEntriesController < ApplicationController
include EportfolioPage
before_action :rce_js_env
before_action :get_eportfolio
def create
if authorized_action(@portfolio, @current_user, :update)
@category = @portfolio.eportfolio_categories.find(params[:eportfolio_entry].delete(:eportfolio_category_id))
page_names = @category.eportfolio_entries.map{|c| c.name}
@page = @portfolio.eportfolio_entries.build(eportfolio_entry_params)
@page.eportfolio_category = @category
@page.parse_content(params)
respond_to do |format|
if @page.save
format.html { redirect_to eportfolio_entry_url(@portfolio, @page) }
format.json { render :json => @page.as_json(:methods => :category_slug) }
else
format.json { render :json => @page.errors }
end
end
end
end
def show
if params[:verifier] == @portfolio.uuid
session[:eportfolio_ids] ||= []
session[:eportfolio_ids] << @portfolio.id
session[:permissions_key] = SecureRandom.uuid
end
if authorized_action(@portfolio, @current_user, :read)
if params[:category_name]
@category = @portfolio.eportfolio_categories.where(slug: params[:category_name]).first
end
if params[:id]
@page = @portfolio.eportfolio_entries.find(params[:id])
elsif params[:entry_name] && @category
@page = @category.eportfolio_entries.where(slug: params[:entry_name]).first
end
if !@page
flash[:notice] = t('notices.missing_page', "Couldn't find that page")
redirect_to eportfolio_url(@portfolio.id)
return
end
@category = @page.eportfolio_category
eportfolio_page_attributes
render "eportfolios/show", stream: can_stream_template?
end
end
def update
if authorized_action(@portfolio, @current_user, :update)
@entry = @portfolio.eportfolio_entries.find(params[:id])
@entry.parse_content(params) if params[:section_count]
category_id = params[:eportfolio_entry].delete(:eportfolio_category_id)
entry_params = eportfolio_entry_params
if category_id && category_id.to_i != @entry.eportfolio_category_id
category = @portfolio.eportfolio_categories.find(category_id)
entry_params[:eportfolio_category] = category
end
respond_to do |format|
if @entry.update!(entry_params)
format.html { redirect_to eportfolio_entry_url(@portfolio, @entry) }
format.json { render :json => @entry }
else
format.html { redirect_to eportfolio_entry_url(@portfolio, @entry) }
format.json { render :json => @entry.errors, :status => :bad_request }
end
end
end
end
def destroy
if authorized_action(@portfolio, @current_user, :update)
@entry = @portfolio.eportfolio_entries.find(params[:id])
@category = @entry.eportfolio_category
respond_to do |format|
if @entry.destroy
format.html { redirect_to eportfolio_category_url(@portfolio, @category) }
format.json { render :json => @entry }
else
end
end
end
end
def attachment
if authorized_action(@portfolio, @current_user, :read)
@entry = @portfolio.eportfolio_entries.find(params[:entry_id])
@category = @entry.eportfolio_category
@attachment = @portfolio.user.all_attachments.shard(@portfolio.user).where(uuid: params[:attachment_id]).first
# @entry.check_for_matching_attachment_id
begin
redirect_to file_download_url(@attachment, { :verifier => @attachment.uuid })
rescue
raise t('errors.not_found', "Not Found")
end
end
end
def submission
if authorized_action(@portfolio, @current_user, :read)
@entry = @portfolio.eportfolio_entries.find(params[:entry_id])
@category = @entry.eportfolio_category
@submission = @portfolio.user.submissions.find(params[:submission_id])
@assignment = @submission.assignment
@user = @submission.user
@context = @assignment.context
# @entry.check_for_matching_attachment_id
@headers = false
render template: 'submissions/show_preview', locals: {
anonymize_students: @assignment.anonymize_students?
}
end
end
protected
def eportfolio_entry_params
params.require(:eportfolio_entry).permit(:name, :allow_comments, :show_comments)
end
def get_eportfolio
@portfolio = Eportfolio.active.find(params[:eportfolio_id])
end
end
|
djbender/canvas-lms
|
app/controllers/eportfolio_entries_controller.rb
|
Ruby
|
agpl-3.0
| 5,240 |
require 'ffaker'
module Ekylibre
module FirstRun
class Booker
cattr_accessor :production
class << self
def find(model, options = {})
relation = model
relation = relation.where("COALESCE(born_at, ?) <= ? ", options[:started_at], options[:started_at]) if options[:started_at]
relation = relation.of_work_numbers(options[:work_number]) if options[:work_number]
relation = relation.can(options[:can]) if options[:can]
relation = relation.of_variety(options[:variety]) if options[:variety]
relation = relation.derivative_of(options[:derivative_of]) if options[:derivative_of]
if relation.any?
return relation.all.sample
else
# Create product with given elements
attributes = {}
unless options[:default_storage].is_a?(FalseClass)
attributes[:default_storage] = find(BuildingDivision, default_storage: find(Building, default_storage: false))
end
if model == Worker
options[:first_name] ||= ::FFaker::Name.first_name
options[:last_name] ||= ::FFaker::Name.last_name
options[:born_at] ||= Date.new(1970 + rand(20), 1 + rand(12), 1 + rand(28))
unless person = Contact.find_by(first_name: options[:first_name], last_name: options[:last_name])
person = Contact.create!(first_name: options[:first_name], last_name: options[:last_name], born_at: options[:born_at])
end
attributes[:person] = person
end
variants = ProductNatureVariant.find_or_import!(options[:variety] || model.name.underscore, derivative_of: options[:derivative_of])
variants.can(options[:can]) if options[:can]
unless attributes[:variant] = variants.first
raise StandardError, "Cannot find product variant with options #{options.inspect}"
end
return model.create!(attributes)
end
end
def daytime_duration(on)
12.0 - 4.0 * Math.cos((on + 11.days).yday.to_f / (365.25 / Math::PI / 2))
end
def sunrise(on, shift = 1.5)
return shift + (24.0 - self.daytime_duration(on)) / 2.0
end
def sunset(on, shift = 1.5)
self.daytime_duration(on) + self.sunrise(on, shift)
end
# Duration is expected to be in hours
def intervene(procedure_code, year, month, day, duration, options = {}, &block)
day_range = options[:range] || 30
duration += 1.5 - rand(0.5)
# Find procedure
procedure_name = "#{options[:namespace] || Procedo::DEFAULT_NAMESPACE}#{Procedo::NAMESPACE_SEPARATOR}#{procedure_code}#{Procedo::VERSION_SEPARATOR}#{options[:version] || '0'}"
unless procedure = Procedo[procedure_name]
raise ArgumentError, "Unknown procedure #{procedure_code} (#{procedure_name})"
end
# Find actors
booker = new(procedure, Time.new(year, month, day), duration)
yield booker
actors = booker.casts.collect{|c| c[:actor]}.compact
if actors.empty?
raise ArgumentError, "What's the fuck ? No actors ? "
end
# Adds fixed durations to given time
fixed_duration = procedure.fixed_duration / 3600
duration += fixed_duration
# Estimate number of days to work
duration_days = (duration / 8.0).ceil
# Find a slot for all actors for given number of day
on = nil
begin
on = Date.civil(year, month, day) + rand(day_range - duration_days).days
end while InterventionCast.joins(:intervention).where(actor_id: actors.map(&:id)).where("? BETWEEN started_at AND stopped_at OR ? BETWEEN started_at AND stopped_at", on, on + duration_days).any?
# Compute real number of day
# 11 days shifting is here respect solstice shifting with 1st day of year
daytime_duration = self.daytime_duration(on) - 2.0
if duration > daytime_duration
duration_days = (duration.to_f / daytime_duration).ceil
end
# Split into many interventions
periods = []
total = duration * 1.0 - fixed_duration
duration_days.times do
started_at = on.to_time + self.sunrise(on).hours + 1.hour
d = self.daytime_duration(on) - 2.0 - fixed_duration
d = total if d > total
periods << {started_at: started_at, duration: (d + fixed_duration) * 3600} if d > 0
total -= d
on += 1
end
# Run interventions
intervention = nil
for period in periods
stopped_at = period[:started_at] + period[:duration]
if stopped_at < Time.now
intervention = Intervention.create!(reference_name: procedure_name, production: Booker.production, production_support: options[:support], started_at: period[:started_at], stopped_at: stopped_at)
for cast in booker.casts
intervention.add_cast!(cast)
end
intervention.run!(period, options[:parameters])
end
end
return intervention
end
# used for importing intervention from others editors
# procedure_code symbol (from procedure)
# started_at datetime
# duration integer (hours)
def force(procedure_code, started_at, duration, options = {}, &block)
# Find procedure
procedure_name = "#{options[:namespace] || Procedo::DEFAULT_NAMESPACE}#{Procedo::NAMESPACE_SEPARATOR}#{procedure_code}#{Procedo::VERSION_SEPARATOR}#{options[:version] || '0'}"
unless procedure = Procedo[procedure_name]
raise ArgumentError, "Unknown procedure #{procedure_code} (#{procedure_name})"
end
# Adds fixed durations to given time
fixed_duration = procedure.fixed_duration / 3600
duration += fixed_duration
# Find actors
booker = new(procedure, started_at, duration)
yield booker
actors = booker.casts.collect{|c| c[:actor]}.compact
if actors.empty?
raise ArgumentError, "What's the fuck ? No actors ? "
end
# Find a slot for all actors for given day and given duration
at = nil
9.times do |p|
at = started_at + p
break unless InterventionCast.joins(:intervention).where(actor_id: actors.map(&:id)).where("? BETWEEN started_at AND stopped_at OR ? BETWEEN started_at AND stopped_at", at, at + duration.hours).any?
end
# Run interventions
intervention = nil
stopped_at = at + duration.hours
if stopped_at < Time.now
intervention = Intervention.create!(reference_name: procedure_name, production: Booker.production, production_support: options[:support], started_at: at, stopped_at: stopped_at, description: options[:description])
for cast in booker.casts
intervention.add_cast!(cast)
end
intervention.run!({started_at: at, duration: duration.hours}, options[:parameters])
end
return intervention
end
end
attr_reader :casts, :duration, :started_at, :reference
def initialize(reference, started_at, duration)
@reference = reference
@duration = duration
@started_at = started_at
@casts = []
end
def add_cast(options = {})
unless reference.variables[options[:reference_name]]
raise "Invalid variable: #{options[:reference_name]} in procedure #{reference.name}"
end
@casts << options
end
# Find a valid actor in the given period
def find(model, options = {})
options.update(started_at: @started_at)
options.update(stopped_at: @started_at)
self.class.find(model, options)
end
end
end
end
|
gaapt/ekylibre
|
lib/ekylibre/first_run/booker.rb
|
Ruby
|
agpl-3.0
| 8,111 |
from bears.yml.RAMLLintBear import RAMLLintBear
from tests.LocalBearTestHelper import verify_local_bear
good_file = """
#%RAML 0.8
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
"""
bad_file = """#%RAML 0.8
title: Failing RAML
version: 1
baseUri: http://example.com
/resource:
description: hello
post:
"""
RAMLLintBearTest = verify_local_bear(RAMLLintBear,
valid_files=(good_file,),
invalid_files=(bad_file,),
tempfile_kwargs={'suffix': '.raml'})
|
sounak98/coala-bears
|
tests/yml/RAMLLintBearTest.py
|
Python
|
agpl-3.0
| 602 |
<?php
$url="clasificacion_unica_list";
$modulo="Clasificacion Única";
$tabla="clasificacion_unica";
$titulos=array("Código","Descripción");
$indices=array("0","1");
//DECLARACION DE LIBRERIAS
require_once '../lib/common.php';
$conexion=conexion();
$tipob=@$_GET['tipo'];
$des=@$_GET['des'];
$pagina=@$_GET['pagina'];
if(isset($_POST['buscar']) || $tipob!=NULL){
if(!$tipob){
$tipob=$_POST['palabra'];
$des=$_POST['buscar'];
}
switch($tipob){
case "exacta":
$consulta=buscar_exacta($tabla,$des,"descripcion");
break;
case "todas":
$consulta=buscar_todas($tabla,$des,"descripcion");
break;
case "cualquiera":
$consulta=buscar_cualquiera($tabla,$des,"descripcion");
break;
}
}else{
$consulta="select * from ".$tabla." order by codigo";
}
//echo $consulta." este es el valor quemuestra ";
$num_paginas=obtener_num_paginas($consulta);
$pagina=obtener_pagina_actual($pagina, $num_paginas);
$resultado=paginacion($pagina, $consulta);
include ("../header.php");
?>
<FORM name="<?echo $url?>" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" target="_self">
<?
titulo($modulo,"clasificacion_unica_add.php","../menu_int.php?cod=10","17");
?>
<table class="tb-head" width="100%">
<tr>
<td><input type="text" name="buscar" size="20"></td>
<td><? btn('search',$url,1); ?></td>
<td><? btn('show_all',$url.".php?pagina=".$pagina); ?></td>
<td width="120"><input onclick="javascript:actualizar(this);" checked="true" type="radio" name="palabra" value="exacta">Palabra exacta</td>
<td width="140"><input onclick="javascript:actualizar(this);" type="radio" name="palabra" value="todas">Todas las palabras</td>
<td width="150"><input onclick="javascript:actualizar(this);" type="radio" name="palabra" value="cualquiera">Cualquier palabra</td>
<td colspan="3" width="386"></td>
</tr>
</table>
<BR>
<table width="100%" cellspacing="0" border="0" cellpadding="1" align="center">
<tbody>
<tr class="tb-head" >
<?
foreach($titulos as $nombre){
echo "<td><STRONG>$nombre</STRONG></td>";
}
?>
<td></td>
<td></td>
</tr>
<?
if($num_paginas!=0){
$i=0;
while($fila=mysql_fetch_array($resultado)){
$i++;
if($i%2==0){
?>
<tr class="tb-fila">
<?
}else{
echo"<tr>";
}
foreach($indices as $campo){
$nom_tabla=mysql_field_name($resultado,$campo);
$var=$fila[$nom_tabla];
echo"<td>$var</td>";
}
$codigo=$fila["codigo"];
icono("clasificacion_unica_edit.php?codigo=".$codigo."&pagina=".$pagina, "Editar", "edit.gif");
icono("clasificacion_unica_delete.php?codigo=".$codigo."&pagina=".$pagina, "Eliminar", "delete.gif");
echo"</tr>";
}
}else{
echo"<tr><td>No existen registro con la busqueda especificada</td></tr>";
}
cerrar_conexion($conexion);
?>
</tbody>
</table>
<?
pie_pagina($url,$pagina,"&tipo=".$tipob."&des=".$des,$num_paginas);
?>
</FORM>
</BODY>
</html>
|
armadillotec/SuiteSelectra
|
selectraerp/configuracion/clasificacion_unica_list.php
|
PHP
|
agpl-3.0
| 2,958 |
// =======================================================================
// PageLess - endless page
//
// Pageless is a jQuery plugin.
// As you scroll down you see more results coming back at you automatically.
// It provides an automatic pagination in an accessible way : if javascript
// is disabled your standard pagination is supposed to work.
//
// Licensed under the MIT:
// http://www.opensource.org/licenses/mit-license.php
//
// Parameters:
// currentPage: current page (params[:page])
// distance: distance to the end of page in px when ajax query is fired
// loader: selector of the loader div (ajax activity indicator)
// loaderHtml: html code of the div if loader not used
// loaderImage: image inside the loader
// loaderMsg: displayed ajax message
// pagination: selector of the paginator divs.
// if javascript is disabled paginator is provided
// params: paramaters for the ajax query, you can pass auth_token here
// totalPages: total number of pages
// url: URL used to request more data
//
// Callback Parameters:
// scrape: A function to modify the incoming data.
// complete: A function to call when a new page has been loaded (optional)
// end: A function to call when the last page has been loaded (optional)
//
// Usage:
// $('#results').pageless({ totalPages: 10
// , url: '/articles/'
// , loaderMsg: 'Loading more results'
// });
//
// Requires: jquery
//
// Author: Jean-Sébastien Ney (https://github.com/jney)
//
// Contributors:
// Alexander Lang (https://github.com/langalex)
// Lukas Rieder (https://github.com/Overbryd)
//
// Thanks to:
// * codemonky.com/post/34940898
// * www.unspace.ca/discover/pageless/
// * famspam.com/facebox
// =======================================================================
(function($) {
var FALSE = !1
, TRUE = !FALSE
, NAMESPACE = '.pageless'
, SCROLL = 'scroll' + NAMESPACE
, RESIZE = 'resize' + NAMESPACE
, BARE_INSTANCE = null;
var createClosure = function (opts) {
var element
, isLoading = FALSE
, loader
, settings = { container: window
, currentPage: 1
, distance: 100
, pagination: '.pagination'
, params: {}
, url: location.href
, loaderImage: "/images/load.gif"
, animate: true
}
, container
, $container;
var activate = function(opts) {
$.isFunction(opts) ? opts.call() : init(opts);
};
var loaderHtml = function () {
return settings.loaderHtml || '\
<div id="pageless-loader" style="display:none;text-align:center;width:100%;">\
<div class="msg" style="color:#e9e9e9;font-size:2em"></div>\
<img src="' + settings.loaderImage + '" alt="loading more results" style="margin:10px auto" />\
</div>';
};
// settings params: totalPages
var init = function (opts) {
if (opts) $.extend(settings, opts);
container = settings.container;
$container = $(container);
// for accessibility we can keep pagination links
// but since we have javascript enabled we remove pagination links
if(settings.pagination) $(settings.pagination).remove();
// start the listener
startListener();
};
var applyContext = function ($el, opts) {
var $loader = $(opts.loader, $el);
element = $el;
// loader element
if (opts.loader && $loader.length) {
loader = $loader;
} else {
loader = $(loaderHtml());
$el.append(loader);
// if we use the default loader, set the message
if (!opts.loaderHtml) {
$('#pageless-loader .msg').html(opts.loaderMsg);
}
}
loading(isLoading);
};
//
var loading = function (bool) {
isLoading = bool;
if (!loader) { return; }
if (isLoading) {
if (loader.parents().first().is(':visible') && settings.animate) {
// visible parent, animate it
loader.fadeIn('normal');
} else {
// invisible parent, just show so it's visible when parent is shown
loader.show();
}
} else {
if (loader.parents().first().is(':visible') && settings.animate) {
// visible parent, animate it
loader.fadeOut('normal');
} else {
// invisible parent, just hide so it remains invisible when parent is
// shown
loader.hide();
}
}
};
// distance to end of the container
var distanceToBottom = function () {
return (container === window)
? $(document).height()
- $container.scrollTop()
- $container.height()
: $container[0].scrollHeight
- $container.scrollTop()
- $container.height();
};
var stopListener = function() {
$container.unbind(NAMESPACE);
};
// * bind a scroll event
// * trigger is once in case of reload
var startListener = function() {
$container.bind(SCROLL+' '+RESIZE, watch)
.trigger(SCROLL);
};
var watch = function() {
// listener was stopped or we've run out of pages
if (settings.totalPages <= settings.currentPage) {
stopListener();
// if there is a afterStopListener callback we call it
if (settings.end) settings.end.call();
return;
}
// if slider past our scroll offset, then fire a request for more data
if(!isLoading && (distanceToBottom() < settings.distance)) {
loading(TRUE);
// move to next page
settings.currentPage++;
// set up ajax query params
$.extend( settings.params
, { page: settings.currentPage });
// finally ajax query
$.get( settings.url
, settings.params
, function (data, text, xhr) {
var data = $.isFunction(settings.scrape) ? settings.scrape(data, xhr) : data;
loader ? loader.before(data) : element.append(data);
loading(FALSE);
// if there is a complete callback we call it
if (settings.complete) settings.complete.call();
}, 'html');
}
};
return {activate: activate, applyContext: applyContext};
};
$.pageless = function(opts) {
if (BARE_INSTANCE === null) {
BARE_INSTANCE = createClosure(opts);
BARE_INSTANCE.activate(opts);
}
return BARE_INSTANCE;
};
$.fn.pageless = function(opts) {
if (!this.hasOwnProperty('pagelessInstance')) {
this.pagelessInstance = createClosure(opts);
this.pagelessInstance.activate(opts);
}
this.pagelessInstance.applyContext($(this), opts);
return this;
};
})(jQuery);
|
faraazkhan/canvas
|
public/javascripts/vendor/jquery.pageless.js
|
JavaScript
|
agpl-3.0
| 6,999 |
{% extends "base.html" %}{% set admin_area=True %}
{% block title %}All Panel Feedback{% endblock %}}
{% block content %}
<h2>Panel Feedback</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Event</th>
<th>Reviewer</th>
<th>Rating</th>
<th>Attendance 5 minutes in</th>
<th>Attendance 15 minutes in</th>
<th>Comments</th>
<th></th>
</tr>
</thead>
<tbody>
{% for event, feedback in events %}
{% for fb in feedback %}
<tr>
{% if loop.first %}
<td rowspan="{{ feedback|length }}"><a href="panel_feedback?event_id={{ event.id }}">{{ event.name }}</a></td>
{% endif %}
<td><a href="assigned_to?id={{ fb.attendee_id }}">{{ fb.attendee.full_name }}</a></td>
<td>{{ fb.rating_label }}</td>
<td>{{ fb.headcount_starting|default("(unknown)") }}</td>
<td>{{ fb.headcount_during|default("(unknown)") }}</td>
<td>{{ fb.comments|linebreaksbr }}</td>
<td><a href="panel_feedback?event_id={{ fb.event_id }}&id={{ fb.id }}">Edit</a></td>
</tr>
{% else %}
<tr>
<td><a href="panel_feedback?event_id={{ event.id }}">{{ event.name }}</a></td>
<td colspan="6">Click the event name to leave feedback</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
{% endblock %}
|
magfest/ubersystem
|
uber/templates/panels_admin/feedback_report.html
|
HTML
|
agpl-3.0
| 1,533 |
from twisted.python import log
from autobahn.wamp import WampServerProtocol
class OpenERPWampServerProtocol(WampServerProtocol):
def onConnect(self, connectionRequest):
core = "asterisk360/callsto#"
self.registerForPubSub(core, True)
log.msg("Web Socket Server Connected:%s" % core)
return 'wamp'
|
ygol/asterisk360
|
daemons/callmanager/openerp_wamp_server_protocol.py
|
Python
|
agpl-3.0
| 335 |
<?php
try {
global $RBAC;
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
//$oJSON = new Services_JSON();
$aData = get_object_vars( G::json_decode( $_POST['oData'] ));
//$aData = get_object_vars( $oJSON->decode( $_POST['oData'] ) );
if (isset($aData["TAS_TITLE"])) {
$aData["TAS_TITLE"] = str_replace("__ADD__", "+", $aData["TAS_TITLE"]);
}
if (isset($aData["TAS_DESCRIPTION"])) {
$aData["TAS_DESCRIPTION"] = str_replace("__ADD__", "+", $aData["TAS_DESCRIPTION"]);
}
if (isset( $_POST['function'] )) {
$sAction = $_POST['function'];
} else {
$sAction = $_POST['functions'];
}
switch ($sAction) {
case "saveTaskData":
require_once ("classes/model/Task.php");
$response = array ();
$oTask = new Task();
$aTaskInfo = $oTask->load($aData['TAS_UID']);
/**
* routine to replace @amp@ by &
* that why the char "&" can't be passed by XmlHttpRequest directly
* @autor erik <[email protected]>
*/
foreach ($aData as $k => $v) {
$aData[$k] = str_replace( '@amp@', '&', $v );
}
if (isset( $aData['SEND_EMAIL'] )) {
$aData['TAS_SEND_LAST_EMAIL'] = $aData['SEND_EMAIL'] == 'TRUE' ? 'TRUE' : 'FALSE';
} else {
//$aTaskInfo = $oTask->load($aData['TAS_UID']);
$aData['TAS_SEND_LAST_EMAIL'] = is_null($aTaskInfo['TAS_SEND_LAST_EMAIL']) ? 'FALSE' : $aTaskInfo['TAS_SEND_LAST_EMAIL'];
}
//Additional configuration
if (isset( $aData['TAS_DEF_MESSAGE_TYPE'] ) && isset( $aData['TAS_DEF_MESSAGE_TEMPLATE'] )) {
G::LoadClass( 'configuration' );
$oConf = new Configurations();
$oConf->aConfig = array ('TAS_DEF_MESSAGE_TYPE' => $aData['TAS_DEF_MESSAGE_TYPE'],'TAS_DEF_MESSAGE_TEMPLATE' => $aData['TAS_DEF_MESSAGE_TEMPLATE']
);
$oConf->saveConfig( 'TAS_EXTRA_PROPERTIES', $aData['TAS_UID'], '', '' );
unset( $aData['TAS_DEF_MESSAGE_TYPE'] );
unset( $aData['TAS_DEF_MESSAGE_TEMPLATE'] );
}
//Validating TAS_ASSIGN_VARIABLE value
$sw = false;
if (!isset($aData['TAS_ASSIGN_TYPE'])) {
$sw = true;
if (isset($aTaskInfo['TAS_ASSIGN_TYPE'])) {
switch($aTaskInfo['TAS_ASSIGN_TYPE']) {
case 'SELF_SERVICE':
case 'SELF_SERVICE_EVALUATE':
$aData['TAS_ASSIGN_TYPE'] = ($aTaskInfo['TAS_GROUP_VARIABLE'] == '') ? 'SELF_SERVICE':'SELF_SERVICE_EVALUATE';
$aData['TAS_GROUP_VARIABLE'] = $aTaskInfo['TAS_GROUP_VARIABLE'];
break;
default:
$aData['TAS_ASSIGN_TYPE'] = $aTaskInfo['TAS_ASSIGN_TYPE'];
break;
}
} else {
$derivateType = $oTask->kgetassigType($_SESSION['PROCESS'],$aData['TAS_UID']);
if (is_null($derivateType)){
$aData['TAS_ASSIGN_TYPE'] = 'BALANCED';
} else {
$aData['TAS_ASSIGN_TYPE'] = $derivateType['TAS_ASSIGN_TYPE'];
}
}
}
switch($aData['TAS_ASSIGN_TYPE']) {
case 'SELF_SERVICE':
case 'SELF_SERVICE_EVALUATE':
if ($aData['TAS_ASSIGN_TYPE'] == 'SELF_SERVICE_EVALUATE') {
$aData['TAS_ASSIGN_TYPE'] = 'SELF_SERVICE';
if(trim($aData['TAS_GROUP_VARIABLE']) == '') {
$aData['TAS_GROUP_VARIABLE'] = '@@SYS_GROUP_TO_BE_ASSIGNED';
}
} else {
$aData['TAS_GROUP_VARIABLE'] = '';
}
break;
default:
if (isset($aTaskInfo['TAS_ASSIGN_TYPE']) && $sw) {
$aData['TAS_ASSIGN_TYPE'] = $aTaskInfo['TAS_ASSIGN_TYPE'];
}
$aData['TAS_GROUP_VARIABLE'] = '';
break;
}
$result = $oTask->update( $aData );
$oTaskNewPattern = new Task();
$taskInfo=$oTaskNewPattern->load($aData['TAS_UID']);
$titleTask=$taskInfo['TAS_TITLE'];
$taskProperties='';
foreach ($aData as $key => $value){
if ($value!='') {
$taskProperties.=$key.' -> '.$value.' ';
}
}
G::auditLog("SaveTaskProperties","Task Properties DETAILS : ".$taskProperties);
$response["status"] = "OK";
if ($result == 3) {
$response["status"] = "CRONCL";
}
echo G::json_encode( $response );
break;
}
} catch (Exception $oException) {
die( $oException->getMessage() );
}
|
baozhoutao/processmaker
|
workflow/engine/methods/tasks/tasks_Ajax.php
|
PHP
|
agpl-3.0
| 5,583 |
import * as React from 'react';
import 'rc-tooltip/assets/bootstrap_white.css';
import { VAFPlot, IVAFPlotProps, MutationFrequenciesBySample } from './VAFPlot';
import { IKeyedIconData } from '../genomicOverview/GenomicOverviewUtils';
import { DefaultTooltip, isWebdriver } from 'cbioportal-frontend-commons';
export type IThumbnailExpandVAFPlotProps = {
data: MutationFrequenciesBySample;
order?: { [s: string]: number };
colors?: { [s: string]: string };
labels?: { [s: string]: string };
overlayPlacement?: string;
cssClass?: string;
genePanelIconData?: IKeyedIconData;
};
export class ThumbnailExpandVAFPlot extends React.Component<
IThumbnailExpandVAFPlotProps,
{}
> {
public static defaultProps = {
order: {},
colors: {},
labels: {},
overlayPlacement: 'left',
};
render() {
let thumbnailProps = {
data: this.props.data,
colors: this.props.colors,
order: this.props.order,
show_controls: false,
nolegend: true,
width: 64,
height: 64,
label_font_size: '6.5px',
xticks: 0,
yticks: 0,
margin_bottom: 15,
};
let expandedProps = {
data: this.props.data,
colors: this.props.colors,
labels: this.props.labels,
order: this.props.order,
show_controls: true,
nolegend: false,
init_show_histogram: true,
init_show_curve: true,
genepanel_icon_data: this.props.genePanelIconData,
};
return (
<DefaultTooltip
placement={this.props.overlayPlacement}
trigger={['hover', 'focus']}
overlay={<VAFPlot {...expandedProps} />}
arrowContent={<div className="rc-tooltip-arrow-inner" />}
destroyTooltipOnHide={false}
mouseLeaveDelay={isWebdriver() ? 2 : 0.05}
>
<div className={this.props.cssClass || ''}>
<VAFPlot {...thumbnailProps} />
</div>
</DefaultTooltip>
);
}
}
|
cBioPortal/cbioportal-frontend
|
src/pages/patientView/vafPlot/ThumbnailExpandVAFPlot.tsx
|
TypeScript
|
agpl-3.0
| 2,210 |
COMMENT ON SCHEMA portal IS 'This module is used to create portals.
Portals are views of person data. Several portals can be created, depending on institution category, employee, etc.
A portal contains:
- a main navigation, which will contain information about all persons,
- and a navigation for the dossiers.
Each navigation is composed of sections containing menu entries.
All functions from this module require the ''structure'' user right.';
COMMENT ON TABLE portal.mainmenu IS 'Menu entries of a main view';
COMMENT ON COLUMN portal.mainmenu.mme_id IS 'Unique identifier';
COMMENT ON COLUMN portal.mainmenu.mse_id IS 'Main section containing this menu entry';
COMMENT ON COLUMN portal.mainmenu.mme_name IS 'Menu name';
COMMENT ON COLUMN portal.mainmenu.mme_order IS 'Menu order in the section';
COMMENT ON COLUMN portal.mainmenu.mme_title IS '';
COMMENT ON COLUMN portal.mainmenu.mme_icon IS '';
COMMENT ON COLUMN portal.mainmenu.mme_content_type IS '';
COMMENT ON COLUMN portal.mainmenu.mme_content_id IS '';
COMMENT ON TABLE portal.mainsection IS 'The main view of a portal consists of menus regrouped in sections. This table defines these sections.';
COMMENT ON COLUMN portal.mainsection.mse_id IS 'Unique identifier';
COMMENT ON COLUMN portal.mainsection.por_id IS 'Portal containing this section';
COMMENT ON COLUMN portal.mainsection.mse_name IS 'Section name';
COMMENT ON COLUMN portal.mainsection.mse_order IS 'Order of the section in the portal';
COMMENT ON TABLE portal.personmenu IS 'Menu entries of a view for an entity type';
COMMENT ON COLUMN portal.personmenu.pme_id IS 'Unique identifier';
COMMENT ON COLUMN portal.personmenu.pse_id IS 'Section containing this menu entry';
COMMENT ON COLUMN portal.personmenu.pme_name IS 'Menu name';
COMMENT ON COLUMN portal.personmenu.pme_order IS 'Menu order in the section';
COMMENT ON TABLE portal.personsection IS 'A view of a portal for an entity type consists of menus regrouped in sections.
This table defines these sections.';
COMMENT ON COLUMN portal.personsection.pse_id IS 'Unique identifier';
COMMENT ON COLUMN portal.personsection.por_id IS 'Portal containing this section';
COMMENT ON COLUMN portal.personsection.pse_name IS 'Section name';
COMMENT ON COLUMN portal.personsection.pse_order IS 'Order of the section in the portal for the entity type';
COMMENT ON TABLE portal.portal IS 'A portal is a particular view of the data contained in the database. It will be defined
by several navigation views, one main view (mainsection and mainmenu) and one view per entity type
(personsection and personmenu).';
COMMENT ON COLUMN portal.portal.por_id IS 'Unique identifier';
COMMENT ON COLUMN portal.portal.por_name IS 'Portal name';
COMMENT ON COLUMN portal.portal.por_description IS '';
|
actimeo/simmage-backend
|
src/portal/sql/comments.sql
|
SQL
|
agpl-3.0
| 2,767 |
package com.bitschupfa.sw16.yaq.bluetooth;
import java.util.UUID;
public class BTService {
public static final String SERVICE_NAME = "YAQ_BT_SERVICE";
public static final UUID SERVICE_UUID = UUID.fromString("fa4bf3ee-e9c3-422e-98f0-37d514be1988");
}
|
thomasmauerhofer/software2016
|
src/Yaq/app/src/main/java/com/bitschupfa/sw16/yaq/bluetooth/BTService.java
|
Java
|
agpl-3.0
| 261 |
/*
* RapidMiner
*
* Copyright (C) 2001-2014 by RapidMiner and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapidminer.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.rapidminer.gui.properties.celleditors.value;
import java.awt.Component;
import java.awt.event.ActionEvent;
import javax.swing.AbstractCellEditor;
import javax.swing.JButton;
import javax.swing.JTable;
import com.rapidminer.gui.tools.ResourceAction;
import com.rapidminer.gui.wizards.ConfigurationWizardCreator;
import com.rapidminer.operator.Operator;
import com.rapidminer.parameter.ParameterTypeConfiguration;
/**
* Cell editor consisting of a simple button which opens a configuration wizard for
* the corresponding operator.
*
* @author Ingo Mierswa
*/
public class ConfigurationWizardValueCellEditor extends AbstractCellEditor implements PropertyValueCellEditor {
private static final long serialVersionUID = -7163760967040772736L;
private transient final ParameterTypeConfiguration type;
private final JButton button;
public ConfigurationWizardValueCellEditor(ParameterTypeConfiguration type) {
this.type = type;
button = new JButton(new ResourceAction(true, "wizard."+type.getWizardCreator().getI18NKey()) {
private static final long serialVersionUID = 5340097986173787690L;
@Override
public void actionPerformed(ActionEvent e) {
buttonPressed();
}
});
button.setToolTipText(type.getDescription());
}
/** Does nothing. */
public void setOperator(Operator operator) {}
private void buttonPressed() {
ConfigurationWizardCreator creator = type.getWizardCreator();
if (creator != null)
creator.createConfigurationWizard(type, type.getWizardListener());
}
public Object getCellEditorValue() {
return null;
}
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) {
return button;
}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
return getTableCellEditorComponent(table, value, isSelected, row, column);
}
public boolean useEditorAsRenderer() {
return true;
}
@Override
public boolean rendersLabel() {
return true;
}
}
|
rapidminer/rapidminer-5
|
src/com/rapidminer/gui/properties/celleditors/value/ConfigurationWizardValueCellEditor.java
|
Java
|
agpl-3.0
| 3,066 |
class Picture < ActiveRecord::Base
belongs_to :cca
has_many :normalized_tags
has_many :tags
has_many :users, :through => :tags
# add the tag system...
has_many :taggings, :as => :taggable, :dependent => :destroy
has_many :tags, :through => :taggings
has_many :normalized_tags, :through => :taggings
has_many :turk_answers, :as => :turkable
attr_accessor :taglist
has_attached_file :photo,
:styles => { :thumb => '50x50#', :large => '643x500', :medium => '321x250' },
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:bucket => S3_BUCKET,
:path => "photos/" <<
":attachment/:id_partition/" <<
":basename_:style.:extension",
:url => "photos/:attachment/:id_partition/" <<
":basename_:style.:extension",
:default_url => "/images/featured_images/missing_:style.png"
#if Rails.env.production?
validates_attachment_content_type :photo,
:content_type => ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png',
'image/x-png', 'image/jpg'],
:message => "Oops! Make sure you are uploading an image file.",
:unless => :no_photo_name
validates_attachment_size :photo, :in => 1..5.megabytes, :unless => :no_photo_name
#end
named_scope :random, lambda { |cca_id, picture_ids_string|
conditions = []
conditions << "cca_id=#{cca_id}"
conditions << "id not in (#{picture_ids_string})" unless picture_ids_string.blank?
{:conditions => conditions.join(" and "), :order=>"rand()", :limit=>1}
}
def no_photo_name
!photo_file_name.blank?
end
end
|
spot-us/spot-us
|
app/models/picture.rb
|
Ruby
|
agpl-3.0
| 1,849 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Sean Nesbitt using IMS Development Environment (version 1.65 build 3210.27143)
// Copyright (C) 1995-2008 IMS MAXIMS plc. All rights reserved.
package ims.core.forms.addresssearch;
import java.io.Serializable;
public final class AccessLogic extends BaseAccessLogic implements Serializable
{
private static final long serialVersionUID = 1L;
public boolean isAccessible()
{
if(!super.isAccessible())
return false;
// TODO: Add your conditions here.
return true;
}
public boolean isReadOnly()
{
if(super.isReadOnly())
return true;
// TODO: Add your conditions here.
return false;
}
}
|
open-health-hub/openmaxims-linux
|
openmaxims_workspace/Core/src/ims/core/forms/addresssearch/AccessLogic.java
|
Java
|
agpl-3.0
| 2,137 |
/*##############################################################################
Copyright (C) 2011 HPCC Systems.
All rights reserved. This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
############################################################################## */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "esdlcomp.h"
int gArgc;
char** gArgv = NULL;
//------------------------------------------------------
// usage
void usage(const char* programName)
{
printf("ESDL Compiler\n\n");
printf("Usage: %s [options] filename.scm [<outdir>]\n\n", programName);
printf("Output: filename.xml\n");
puts("Available options:");
puts(" -?/-h: show this usage page");
exit(1);
}
//------------------------------------------------------
// parse comamnd line: put non-option params into gArgv
void parseCommandLine(int argc, char* argv[])
{
gArgv = new char*[argc+1];
gArgc = 0;
// parse options
for (int i=0; i<argc; i++)
{
if (*argv[i]=='-')
{
if (stricmp(argv[i], "-?")==0 || stricmp(argv[i], "-h")==0)
usage(argv[0]);
else
{
printf("Unknown option: %s\n", argv[i]);
exit(1);
}
}
else
gArgv[gArgc++] = argv[i];
}
gArgv[gArgc] = NULL;
if (gArgc<2 || gArgc>4)
usage(argv[0]);
}
//------------------------------------------------------
// main
int main(int argc, char* argv[])
{
parseCommandLine(argc, argv);
char* sourcefile = gArgv[1];
char* outdir = (gArgc>=3)?(char*)gArgv[2]:(char*)"";
ESDLcompiler hc(sourcefile, outdir);
hc.Process();
delete[] gArgv;
return 0;
}
// end
//------------------------------------------------------
|
RussWhitehead/HPCC-Platform
|
tools/esdl/main.cpp
|
C++
|
agpl-3.0
| 2,446 |
//#############################################################################
//# #
//# Copyright (C) <2015> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of #
//# this program. Users of this software do so entirely at their own risk. #
//# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time #
//# software that it builds, deploys and maintains. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.nursing.vo.lookups;
import ims.framework.cn.data.TreeNode;
import java.util.ArrayList;
import ims.framework.utils.Image;
import ims.framework.utils.Color;
public class AssessmentType extends ims.vo.LookupInstVo implements TreeNode
{
private static final long serialVersionUID = 1L;
public AssessmentType()
{
super();
}
public AssessmentType(int id)
{
super(id, "", true);
}
public AssessmentType(int id, String text, boolean active)
{
super(id, text, active, null, null, null);
}
public AssessmentType(int id, String text, boolean active, AssessmentType parent, Image image)
{
super(id, text, active, parent, image);
}
public AssessmentType(int id, String text, boolean active, AssessmentType parent, Image image, Color color)
{
super(id, text, active, parent, image, color);
}
public AssessmentType(int id, String text, boolean active, AssessmentType parent, Image image, Color color, int order)
{
super(id, text, active, parent, image, color, order);
}
public static AssessmentType buildLookup(ims.vo.LookupInstanceBean bean)
{
return new AssessmentType(bean.getId(), bean.getText(), bean.isActive());
}
public String toString()
{
if(getText() != null)
return getText();
return "";
}
public TreeNode getParentNode()
{
return (AssessmentType)super.getParentInstance();
}
public AssessmentType getParent()
{
return (AssessmentType)super.getParentInstance();
}
public void setParent(AssessmentType parent)
{
super.setParentInstance(parent);
}
public TreeNode[] getChildren()
{
ArrayList children = super.getChildInstances();
AssessmentType[] typedChildren = new AssessmentType[children.size()];
for (int i = 0; i < children.size(); i++)
{
typedChildren[i] = (AssessmentType)children.get(i);
}
return typedChildren;
}
public int addChild(TreeNode child)
{
if (child instanceof AssessmentType)
{
super.addChild((AssessmentType)child);
}
return super.getChildInstances().size();
}
public int removeChild(TreeNode child)
{
if (child instanceof AssessmentType)
{
super.removeChild((AssessmentType)child);
}
return super.getChildInstances().size();
}
public Image getExpandedImage()
{
return super.getImage();
}
public Image getCollapsedImage()
{
return super.getImage();
}
public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
{
AssessmentTypeCollection result = new AssessmentTypeCollection();
result.add(INITIAL);
return result;
}
public static AssessmentType[] getNegativeInstances()
{
AssessmentType[] instances = new AssessmentType[2];
instances[0] = INITIAL;
return instances;
}
public static String[] getNegativeInstanceNames()
{
String[] negativeInstances = new String[2];
negativeInstances[0] = "COMPLETE";
negativeInstances[1] = "INITIAL";
return negativeInstances;
}
public static AssessmentType getNegativeInstance(String name)
{
if(name == null)
return null;
String[] negativeInstances = getNegativeInstanceNames();
for (int i = 0; i < negativeInstances.length; i++)
{
if(negativeInstances[i].equals(name))
return getNegativeInstances()[i];
}
return null;
}
public static AssessmentType getNegativeInstance(Integer id)
{
if(id == null)
return null;
AssessmentType[] negativeInstances = getNegativeInstances();
for (int i = 0; i < negativeInstances.length; i++)
{
if(negativeInstances[i].getID() == id)
return negativeInstances[i];
}
return null;
}
public int getTypeId()
{
return TYPE_ID;
}
public static final int TYPE_ID = 1211000;
public static final AssessmentType COMPLETE = new AssessmentType(-41, "Complete Assessment", false, null, null, Color.Black);
public static final AssessmentType INITIAL = new AssessmentType(-7, "Initial Assessment", true, null, null, Color.Black);
}
|
IMS-MAXIMS/openMAXIMS
|
Source Library/openmaxims_workspace/ValueObjects/src/ims/nursing/vo/lookups/AssessmentType.java
|
Java
|
agpl-3.0
| 6,082 |
<div ng-class="{component:true}" ng-switch on="root.type">
<category ng-switch-when="category" root="root"></category>
<group ng-switch-when="group" root="root"></group>
<inputitem ng-switch-when="item" item="root" class="row"></inputitem>
<div ng-switch-when="form" class="container">
<h1 ng-bind='root.name'></h1>
<component ng-repeat="ri in root" root="ri"></component>
</div>
<div ng-switch-default unknown-type="{{root.type}}"> {{ root.name }} </div>
</div>
|
indx/indx-core
|
apps/datawell/html/schema/partials/component.html
|
HTML
|
agpl-3.0
| 496 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Neil McAnaspie using IMS Development Environment (version 1.51 build 2480.15886)
// Copyright (C) 1995-2006 IMS MAXIMS plc. All rights reserved.
package ims.assessment.forms.userdefinedformnew;
import java.io.Serializable;
public final class AccessLogic extends BaseAccessLogic implements Serializable
{
private static final long serialVersionUID = 1L;
public boolean isAccessible()
{
if(!super.isAccessible())
return false;
// TODO: Add your conditions here.
return true;
}
}
|
openhealthcare/openMAXIMS
|
openmaxims_workspace/Assessment/src/ims/assessment/forms/userdefinedformnew/AccessLogic.java
|
Java
|
agpl-3.0
| 2,012 |
package Metawebdesign.metawebdesign.diagram.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
*/
public class LinkViewCreateCommand extends EditElementCommand {
/**
* @generated
*/
public LinkViewCreateCommand(CreateElementRequest req) {
super(req.getLabel(), null, req);
}
/**
* FIXME: replace with setElementToEdit()
* @generated
*/
protected EObject getElementToEdit() {
EObject container = ((CreateElementRequest) getRequest())
.getContainer();
if (container instanceof View) {
container = ((View) container).getElement();
}
return container;
}
/**
* @generated
*/
public boolean canExecute() {
return true;
}
/**
* @generated
*/
protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
IAdaptable info) throws ExecutionException {
Metawebdesign.metawebdesign.LinkView newElement = Metawebdesign.metawebdesign.MetawebdesignFactory.eINSTANCE
.createLinkView();
Metawebdesign.metawebdesign.Root owner = (Metawebdesign.metawebdesign.Root) getElementToEdit();
owner.getLink().add(newElement);
doConfigure(newElement, monitor, info);
((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
/**
* @generated
*/
protected void doConfigure(Metawebdesign.metawebdesign.LinkView newElement,
IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
IElementType elementType = ((CreateElementRequest) getRequest())
.getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(
getEditingDomain(), newElement, elementType);
configureRequest.setClientContext(((CreateElementRequest) getRequest())
.getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType
.getEditCommand(configureRequest);
if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
}
|
MetaWebDesign/Editor
|
Editor_MWD.diagram/src/Metawebdesign/metawebdesign/diagram/edit/commands/LinkViewCreateCommand.java
|
Java
|
agpl-3.0
| 2,613 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.