answer stringlengths 15 1.25M |
|---|
.mycourse_con {float:left; width:100%; margin-top:30px;}
.mycourse_con ul {margin:auto; width:85%; background:#ebebeb; padding:20px;}
.mycourse_con p {line-height:40px; font-size:15px;}
.mycourse_con p.fb {font-weight:bold;}
.mycourse_con p.c1 {text-align:center; color:#ff8400;}
.mycourse_con p img {float:left; width:90px; height:90px; border:#FFFFFF solid 3px; margin-right:15px;}
.mycourse_con p.l25 {line-height:25px; font-size:11pt;}
.mycourse_con p.l45 {line-height:50px; font-size:15px;}
.homework_con {float:left; width:100%; margin:30px 0;}
.homework_con.m0 {margin:0;}
.homework_con.m30 {margin:0 0 30px 0;}
.homework_con ul {margin:auto; width:90%;}
.homework_con ul.p30 {padding:0 0 30px 0;}
.homework_con ul.b6 {border-bottom:#ebebeb solid 6px; padding-bottom:30px;}
.homework_con li {float:left; width:100%; line-height:35px; font-size:13px;}
.homework_con li.p50 {padding-bottom:30px;}
.homework_con p {line-height:40px; font-size:12pt; padding:10px 0;}
.homework_con p.center {text-align:center;}
.homework_con p.bg {background:#ebebeb; padding:5px 0;}
.homework_con p span {padding-left:15px;}
.homework_con p.p0 {padding:10px 0 0 0;}
.homework_con .fenshu {width:20%; height:20px; border:#CCCCCC solid 1px; padding:10px; line-height:30px; font-size:12pt; color:#666666;}
.homework_con .input {width:95%; height:300px; border:#CCCCCC solid 1px; padding:10px; line-height:36px; font-size:12pt; color:#666666;}
.homework_con .inputh50 {width:95%; height:50px; border:#CCCCCC solid 1px; padding:10px; line-height:36px; font-size:12pt; color:#666666;}
.homework_con .input_web {width:95%; border:#CCCCCC solid 1px; padding:10px; line-height:36px; font-size:12pt; color:#666666; height:40px;}
/*hfy*/
.homework_con .uphomework {background:#ff8400;-moz-border-radius: 5px; -<API key>: 5px; border-radius:5px; width:100%; height:35px; font-size:12pt; color:#FFFFFF; text-align:center; cursor:pointer; margin:0; background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
border: 1px solid #cc5100;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 0 0 rgba(0, 0, 0, 0);}
.app-mar{width:100%;}
.homework_con2{width:90%;margin:auto;}
.homework_con2 .con2_title{width:100%; padding:10px 0;float:left; font-size:15px; color:#666;}
.homework_con2 .con2_text{width:100%;margin-bottom:20px; height:160px; float:left;}
.homework_con2 .uphomework {background:#ff8400;-moz-border-radius: 5px; -<API key>: 5px; border-radius:5px; width:100%; height:35px; font-size:12pt; color:#FFFFFF; text-align:center; cursor:pointer; margin:auto; background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
border: 1px solid #cc5100;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 0 0 rgba(0, 0, 0, 0);}
/*hfy end*/
.homework_con .p10 {padding-left:10px;}
.homework_teach {float:left; width:100%; background:#f7f7f7; margin:30px 0; font-size:15px; line-height:36px; text-align:center;}
.mycourse {width:90%; margin:auto;}
.mycourse ul {float:left; width:100%; padding:30px 0;}
.mycourse ul.p0 {margin:30px 0 0 0; padding:0; background:#ebebeb; font-size:12pt; color:#ff8400; font-weight:bold; line-height:60px; text-align:center;}
.mycourse li {float:left; width:100%; border-bottom:#CCCCCC solid 1px; font-size:12pt; line-height:30px; color:#333333; padding:15px 0;}
.mycourse li a {color:#333333; text-decoration:none;}
.mycourse li .left {float:left; width:60%;}
.mycourse li .right {float:right; width:40%; text-align:right; color:#999999;}
.mycourse li .uphomework {background:#ff8400;-moz-border-radius: 5px; -<API key>: 5px; border-radius:5px; width:90px; height:35px; font-size:12pt; color:#FFFFFF; text-align:center; cursor:pointer; border:#ffffff solid 1px; margin:0;}
.mycourse .l40 {line-height:40px; font-size:12pt;}
.left{float: left;}
/*hfy*/
ul,ol{ list-style:none;}
.right{float: right;padding-right:40px;}
a:link,a:visited{color:#666;}
/*hfy end*/
.app-content .con3_title{width:100%; float:left; margin-top:10px; font-size:15px; color:#666;}
.app-content .con3_text{margin:20px 0; width:100%;}
.app-list .app-button .app-button-left{width:90%;}
.homework_con2 .t_mar{margin-top:20px;}
.homework_con2 .t_mar p{font-size:13px; color:#999;}
.app-banner{background:none; position:relative;}
.banner-text{position:absolute; color:#ffff00; font-size:18px; font-weight:bold; left:10px; top:10px;}
.banner-text2{position:absolute; color:#ffff00; font-size:18px; font-weight:bold; left:80px; top:40px;}
.app-content .uphomework{background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0)) repeat scroll 0 0 #ff8400;
border: 1px solid #cc5100;
border-radius: 5px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 0 0 rgba(0, 0, 0, 0);
color: #ffffff;
cursor: pointer;
font-size: 12pt;
height: 35px;
margin: 0;
text-align: center;
width: 100%;}
.app-content .but_mar{margin:auto; width:90%;}
/*hfy*/
footer{
position:fixed;bottom:0;z-index:2100;width: 100%;height:3em;
background-color: #ccc;color: #fff;
}
.courseBtn,.operationBtn,.achievementBtn,.messBtn,.inforBtn{
float:left;
width:20%;
height:2.5em;
text-align:center;
font-size:13px;
color: #fff;
}
.icon{
display:block;height:25px;cursor:pointer;
margin-left: 50%;
}
.courseBtn{
}
.courseBtn .icon{
background:url(../img/icon_05.gif) 0 0 no-repeat;
}
.operationBtn{
}
.operationBtn .icon{
background:url(../img/icon_07.gif) 0 0 no-repeat;
}
.achievementBtn{
}
.achievementBtn .icon{
background:url(../img/icon_09.gif) 0 0 no-repeat;
}
.messBtn{
}
.messBtn .icon{
background:url(../img/icon_11.gif) 0 0 no-repeat;
}
.inforBtn{
}
.inforBtn .icon{
background:url(../img/icon_13.gif) 0 0 no-repeat;
}
/*
.app-home{float:left;width:16%;height:44px; text-align:center;font-size:13px;}
.home-icon{
margin:auto;width:25px; height:24px; background:url(../img/icon_03.gif) 0 0 no-repeat; display:block; cursor:pointer;
}
.home-icon:hover{ margin:auto;width:25px; height:24px; background:url(../img/icon_03.gif) 0 -24px no-repeat; display:block;}
.app-course{float:left;width:16%;height:44px;text-align:center;font-size:13px;}
.course-icon{ margin:auto; width:24px; height:24px; background:url(../img/icon_05.gif) 0 0 no-repeat; display:block; cursor:pointer;}
.course-icon:hover{ margin:auto; width:24px; height:24px; background:url(../img/icon_05.gif) 0 -24px no-repeat; display:block;}
.app-operation{float:left;width:16%;height:44px;text-align:center;font-size:13px;}
.operation-icon{margin:auto; width:24px; height:24px; background:url(../img/icon_07.gif) 0 0 no-repeat; display:block; cursor:pointer;}
.operation-icon:hover{margin:auto; width:24px; height:24px; background:url(../img/icon_07.gif) 0 -24px no-repeat; display:block;}
.app-achievement{float:left;width:16%;height:44px;text-align:center;font-size:13px;}
.achievement-icon{ margin:auto; width:23px; height:24px; background:url(../img/icon_09.gif) 0 0 no-repeat; display:block; cursor:pointer;}
.achievement-icon:hover{ margin:auto; width:23px; height:24px; background:url(../img/icon_09.gif) 0 -24px no-repeat; display:block;}
.app-infor{float:left;width:16%;height:44px;text-align:center;font-size:13px;}
.infor-icon{margin:auto; width:27px; height:24px; background:url(../img/icon_11.gif) 0 0 no-repeat; display:block; cursor:pointer;}
.infor-icon:hover{margin:auto; width:27px; height:24px; background:url(../img/icon_11.gif) 0 -24px no-repeat; display:block;}
.app-per-infor{float:left;width:16%;height:44px;text-align:center;font-size:13px;}
.per-infor-icon{margin:auto; width:24px; height:24px; background:url(../img/icon_13.gif) 0 0 no-repeat; display:block; cursor:pointer;}
.per-infor-icon:hover{margin:auto; width:24px; height:24px; background:url(../img/icon_13.gif) 0 -24px no-repeat; display:block; cursor:pointer;}
*/
/*hfy end*/ |
# This program is free software: you can redistribute it and/or modify
# published by the Free Software Foundation, either version 3 of the
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic import ListView
from django.views.generic.edit import CreateView, UpdateView
from rolepermissions.mixins import HasPermissionsMixin
from apps.common import DV_STATES
from defivelo.roles import has_permission
from defivelo.views import MenuView
from ..forms import <API key>
from ..models import AnnualStateSetting
class SettingsMixin(HasPermissionsMixin):
model = AnnualStateSetting
required_permission = "settings_crud"
def dispatch(self, request, *args, **kwargs):
self.year = kwargs.pop("year")
self.cantons = (
DV_STATES
if has_permission(request.user, "cantons_all")
else self.request.user.managedstates.all().values_list("canton", flat=True)
)
return super().dispatch(request, *args, **kwargs)
def get_queryset(self):
return super().get_queryset().filter(year=self.year, canton__in=self.cantons)
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
# Add our menu_category context
context["menu_category"] = "settings"
context["year"] = self.year
return context
def get_form_kwargs(self):
form_kwargs = super().get_form_kwargs()
form_kwargs["year"] = self.year
form_kwargs["cantons"] = self.cantons
return form_kwargs
def get_success_url(self):
return reverse_lazy(
"<API key>", kwargs={"year": self.object.year}
)
class <API key>(SettingsMixin, MenuView, ListView):
context_object_name = "settings"
ordering = ["canton"]
class <API key>(SettingsMixin, SuccessMessageMixin, MenuView):
context_object_name = "setting"
form_class = <API key>
class <API key>(<API key>, CreateView):
success_message = _("Configuration cantonale par année créée")
class <API key>(<API key>, UpdateView):
success_message = _("Configuration cantonale par année mise à jour") |
package edu.yu.einstein.wasp.variantcalling.integration.messages;
import edu.yu.einstein.wasp.integration.messages.WaspMessageType;
/**
* @author
*
*/
public class <API key> extends WaspMessageType{
public static final String VARIANTCALLING = "edu.yu.einstein.wasp.variantcalling";
} |
#!/usr/bin/env bash
# Start-up script that waits for Postgres to be ready
# Christopher Harrison <ch12@sanger.ac.uk>
set -eu
wait_for_postgres() {
local -i max_attempts="$1"
python -u <<-PYTHON
import os
from time import sleep
from cogs import config, mail
from cogs.db.interface import Database
config_file = os.getenv("COGS_CONFIG", "config.yaml")
c = config.load(config_file)
available = False
attempts = 0
while not available and attempts < ${max_attempts}:
try:
db = Database(c["database"])
available = True
except:
sleep_for = 2 ** attempts
print(f"Database is not ready yet! Will try again in {sleep_for} seconds...")
sleep(sleep_for)
attempts += 1
if not available:
print("Could not connect to the database!")
exit(1)
PYTHON
}
MAX_ATTEMPTS="${MAX_ATTEMPTS-5}"
wait_for_postgres "${MAX_ATTEMPTS}" >&2
exec python "$@" -m cogs.main |
#ifndef INITGRID_H
#define INITGRID_H
extern const OptionDef odinitgrid [];
int initparamsinitgrid(Option * opts, int optsc);
void freeparamsinitgrid();
void initgrid(Grid g);
#endif |
DELETE FROM `weenie` WHERE `class_Id` = 10356;
INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`)
VALUES (10356, 'housecottage664', 53, '2019-02-10 00:00:00') /* House */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10356, 1, 128) /* ItemType - Misc */
, (10356, 5, 10) /* EncumbranceVal */
, (10356, 16, 1) /* ItemUseable - No */
, (10356, 93, 52) /* PhysicsState - Ethereal, IgnoreCollisions, NoDraw */
, (10356, 155, 1) /* HouseType - Cottage */
, (10356, 8041, 101) /* <API key> - Resting */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10356, 1, True ) /* Stuck */
, (10356, 24, True ) /* UiHidden */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10356, 39, 0.1) /* DefaultScale */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10356, 1, 'Cottage') /* Name */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10356, 1, 33557058) /* Setup */
, (10356, 8, 100671873) /* Icon */
, (10356, 30, 152) /* PhysicsScript - <API key> */
, (10356, 8001, 203423760) /* <API key> - Usable, Burden, HouseRestrictions, PScript */
, (10356, 8003, 148) /* <API key> - Stuck, Attackable, UiHidden */
, (10356, 8005, 163969) /* <API key> - CSetup, ObjScale, Position, AnimationFrame */;
INSERT INTO `<API key>` (`object_Id`, `position_Type`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`)
VALUES (10356, 8040, 3148349744, 133.027, 38.2669, 75.9995, -0.3570581, 0, 0, 0.9340822) /* <API key> */
/* @teleloc 0xBBA80130 [133.027000 38.266900 75.999500] -0.357058 0.000000 0.000000 0.934082 */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10356, 8000, 2075820195) /* <API key> */; |
using System;
using System.IO;
using System.Linq;
using System.Reflection;
namespace Nugety
{
public static class AssemblyExtensions
{
}
} |
rockmite = Creature:new {
objectName = "@mob/creature_names:rockmite",
socialGroup = "self",
faction = "",
level = 8,
chanceHit = 0.27,
damageMin = 70,
damageMax = 75,
baseXp = 187,
baseHAM = 405,
baseHAMmax = 495,
armor = 0,
resists = {0,0,0,0,0,0,0,-1,-1},
meatType = "meat_insect",
meatAmount = 3,
hideType = "hide_scaley",
hideAmount = 4,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0.25,
ferocity = 1,
pvpBitmask = ATTACKABLE,
creatureBitmask = HERD,
optionsBitmask = AIENABLED,
diet = CARNIVORE,
templates = {"object/mobile/rock_mite.iff"},
<API key> = "object/intangible/pet/rock_mite_hue.iff",
scale = 0.6,
lootGroups = {
{
groups = {
{group = "low_level_insects", chance = 10000000}
},
lootChance = 1440000
}
},
weapons = {},
<API key> = "",
attacks = {
}
}
CreatureTemplates:addCreatureTemplate(rockmite, "rockmite") |
/**
* A media element corresponding to a <video> element.
*
* It is implemented as a collection of mediaSource objects. The media sources
* will be initialized from the <video> element, its child <source> elements,
* and/or the ROE file referenced by the <video> element.
*
* @param {element}
* videoElement <video> element used for initialization.
* @constructor
*/
( function( mw, $ ) { "use strict";
mw.MediaElement = function( element ) {
this.init( element );
};
mw.MediaElement.prototype = {
// The array of mediaSource elements.
sources: null,
// flag for ROE data being added.
addedROEData: false,
// Selected mediaSource element.
selectedSource: null,
// the prefered target flavor bitrate:
preferedFlavorBR: null,
/**
* Media Element constructor
*
* Sets up a mediaElement from a provided top level "video" element adds any
* child sources that are found
*
* @param {Element}
* videoElement Element that has src attribute or has children
* source elements
*/
init: function( videoElement ) {
var _this = this;
mw.log( "EmbedPlayer::mediaElement:init:" + videoElement.id );
this.parentEmbedId = videoElement.id;
this.sources = new Array();
// Process the videoElement as a source element:
if( videoElement ){
if ( $( videoElement ).attr( "src" ) ) {
_this.tryAddSource( videoElement );
}
// Process elements source children
$( videoElement ).find( 'source,track' ).each( function( ) {
_this.tryAddSource( this );
} );
}
},
/**
* Updates the time request for all sources that have a standard time
* request argument (ie &t=start_time/end_time)
*
* @param {String}
* startNpt Start time in npt format
* @param {String}
* endNpt End time in npt format
*/
updateSourceTimes: function( startNpt, endNpt ) {
var _this = this;
$.each( this.sources, function( inx, mediaSource ) {
mediaSource.updateSrcTime( startNpt, endNpt );
} );
},
/**
* Get Text tracks
*/
getTextTracks: function(){
var textTracks = [];
$.each( this.sources, function(inx, source ){
if ( source.nodeName == 'track' || ( source.mimeType && source.mimeType.indexOf('text/') !== -1 )){
textTracks.push( source );
}
});
return textTracks;
},
/**
* Returns the array of mediaSources of this element.
*
* @param {String}
* [mimeFilter] Filter criteria for set of mediaSources to return
* @return {Array} mediaSource elements.
*/
getSources: function( mimeFilter ) {
if ( !mimeFilter ) {
return this.sources;
}
// Apply mime filter:
var source_set = new Array();
for ( var i = 0; i < this.sources.length ; i++ ) {
if ( this.sources[i].mimeType &&
this.sources[i].mimeType.indexOf( mimeFilter ) != -1 )
{
source_set.push( this.sources[i] );
}
}
return source_set;
},
/**
* Selects a source by id
*
* @param {String}
* sourceId Id of the source to select.
* @return {MediaSource} The selected mediaSource or null if not found
*/
getSourceById:function( sourceId ) {
for ( var i = 0; i < this.sources.length ; i++ ) {
if ( this.sources[i].id == sourceId ) {
return this.sources[i];
}
}
return null;
},
/**
* Selects a particular source for playback updating the "selectedSource"
*
* @param {Number}
* index Index of source element to set as selectedSource
*/
setSourceByIndex: function( index ) {
mw.log( 'EmbedPlayer::mediaElement:selectSource: ' + index );
var playableSources = this.getPlayableSources();
var oldSrc;
if ( this.selectedSource ) {
oldSrc = this.selectedSource.getSrc();
}
for ( var i = 0; i < playableSources.length; i++ ) {
if ( i == index ) {
this.selectedSource = playableSources[i];
break;
}
}
if( ! oldSrc || oldSrc != this.selectedSource.getSrc() ){
$( '#' + this.parentEmbedId ).trigger( 'SourceChange');
}
},
/**
* Sets a the selected source to passed in source object
* @param {Object} Source
*/
setSource: function( source ){
var oldSrc = this.selectedSource;
this.selectedSource = source;
if( !oldSrc || oldSrc.getSrc() != source.getSrc() ){
$( '#' + this.parentEmbedId ).trigger( 'SourceChange');
}
return this.selectedSource;
},
autoSelectSource:function( options ){
// make sure options is defined as empty object if unset:
if( ! options ){
options = {};
}
if ( this.<API key>( options ) ){
this.selectedSource.src = this.selectedSource.src.replace(/seekFrom\/\d+\
this.selectedSource.src = this.selectedSource.src.replace(/clipTo\/\d+\
var updatedDuration = 0;
if (options.<API key> && !!options.endTime) {
updatedDuration = options.endTime;
this.selectedSource.src = this.selectedSource.src.replace(
"playManifest/",
"playManifest/clipTo/" + parseInt(options.endTime) * 1000 + "/"
);
}
if (options.<API key> && !! options.startTime) {
updatedDuration -= options.startTime;
this.selectedSource.src = this.selectedSource.src.replace(
"playManifest/",
"playManifest/seekFrom/" + parseInt(options.startTime) * 1000 + "/"
);
}
$( '#' + this.parentEmbedId ).trigger( 'SourceSelected' , this.selectedSource );
if ( updatedDuration > 0 ){
try{
// try accessing the embedPlayer setDuration method to make sure embedPlayer.duration is updated as well
$( '#' + this.parentEmbedId )[0].setDuration(updatedDuration);
}catch(e){
// if we can't access the embedPlayer directly, trigger the durationChange event. embedPlayer.duration will not be updated
$( '#' + this.parentEmbedId ).trigger( 'durationChange' , updatedDuration );
}
}
return this.selectedSource;
}
return false;
},
/**
* Selects the default source via cookie preference, default marked, or by
* id order
* @param {Object} options
* sources -- overrides the playable sources to be selected from
* forceNative -- if native player sources should be forced.
*/
<API key>: function( options ) {
mw.log( 'EmbedPlayer::mediaElement::autoSelectSource' );
var _this = this;
// setup options
if( ! options ){
options = {};
}
// Populate the source set from options or from playable sources:
var playableSources = options.sources || this.getPlayableSources();
this.removeSourceFlavor(playableSources);
var flash_flag = false, ogg_flag = false;
// null out the existing selected source to autoSelect ( in case params have changed ).
this.selectedSource = null;
// Check if there are any playableSources
if( playableSources.length == 0 ){
return false;
}
// Set via module driven preference:
$( this ).trigger( 'onSelectSource', playableSources );
if( _this.selectedSource ){
mw.log('MediaElement::autoSelectSource: Set via trigger::' + _this.selectedSource.getTitle() );
return _this.selectedSource;
}
// Set via marked default:
var hasDefaultSource = false;
$.each( playableSources, function( inx, source ){
if ( source.markedDefault ) {
mw.log( 'MediaElement::autoSelectSource: Set via marked default: ' + source.markedDefault );
hasDefaultSource = true;
_this.setSource( source );
return false;
}
});
if (hasDefaultSource){
return _this.selectedSource;
}
mw.setConfig( 'EmbedPlayer.IgnoreStreamerType', false);
//this array contains mimeTypes player should prefer to select, sorted by descending order
var typesToCheck = ['application/dash+xml', 'video/playreadySmooth', 'video/ism', 'video/multicast', 'video/wvm'];
for ( var i = 0; i < typesToCheck.length; i++ ) {
var matchingSources = this.getPlayableSources( typesToCheck[i], playableSources );
if ( matchingSources.length ) {
mw.log( 'MediaElement::autoSelectSource: Set prefered mimeType flavor ' + typesToCheck[i] );
mw.setConfig( 'EmbedPlayer.IgnoreStreamerType', true);
return _this.setSource( matchingSources[0] );
}
}
// Set apple adaptive ( if available )
var vndSources = this.getPlayableSources('application/vnd.apple.mpegurl', playableSources);
this.removeSourceFlavor(vndSources);
if( vndSources.length && mw.EmbedTypes.getMediaPlayers().getMIMETypePlayers( 'application/vnd.apple.mpegurl' ).length ){
// Check for device flags:
var desktopVdn, mobileVdn;
$.each( vndSources, function( inx, source) {
// Kaltura tags vdn sources with iphonenew
if( source.getFlavorId() && source.getFlavorId().toLowerCase() == 'iphonenew' ){
mobileVdn = source;
} else {
desktopVdn = source;
}
});
// NOTE: We really should not have two VDN sources the point of vdn is to be a set of adaptive streams.
// This work around is a result of Kaltura HLS stream tagging
if( ( mw.isIphone() || mw.isAndroid4andUp() ) && mobileVdn ){
_this.setSource( mobileVdn );
} else if( desktopVdn ){
_this.setSource( desktopVdn );
}
}
if ( this.selectedSource ) {
mw.log('MediaElement::autoSelectSource: Set via Adaptive HLS: source flavor id:' + _this.selectedSource.getFlavorId() + ' src: ' + _this.selectedSource.getSrc() );
return this.selectedSource;
}
// Set via user bandwidth pref will always set source to closest bandwidth allocation while not going over
// uses the EmbedPlayer.UserBandwidth cookie first, or the preferedFlavorBR data
if( $.cookie('EmbedPlayer.UserBandwidth') || this.preferedFlavorBR ){
var bandwidthDelta = 999999999;
var bandwidthTarget = $.cookie('EmbedPlayer.UserBandwidth') || this.preferedFlavorBR;
$.each( playableSources, function(inx, source ){
if( source.bandwidth ){
if( Math.abs( source.bandwidth - bandwidthTarget ) < bandwidthDelta ){
bandwidthDelta = Math.abs( source.bandwidth - bandwidthTarget );
_this.setSource( source );
}
}
});
if ( this.selectedSource ) {
var setTypeName = ( $.cookie('EmbedPlayer.UserBandwidth') )? 'cookie': 'preferedFlavorBR'
mw.log('MediaElement::autoSelectSource: ' +
'Set via bandwidth, ' + setTypeName + ' source:' +
this.selectedSource.bandwidth + ' target: ' + bandwidthTarget );
return this.selectedSource;
}
}
// If we have at least one native source, throw out non-native sources
// for size based source selection:
var <API key> = this.<API key>(playableSources);
this.removeSourceFlavor(<API key>);
// Prefer native playback ( and prefer WebM over ogg and h.264 )
var namedSourceSet = {};
$.each( <API key>, function(inx, source ){
var mimeType = source.mimeType;
var player = mw.EmbedTypes.getMediaPlayers().getNativePlayer( mimeType );
switch( player.id ){
case 'mp3Native':
var shortName = 'mp3';
break;
case 'oggNative':
var shortName = 'ogg';
break;
case 'webmNative':
var shortName = 'webm';
break;
case 'h264Native':
var shortName = 'h264';
break;
case 'appleVdn':
var shortName = 'appleVdn';
break;
}
if( !namedSourceSet[ shortName ] ){
namedSourceSet[ shortName ] = [];
}
namedSourceSet[ shortName ].push( source );
});
// Check if is mobile ( and we don't have a flavor id based selection )
// get the most compatible h.264 file
if ( mw.isMobileDevice() && namedSourceSet[ 'h264' ] && namedSourceSet[ 'h264' ].length ){
var minSize = 99999999;
$.each( namedSourceSet[ 'h264' ], function( inx, source ){
// Don't select sources of type audio,
// ( if an actual audio file don't use "width" as a source selection metric )
if( parseInt( source.width ) < parseInt( minSize ) && parseInt( source.width ) != 0 ){
minSize = source.width;
_this.setSource( source );
}
})
}
if ( this.selectedSource ) {
mw.log('MediaElement::autoSelectSource: mobileDevice; most compatible h.264 because of resolution:' + this.selectedSource.width );
return this.selectedSource;
}
var codecPref = mw.getConfig( 'EmbedPlayer.CodecPreference');
if ( !$.isArray(codecPref) ){
codecPref = codecPref.split(",");
}
if( codecPref ){
for(var i =0; i < codecPref.length; i++){
var codec = codecPref[ i ];
if( ! namedSourceSet[ codec ] ){
continue;
}
if( namedSourceSet[ codec ].length == 1 ){
mw.log('MediaElement::autoSelectSource: Set 1 source via EmbedPlayer.CodecPreference: ' + namedSourceSet[ codec ][0].getTitle() );
return _this.setSource( namedSourceSet[ codec ][0] );
} else if( namedSourceSet[ codec ].length > 1 ) {
// select based on size:
// Set via embed resolution closest to relative to display size
var minSizeDelta = null;
if( this.parentEmbedId ){
var displayWidth = $('#' + this.parentEmbedId).width();
$.each( namedSourceSet[ codec ], function(inx, source ){
if( parseInt( source.width ) && displayWidth ){
var sizeDelta = Math.abs( source.width - displayWidth );
//mw.log('MediaElement::autoSelectSource: size delta : ' + sizeDelta + ' for s:' + source.width );
if( minSizeDelta == null || sizeDelta < minSizeDelta){
minSizeDelta = sizeDelta;
_this.setSource( source );
}
}
});
}
// If we found a source via display size return:
if ( this.selectedSource ) {
mw.log('MediaElement::autoSelectSource: from ' + this.selectedSource.mimeType + ' because of resolution:' + this.selectedSource.width + ' close to: ' + displayWidth );
return this.selectedSource;
}
// if no size info is set just select the first source:
if( namedSourceSet[ codec ][0] ){
mw.log('MediaElement::autoSelectSource: first codec prefrence source');
return _this.setSource( namedSourceSet[ codec ][0] );
}
}
}
}
// Set h264 via native or flash fallback
$.each( playableSources, function(inx, source ){
var mimeType = source.mimeType;
var player = mw.EmbedTypes.getMediaPlayers().getDefaultPlayer( mimeType );
if ( (
mimeType == 'video/mp4'
||
mimeType == 'video/h264'
)
&& player
&& (
player.library == 'Native'
||
player.library == 'Kplayer'
)
) {
if( source ){
mw.log('MediaElement::autoSelectSource: Set h264 via native or flash fallback:' + source.getTitle() );
return _this.setSource( source );
}
}
});
if ( this.selectedSource ) {
mw.log('MediaElement::autoSelectSource: from ' + this.selectedSource.mimeType + ' because of resolution:' + this.selectedSource.width + ' close to: ' + displayWidth );
return this.selectedSource;
}
// Look for the first mbr source
if ( !this.selectedSource ){
for (var i = 0; i < playableSources.length; i++ ){
if ( playableSources[i].tags && playableSources[i].tags.indexOf("mbr") !== -1 ){
return _this.setSource( playableSources[i] );
}
}
}
// Else just select the first playable source.
if ( !this.selectedSource && playableSources[0] ) {
mw.log( 'MediaElement::autoSelectSource: Set via first source: ' + playableSources[0].getTitle() + ' mime: ' + playableSources[0].getMIMEType() );
return _this.setSource( playableSources[0] );
}
mw.log( 'MediaElement::autoSelectSource: no match found');
// No Source found so no source selected
return false;
},
<API key>: function() {
mw.log( "MediaElement::<API key>");
// check if already auto selected source can just "switch" to native:
if (! this.selectedSource && ! this.autoSelectSource( { 'forceNative':true }) ) {
return false;
}
// attempt to select player:
var player = mw.EmbedTypes.getMediaPlayers().getNativePlayer( this.selectedSource.mimeType );
if( player ){
return this.selectedSource;
}
mw.log( "MediaElement::<API key>: no native player found");
// else the selected source can't be played natively get alternate source
// TODO: refactor autoSelect source into methods that would be agreeable to native player prioritization.
return null;
},
/**
* check if the mime is ogg
*/
isOgg: function( mimeType ){
if ( mimeType == 'video/ogg'
|| mimeType == 'ogg/video'
|| mimeType == 'video/annodex'
|| mimeType == 'application/ogg'
) {
return true;
}
return false;
},
/**
* Returns the thumbnail URL for the media element.
*
* @returns {String} thumbnail URL
*/
getPosterSrc: function( ) {
return this.poster;
},
/**
* Checks whether there is a stream of a specified MIME type.
*
* @param {String}
* mimeType MIME type to check.
* @return {Boolean} true if sources include MIME false if not.
*/
hasStreamOfMIMEType: function( mimeType ){
for ( var i = 0; i < this.sources.length; i++ )
{
if ( this.sources[i].getMIMEType() == mimeType ){
return true;
}
}
return false;
},
/**
* Checks if the avaliable sources include native playback
* @return {Array} set of native playable sources
*/
<API key>: function(sources){
var playableSources = sources || this.getPlayableSources();
var <API key> = [];
$.each( playableSources, function(inx, source ){
var mimeType = source.mimeType;
var player = mw.EmbedTypes.getMediaPlayers().getNativePlayer( mimeType );
if ( player && player.library == 'Native' ) {
<API key>.push( source );
}
});
return <API key>;
},
/**
* Checks if media is a playable type
*/
isPlayableType: function( mimeType ) {
// mw.log("isPlayableType:: " + mimeType);
if ( mw.EmbedTypes.getMediaPlayers().getDefaultPlayer( mimeType ) ) {
return true;
} else {
return false;
}
},
/**
* Adds a single mediaSource using the provided element if the element has a
* 'src' attribute.
*
* @param {Element}
* element <video>, <source> or <mediaSource> <text> element.
*/
tryAddSource: function( element ) {
// Check if our source is already MediaSource
if( element instanceof mw.MediaSource ){
this.sources.push( element );
return element;
}
//mw.log( 'mw.MediaElement::tryAddSource:' + $( element ).attr( "src" ) );
var newSrc = $( element ).attr( 'src' );
if ( newSrc ) {
// Make sure an existing element with the same src does not already exist:
for ( var i = 0; i < this.sources.length; i++ ) {
if ( this.sources[i].src == newSrc ) {
// Source already exists update any new attr:
this.sources[i].updateSource( element );
return this.sources[i];
}
}
}
// Create a new source
var source = new mw.MediaSource( element );
this.sources.push( source );
// Add <track> element as child of <video> tag
if( element.nodeName && element.nodeName.toLowerCase() === 'track' ) {
// under iOS - if there are captions within the HLS stream, users should set disableTrackElement=true in the flashVars to prevent duplications
if ( !mw.isIOS() || ( mw.isIOS() && !mw.getConfig('disableTrackElement') ) ) {
if ( !mw.isIE8() ) {
var $vid = $( '#pid_' + this.parentEmbedId );
if( $vid.length ) {
if( mw.isIphone() ) {
$vid.attr('crossorigin', 'anonymous');
}
$vid.append(element);
}
}
}
}
//mw.log( 'tryAddSource: added source ::' + source + 'sl:' + this.sources.length );
return source;
},
/**
* Get playable sources
*
*@pram mimeFilter {=string} (optional) Filter the playable sources set by mime filter
*
* @returns {Array} of playable media sources
*/
getPlayableSources: function (mimeFilter, sources) {
var playableSources = [];
var sourcesList = sources || this.sources;
for ( var i = 0; i < sourcesList.length; i++ ) {
if ( this.isPlayableType( sourcesList[i].mimeType )
&&
( !mimeFilter || sourcesList[i].mimeType.indexOf( mimeFilter) != -1 )
){
playableSources.push( sourcesList[i] );
}
};
mw.log( "MediaElement::GetPlayableSources mimeFilter:" + mimeFilter + " " +
playableSources.length + ' sources playable out of ' + sourcesList.length );
return playableSources;
},
/**
* removeSourceFlavor: remove the original source from playableSources unless its the only playable source
*
* @pram sources {=array} the sources array from which to removed the source flavor. Send by ref and manipulated by this function.
*
*/
removeSourceFlavor: function( sources ){
if ( sources.length > 1 ){
for (var i = sources.length-1; i >= 0; i
if ( sources[i].tags && sources[i].tags.indexOf("source") !== -1 ){
sources.splice( i, 1 );
}
}
}
},
getLicenseData: function(){
var licenseData = {
custom_data: this.selectedSource["custom_data"],
signature: this.selectedSource["signature"]
};
if (this.selectedSource.flavors){
var base64encode = window.btoa ? window.btoa : window.base64_encode;
licenseData.files = encodeURIComponent(base64encode(this.selectedSource.flavors));
}
return licenseData;
},
<API key>: function(){
var licenseData = this.getLicenseData();
var licenseDataString = "";
if (licenseData) {
$.each( licenseData, function ( key, val ) {
//Only concatenate keys with actual values
if (val) {
licenseDataString += key + "=" + val + "&";
}
} );
}
return licenseDataString;
},
<API key>: function(){
return this.selectedSource["contentId"];
}
};
} )( mediaWiki, jQuery ); |
namespace Bny.Blog.Backend.Core.Configuration
{
public static class BnyConfig
{
public const string BNY_ARTICLE_SOURCE = "bny.blog.articleDirectory";
public const string BNY_PORT = "bny.blog.service.port";
public const string BNY_QUICK_EDIT_LINK = "bny.blog.quickEditLink";
public const string BNY_TITLE = "bny.blog.frontend.title";
public const string BNY_NAV = "bny.blog.frontend.nav";
};
} |
<!DOCTYPE html>
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../style.css');
@import url('../../../../tree.css');
</style>
<script src="../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../clover.js" type="text/javascript"></script>
<script src="../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../cloud.js" type="text/javascript"></script>
<title><API key> </title>
</head>
<body onload="onLoad('<API key> : com.rapidminer.gui.actions.WorkspaceAction.java')">
<div id="page">
<header id="header" role="banner">
<nav class="aui-header <API key>" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo <API key>">
<a href="http:
</h1>
</div>
<div class="<API key>">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online Clover documentation" target="_blank"
href="https://confluence.atlassian.com/display/CLOVER/Clover+Documentation+Home">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="<API key>">
<div class="aui-page-panel-nav <API key>">
<div class="<API key>" style="margin-bottom: 20px;">
<div class="<API key>">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</div>
<div class="<API key>" >
<h1>
<API key>
</h1>
</div>
</div>
<nav class="aui-navgroup <API key>">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading <API key>">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui <API key>">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="<API key> hidden">
<small>No results found.</small>
</p>
<div class="<API key>" data-root-relative="../../../../" data-package-name="com.rapidminer.gui.actions">
<div class="<API key>"></div>
<div class="<API key>"></div>
</div>
</div>
</div>
</nav> </div>
<section class="<API key>">
<div class="<API key>">
<ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../dashboard.html">Project Clover database 5 2017 16:40:29 CST</a></li>
<li><a href="pkg-summary.html"> Package com.rapidminer.gui.actions</a></li>
</ol>
<h1 class="aui-h2-clover">
File WorkspaceAction.java
</h1>
<div class="aui-message aui-message-warning">
<p class="title">
<strong>Evaluation License</strong>
</p>
<p>
This report was generated with an evaluation server license. <a href="http:
</p>
</div>
<div class="aui-tabs horizontal-tabs" id="tabs-file">
<div class="tabs-pane <API key> active-pane" id="tabs-file-source">
<div> </div>
<div style="display: table; width: 100%">
<div style="display: table-cell; ">
<div class="dashboard-widget">
<header class="<API key>">
<h3>Code metrics</h3>
</header>
<div class="<API key>">
<div id="td-header-stats" class="aui-item" style="display: ">
<div style="display: table">
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of branches in this file">Branches:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of statements in this file">Statements:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of methods in this file">Methods:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of classes in this file">Classes:</label></div>
<div class="stats-box-value">1</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of lines of code in this file">LOC:</label></div>
<div class="stats-box-value">73</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of non-comment lines of code in this file">NCLOC:</label></div>
<div class="stats-box-value">36</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Cyclomatic complexity is the number of paths in this file">Total complexity:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label">
<label title="Complexity density is the complexity divided by the number of statements in this file">Complexity density:</label>
</div>
<div class="stats-box-value">-</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Number of statements per method.">Statements/Method:</label></div>
<div class="stats-box-value">-</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Number of methods per class.">Methods/Class:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Complexity divided by the number of methods in this file">Average method complexity:</label></div>
<div class="stats-box-value">-</div>
</div>
</div>
<div class="subtle">
<small><strong>100%</strong> of code in this file is excluded from these metrics.</small>
<label class="aui-button aui-button-subtle" onclick="toggleStats('td-header-stats', '<API key>');"
title="Include or exclude filtered elements from these statistics.">Remove Filter</label>
</div>
</div>
<div id="<API key>" class="aui-item" style="display: none">
<div style="display: table">
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of branches in this file">Branches:</label></div>
<div class="stats-box-value">2</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of statements in this file">Statements:</label></div>
<div class="stats-box-value">12</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of methods in this file">Methods:</label></div>
<div class="stats-box-value">4</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of classes in this file">Classes:</label></div>
<div class="stats-box-value">1</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of lines of code in this file">LOC:</label></div>
<div class="stats-box-value">73</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of non-comment lines of code in this file">NCLOC:</label></div>
<div class="stats-box-value">36</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Cyclomatic complexity is the number of paths in this file">Total complexity:</label></div>
<div class="stats-box-value">5</div>
</div>
<div class="stats-box">
<div class="stats-box-label">
<label title="Complexity density is the complexity divided by the number of statements in this file">Complexity density:</label>
</div>
<div class="stats-box-value">0.42</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Number of statements per method.">Statements/Method:</label></div>
<div class="stats-box-value">3</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Number of methods per class.">Methods/Class:</label></div>
<div class="stats-box-value">4</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Complexity divided by the number of methods in this file">Average method complexity:</label></div>
<div class="stats-box-value">1.25</div>
</div>
</div>
<div class="subtle">
<small>These metrics include <strong class='bold'>100%</strong> of code marked as filtered.</small>
<label class="aui-button aui-button-subtle" onclick="toggleStats('<API key>', 'td-header-stats');"
title="Include or exclude filtered elements from these statistics.">Apply Filter</label>
</div>
</div> </div>
</div>
</div>
</div>
<h2>Classes</h2>
<table class="aui aui-table-sortable">
<thead>
<tr> <th>Class</th>
<th>Line
<th class="">
<label title="The total number of statements.">Total Statements</label>
</th>
<th class="">
<label title="Cyclomatic complexity is a measure of the number of paths in your code.">Complexity</label>
</th>
<th class="">
<label title="The amount of code that was hit at least once during testing.">TOTAL Coverage</label>
</th>
<th>Actions</th>
</tr> </thead>
<tbody>
<tr> <td id="WorkspaceAction">
<span><a href="#34" title="WorkspaceAction" onclick="<API key>('<API key>', '34');">WorkspaceAction</a></span>
</td>
<td>34<a name="sl-34"></a></td>
<td class="">0</td>
<td class="">0</td>
<td class=""><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></td>
<td><button data-dialog-id="<API key>" class="aui-button aui-button-link dialog-show-button">Show methods</button></td>
</tr> </tbody>
</table>
<section role="dialog" id="<API key>" class="aui-layer aui-dialog2 aui-dialog2-xlarge" aria-hidden="true">
<header class="aui-dialog2-header">
<h1 class="<API key>">Class WorkspaceAction</h1>
<div class="<API key>">
<input id="<API key>" class="test-filter text" type="text" name="method-filter"
placeholder="Type to filter methods..." autocomplete="off"
onkeyup="filterMethods('<API key>', '<API key>');"/>
</div>
</header>
<div class="aui-dialog2-content">
<table class="aui aui-table-sortable">
<thead>
<tr> <th id="WorkspaceAction">
Class<br/> <span><a href="#34" title="WorkspaceAction" onclick="<API key>('<API key>', '34');">WorkspaceAction</a></span>
</th>
<th>Line #<br/>34<a name="sl-34"></a></th>
<th class=""><label title="The total number of statements.">Total Statements</label><br/>0</th>
<th class=""><label title="Cyclomatic complexity is a measure of the number of paths in your code.">Complexity</label><br/>0</th>
<th class=""><label title="The amount of code that was hit at least once during testing.">TOTAL Coverage</label><br/><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></th>
</tr> </thead>
<tbody id="<API key>">
<tr id="WorkspaceAction-1">
<td id="summary-44-2">
<span class="sortValue">WorkspaceAction(<API key>,Perspective,String)</span>
  <a href="?line=29#44" title="WorkspaceAction(<API key>,Perspective,String)" name="sl-44" onclick="<API key>('<API key>', '44');">WorkspaceAction(<API key>,Perspective,String)</a>
</td>
<td align="right"><span class="sortValue">44</span>44</td>
<td class="" align="right"><span class="sortValue">0.0</span>0</td>
<td class="" align="right"><span class="sortValue">1.0</span>1</td>
<td class="" align="right"><span class="sortValue">-1.0</span><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></td>
</tr> <tr id="WorkspaceAction-2">
<td id="summary-51-2">
<span class="sortValue">WorkspaceAction(<API key>,Perspective,String)</span>
  <a href="?line=29#51" title="WorkspaceAction(<API key>,Perspective,String)" name="sl-51" onclick="<API key>('<API key>', '51');">WorkspaceAction(<API key>,Perspective,String)</a>
</td>
<td align="right"><span class="sortValue">51</span>51</td>
<td class="" align="right"><span class="sortValue">0.0</span>0</td>
<td class="" align="right"><span class="sortValue">1.0</span>1</td>
<td class="" align="right"><span class="sortValue">-1.0</span><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></td>
</tr> <tr id="WorkspaceAction-3">
<td id="summary-58-2">
<span class="sortValue">actionPerformed(ActionEvent) : void</span>
  <a href="?line=29#58" title="actionPerformed(ActionEvent) : void" name="sl-58" onclick="<API key>('<API key>', '58');">actionPerformed(ActionEvent) : void</a>
</td>
<td align="right"><span class="sortValue">58</span>58</td>
<td class="" align="right"><span class="sortValue">0.0</span>0</td>
<td class="" align="right"><span class="sortValue">1.0</span>1</td>
<td class="" align="right"><span class="sortValue">-1.0</span><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></td>
</tr> <tr id="WorkspaceAction-4">
<td id="summary-70-2">
<span class="sortValue">getPerspective() : Perspective</span>
  <a href="?line=29#70" title="getPerspective() : Perspective" name="sl-70" onclick="<API key>('<API key>', '70');">getPerspective() : Perspective</a>
</td>
<td align="right"><span class="sortValue">70</span>70</td>
<td class="" align="right"><span class="sortValue">0.0</span>0</td>
<td class="" align="right"><span class="sortValue">1.0</span>1</td>
<td class="" align="right"><span class="sortValue">-1.0</span><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></td>
</tr> </tbody>
</table>
<div> </div>
</div>
<footer class="aui-dialog2-footer">
<div class="<API key>">
<button class="aui-button aui-button-primary dialog-close-button"
data-dialog-id="<API key>">Close</button>
</div>
<div class="<API key>">Click on a class or a method name to jump to source.</div>
</footer>
</section>
<div> </div>
<h2>Contributing tests</h2>
<div class="aui-message">
<p>No tests hitting this source file were found.</p>
</div>
<h2>Source view</h2>
<div style="display: table; width: 100%;">
<div style="display: table-cell">
<button class="aui-button aui-button-link"
title="Toggles all methods in the source to be either expanded or collapsed."
onclick="<API key>(this); return false;" id="method-expander">
Collapse all methods
</button>
</div>
<div style="display: table-cell">
<div style="text-align: right; margin-bottom: 10px">
<button class="aui-button aui-button-subtle" id="popupHelp">
<span class="aui-icon aui-icon-small aui-iconfont-help"></span> Show legend
</button>
<script>
AJS.InlineDialog(AJS.$("#popupHelp"), "helpDialog",
function(content, trigger, showPopup) {
content.css({"padding":"20px"}).html(<API key>);
showPopup();
return false;
},
{
width: 700, hideDelay: 60000
}
);
</script> </div>
</div>
</div>
<table cellspacing="0" cellpadding="0" class="srcView" width="100%">
<tbody> <tr id="l1">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=1#src-1">1</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
</tr>
<tr id="l19">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=19#src-19">19</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-19" class="srcLine"><span class="keyword">package</span> com.<a href="../../../rapidminer/pkg-summary.html">rapidminer</a>.<a href="../../gui/pkg-summary.html">gui</a>.<a href="../actions/pkg-summary.html">actions</a>;</span></td>
</tr>
<tr id="l20">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=20#src-20">20</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-20" class="srcLine"></span></td>
</tr>
<tr id="l21">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=21#src-21">21</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-21" class="srcLine"><span class="keyword">import</span> java.awt.event.ActionEvent;</span></td>
</tr>
<tr id="l22">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=22#src-22">22</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-22" class="srcLine"></span></td>
</tr>
<tr id="l23">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=23#src-23">23</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-23" class="srcLine"><span class="keyword">import</span> com.<a href="../../../rapidminer/pkg-summary.html">rapidminer</a>.<a href="../../gui/pkg-summary.html">gui</a>.<a href="../../../../com/rapidminer/gui/<API key>.html#<API key>"><API key></a>;</span></td>
</tr>
<tr id="l24">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=24#src-24">24</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-24" class="srcLine"><span class="keyword">import</span> com.<a href="../../../rapidminer/pkg-summary.html">rapidminer</a>.<a href="../../gui/pkg-summary.html">gui</a>.<a href="../../../../com/rapidminer/gui/<API key>.html#<API key>"><API key></a>;</span></td>
</tr>
<tr id="l25">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=25#src-25">25</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-25" class="srcLine"><span class="keyword">import</span> com.<a href="../../../rapidminer/pkg-summary.html">rapidminer</a>.<a href="../../gui/pkg-summary.html">gui</a>.<a href="../../../../com/rapidminer/gui/Perspective.html#Perspective">Perspective</a>;</span></td>
</tr>
<tr id="l26">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=26#src-26">26</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-26" class="srcLine"><span class="keyword">import</span> com.<a href="../../../rapidminer/pkg-summary.html">rapidminer</a>.<a href="../../gui/pkg-summary.html">gui</a>.<a href="../tools/pkg-summary.html">tools</a>.<a href="../../../../com/rapidminer/gui/tools/ResourceAction.html#ResourceAction">ResourceAction</a>;</span></td>
</tr>
<tr id="l27">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=27#src-27">27</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-27" class="srcLine"></span></td>
</tr>
<tr id="l28">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=28#src-28">28</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-28" class="srcLine"></span></td>
</tr>
<tr id="l29">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=29#src-29">29</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-29" class="srcLine"><span class="comment">/**</span></span></td>
</tr>
<tr id="l30">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=30#src-30">30</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-30" class="srcLine"><span class="comment"> *</span></span></td>
</tr>
<tr id="l31">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=31#src-31">31</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-31" class="srcLine"><span class="comment"> * </span><span class="javadoc">@author</span><span class="comment"> Simon Fischer</span></span></td>
</tr>
<tr id="l32">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=32#src-32">32</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-32" class="srcLine"><span class="comment"> */</span></span></td>
</tr>
<tr id="l33">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=33#src-33">33</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-33" class="srcLine">@SuppressWarnings(<span class="string">"deprecation"</span>)</span></td>
</tr>
<tr class="inlineStatsRow" align="right" valign="middle">
<td class="coverageCount"><a name="34" class="nolink"> </a></td>
<td class="coverageCount aui-icon aui-icon-small <API key>" id='<API key>' onclick="toggleInlineStats(this, 'inlinestats-34');"/>
<td align="center" valign="middle">
<table id="inlinestats-34" style="display:none;" class="inlineStats" width="100%" cellspacing="1px" cellpadding="1px">
<tr onclick="toggleInlineStats(document.getElementById('<API key>'), 'inlinestats-34');return true;">
<td><div>
<div title="Empty" class="barEmpty" style="min-width:40px;"></div>
</div></td><td> - </td>
<td class="inlineStat">Uncovered Elements: 0 (0)</td>
<td class="inlineStat">Complexity: 0</td>
<td class="inlineStat">Complexity Density: -</td>
</tr>
</table>
</td>
</tr>
<tr id="l34">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=34#src-34">34</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" id="id-34"><span class="spacer"></span><span id="src-34" class="srcLine"><span class="keyword">public</span> <span class="keyword">class</span> <a href="../../../../com/rapidminer/gui/actions/WorkspaceAction.html#WorkspaceAction">WorkspaceAction</a> <span class="keyword">extends</span> <a href="../../../../com/rapidminer/gui/tools/ResourceAction.html#ResourceAction">ResourceAction</a> {</span></td>
</tr>
<tr id="l35">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=35#src-35">35</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-35" class="srcLine"></span></td>
</tr>
<tr id="l36">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=36#src-36">36</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-36" class="srcLine"> <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">long</span> serialVersionUID = 1L;</span></td>
</tr>
<tr id="l37">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=37#src-37">37</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-37" class="srcLine"></span></td>
</tr>
<tr id="l38">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=38#src-38">38</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-38" class="srcLine"> <span class="keyword">private</span> <span class="keyword">final</span> <a href="../../../../com/rapidminer/gui/<API key>.html#<API key>"><API key></a> perspectives;</span></td>
</tr>
<tr id="l39">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=39#src-39">39</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-39" class="srcLine"></span></td>
</tr>
<tr id="l40">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=40#src-40">40</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-40" class="srcLine"> <span class="keyword">private</span> <span class="keyword">final</span> <a href="../../../../com/rapidminer/gui/<API key>.html#<API key>"><API key></a> <API key>;</span></td>
</tr>
<tr id="l41">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=41#src-41">41</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-41" class="srcLine"></span></td>
</tr>
<tr id="l42">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=42#src-42">42</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-42" class="srcLine"> <span class="keyword">private</span> <span class="keyword">final</span> <a href="../../../../com/rapidminer/gui/Perspective.html#Perspective">Perspective</a> perspective;</span></td>
</tr>
<tr id="l43">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=43#src-43">43</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-43" class="srcLine"></span></td>
</tr>
<tr class="inlineStatsRow" align="right" valign="middle">
<td class="coverageCount"><a name="44" class="nolink"> </a></td>
<td class="coverageCount aui-icon aui-icon-small <API key>" id='<API key>' onclick="toggleInlineStats(this, 'inlinestats-44');"/>
<td align="center" valign="middle">
<table id="inlinestats-44" style="display:none;" class="inlineStats" width="100%" cellspacing="1px" cellpadding="1px">
<tr onclick="toggleInlineStats(document.getElementById('<API key>'), 'inlinestats-44');return true;">
<td><div>
<div title="Empty" class="barEmpty" style="min-width:40px;"></div>
</div></td><td> - </td>
<td class="inlineStat">Uncovered Elements: 0 (0)</td>
<td class="inlineStat">Complexity: 1</td>
<td class="inlineStat">Complexity Density: -</td>
</tr>
</table>
</td>
</tr>
<tr id="l44">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=44#src-44">44</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" methodStart srcCell" id="id-44"><img title="Method Statistics" onclick="toggleSrcRowVis(this, 44,49);" id="img-44" src="../../../../img/collapse.gif" alt="toggle" class="icon"/><span id="src-44" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">public</span> <a href="../../../../com/rapidminer/gui/actions/WorkspaceAction.html#WorkspaceAction">WorkspaceAction</a>(<a href="../../../../com/rapidminer/gui/<API key>.html#<API key>"><API key></a> perspectives, <a href="../../../../com/rapidminer/gui/Perspective.html#Perspective">Perspective</a> perspective, String name) {</span><span class="foldControl" onclick="toggleSrcRowVis(document.getElementById('img-44'), 44,49);" id="e44" style="display:none;border:none;">...</span></span></td>
</tr>
<tr id="l45">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=45#src-45">45</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-45" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">super</span>(<span class="keyword">true</span>, <span class="string">"workspace_"</span> + name);</span></span></td>
</tr>
<tr id="l46">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=46#src-46">46</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-46" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">this</span>.perspective = perspective;</span></span></td>
</tr>
<tr id="l47">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=47#src-47">47</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-47" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">this</span>.perspectives = perspectives;</span></span></td>
</tr>
<tr id="l48">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=48#src-48">48</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-48" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">this</span>.<API key> = <span class="keyword">null</span>;</span></span></td>
</tr>
<tr id="l49">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=49#src-49">49</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-49" class="srcLine"> }</span></td>
</tr>
<tr id="l50">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=50#src-50">50</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-50" class="srcLine"></span></td>
</tr>
<tr class="inlineStatsRow" align="right" valign="middle">
<td class="coverageCount"><a name="51" class="nolink"> </a></td>
<td class="coverageCount aui-icon aui-icon-small <API key>" id='<API key>' onclick="toggleInlineStats(this, 'inlinestats-51');"/>
<td align="center" valign="middle">
<table id="inlinestats-51" style="display:none;" class="inlineStats" width="100%" cellspacing="1px" cellpadding="1px">
<tr onclick="toggleInlineStats(document.getElementById('<API key>'), 'inlinestats-51');return true;">
<td><div>
<div title="Empty" class="barEmpty" style="min-width:40px;"></div>
</div></td><td> - </td>
<td class="inlineStat">Uncovered Elements: 0 (0)</td>
<td class="inlineStat">Complexity: 1</td>
<td class="inlineStat">Complexity Density: -</td>
</tr>
</table>
</td>
</tr>
<tr id="l51">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=51#src-51">51</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" methodStart srcCell" id="id-51"><img title="Method Statistics" onclick="toggleSrcRowVis(this, 51,56);" id="img-51" src="../../../../img/collapse.gif" alt="toggle" class="icon"/><span id="src-51" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">public</span> <a href="../../../../com/rapidminer/gui/actions/WorkspaceAction.html#WorkspaceAction">WorkspaceAction</a>(<a href="../../../../com/rapidminer/gui/<API key>.html#<API key>"><API key></a> <API key>, <a href="../../../../com/rapidminer/gui/Perspective.html#Perspective">Perspective</a> perspective, String name) {</span><span class="foldControl" onclick="toggleSrcRowVis(document.getElementById('img-51'), 51,56);" id="e51" style="display:none;border:none;">...</span></span></td>
</tr>
<tr id="l52">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=52#src-52">52</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-52" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">super</span>(<span class="keyword">true</span>, <span class="string">"workspace_"</span> + name);</span></span></td>
</tr>
<tr id="l53">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=53#src-53">53</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-53" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">this</span>.perspective = perspective;</span></span></td>
</tr>
<tr id="l54">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=54#src-54">54</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-54" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">this</span>.perspectives = <span class="keyword">null</span>;</span></span></td>
</tr>
<tr id="l55">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=55#src-55">55</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-55" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">this</span>.<API key> = <API key>;</span></span></td>
</tr>
<tr id="l56">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=56#src-56">56</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-56" class="srcLine"> }</span></td>
</tr>
<tr id="l57">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=57#src-57">57</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-57" class="srcLine"></span></td>
</tr>
<tr class="inlineStatsRow" align="right" valign="middle">
<td class="coverageCount"><a name="58" class="nolink"> </a></td>
<td class="coverageCount aui-icon aui-icon-small <API key>" id='<API key>' onclick="toggleInlineStats(this, 'inlinestats-58');"/>
<td align="center" valign="middle">
<table id="inlinestats-58" style="display:none;" class="inlineStats" width="100%" cellspacing="1px" cellpadding="1px">
<tr onclick="toggleInlineStats(document.getElementById('<API key>'), 'inlinestats-58');return true;">
<td><div>
<div title="Empty" class="barEmpty" style="min-width:40px;"></div>
</div></td><td> - </td>
<td class="inlineStat">Uncovered Elements: 0 (0)</td>
<td class="inlineStat">Complexity: 1</td>
<td class="inlineStat">Complexity Density: -</td>
</tr>
</table>
</td>
</tr>
<tr id="l58">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=58#src-58">58</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" methodStart srcCell" id="id-58"><img title="Method Statistics" onclick="toggleSrcRowVis(this, 58,65);" id="img-58" src="../../../../img/collapse.gif" alt="toggle" class="icon"/><span id="src-58" class="srcLineFiltered"><span class="nolink" title="Filtered by: method"> @Override</span><span class="foldControl" onclick="toggleSrcRowVis(document.getElementById('img-58'), 58,65);" id="e58" style="display:none;border:none;">...</span></span></td>
</tr>
<tr id="l59">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=59#src-59">59</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-59" class="srcLine"> <span class="keyword">public</span> <span class="keyword">void</span> actionPerformed(ActionEvent e) {</span></td>
</tr>
<tr id="l60">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=60#src-60">60</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-60" class="srcLineFiltered"><span class="nolink" title="Filtered by: method, else"> <span class="keyword">if</span> (<API key> != <span class="keyword">null</span>) {</span></span></td>
</tr>
<tr id="l61">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=61#src-61">61</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-61" class="srcLineFiltered"><span class="nolink" title="Filtered by: method, if"> <API key>.showPerspective(perspective.getName());</span></span></td>
</tr>
<tr id="l62">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=62#src-62">62</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-62" class="srcLine"> } <span class="keyword">else</span> {</span></td>
</tr>
<tr id="l63">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=63#src-63">63</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-63" class="srcLineFiltered"><span class="nolink" title="Filtered by: method, else"> perspectives.showPerspective(perspective.getName());</span></span></td>
</tr>
<tr id="l64">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=64#src-64">64</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-64" class="srcLine"> }</span></td>
</tr>
<tr id="l65">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=65#src-65">65</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-65" class="srcLine"> }</span></td>
</tr>
<tr id="l66">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=66#src-66">66</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-66" class="srcLine"></span></td>
</tr>
<tr id="l67">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=67#src-67">67</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-67" class="srcLine"> <span class="comment">/**</span></span></td>
</tr>
<tr id="l68">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=68#src-68">68</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-68" class="srcLine"><span class="comment"> * Returns the {</span><span class="javadoc">@link</span><span class="comment"> Perspective} for this action.</span></span></td>
</tr>
<tr id="l69">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=69#src-69">69</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-69" class="srcLine"><span class="comment"> */</span></span></td>
</tr>
<tr class="inlineStatsRow" align="right" valign="middle">
<td class="coverageCount"><a name="70" class="nolink"> </a></td>
<td class="coverageCount aui-icon aui-icon-small <API key>" id='<API key>' onclick="toggleInlineStats(this, 'inlinestats-70');"/>
<td align="center" valign="middle">
<table id="inlinestats-70" style="display:none;" class="inlineStats" width="100%" cellspacing="1px" cellpadding="1px">
<tr onclick="toggleInlineStats(document.getElementById('<API key>'), 'inlinestats-70');return true;">
<td><div>
<div title="Empty" class="barEmpty" style="min-width:40px;"></div>
</div></td><td> - </td>
<td class="inlineStat">Uncovered Elements: 0 (0)</td>
<td class="inlineStat">Complexity: 1</td>
<td class="inlineStat">Complexity Density: -</td>
</tr>
</table>
</td>
</tr>
<tr id="l70">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=70#src-70">70</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" methodStart srcCell" id="id-70"><img title="Method Statistics" onclick="toggleSrcRowVis(this, 70,72);" id="img-70" src="../../../../img/collapse.gif" alt="toggle" class="icon"/><span id="src-70" class="srcLineFiltered"><span class="nolink" title="Filtered by: method, property"> <span class="keyword">public</span> <a href="../../../../com/rapidminer/gui/Perspective.html#Perspective">Perspective</a> getPerspective() {</span><span class="foldControl" onclick="toggleSrcRowVis(document.getElementById('img-70'), 70,72);" id="e70" style="display:none;border:none;">...</span></span></td>
</tr>
<tr id="l71">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=71#src-71">71</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-71" class="srcLineFiltered"><span class="nolink" title="Filtered by: method, property"> <span class="keyword">return</span> perspective;</span></span></td>
</tr>
<tr id="l72">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=72#src-72">72</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-72" class="srcLine"> }</span></td>
</tr>
<tr id="l73">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=73#src-73">73</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-73" class="srcLine">}</span></td>
</tr>
</tbody></table> </div>
</div><!-- .aui-tabs -->
<script type="text/javascript">
var ol_bgclass = "overBG";
var ol_fgclass = "overFG";
var ol_cgclass = "overCaption";
var ol_captionfontclass= "overCaption";
var ol_closefontclass = "closeFont";
var ol_closeclick = 1;
var ol_close = 'X';
var ol_wrap = 1;
var rootRelPath = '../../../../';
var testsPerFile = -1;
</script>
<script src="WorkspaceAction.js" type="text/javascript"></script>
</div> <!-- class="<API key>" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http:
on 5 2017 17:24:16 CST using coverage data from 1 1970 08:00:00 CST.
</li>
</ul>
<ul>
<li>Clover Evaluation License registered to Clover Plugin. You have 29 day(s) before your license expires.</li>
</ul>
<div id="footer-logo">
<a target="_blank" href="http:
Atlassian
</a>
</div>
</section>
</footer> </section> <!-- class="<API key>" -->
</div> <!-- class="<API key>" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> |
package com.x.bbs.assemble.control.service;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.x.base.core.container.<API key>;
import com.x.base.core.container.factory.<API key>;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.config.StorageMapping;
import com.x.base.core.project.tools.ListTools;
import com.x.bbs.assemble.common.date.DateOperation;
import com.x.bbs.assemble.control.Business;
import com.x.bbs.assemble.control.ThisApplication;
import com.x.bbs.entity.BBSForumInfo;
import com.x.bbs.entity.BBSPermissionInfo;
import com.x.bbs.entity.BBSPermissionRole;
import com.x.bbs.entity.BBSReplyInfo;
import com.x.bbs.entity.BBSRoleInfo;
import com.x.bbs.entity.BBSSectionInfo;
import com.x.bbs.entity.<API key>;
import com.x.bbs.entity.BBSSubjectContent;
import com.x.bbs.entity.BBSSubjectInfo;
import com.x.bbs.entity.BBSUserRole;
/**
*
* @author LIYI
*
*/
public class <API key> {
private DateOperation dateOperation = new DateOperation();
private <API key> sectionInfoService = new <API key>();
/**
* IDBBSSectionInfo
* @param id
* @return
* @throws Exception
*/
public BBSSectionInfo get( String id ) throws Exception {
if( id == null || id.isEmpty() ){
throw new Exception( "id is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return emc.find( id, BBSSectionInfo.class );
}catch( Exception e ){
throw e;
}
}
/**
* BBSSectionInfo
* @param mainSectionName
* @return
* @throws Exception
*/
public BBSSectionInfo <API key>( String mainSectionName ) throws Exception {
if( mainSectionName == null || mainSectionName.isEmpty() ){
throw new Exception( "mainSectionName is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, mainSectionName);
}catch( Exception e ){
throw e;
}
}
/**
* BBSSectionInfo
* @param _bBSSectionInfo
*/
public BBSSectionInfo save( BBSSectionInfo _bBSSectionInfo ) throws Exception {
if( _bBSSectionInfo == null ){
throw new Exception( "_bBSSectionInfo is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.save( emc, _bBSSectionInfo);
}catch( Exception e ){
throw e;
}
}
/**
* IDBBSSectionInfo
* @param sectionId
* @throws Exception
*/
public void delete( String sectionId ) throws Exception {
if( StringUtils.isEmpty( sectionId ) ){
throw new Exception( "sectionId can not null!" );
}
Business business = null;
BBSForumInfo forumInfo = null;
BBSSectionInfo sectionInfo = null;
List<String> ids = null;
List<BBSRoleInfo> roleInfoList = null;
List<BBSUserRole> userRoleList = null;
List<BBSPermissionRole> permissionRoleList = null;
List<BBSPermissionInfo> permissionInfoList = null;
try (<API key> emc = <API key>.instance().create()) {
business = new Business(emc);
emc.beginTransaction( BBSForumInfo.class );
emc.beginTransaction( BBSSectionInfo.class );
emc.beginTransaction( BBSUserRole.class );
emc.beginTransaction( BBSPermissionInfo.class );
emc.beginTransaction( BBSPermissionRole.class );
emc.beginTransaction( BBSRoleInfo.class );
ids = business.userRoleFactory().listBySectionId( sectionId, true );
if( ListTools.isNotEmpty( ids )) {
userRoleList = business.userRoleFactory().list( ids );
if( ListTools.isNotEmpty( userRoleList )) {
for( BBSUserRole userRole : userRoleList ) {
emc.remove( userRole, CheckRemoveType.all );
}
}
}
ids = business.<API key>().listBySectionId( sectionId, true );
if( ListTools.isNotEmpty( ids )) {
permissionRoleList = business.<API key>().list( ids );
if( ListTools.isNotEmpty( permissionRoleList )) {
for( BBSPermissionRole permissionRole : permissionRoleList ) {
emc.remove( permissionRole, CheckRemoveType.all );
}
}
}
ids = business.roleInfoFactory().listRoleBySectionId( sectionId, true );
if( ListTools.isNotEmpty( ids )) {
roleInfoList = business.roleInfoFactory().list( ids );
if( ListTools.isNotEmpty( roleInfoList )) {
for( BBSRoleInfo roleInfo : roleInfoList ) {
emc.remove( roleInfo, CheckRemoveType.all );
}
}
}
ids = business.<API key>().<API key>(sectionId, true );
if( ListTools.isNotEmpty( ids )) {
permissionInfoList = business.<API key>().list( ids );
if( ListTools.isNotEmpty( permissionInfoList )) {
for( BBSPermissionInfo permissionInfo : permissionInfoList ) {
emc.remove( permissionInfo, CheckRemoveType.all );
}
}
}
sectionInfo = emc.find( sectionId, BBSSectionInfo.class );
if( sectionInfo != null ) {
forumInfo = emc.find( sectionInfo.getForumId(), BBSForumInfo.class );
if( forumInfo != null ) {
forumInfo.minusSection(1L);
}
emc.check( forumInfo, CheckPersistType.all );
emc.remove( sectionInfo, CheckRemoveType.all );
}
emc.commit();
}catch( Exception e ){
throw e;
}
}
/**
*
* 1
* 2
* @param sectionId
* @throws Exception
*/
public void deleteForce( String sectionId ) throws Exception {
if( StringUtils.isEmpty( sectionId ) ){
throw new Exception( "sectionId can not null!" );
}
Business business = null;
BBSForumInfo forumInfo = null;
BBSSectionInfo sectionInfo = null;
BBSSubjectContent subjectContent = null;
List<String> ids = null;
List<String> subSectionIds = null;
List<BBSSectionInfo> sectionList = null;
List<BBSSubjectInfo> subjectList = null;
List<<API key>> attachmentList = null;
List<BBSReplyInfo> replyList = null;
List<BBSRoleInfo> roleInfoList = null;
List<BBSUserRole> userRoleList = null;
List<BBSPermissionRole> permissionRoleList = null;
List<BBSPermissionInfo> permissionInfoList = null;
Long subSectionTotal = 0L;
Long subjectTotal = 0L;
Long subjectTotalToday = 0L;
Long replyTotal = 0L;
Long replyTotalToday = 0L;
try (<API key> emc = <API key>.instance().create()) {
business = new Business(emc);
emc.beginTransaction( BBSForumInfo.class );
emc.beginTransaction( BBSSectionInfo.class );
emc.beginTransaction( BBSSubjectInfo.class );
emc.beginTransaction( BBSSubjectContent.class );
emc.beginTransaction( <API key>.class );
emc.beginTransaction( BBSReplyInfo.class );
emc.beginTransaction( BBSUserRole.class );
emc.beginTransaction( BBSPermissionInfo.class );
emc.beginTransaction( BBSPermissionRole.class );
emc.beginTransaction( BBSRoleInfo.class );
sectionInfo = emc.find( sectionId, BBSSectionInfo.class );
if( sectionInfo != null ) {
subSectionTotal = 1L;
forumInfo = emc.find( sectionInfo.getForumId(), BBSForumInfo.class );
subSectionIds = business.sectionInfoFactory().<API key>( sectionId );
if( ListTools.isNotEmpty( subSectionIds ) ) {
subSectionTotal += subSectionIds.size();
sectionList = business.sectionInfoFactory().list(subSectionIds);
}
if( ListTools.isNotEmpty( sectionList )) {
for( BBSSectionInfo subSectionInfo : sectionList ) {
emc.remove( subSectionInfo, CheckRemoveType.all );
}
}
emc.remove( sectionInfo, CheckRemoveType.all );
}
subjectTotalToday = business.subjectInfoFactory().countSubjectByDate( sectionId, dateOperation.getTodayStartTime(), dateOperation.getTodayEndTime(), true );
if( subjectTotalToday == null ) {
subjectTotalToday = 0L;
}
ids = business.subjectInfoFactory().<API key>( sectionId, true );
if( ListTools.isNotEmpty( ids )) {
subjectTotal = Long.parseLong( ids.size() + "" );
subjectList = business.subjectInfoFactory().list( ids );
if( ListTools.isNotEmpty( subjectList )) {
for( BBSSubjectInfo subjectInfo : subjectList ) {
subjectContent = emc.find( subjectInfo.getId(), BBSSubjectContent.class );
if( subjectContent != null ) {
emc.remove( subjectContent, CheckRemoveType.all );
}
emc.remove( subjectInfo, CheckRemoveType.all );
}
}
}
ids = business.<API key>().listBySectionId( sectionId, true );
if( ListTools.isNotEmpty( ids )) {
attachmentList = business.<API key>().list( ids );
if( ListTools.isNotEmpty( attachmentList )) {
StorageMapping mapping = null;
for( <API key> attachment : attachmentList ) {
mapping = ThisApplication.context().storageMappings().get( <API key>.class, attachment.getStorage());
attachment.deleteContent(mapping);
emc.remove( attachment, CheckRemoveType.all );
}
}
}
replyTotalToday = business.replyInfoFactory().countReplyByDate( sectionId, dateOperation.getTodayStartTime(), dateOperation.getTodayEndTime(), true );
if( replyTotalToday == null ) {
replyTotalToday = 0L;
}
ids = business.replyInfoFactory().<API key>( sectionId );
if( ListTools.isNotEmpty( ids )) {
replyTotal = Long.parseLong(ids.size() + "");
replyList = business.replyInfoFactory().list( ids );
if( ListTools.isNotEmpty( replyList )) {
for( BBSReplyInfo replyInfo : replyList ) {
emc.remove( replyInfo, CheckRemoveType.all );
}
}
}
ids = business.userRoleFactory().listBySectionId( sectionId, true );
if( ListTools.isNotEmpty( ids )) {
userRoleList = business.userRoleFactory().list( ids );
if( ListTools.isNotEmpty( userRoleList )) {
for( BBSUserRole userRole : userRoleList ) {
emc.remove( userRole, CheckRemoveType.all );
}
}
}
ids = business.<API key>().listBySectionId( sectionId, true );
if( ListTools.isNotEmpty( ids )) {
permissionRoleList = business.<API key>().list( ids );
if( ListTools.isNotEmpty( permissionRoleList )) {
for( BBSPermissionRole permissionRole : permissionRoleList ) {
emc.remove( permissionRole, CheckRemoveType.all );
}
}
}
ids = business.roleInfoFactory().listRoleBySectionId( sectionId, true );
if( ListTools.isNotEmpty( ids )) {
roleInfoList = business.roleInfoFactory().list( ids );
if( ListTools.isNotEmpty( roleInfoList )) {
for( BBSRoleInfo roleInfo : roleInfoList ) {
emc.remove( roleInfo, CheckRemoveType.all );
}
}
}
ids = business.<API key>().<API key>(sectionId, true );
if( ListTools.isNotEmpty( ids )) {
permissionInfoList = business.<API key>().list( ids );
if( ListTools.isNotEmpty( permissionInfoList )) {
for( BBSPermissionInfo permissionInfo : permissionInfoList ) {
emc.remove( permissionInfo, CheckRemoveType.all );
}
}
}
if( forumInfo != null ) {
forumInfo.minusSection( subSectionTotal );
forumInfo.minusSubjectTotal( subjectTotal );
forumInfo.<API key>( subjectTotalToday );
forumInfo.minusReplyTotal( replyTotal );
forumInfo.<API key>( replyTotalToday );
emc.check( forumInfo, CheckPersistType.all );
}
emc.commit();
}catch( Exception e ){
throw e;
}
}
public List<BBSSectionInfo> listAll() throws Exception {
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.listAll( emc );
}catch( Exception e ){
throw e;
}
}
/**
* ID
* @param forumId
* @return
* @throws Exception
*/
public Long <API key>( String forumId ) throws Exception {
if( forumId == null || forumId.isEmpty() ){
throw new Exception( "forumId is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, forumId);
}catch( Exception e ){
throw e;
}
}
/**
* ID
* @param sectionId
* @return
* @throws Exception
*/
public Long <API key>( String sectionId ) throws Exception {
if( sectionId == null || sectionId.isEmpty() ){
throw new Exception( "sectionId is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, sectionId);
}catch( Exception e ){
throw e;
}
}
/**
* ID
* @param forumId
* @return
* @throws Exception
*/
public List<BBSSectionInfo> <API key>( String forumId ) throws Exception {
if( forumId == null || forumId.isEmpty() ){
throw new Exception( "forumId is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, forumId);
}catch( Exception e ){
throw e;
}
}
/**
* ID
* @param forumId
* @return
* @throws Exception
*/
public List<BBSSectionInfo> <API key>( String forumId, List<String> viewableSectionIds ) throws Exception {
if( forumId == null || forumId.isEmpty() ){
throw new Exception( "forumId is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, forumId, viewableSectionIds );
}catch( Exception e ){
throw e;
}
}
/**
* ID
* @param sectionId
* @return
* @throws Exception
*/
public List<BBSSectionInfo> <API key>( String sectionId, List<String> viewableSectionIds ) throws Exception {
if( sectionId == null || sectionId.isEmpty() ){
throw new Exception( "sectionId is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, sectionId, viewableSectionIds );
}catch( Exception e ){
throw e;
}
}
/**
* ID
* @param sectionId
* @return
* @throws Exception
*/
public List<BBSSectionInfo> <API key>( String sectionId ) throws Exception {
if( sectionId == null || sectionId.isEmpty() ){
throw new Exception( "sectionId is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, sectionId );
}catch( Exception e ){
throw e;
}
}
public void checkSectionManager( String sectionId ) throws Exception {
if( sectionId == null || sectionId.isEmpty() ){
throw new Exception( "sectionId is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
sectionInfoService.checkSectionManager( emc, sectionId );
}catch( Exception e ){
throw e;
}
}
/**
*
* @param sectionInfo
* @throws Exception
*/
public void checkSectionManager( BBSSectionInfo sectionInfo ) throws Exception {
if( sectionInfo == null ){
throw new Exception( "sectionInfo is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
sectionInfoService.checkSectionManager( emc, sectionInfo );
}catch( Exception e ){
throw e;
}
}
/**
* IDID
* @param forumId
* @param sectionIds
* @return
* @throws Exception
*/
public List<BBSSectionInfo> <API key>( String forumId, List<String> sectionIds ) throws Exception {
if( forumId == null || forumId.isEmpty() ){
throw new Exception( "forumId is null!" );
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, forumId, sectionIds );
}catch( Exception e ){
throw e;
}
}
/**
*
* @param viewforumIds
* @param publicStatus
* @return
* @throws Exception
*/
public List<String> <API key>( List<String> viewforumIds, Boolean publicStatus ) throws Exception {
if( viewforumIds == null || viewforumIds.isEmpty() ){
return null;
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.<API key>( emc, viewforumIds, publicStatus );
}catch( Exception e ){
throw e;
}
}
public List<BBSSectionInfo> list(List<String> publicSectionIds) throws Exception {
if( publicSectionIds == null || publicSectionIds.isEmpty() ){
return null;
}
try ( <API key> emc = <API key>.instance().create() ) {
return sectionInfoService.list( emc, publicSectionIds );
}catch( Exception e ){
throw e;
}
}
} |
{% extends "tutorial/base.html" %}
{% load crispy_forms_tags %}
{% block title %}
Nouvel extrait – Tutoriels
{% endblock %}
{% block headline %}
Nouvel extrait
{% endblock %}
{% block headline-sub %}
{% if chapter.part %}
{{ chapter.title }}
{% else %}
{{ chapter.tutorial.title }}
{% endif %}
{% endblock %}
{% block breadcrumb %}
{% if chapter.part %}
<li><a href="{{ chapter.part.tutorial.get_absolute_url }}">{{ chapter.part.tutorial.title }}</a></li>
<li><a href="{{ chapter.part.get_absolute_url }}">{{ chapter.part.title }}</a></li>
<li><a href="{{ chapter.get_absolute_url }}">{{ chapter.title }}</a> </li>
{% else %}
<li><a href="{{ chapter.tutorial.get_absolute_url }}">{{ chapter.tutorial.title }}</a></li>
{% endif %}
<li class="current"><a href="#">Ajouter un extrait</a></li>
{% endblock %}
{% block content %}
<div class="row">
<div class="large-12 columns">
{% include "tutorial/extract_common.part.html" %}
</div>
</div>
<div class="row">
<div class="large-12 columns">
{% crispy form %}
</div>
</div>
{% if text %}
{% include "tutorial/previsualization.part.html" %}
{% endif %}
{% endblock %} |
from typing import Optional
import os
def get_env(secret_name: str, default: Optional[str] = None):
"""Gathers secrets and envvars from secret provider and environment"""
if secret_name.startswith("SDC_"):
# Get secret from a secret provider (portainer ?)
return ""
result = os.environ.get(secret_name)
if result is None:
return default
return result
def programTypeAndSlug(program) -> tuple:
"""Returns the type of the program (Bachelier, Master, CAP, ...)"""
# FIXME : Maybe find a more elegant solution to define a program's type ?
if "bachelier" in program.name.lower():
return "Bachelier", "aaaaba"
if "master de spécialisation" in program.name.lower():
return "Master de spécialisation", "aamas"
if "master" in program.name.lower():
return "Master", "aaama"
if "certificat" in program.name.lower():
return "Certificat", "cap"
if "agrégation" in program.name.lower():
return "Agrégation", "aess"
else:
return "Autre", "zaut"
def <API key>(programs) -> list:
"""Builds a list of program types (Bachelier, Master, CAP) with the corresping programs in it"""
program_dict: dict = {}
for program in programs:
program_type, type_slug = programTypeAndSlug(program)
if type_slug not in program_dict.keys():
program_dict[type_slug] = {
"name": program_type,
"slug": type_slug,
"programs": [program]
}
else:
program_dict[type_slug]['programs'].append(program)
return sorted([program for _, program in program_dict.items()], key=lambda x: x['slug']) |
// This file is part of the Kaltura Collaborative Media Suite which allows users
// to do with audio, video, and animation what Wiki platfroms allow them to do with
// text.
// This program is free software: you can redistribute it and/or modify
// published by the Free Software Foundation, either version 3 of the
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// @ignore
package com.kaltura.client.enums;
/**
* This class was generated using generate.php
* against an XML schema provided by Kaltura.
*
* MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN.
*/
public enum <API key> implements KalturaEnumAsString {
ADMIN_TAGS ("adminTags"),
CATEGORIES_IDS ("categoriesIds"),
CREATOR_ID ("creatorId"),
DESCRIPTION ("description"),
GROUP_ID ("groupId"),
ID ("id"),
NAME ("name"),
REFERENCE_ID ("referenceId"),
REPLACED_ENTRY_ID ("replacedEntryId"),
REPLACING_ENTRY_ID ("replacingEntryId"),
SEARCH_TEXT ("searchText"),
TAGS ("tags"),
USER_ID ("userId");
public String hashCode;
<API key>(String hashCode) {
this.hashCode = hashCode;
}
public String getHashCode() {
return this.hashCode;
}
public void setHashCode(String hashCode) {
this.hashCode = hashCode;
}
public static <API key> get(String hashCode) {
if (hashCode.equals("adminTags"))
{
return ADMIN_TAGS;
}
else
if (hashCode.equals("categoriesIds"))
{
return CATEGORIES_IDS;
}
else
if (hashCode.equals("creatorId"))
{
return CREATOR_ID;
}
else
if (hashCode.equals("description"))
{
return DESCRIPTION;
}
else
if (hashCode.equals("groupId"))
{
return GROUP_ID;
}
else
if (hashCode.equals("id"))
{
return ID;
}
else
if (hashCode.equals("name"))
{
return NAME;
}
else
if (hashCode.equals("referenceId"))
{
return REFERENCE_ID;
}
else
if (hashCode.equals("replacedEntryId"))
{
return REPLACED_ENTRY_ID;
}
else
if (hashCode.equals("replacingEntryId"))
{
return REPLACING_ENTRY_ID;
}
else
if (hashCode.equals("searchText"))
{
return SEARCH_TEXT;
}
else
if (hashCode.equals("tags"))
{
return TAGS;
}
else
if (hashCode.equals("userId"))
{
return USER_ID;
}
else
{
return ADMIN_TAGS;
}
}
} |
# -*- coding: utf-8 -*-
# template 18
"""
Various tools at your fingertips.
The available tools are:
* cvt_csv_2_rst.py: convert csv file into rst file
* cvt_csv_2_xml.py: convert csv file into xml file
* cvt_script: parse bash script and convert to meet company standard
* gen_readme.py: generate documentation files, mainly README.rst
* odoo_dependency.py: show odoo depencies and/or Odoo module tree
* odoo_translation.py: manage Odoo translation
* pep8: parse source .py file to meet pep8 and convert across Odoo versions
* please: developer shell
* <API key>.py: get repository names from github.com
"""
import os
import sys
import pkg_resources
import gzip
import shutil
__version__ = '1.0.7.1'
def fake_setup(**kwargs):
globals()['setup_args'] = kwargs
def read_setup():
setup_info = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'setup.info'))
if not os.path.isfile(setup_info):
setup_info = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'setup.py'))
setup_args = {}
if os.path.isfile(setup_info):
with open(setup_info, 'r') as fd:
exec(fd.read().replace('setup(', 'fake_setup('))
setup_args = globals()['setup_args']
else:
print('Not internal configuration file found!')
setup_args['setup'] = setup_info
try:
pkg = pkg_resources.get_distribution(__package__.split('.')[0])
setup_args['name'] = pkg.key
setup_args['version'] = pkg.version
except BaseException:
pass
return setup_args
def get_pypi_paths():
local_venv = '/devel/venv/'
pkgpath = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..'))
bin_path = lib_path = ''
path = pkgpath
while not bin_path and path != '/' and path != os.environ['HOME']:
path = os.path.dirname(path)
if os.path.isdir(path) and os.path.basename(path) == 'lib':
bin_path = os.path.join(os.path.dirname(path), 'bin')
lib_path = path
if not bin_path and local_venv:
for path in sys.path:
if local_venv in path:
bin_path = os.path.join(
path[:path.find(local_venv)],
*[x for x in local_venv.split('/') if x][:-1])
break
return pkgpath, bin_path, lib_path
def copy_pkg_data(setup_args, verbose):
if setup_args.get('package_data'):
pkgpath, bin_path, lib_path = get_pypi_paths()
if bin_path:
# TODO> compatibility mode
bin2_path = os.path.join(os.environ['HOME'], 'devel')
if not os.path.isdir(bin2_path):
bin2_path = ''
man_path = os.path.join(bin_path, 'man', 'man8')
if not os.path.isdir(man_path):
man_path = ''
for pkg in setup_args['package_data'].keys():
for fn in setup_args['package_data'][pkg]:
base = os.path.basename(fn)
if base in ('setup.info', '*'):
continue
full_fn = os.path.abspath(os.path.join(pkgpath, fn))
if base.endswith('.man') and man_path:
with open(full_fn, 'r') as fd:
help_text = fd.read()
tgt_fn = os.path.join(man_path, '%s.8.gz' % base[:-4])
with gzip.open(tgt_fn, 'w') as fd:
if sys.version_info[0] == 3:
fd.write(help_text.encode('utf-8'))
else:
fd.write(help_text)
continue
if lib_path:
tgt_fn = os.path.join(lib_path, base)
if verbose:
print('$ cp %s %s' % (full_fn, tgt_fn))
shutil.copy(full_fn, tgt_fn)
# TODO> compatibility mode
tgt_fn = os.path.join(bin_path, base)
if os.path.isfile(tgt_fn):
os.unlink(tgt_fn)
if not os.path.exists(tgt_fn):
if verbose:
print('$ ln -s %s %s' % (full_fn, tgt_fn))
os.symlink(full_fn, tgt_fn)
if bin2_path:
tgt_fn = os.path.join(bin2_path, base)
if os.path.isfile(tgt_fn):
os.unlink(tgt_fn)
# if not os.path.exists(tgt_fn):
# if verbose:
# print('$ ln -s %s %s' % (full_fn, tgt_fn))
# os.symlink(full_fn, tgt_fn)
# TODO> compatibility mode to remove early
if lib_path and bin2_path:
for base in ('z0librc', 'odoorc', 'travisrc'):
full_fn = os.path.join(bin2_path, base)
tgt_fn = os.path.join(bin_path, base)
if os.path.exists(full_fn) and not os.path.exists(tgt_fn):
if verbose:
print('$ cp %s %s' % (full_fn, tgt_fn))
shutil.copy(full_fn, tgt_fn)
def main(cli_args=None):
if not cli_args:
cli_args = sys.argv[1:]
action = '-H'
verbose = False
for arg in cli_args:
if arg in ('-h', '-H', '--help', '-V', '--version', '--copy-pkg-data'):
action = arg
elif arg == '-v':
verbose = True
setup_args = read_setup()
if action == '-h':
print('%s [-h][-H][--help][-V][--version][-C][--copy-pkg-data]' %
setup_args['name'])
elif action in ('-V', '--version'):
if setup_args['version'] == __version__:
print(setup_args['version'])
else:
print('Version mismatch %s/%s' % (setup_args['version'],
__version__))
elif action in ('-H', '--help'):
for text in __doc__.split('\n'):
print(text)
elif action in ('-C', '--copy-pkg-data'):
copy_pkg_data(setup_args, verbose)
return 0 |
from test_delete import *
from test_openid import *
from test_edit import * |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <float.h>
#include "../gui.h"
#include "../gui_internal.h"
#include "../utilities.h"
static int keyUp(InputEvent* ev, GUIDebugAdjuster* bc);
static void render(GUIDebugAdjuster* da, PassFrameParams* pfp);
static void updateText(GUIDebugAdjuster* da);
static void delete(GUIObject* go) {
if(go->debugAdjuster.format)
free(go->debugAdjuster.format);
}
GUIDebugAdjuster* <API key>(GUIManager* gm, char* format, void* target, char type) {
GUIDebugAdjuster* da;
static struct gui_vtbl static_vt = {
.Render = render,
.Delete = delete,
};
static InputEventHandler input_vt = {
.keyUp = keyUp,
};
pcalloc(da);
gui_headerInit(&da->header, gm, &static_vt);
da->header.input_vt = &input_vt;
da->target = target;
da->type = type;
da->format = strdup(format);
da->bufferLen = 0;
da->text = GUIText_new(gm, "", "Arial", 3.0f);
updateText(da);
GUIRegisterObject(da->text, da);
da->increments[0].f = 1.0f;
da->increments[0].d = 1.0;
da->increments[0].i = 1;
da->increments[1].f = 10.0f;
da->increments[1].d = 10.0;
da->increments[1].i = 10;
da->max.d = DBL_MAX;
da->min.d = DBL_MIN;
da->max.i = INT64_MAX;
da->min.i = INT64_MIN;
da->max.u = UINT64_MAX;
da->min.u = 0;
return da;
}
/*
static void updatePos(GUIWindow* gw, GUIRenderParams* grp, PassFrameParams* pfp) {
Vector2 tl = gui_calcPosGrav(&gw->header, grp);
}*/
static void render(GUIDebugAdjuster* da, PassFrameParams* pfp) {
if(da->header.hidden || da->header.deleted) return;
updateText(da);
<API key>(&da->header, pfp);
}
static void updateText(GUIDebugAdjuster* da) {
size_t len;
union {
double d;
int64_t l;
uint64_t u;
char* a; // "ascii", if you wish?
} u;
switch(da->type) {
case 'f': u.d = *(float*)da->target; break;
case 'd': u.d = *(double*)da->target; break;
case 'c': u.l = *(char*)da->target; break;
case 's': u.l = *(short*)da->target; break;
case 'i': u.l = *(int*)da->target; break;
case 'l': u.l = *(long*)da->target; break;
case '1': u.u = *(uint8_t*)da->target; break;
case '2': u.u = *(uint16_t*)da->target; break;
case '4': u.u = *(uint32_t*)da->target; break;
case '8': u.u = *(uint64_t*)da->target; break;
case 'a': u.a = *(char**)da->target; break;
}
switch(da->type) {
case 'f':
case 'd':
len = snprintf(NULL, 0, da->format, u.d) + 1;
break;
case 'c':
case 's':
case 'i':
case 'l':
len = snprintf(NULL, 0, da->format, u.l) + 1;
break;
case '1':
case '2':
case '4':
case '8':
len = snprintf(NULL, 0, da->format, u.u) + 1;
break;
case 'a':
len = snprintf(NULL, 0, da->format, u.a) + 1;
break;
}
if(da->bufferLen < len) {
da->bufferLen = len + 64;
da->buffer = realloc(da->buffer, da->bufferLen);
}
switch(da->type) {
case 'f':
case 'd':
snprintf(da->buffer, da->bufferLen, da->format, u.d);
break;
case 'c':
case 's':
case 'i':
case 'l':
snprintf(da->buffer, da->bufferLen, da->format, u.l);
break;
case '1':
case '2':
case '4':
case '8':
snprintf(da->buffer, da->bufferLen, da->format, u.u);
break;
case 'a':
snprintf(da->buffer, da->bufferLen, da->format, u.a);
break;
}
GUIText_setString(da->text, da->buffer);
}
static void increment(GUIDebugAdjuster* da, int scale) {
switch(da->type) {
case 'f': *((float*)da->target) += da->increments[scale].f; break;
case 'd': *((double*)da->target) += da->increments[scale].d; break;
case 'c': *((char*)da->target) += da->increments[scale].i; break;
case 's': *((short*)da->target) += da->increments[scale].i; break;
case 'i': *((int*)da->target) += da->increments[scale].i; break;
case 'l': *((long*)da->target) += da->increments[scale].i; break;
case '1': *((uint8_t*)da->target) += da->increments[scale].i; break;
case '2': *((uint16_t*)da->target) += da->increments[scale].i; break;
case '4': *((uint32_t*)da->target) += da->increments[scale].i; break;
case '8': *((uint64_t*)da->target) += da->increments[scale].i; break;
// strings are not incremented
}
}
static void decrement(GUIDebugAdjuster* da, int scale) {
switch(da->type) {
case 'f': *((float*)da->target) -= da->increments[scale].f; break;
case 'd': *((double*)da->target) -= da->increments[scale].d; break;
case 'c': *((char*)da->target) -= da->increments[scale].i; break;
case 's': *((short*)da->target) -= da->increments[scale].i; break;
case 'i': *((int*)da->target) -= da->increments[scale].i; break;
case 'l': *((long*)da->target) -= da->increments[scale].i; break;
case '1': *((uint8_t*)da->target) -= da->increments[scale].i; break;
case '2': *((uint16_t*)da->target) -= da->increments[scale].i; break;
case '4': *((uint32_t*)da->target) -= da->increments[scale].i; break;
case '8': *((uint64_t*)da->target) -= da->increments[scale].i; break;
// strings are not incremented
}
}
static int keyUp(InputEvent* ev, GUIDebugAdjuster* da) {
if(ev->keysym == XK_Escape) {
<API key>(da);
//gbcTest = NULL;
return 0;
}
if(ev->keysym == XK_Up) {
increment(da, 0);
updateText(da);
return 0;
}
if(ev->keysym == XK_Down) {
decrement(da, 0);
updateText(da);
return 0;
}
return 1;
} |
/**
* @brief Posix queues support
*
* @file sys_posixq.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <stdarg.h>
#include <ctype.h>
#include <memory.h>
#include <errno.h>
#include <signal.h>
#include <limits.h>
#include <pthread.h>
#include <string.h>
#include <ndrx_config.h>
#include <ndrstandard.h>
#include <ndebug.h>
#include <nstdutil.h>
#include <limits.h>
#include <mqueue.h>
#include <sys/stat.h>
#include <fcntl.h>
/*
* We assume that this is thread safe.
* Even if two threads get here. The work result will be the same.
*/
#define API_ENTRY if (M_first)\
{\
strcpy(M_qpath, getenv(CONF_NDRX_QPATH));\
M_first = EXFALSE;\
}
static int M_first = EXTRUE;
static char M_qpath[PATH_MAX] = {EXEOS};
/**
* This is version with registry files to FS
* - Firstly open the queue,
* - The open fifo file
*/
expublic mqd_t <API key>(char *name, int oflag,
mode_t mode, struct mq_attr *attr)
{
mqd_t ret;
char regpath[PATH_MAX];
int err;
API_ENTRY;
sprintf(regpath, "%s%s", M_qpath, name);
NDRX_LOG(log_debug, "opening, registry path built: [%s]", regpath);
ret = mq_open(name, oflag, mode, attr);
if ((mqd_t)EXFAIL!=ret && (oflag & O_CREAT))
{
if (EXSUCCEED!=mkfifo(regpath, S_IWUSR | S_IRUSR))
{
err = errno;
NDRX_LOG(log_error, "Failed to open fifo file [%s]: %s",
regpath, strerror(errno));
if (EEXIST==err)
{
NDRX_LOG(log_warn, "File already exists, ignore error...");
errno = 0;
}
else
{
ret=(mqd_t)EXFAIL;
errno = err;
NDRX_LOG(log_error, "Removing queue...");
if (EXSUCCEED!=mq_unlink(name))
{
NDRX_LOG(log_error, "Failed to mq_unlink [%s]: %s",
name, strerror(errno));
}
}
}
}
return ret;
}
/**
* Remove the queue name from registry
* - Remove the queue
* - Then remove fifo file
*/
expublic int <API key> (char *name)
{
char regpath[PATH_MAX];
int ret, err;
API_ENTRY;
sprintf(regpath, "%s%s", M_qpath, name);
NDRX_LOG(log_debug, "deleting, registry path built: [%s]", regpath);
if (EXSUCCEED!=(ret = mq_unlink(name)))
{
err = errno;
NDRX_LOG(log_error, "Failed to mq_unlink [%s]: %s", name, strerror(err));
}
if (EXSUCCEED!=unlink(regpath))
{
NDRX_LOG(log_error, "Failed to unlink [%s]: %s", regpath, strerror(errno));
}
errno = err;
return ret;
}
/* vim: set ts=4 sw=4 et smartindent: */ |
<!DOCTYPE html>
<html lang="en"
>
<head>
<title>Articles by 40323132 - CD (MDE)</title>
<!-- Using the latest rendering mode for IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
/*some stuff for output/input prompts*/
div.cell{border:1px solid transparent;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;display:flex;flex-direction:column;align-items:stretch}div.cell.selected{border-radius:4px;border:thin #ababab solid}
div.cell.edit_mode{border-radius:4px;border:thin #008000 solid}
div.cell{width:100%;padding:5px 5px 5px 0;margin:0;outline:none}
div.prompt{min-width:11ex;padding:.4em;margin:0;font-family:monospace;text-align:right;line-height:1.21429em}
@media (max-width:480px){div.prompt{text-align:left}}div.inner_cell{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;display:flex;flex-direction:column;align-items:stretch;-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;flex:1}
div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;line-height:1.21429em}
div.prompt:empty{padding-top:0;padding-bottom:0}
div.input{page-break-inside:avoid;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:horizontal;-moz-box-align:stretch;display:box;box-orient:horizontal;box-align:stretch;}
div.inner_cell{width:90%;}
div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;}
div.input_prompt{color:navy;border-top:1px solid transparent;}
div.output_wrapper{margin-top:5px;position:relative;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;}
div.output_scroll{height:24em;width:100%;overflow:auto;border-radius:4px;-webkit-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);-moz-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);}
div.output_collapsed{margin:0px;padding:0px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;}
div.out_prompt_overlay{height:100%;padding:0px 0.4em;position:absolute;border-radius:4px;}
div.out_prompt_overlay:hover{-webkit-box-shadow:inset 0 0 1px #000000;-moz-box-shadow:inset 0 0 1px #000000;box-shadow:inset 0 0 1px #000000;background:rgba(240, 240, 240, 0.5);}
div.output_prompt{color:darkred;}
a.anchor-link:link{text-decoration:none;padding:0px 20px;visibility:hidden;}
h1:hover .anchor-link,h2:hover .anchor-link,h3:hover .anchor-link,h4:hover .anchor-link,h5:hover .anchor-link,h6:hover .anchor-link{visibility:visible;}
/* end stuff for output/input prompts*/
.highlight-ipynb .hll { background-color: #ffffcc }
.highlight-ipynb { background: #f8f8f8; }
.highlight-ipynb .c { color: #408080; font-style: italic } /* Comment */
.highlight-ipynb .err { border: 1px solid #FF0000 } /* Error */
.highlight-ipynb .k { color: #008000; font-weight: bold } /* Keyword */
.highlight-ipynb .o { color: #666666 } /* Operator */
.highlight-ipynb .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.highlight-ipynb .cp { color: #BC7A00 } /* Comment.Preproc */
.highlight-ipynb .c1 { color: #408080; font-style: italic } /* Comment.Single */
.highlight-ipynb .cs { color: #408080; font-style: italic } /* Comment.Special */
.highlight-ipynb .gd { color: #A00000 } /* Generic.Deleted */
.highlight-ipynb .ge { font-style: italic } /* Generic.Emph */
.highlight-ipynb .gr { color: #FF0000 } /* Generic.Error */
.highlight-ipynb .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight-ipynb .gi { color: #00A000 } /* Generic.Inserted */
.highlight-ipynb .go { color: #888888 } /* Generic.Output */
.highlight-ipynb .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight-ipynb .gs { font-weight: bold } /* Generic.Strong */
.highlight-ipynb .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight-ipynb .gt { color: #0044DD } /* Generic.Traceback */
.highlight-ipynb .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.highlight-ipynb .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.highlight-ipynb .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.highlight-ipynb .kp { color: #008000 } /* Keyword.Pseudo */
.highlight-ipynb .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.highlight-ipynb .kt { color: #B00040 } /* Keyword.Type */
.highlight-ipynb .m { color: #666666 } /* Literal.Number */
.highlight-ipynb .s { color: #BA2121 } /* Literal.String */
.highlight-ipynb .na { color: #7D9029 } /* Name.Attribute */
.highlight-ipynb .nb { color: #008000 } /* Name.Builtin */
.highlight-ipynb .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.highlight-ipynb .no { color: #880000 } /* Name.Constant */
.highlight-ipynb .nd { color: #AA22FF } /* Name.Decorator */
.highlight-ipynb .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight-ipynb .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.highlight-ipynb .nf { color: #0000FF } /* Name.Function */
.highlight-ipynb .nl { color: #A0A000 } /* Name.Label */
.highlight-ipynb .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight-ipynb .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight-ipynb .nv { color: #19177C } /* Name.Variable */
.highlight-ipynb .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.highlight-ipynb .w { color: #bbbbbb } /* Text.Whitespace */
.highlight-ipynb .mf { color: #666666 } /* Literal.Number.Float */
.highlight-ipynb .mh { color: #666666 } /* Literal.Number.Hex */
.highlight-ipynb .mi { color: #666666 } /* Literal.Number.Integer */
.highlight-ipynb .mo { color: #666666 } /* Literal.Number.Oct */
.highlight-ipynb .sb { color: #BA2121 } /* Literal.String.Backtick */
.highlight-ipynb .sc { color: #BA2121 } /* Literal.String.Char */
.highlight-ipynb .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight-ipynb .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight-ipynb .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.highlight-ipynb .sh { color: #BA2121 } /* Literal.String.Heredoc */
.highlight-ipynb .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.highlight-ipynb .sx { color: #008000 } /* Literal.String.Other */
.highlight-ipynb .sr { color: #BB6688 } /* Literal.String.Regex */
.highlight-ipynb .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight-ipynb .ss { color: #19177C } /* Literal.String.Symbol */
.highlight-ipynb .bp { color: #008000 } /* Name.Builtin.Pseudo */
.highlight-ipynb .vc { color: #19177C } /* Name.Variable.Class */
.highlight-ipynb .vg { color: #19177C } /* Name.Variable.Global */
.highlight-ipynb .vi { color: #19177C } /* Name.Variable.Instance */
.highlight-ipynb .il { color: #666666 } /* Literal.Number.Integer.Long */
</style>
<style type="text/css">
/* Overrides of notebook CSS for static HTML export */
div.entry-content {
overflow: visible;
padding: 8px;
}
.input_area {
padding: 0.2em;
}
a.heading-anchor {
white-space: normal;
}
.rendered_html
code {
font-size: .8em;
}
pre.ipynb {
color: black;
background: #f7f7f7;
border: none;
box-shadow: none;
margin-bottom: 0;
padding: 0;
margin: 0px;
font-size: 13px;
}
/* remove the prompt div from text cells */
div.text_cell .prompt {
display: none;
}
/* remove horizontal padding from text cells, */
/* so it aligns with outer body text */
div.text_cell_render {
padding: 0.5em 0em;
}
img.anim_icon{padding:0; border:0; vertical-align:middle; -webkit-box-shadow:none; -box-shadow:none}
</style>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>
<script type="text/javascript">
init_mathjax = function() {
if (window.MathJax) {
// MathJax loaded
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
},
displayAlign: 'left', // Change this to 'center' to center equations.
"HTML-CSS": {
styles: {'.MathJax_Display': {"margin": 0}}
}
});
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}
}
init_mathjax();
</script>
<meta name="author" content="kmol" />
<!-- Open Graph tags -->
<meta property="og:site_name" content="CD (MDE)" />
<meta property="og:type" content="website"/>
<meta property="og:title" content="CD (MDE)"/>
<meta property="og:url" content="http://cdw18-40323132.rhcloud.com//static/blog"/>
<meta property="og:description" content="CD (MDE)"/>
<!-- Bootstrap -->
<link rel="stylesheet" href="http://cdw18-40323132.rhcloud.com//static/blog/theme/css/bootstrap.united.min.css" type="text/css"/>
<link href="http://cdw18-40323132.rhcloud.com//static/blog/theme/css/font-awesome.min.css" rel="stylesheet">
<link href="http://cdw18-40323132.rhcloud.com//static/blog/theme/css/pygments/monokai.css" rel="stylesheet">
<link href="http://cdw18-40323132.rhcloud.com//static/blog/theme/tipuesearch/tipuesearch.css" rel="stylesheet">
<link rel="stylesheet" href="http://cdw18-40323132.rhcloud.com//static/blog/theme/css/style.css" type="text/css"/>
<link href="http://cdw18-40323132.rhcloud.com//static/blog/feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
title="CD (MDE) ATOM Feed"/>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shCore.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushJScript.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushJava.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushPython.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushSql.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushXml.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushPhp.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushCpp.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushCss.js"></script>
<script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushCSharp.js"></script>
<script type='text/javascript'>
(function(){
var corecss = document.createElement('link');
var themecss = document.createElement('link');
var corecssurl = "http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/css/shCore.css";
if ( corecss.setAttribute ) {
corecss.setAttribute( "rel", "stylesheet" );
corecss.setAttribute( "type", "text/css" );
corecss.setAttribute( "href", corecssurl );
} else {
corecss.rel = "stylesheet";
corecss.href = corecssurl;
}
document.<API key>("head")[0].insertBefore( corecss, document.getElementById("<API key>") );
var themecssurl = "http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/css/shThemeDefault.css?ver=3.0.9b";
if ( themecss.setAttribute ) {
themecss.setAttribute( "rel", "stylesheet" );
themecss.setAttribute( "type", "text/css" );
themecss.setAttribute( "href", themecssurl );
} else {
themecss.rel = "stylesheet";
themecss.href = themecssurl;
}
//document.getElementById("<API key>").appendChild(themecss);
document.<API key>("head")[0].insertBefore( themecss, document.getElementById("<API key>") );
})();
SyntaxHighlighter.config.strings.expandSource = '+ expand source';
SyntaxHighlighter.config.strings.help = '?';
SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n';
SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: ';
SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: ';
SyntaxHighlighter.defaults['pad-line-numbers'] = false;
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
</script>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="http://cdw18-40323132.rhcloud.com//static/blog/" class="navbar-brand">
CD (MDE) </a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li >
<a href="http://cdw18-40323132.rhcloud.com//static/blog/category/ag100.html">Ag100</a>
</li>
<li >
<a href="http://cdw18-40323132.rhcloud.com//static/blog/category/ag9.html">Ag9</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><span>
<form class="navbar-search" action="http://cdw18-40323132.rhcloud.com//static/blog/search.html">
<input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input" required>
</form></span>
</li>
<li><a href="http://cdw18-40323132.rhcloud.com//static/blog/archives.html"><i class="fa fa-th-list"></i><span class="icon-label">Archives</span></a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
</div> <!-- /.navbar -->
<!-- Banner -->
<!-- End Banner -->
<div class="container">
<div class="row">
<div class="col-sm-9">
<article>
<h2><a href="http://cdw18-40323132.rhcloud.com//static/blog/<API key>.html">40323132 final </a></h2>
<div class="summary"><p>2D<br>
<img src="http://32-40323132.rhcloud.com/a40323132_1/ag9_2D" width="100%" />
2D<br>
<img src="http://32-40323132.rhcloud.com/a40323132_1/ag9_2D1" width="100%" /></p>
<p>3D<br>
<br>
<br></p>
<p>1.onshape
<br>
<br></p>
<p><img src="http://i.imgur.com/mqwapJ3.png" width="100%" />
<br>
<br>
<br>
2.
<br>
<br></p>
<p><img src="http://i.imgur.com/0q7LYjP.png" width="100%" />
<br>
<br>
<br>
3.(21)
<br>
<br></p>
<p><img src="http://i.imgur.com/pTspPoO.jpg" width="100%" />
<br>
<br>
<br>
4.
<br>
<br>
<img src="http://i.imgur.com/enavZBp.png" width="100%" />
<br>
<br>
<br>
5.
<br>
<br>
<iframe width="560" height="315" src="https:
<br>
<br>
<br>
6.
<br>
<br>
<img src="http://i.imgur.com/2mssez1.png" width="100%" />
<br>
<br>
<br></p>
<hr />
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<p>
<br>
67</p>
<a class="btn btn-default btn-xs" href="http://cdw18-40323132.rhcloud.com//static/blog/<API key>.html">more ...</a>
</div>
</article>
<hr/>
</div>
<div class="col-sm-3" id="sidebar">
<aside>
<section class="well well-sm">
<ul class="list-group list-group-flush">
<li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Recent Posts</span></h4>
<ul class="list-group" id="recentposts">
<li class="list-group-item">
<a href="http://cdw18-40323132.rhcloud.com//static/blog/<API key>.html">
40323132 final
</a>
</li>
</ul>
</li>
<li class="list-group-item"><a href="http://cdw18-40323132.rhcloud.com//static/blog/categories.html"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Categories</span></h4></a>
<ul class="list-group" id="categories">
<li class="list-group-item">
<a href="http://cdw18-40323132.rhcloud.com//static/blog/category/ag100.html">
<i class="fa fa-folder-open fa-lg"></i> ag100
</a>
</li>
<li class="list-group-item">
<a href="http://cdw18-40323132.rhcloud.com//static/blog/category/ag9.html">
<i class="fa fa-folder-open fa-lg"></i> ag9
</a>
</li>
</ul>
</li>
<li class="list-group-item"><a href="http://cdw18-40323132.rhcloud.com//static/blog/tags.html"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a>
<ul class="list-group list-inline tagcloud" id="tags">
</ul>
</li>
<li class="list-group-item"><h4><i class="fa <API key> fa-lg"></i><span class="icon-label">Links</span></h4>
<ul class="list-group" id="links">
<li class="list-group-item">
<a href="http://getpelican.com/" target="_blank">
Pelican
</a>
</li>
<li class="list-group-item">
<a href="https://github.com/DandyDev/pelican-bootstrap3/" target="_blank">
pelican-bootstrap3
</a>
</li>
<li class="list-group-item">
<a href="https://github.com/getpelican/pelican-plugins" target="_blank">
pelican-plugins
</a>
</li>
<li class="list-group-item">
<a href="https://github.com/Tipue/Tipue-Search" target="_blank">
Tipue search
</a>
</li>
</ul>
</li>
</ul>
</section>
</aside>
</div>
</div>
</div>
<footer>
<div class="container">
<hr>
<div class="row">
<div class="col-xs-10">© 2016 kmol
· Powered by <a href="https://github.com/DandyDev/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>,
<a href="http://docs.getpelican.com/" target="_blank">Pelican</a>,
<a href="http://getbootstrap.com" target="_blank">Bootstrap</a> </div>
<div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">Back to top</a></p></div>
</div>
</div>
</footer>
<script src="http://cdw18-40323132.rhcloud.com//static/blog/theme/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="http://cdw18-40323132.rhcloud.com//static/blog/theme/js/bootstrap.min.js"></script>
<script src="http://cdw18-40323132.rhcloud.com//static/blog/theme/js/respond.min.js"></script>
<!-- Disqus -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'cadlabmanual'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script');
s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.<API key>('HEAD')[0] || document.<API key>('BODY')[0]).appendChild(s);
}());
</script>
<!-- End Disqus Code -->
</body>
</html> |
package com.gildorymrp.core.feat;
import com.gildorymrp.api.plugin.core.ActiveFeat;
import com.gildorymrp.api.plugin.core.Character;
import com.gildorymrp.api.plugin.core.Feat;
public class <API key> implements ActiveFeat {
@Override
public String getDescription() {
return "In addition to the single extra attack you get with an off-hand weapon, you get a second attack, albeit with a -5 penalty.";
}
@Override
public boolean hasPrerequisites(Character character) {
if (character.getDexterity() >= 17) {
if (character.getAttackBonus() >= 6) {
for (Feat feat : character.getFeats()) {
if (feat instanceof TwoWeaponFighting) {
return true;
}
}
}
}
return false;
}
@Override
public boolean isFighterBonusFeat() {
return true;
}
} |
#include <kernel/access.h>
#include <kotaka/log.h>
#include <kotaka/paths/bigstruct.h>
#include <kotaka/paths/system.h>
#include <kotaka/paths/text.h>
#include <kotaka/privilege.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
private void load()
{
MODULED->boot_module("Verb");
load_dir("lwo");
load_dir("obj");
load_dir("sys");
}
private void set_limits()
{
reset_limits();
KERNELD->rsrc_set_limit("Text", "ticks", 5000000);
}
static void create()
{
KERNELD->set_global_access("Text", 1);
set_limits();
load();
}
void upgrade()
{
ACCESS_CHECK(previous_program() == OBJECTD);
set_limits();
}
/* to be called in 0.60 prior to upgrade to 0.61 */
void upgrade_check()
{
ACCESS_CHECK(previous_program() == MODULED);
}
void upgrade_module()
{
ACCESS_CHECK(previous_program() == MODULED);
}
static void <API key>()
{
}
private void booted_channel()
{
object *users;
int sz;
users = TEXT_USERD->query_users() + TEXT_USERD->query_guests();
for (sz = sizeof(users); --sz >= 0; ) {
users[sz]->subscribe_channels();
}
}
void booted_module(string module)
{
switch(module) {
case "Channel":
booted_channel();
}
}
static void destruct()
{
destruct_object("sys/userd");
}
string query_patcher(string path)
{
switch(path) {
case USR_DIR + "/obj/user":
return "set_ip";
}
} |
Cuttlefish::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.<API key> = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.<API key> = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
config.assets.debug = true
config.middleware.insert_after(ActionDispatch::Static, Rack::LiveReload)
# Cuttlefish specific configuration below here ONLY #
config.cuttlefish_domain = "localhost"
config.action_mailer.default_url_options = { host: "#{config.cuttlefish_domain}:3000" }
config.postfix_smtp_host = "localhost"
config.postfix_smtp_port = 1025
# These need to be set to something secret in production.rb!
config.devise_secret_key = 'xxxxxx'
config.secret_key_base = 'xxxxxx'
end |
from sklearn.utils import check_array
import numpy as np
def geh(y_true, y_pred, axis=0):
return np.sqrt(2*np.power(y_pred - y_true, 2)/(y_pred + y_true)).mean(axis=axis)
def <API key>(y_true, y_pred):
# y_true, y_pred = check_array(y_true), check_array(y_pred)
# Note: does not handle mix 1d representation
# if _is_1d(y_true):
# y_true, y_pred = _check_1d_array(y_true, y_pred)
return np.mean(np.abs((y_true - y_pred) / y_true)) * 100
mape = <API key>
def rmse(y_true, y_pred, axis=0):
return np.sqrt(((y_pred - y_true) ** 2).mean(axis=axis))
def MASE(training_series, testing_series, prediction_series):
"""
Computes the MEAN-ABSOLUTE SCALED ERROR forecast error for univariate time series prediction.
See "Another look at measures of forecast accuracy", Rob J Hyndman
parameters:
training_series: the series used to train the model, 1d numpy array
testing_series: the test series to predict, 1d numpy array or float
prediction_series: the prediction of testing_series, 1d numpy array (same size as testing_series) or float
absolute: "squares" to use sum of squares and root the result, "absolute" to use absolute values.
"""
# print("Needs to be tested.")
n = training_series.shape[0]
d = np.abs(np.diff(training_series)).sum() / (n - 1)
errors = np.abs(testing_series - prediction_series)
return errors.mean() / d
def <API key>(y_pred, y_test):
return np.median(np.abs((y_test - y_pred) / y_test)) * 100
def smape(y_pred, y_test):
return np.mean(np.abs(y_pred - y_test) / ((np.abs(y_pred) + np.abs(y_pred)) / 2)) |
<?
/*
include(dirname(__FILE__)."/../conf/main.conf.php");
include(dirname(__FILE__)."/../phpwf/plugins/class.db.php");
include(dirname(__FILE__)."/../www/lib/imap.inc.php");
include(dirname(__FILE__)."/../www/lib/class.erpapi.php");
include(dirname(__FILE__)."/../www/plugins/phpmailer/class.phpmailer.php");
include(dirname(__FILE__)."/../www/plugins/phpmailer/class.smtp.php");
class app_t {
var $DB;
var $user;
}
//ENDE
*/
$app = new app_t();
$DEBUG = 0;
$conf = new Config();
$app->DB = new DB($conf->WFdbhost,$conf->WFdbname,$conf->WFdbuser,$conf->WFdbpass);
$erp = new erpAPI($app);
$firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
$benutzername = $app->DB->Select("SELECT benutzername FROM firmendaten WHERE id='".$firmendatenid."' LIMIT 1");
$passwort = $app->DB->Select("SELECT passwort FROM firmendaten WHERE id='".$firmendatenid."' LIMIT 1");
$host = $app->DB->Select("SELECT host FROM firmendaten WHERE id='".$firmendatenid."' LIMIT 1");
$port = $app->DB->Select("SELECT port FROM firmendaten WHERE id='".$firmendatenid."' LIMIT 1");
$mailssl = $app->DB->Select("SELECT mailssl FROM firmendaten WHERE id='".$firmendatenid."' LIMIT 1");
$app->mail = new PHPMailer();
//$app->mail->PluginDir="plugins/phpmailer/";
$app->mail->IsSMTP();
$app->mail->SMTPAuth = true; // enable SMTP authentication
if($mailssl)
$app->mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$app->mail->Host = $host;
$app->mail->Port = $port; // set the SMTP port for the GMAIL server
$app->mail->Username = $benutzername;
$app->mail->Password = $passwort;
$meineauftraege = $app->DB->SelectArr("SELECT id FROM aufgabe WHERE emailerinnerung='1' AND DATE_SUB(abgabe_bis, INTERVAL 1 DAY) = DATE_FORMAT(NOW(),'%Y-%m-%d')");
for($i=0;$i<count($meineauftraege);$i++)
{
//$this-><API key>($meineauftraege[$i][id]);
echo "Sende Aufgabe ID ".$meineauftraege[$i][id]."\r\n";
$erp->AufgabenMail($meineauftraege[$i][id]);
}
?> |
package br.gov.mj.sislegis.app.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;
@Entity
@XmlRootElement
public class Usuario implements AbstractEntity {
private static final long serialVersionUID = -<API key>;
public Usuario() {
// TODO Auto-generated constructor stub
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", updatable = false, nullable = false)
private Long id;
@Column
private String nome;
@Column
private String email;
public Long getId() {
return this.id;
}
public void setId(final Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Usuario)) {
return false;
}
Usuario other = (Usuario) obj;
if (id != null) {
if (!id.equals(other.id)) {
return false;
}
}
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public String toString() {
String result = getClass().getSimpleName() + " ";
if (nome != null && !nome.trim().isEmpty())
result += "nome: " + nome;
if (email != null && !email.trim().isEmpty())
result += ", email: " + email;
return result;
}
} |
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="container">
<h2>Kontakt</h2>
<form action="{% url 'contact' %}" method="post">
{% csrf_token %}
{{ form | crispy }}
<input class="btn btn-primary" type="submit" value="Odeslat" />
</form>
</div>
{% endblock %} |
#include "<API key>.h"
#include "application.h"
#include "document.h"
#include "global.h"
#include "cachedimagefile.h"
#include "iconitemdelegate.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QFileDialog>
#include <QFileInfo>
#include <QDebug>
using namespace qNotesManager;
<API key>::<API key>(QWidget *parent) : QDialog(parent) {
iconsModel = Application::I()->GetIconsModel();
filterModel = new <API key>(this);
filterModel->setSourceModel(iconsModel);
filterModel->setFilterRole(IconGroupRole);
buttonGroup = new QButtonGroup(this);
QObject::connect(buttonGroup, SIGNAL(buttonClicked(QAbstractButton*)),
this, SLOT(<API key>(QAbstractButton*)));
QVBoxLayout* buttonsLayout = new QVBoxLayout();
QPushButton* b = 0;
foreach (QString groupName, Application::I()-><API key>()) {
b = new QPushButton(groupName, this);
b->setCheckable(true);
b->setFlat(true);
b->setFocusPolicy(Qt::NoFocus);
buttonGroup->addButton(b);
buttonsLayout->addWidget(b);
}
b = new QPushButton("Custom icons", this);
b->setCheckable(true);
b->setFlat(true);
b->setFocusPolicy(Qt::NoFocus);
buttonGroup->addButton(b);
buttonsLayout->addWidget(b);
buttonsLayout->addStretch();
listView = new QListView();
listView->setViewMode(QListView::IconMode);
listView->setDragEnabled(false);
listView->setSelectionMode(QAbstractItemView::SingleSelection);
listView->setResizeMode(QListView::Adjust);
listView->setUniformItemSizes(true);
listView->setWrapping(true);
#if QT_VERSION >= 0x040700
listView->setSpacing(10); // There is a bug with setSpacing, fixed in 4.7
#else
listView->setGridSize(QSize(30, 30));
#endif
listView->setModel(filterModel);
QStyledItemDelegate* delegate = new IconItemDelegate(this);
listView->setItemDelegate(delegate);
QObject::connect(listView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(<API key>(QModelIndex)));
okButton = new QPushButton("Select");
QObject::connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
cancelButton = new QPushButton("Cancel");
QObject::connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
QObject::connect(this, SIGNAL(rejected()), this, SLOT(sl_Rejected()));
addIconButton = new QPushButton("Add custom icon");
QObject::connect(addIconButton, SIGNAL(clicked()), this, SLOT(<API key>()));
QHBoxLayout* hl = new QHBoxLayout();
hl->addWidget(addIconButton);
hl->addStretch();
hl->addWidget(okButton);
hl->addWidget(cancelButton);
QHBoxLayout* hl2 = new QHBoxLayout();
hl2->addLayout(buttonsLayout);
hl2->addWidget(listView);
QVBoxLayout* vl = new QVBoxLayout();
vl->addLayout(hl2);
vl->addLayout(hl);
setLayout(vl);
setWindowTitle("Pick icon");
SelectedIconKey = "";
}
void <API key>::accept() {
QModelIndex index = listView->currentIndex();
if (!index.isValid()) {return;}
SelectedIconKey = index.data(IconIDRole).toString();
if (SelectedIconKey.isEmpty()) {
WARNING("Selected icon key is empty");
return;
}
QDialog::accept();
}
void <API key>::sl_Rejected() {
SelectedIconKey = "";
}
void <API key>::<API key>() {
QString filter = "Images (*.png)";
QStringList list = QFileDialog::getOpenFileNames (this, "Select icons to add", QString(),
filter);
if (list.isEmpty()) {return;}
foreach (QString fileName, list) {
QFileInfo info(fileName);
if (!info.exists()) {continue;}
CachedImageFile* image = CachedImageFile::FromFile(fileName);
if (!image->IsValidImage()) {
WARNING("Selected file is not a valid image");
delete image;
continue;
}
Application::I()->CurrentDocument()->AddCustomIcon(image);
}
int newIndex = <API key>("Custom icons");
if (newIndex == -1) {
return;
}
QAbstractButton* b = buttonGroup->button(newIndex);
b->click();
}
void <API key>::SelectIcon(const QString& key) {
if (key.isEmpty()) {
WARNING("Selected icon key is empty");
return;
}
QModelIndex start = iconsModel->index(0, 0);
QModelIndexList list = iconsModel->match(start, IconIDRole, key,
1, Qt::MatchFixedString);
if (list.isEmpty()) {
WARNING("NO ICON FOUND");
return;
}
QModelIndex index = list[0];
QString group = index.data(IconGroupRole).toString();
int newIndex = <API key>(group);
if (newIndex == -1) {
WARNING("Button not found");
return;
}
QAbstractButton* b = buttonGroup->button(newIndex);
b->click();
index = filterModel->mapFromSource(index);
if (!index.isValid()) {
WARNING("Mapped index is invalid");
return;
}
listView->scrollTo(index, QAbstractItemView::PositionAtCenter);
listView->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
}
void <API key>::<API key> (const QModelIndex& index) {
(void)index;
accept();
}
void <API key>::<API key>(QAbstractButton*) {
QString group = buttonGroup->checkedButton()->text();
filterModel->setFilterRegExp(QRegExp(group, Qt::CaseInsensitive, QRegExp::FixedString));
}
int <API key>::<API key>(const QString& name) const {
QList<QAbstractButton*> buttons = buttonGroup->buttons();
for (int i = 0; i < buttons.count(); i++) {
if (buttons.at(i)->text() == name) {
return buttonGroup->id(buttons.at(i));
}
}
return -1;
} |
#include "test.h"
#include "memdebug.h"
int test(char *URL)
{
CURLcode res;
CURL *curl;
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
fprintf(stderr, "curl_global_init() failed\n");
return TEST_ERR_MAJOR_BAD;
}
curl = curl_easy_init();
if(!curl) {
fprintf(stderr, "curl_easy_init() failed\n");
curl_global_cleanup();
return TEST_ERR_MAJOR_BAD;
}
test_setopt(curl, CURLOPT_URL, URL);
test_setopt(curl, CURLOPT_PORT, strtol(libtest_arg2, NULL, 10));
test_setopt(curl, CURLOPT_USERPWD, "xxx:yyy");
test_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl);
test_cleanup:
curl_easy_cleanup(curl);
curl_global_cleanup();
return (int)res;
} |
package hundsfickerei.schafkopf.server.network.controller;
import hundsfickerei.schafkopf.server.network.model.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.annotation.PostConstruct;
@Controller
public class NetworkController {
final static Logger LOG = LoggerFactory.getLogger(NetworkController.class);
@Autowired
ClientStore clientStore;
@Autowired
ZContextBean ctx;
@Autowired
<API key> <API key>;
@Autowired
<API key> <API key>;
@PostConstruct
public void init() throws Exception {
<API key> <API key> = new <API key>(ctx.getContext(), <API key>);
new Thread(<API key>).start();
//PLAYGROUND :)
Thread.sleep(5000);
for(Client client : clientStore.getClients()){
<API key>.<API key>(client.getIdentity(), "DEDICATED MSG FOR " + client.getPlayerNumber());
}
<API key>.<API key>("This goes to all clients");
}
} |
package org.mskcc.cbio.portal.dao;
import org.cbioportal.persistence.MutationRepository;
import org.mskcc.cbio.portal.model.*;
import java.util.*;
import org.apache.commons.math3.stat.correlation.PearsonsCorrelation;
import org.mskcc.cbio.portal.model.converter.<API key>;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Utility Class for Retrieving Genetic Alteration Data.
*
* This class is a wrapper for multiple DAO Classes, and enables you to retrieve different types
* of genomic data, and based on different types of genes, e.g. canonical (protein-coding) genes
* and microRNAs.
*
* @author Ethan Cerami.
*/
@Component
public class <API key> {
private static final String NAN = "NaN";
private static MutationRepository mutationRepository;
private static <API key> <API key>;
@Autowired
public <API key>(MutationRepository mutationRepository, <API key> <API key>) {
<API key>.mutationRepository = mutationRepository;
<API key>.<API key> = <API key>;
}
/**
* Gets a Row of data corresponding to: target gene, within the target genetic profile
* and only within the target samples.
*
* @param targetGene Target Gene.
* @param targetSampleList Target Sample List.
* @param <API key> Target Genetic Profile.
* @return Array List of String values.
* @throws DaoException Database Error.
*/
public static ArrayList<String> <API key>(Gene targetGene,
List<Integer> targetSampleList,
GeneticProfile <API key>) throws DaoException
{
ArrayList<String> dataRow = new ArrayList<String>();
<API key> <API key> = <API key>.getInstance();
// First branch: are we dealing with a canonical (protein-coding) gene or a microRNA?
if (targetGene instanceof CanonicalGene) {
CanonicalGene canonicalGene = (CanonicalGene) targetGene;
Map<Integer, String> sampleMap;
// Handle Mutations one way
if (<API key>.<API key>() == <API key>.MUTATION_EXTENDED) {
sampleMap = getMutationMap(targetSampleList,
<API key>.getGeneticProfileId(),
canonicalGene.getEntrezGeneId());
}
else if (<API key>.<API key>() == <API key>.<API key>) {
String type = canonicalGene.isPhosphoProtein() ?
<API key>.PHOSPHORYLATION.toString():<API key>.PROTEIN_LEVEL.toString();
sampleMap = <API key> (<API key>.getCancerStudyId(),
targetSampleList, canonicalGene, type, null)[0];
}
else {
// Handle All Other Data Types another way
sampleMap = <API key>.<API key>(<API key>.getGeneticProfileId(),
canonicalGene.getEntrezGeneId());
}
// Iterate through all samples in the profile
for (Integer sampleId: targetSampleList) {
String value = sampleMap.get(sampleId);
if (value == null) {
dataRow.add (NAN);
} else {
dataRow.add (value);
}
}
}
return dataRow;
}
public static ArrayList<String> <API key>(int cancerStudyId,
CanonicalGene targetGene,
List<Integer> targetSampleList,
List<String> correlatedToData) throws DaoException
{
ArrayList<String> dataRow = new ArrayList<String>();
String type = targetGene.isPhosphoProtein() ?
<API key>.PHOSPHORYLATION.toString():<API key>.PROTEIN_LEVEL.toString();
Map<Integer, String>[] sampleMaps = <API key>(cancerStudyId, targetSampleList,
targetGene, type, null);
Map<Integer, String> sampleMap = <API key>(sampleMaps, targetSampleList, correlatedToData);
// Iterate through all samples in the profile
for (Integer sampleId : targetSampleList) {
String value = sampleMap.get(sampleId);
if (value == null) {
dataRow.add (NAN);
} else {
dataRow.add (value);
}
}
return dataRow;
}
/**
* Gets a Map of Mutation Data.
*/
private static HashMap <Integer, String> getMutationMap (List<Integer> targetSampleList,
int geneticProfileId, long entrezGeneId) throws DaoException
{
HashMap <Integer, String> mutationMap = new HashMap <Integer, String>();
List <ExtendedMutation> mutationList = <API key>.convert(
mutationRepository.getMutations(targetSampleList, (int) entrezGeneId, geneticProfileId));
for (ExtendedMutation mutation : mutationList) {
Integer sampleId = mutation.getSampleId();
// Handle the possibility of multiple mutations in the same gene / sample
// Handles issue: 165
if (mutationMap.containsKey(sampleId))
{
String existingStr = mutationMap.get(sampleId);
mutationMap.put(sampleId, existingStr + "," +
mutation.getProteinChange());
}
else
{
mutationMap.put(sampleId, mutation.getProteinChange());
}
}
return mutationMap;
}
/**
* Gets a Map of Protein Array Data.
*/
private static Map <Integer, String>[] <API key>(int cancerStudyId, List<Integer> targetSampleList,
CanonicalGene canonicalGene, String type,
List<String> correlatedToData) throws DaoException
{
DaoProteinArrayInfo daoPAI = DaoProteinArrayInfo.getInstance();
DaoProteinArrayData daoPAD = DaoProteinArrayData.getInstance();
Map <Integer, String>[] ret;
List<String> arrayIds = new ArrayList<String>();
if (canonicalGene.isPhosphoProtein()) {
//TODO: this is somewhat hacky way--rppa array ids have to be aliases of the phosphoprotein
for (String arrayId : canonicalGene.getAliases()) {
ProteinArrayInfo pai = daoPAI.getProteinArrayInfo(arrayId);
if (pai!=null && pai.getCancerStudies().contains(cancerStudyId)) {
if (arrayId.contains("-")) {
// normalized
arrayIds.add(0, arrayId);
} else {
arrayIds.add(arrayId);
}
}
}
} else {
for (ProteinArrayInfo pai : daoPAI.<API key>(
cancerStudyId, canonicalGene.getEntrezGeneId(), Collections.singleton(type))) {
arrayIds.add(pai.getId());
}
}
if (arrayIds.isEmpty()) {
ret = new Map[1];
Map <Integer, String> map = Collections.emptyMap();
ret[0] = map;
return ret;
}
int n = correlatedToData==null ? 1:arrayIds.size();
ret = new Map[n];
for (int i=0; i<n; i++) {
String arrayId = arrayIds.get(i);
if (arrayId == null) {
continue;
}
ret[i] = new HashMap<Integer,String>();
List<ProteinArrayData> pads = daoPAD.getProteinArrayData(cancerStudyId, arrayId, targetSampleList);
for (ProteinArrayData pad : pads) {
ret[i].put(pad.getSampleId(), Double.toString(pad.getAbundance()));
}
}
return ret;
}
private static Map<Integer,String> <API key>(Map<Integer, String>[] sampleMaps,
List<Integer> targetSampleList,
List<String> correlatedToData)
{
if (sampleMaps.length==1 || correlatedToData==null || correlatedToData.size()!= targetSampleList.size()) {
return sampleMaps[0];
}
Map<Integer, String> ret = null;
double maxCorr = Double.NEGATIVE_INFINITY;
for (Map<Integer, String> map : sampleMaps) {
double corr = calcCorrCoef(map, targetSampleList, correlatedToData);
if (corr > maxCorr) {
maxCorr = corr;
ret = map;
}
}
return ret;
}
private static double calcCorrCoef(Map<Integer, String> sampleMap,
List<Integer> targetSampleList,
List<String> correlatedToData)
{
try {
List<Double> l1 = new ArrayList<Double>();
List<Double> l2 = new ArrayList<Double>();
for (int i=0; i<targetSampleList.size(); i++) {
Integer targetSample = targetSampleList.get(i);
if (correlatedToData.get(i).equals("NAN")) {
continue;
}
String abun = sampleMap.get(targetSample);
if (abun==null) {
continue;
}
l1.add(Double.valueOf(abun));
l2.add(Double.valueOf(correlatedToData.get(i)));
}
int n = l1.size();
double[] d1 = new double[n];
double[] d2 = new double[n];
for (int i=0; i<n; i++) {
d1[i] = l1.get(i);
d2[i] = l2.get(i);
}
PearsonsCorrelation pc = new PearsonsCorrelation();
return pc.correlation(d1, d2);
} catch (Exception e) {
return -2.0;
}
}
} |
# This file is part of VoltDB.
# This program is free software: you can redistribute it and/or modify
# published by the Free Software Foundation, either version 3 of the
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
import unittest
import requests
import socket
import xmlrunner
__host_name__ = socket.gethostname()
__host_or_ip__ = socket.gethostbyname(__host_name__)
__db_url__ = 'http://%s:8000/api/1.0/databases/' % \
__host_or_ip__
class DeploymentUser(unittest.TestCase):
"""
test case for database
"""
def setUp(self):
"""Create a deployment user"""
headers = {'Content-Type': 'application/json; charset=utf-8'}
db_data = {'name': 'testDB'}
response = requests.post(__db_url__, json=db_data, headers=headers)
self.assertEqual(response.status_code, 201)
response = requests.get(__db_url__)
value = response.json()
if value:
db_length = len(value['databases'])
last_db_id = value['databases'][db_length-1]['id']
db_data = {"name": "test", "password": "voltdb", "plaintext": True, "roles": "Administrator,Test", "databaseid": 1}
db_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.post(db_url, json=db_data, headers=headers)
self.assertEqual(response.status_code, 200)
def tearDown(self):
"""Delete a deployment user"""
response = requests.get(__db_url__)
value = response.json()
if value:
db_length = len(value['databases'])
last_db_id = value['databases'][db_length-1]['id']
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.get(user_url)
value = response.json()
if value:
user_length = len(value['deployment'])
last_user_id = value['deployment'][user_length-1]['userid']
user_delete_url = '%s%u/users/%u/' % (__db_url__, last_db_id, last_user_id)
response = requests.delete(user_delete_url)
self.assertEqual(response.status_code, 200)
db_url = __db_url__ + str(last_db_id)
response = requests.delete(db_url)
self.assertEqual(response.status_code, 204)
class <API key>(DeploymentUser):
def <API key>(self):
"""Validate duplicate username"""
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
db_data = {"name": "test", "password": "voltdb", "plaintext": True, "roles": "Administrator", "databaseid": 1}
response = requests.post(user_url, json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusString'], u'user name already exists')
self.assertEqual(response.status_code, 404)
else:
print "The database list is empty"
def <API key>(self):
"""ensure username value is not empty"""
db_data = {"password": "voltdb", "plaintext": True, "roles": "Administrator", "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.post(user_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusString'][0], "'name' is a required property")
self.assertEqual(response.status_code, 200)
else:
print "The database list is empty"
def <API key>(self):
db_data = {"name":"@@@@", "password": "voltdb", "plaintext": True, "roles": "Administrator", "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.post(user_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusString'][0], "u'@@@@' does not match '^[a-zA-Z0-9_.]+$'")
self.assertEqual(response.status_code, 200)
else:
print "The database list is empty"
def <API key>(self):
"""ensure password value is not empty"""
db_data = {"name": "voltdb", "plaintext": True, "roles": "Administrator", "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.post(user_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusString'][0], "'password' is a required property")
self.assertEqual(response.status_code, 200)
else:
print "The database list is empty"
def <API key>(self):
"""ensure roles value is not empty"""
db_data = {"name": "voltdb", "password": "test", "plaintext": True, "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.post(user_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusString'][0], "'roles' is a required property")
self.assertEqual(response.status_code, 200)
else:
print "The database list is empty"
def <API key>(self):
db_data = {"name": "voltdb", "password": "test", "plaintext": True,"roles":"@@@@", "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.post(user_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusString'][0], "u'@@@@' does not match '^[a-zA-Z0-9_.,-]+$'")
self.assertEqual(response.status_code, 200)
db_data = {"name": "voltdb", "password": "test", "plaintext": True,"roles":",", "databaseid": 1}
response = requests.post(user_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusString'], "Invalid user roles.")
self.assertEqual(response.status_code, 200)
else:
print "The database list is empty"
def <API key>(self):
"""ensure no duplicate roles are inserted"""
db_data = {"name": "test", "password": "admin", "plaintext": True, "roles": "Test1,Test1", "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.get(user_url)
value = response.json()
if value:
user_length = len(value['deployment'])
last_user_id = value['deployment'][user_length-1]['userid']
user_update_url = '%s%u/' % (user_url, last_user_id)
response = requests.put(user_update_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusstring'], "User Updated")
self.assertEqual(value['user']['roles'], "Test1")
self.assertEqual(response.status_code, 200)
def <API key>(self):
"""ensure deployment user is updated"""
db_data = {"name": "test", "password": "admin", "plaintext": True, "roles": "Administrator,Test2", "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.get(user_url)
value = response.json()
if value:
user_length = len(value['deployment'])
last_user_id = value['deployment'][user_length-1]['userid']
user_update_url = '%s%u/' % (user_url, last_user_id)
response = requests.put(user_update_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusstring'], "User Updated")
self.assertEqual(response.status_code, 200)
def <API key>(self):
__user_url = 'http://%s:8000/api/1.0/databases/3/users/' % \
__host_or_ip__
response = requests.get(__user_url)
value = response.json()
self.assertEqual(value['statusString'], "No database found for id: 3")
self.assertEqual(response.status_code, 404)
def <API key>(self):
db_data = {"name":"user", "password": "voltdb", "plaintext": True, "roles": "Administrator", "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = 3
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.post(user_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(value['statusString'], "No database found for id: 3")
self.assertEqual(response.status_code, 404)
else:
print "The database list is empty"
def <API key>(self):
response = requests.get(__db_url__)
value = response.json()
if value:
db_data = {"name":"user", "password": "voltdb", "plaintext": True, "roles": "Administrator", "databaseid": 1}
headers = {'Content-Type': 'application/json; charset=utf-8'}
last_db_id = GetLastDbId()
if last_db_id != -1:
user_url = '%s%u/users/' % (__db_url__, last_db_id)
response = requests.post(user_url,
json=db_data, headers=headers)
value = response.json()
self.assertEqual(response.status_code, 200)
last_db_id = 3
last_user_id = 1
user_delete_url = '%s%u/users/%u/' % (__db_url__, last_db_id, last_user_id)
response = requests.delete(user_delete_url)
value1 = response.json()
self.assertEqual(response.status_code, 404)
self.assertEqual(value1['statusString'], "No database found for id: 3")
else:
print "The database list is empty"
def GetLastDbId():
last_db_id = -1
response = requests.get(__db_url__)
value = response.json()
if value:
db_length = len(value['databases'])
last_db_id = value['databases'][db_length-1]['id']
return last_db_id
if __name__ == '__main__':
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports')) |
<?php
include_once ("FDL/Class.Doc.php");
/**
* Modify enum items
* @param Action &$action current action
* @global string $famid Http var : document id
*/
function editfamilyenums(Action & $action)
{
$usage = new ActionUsage($action);
$usage->setDefinitionText("Modify enum items");
$famId = $usage-><API key>("famid", "Family identifier", function ($id)
{
$fam = new_doc("", $id);
if (!$fam->doctype == "C") {
return sprintf("identifier %s is not a family", $id);
}
return '';
});
$viewOldInterface = $usage-><API key>("viewoldinterface", "link to old enum interface", array(
"yes",
"no"
) , "no");
$usage->verify();
$fam = new_doc("", $famId);
$err = $fam->control("edit");
if ($err) {
$action->exitError($err);
}
$action->lay->set("title", sprintf(_("Enum attributes for %s") , $fam->getHTMLTitle()));
$action->lay->set("famicon", $fam->getIcon('', 30));
$action->parent->addJsRef('lib/jquery/jquery.js');
$action->parent->addJsRef("lib/jquery-ui/js/jquery-ui.js");
$action->parent->addJsRef("FDL:editfamilyenums.js");
$action->parent->addCssRef("css/dcp/jquery-ui.css");
$lattr = $fam->getAttributes();
$tcf = array();
$lastFieldId = '';
/**
* @var NormalAttribute $oa
*/
foreach ($lattr as $k => $oa) {
if ((($oa->type == "enum") || ($oa->type == "enumlist")) && (($oa->phpfile == "") || ($oa->phpfile == "-")) && ($oa->getOption("system") != "yes")) {
$parentLabel = '';
$parentId = '';
$label = $oa->getLabel();
if (!empty($oa->fieldSet)) {
$parentLabel = $oa->fieldSet->getLabel();
$parentId = $oa->fieldSet->id;
if ($parentLabel == $label) {
if (!empty($oa->fieldSet->fieldSet)) {
$parentLabel = $oa->fieldSet->fieldSet->getLabel();
$parentId = $oa->fieldSet->fieldSet->id;
} else {
$parentId = "";
$parentLabel = '';
}
}
}
$tcf[] = array(
"label" => $label,
"parentLabel" => $parentLabel,
"sameParent" => ($parentId == $lastFieldId) ,
"famid" => $oa->docid,
"enumid" => $oa->id
);
$lastFieldId = $parentId;
}
}
$action->lay->set("linkOld", $viewOldInterface == "yes");
$action->lay->set("familyid", $fam->id);
$action->lay->set("NOENUMS", empty($tcf));
$action->lay->setBlockData("ENUMS", $tcf);
}
?> |
html {
-<API key>: none;
}
body {
font: 13px/1.7em 'Open Sans';
background-color: #FFF;
}
p {
margin-bottom: 1.7em;
font: 14px/1.7em 'Open Sans';
}
ul {
margin-bottom: 1.7em;
}
h1, h2, h3,
h4, h5, h6 {
margin-bottom: .85em;
}
h3, h4, h6 {
margin-bottom: 1.15em;
}
input,
button,
select,
textarea {
font-family: 'Open Sans';
}
.navbar {
margin-bottom: 0;
border: none;
border-bottom: 1px solid #666;
}
.navbar-fixed-top {
position: static;
}
.navbar-inner {
padding: 15px 0 12px;
background: #292929 url(../img/header-bg.jpg) repeat 0 0;
filter: none;
border-bottom: 1px solid #111;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar .container {
position: relative;
}
.navbar-small-brand {
display: block;
width: 34px;
height: 34px;
padding-top: 0;
padding-bottom: 0;
margin-top: 2px;
margin-left: 10px;
overflow: hidden;
line-height: 600px;
color: #333;
background: url(../img/logo.png) no-repeat 0 0;
}
.navbar-brand {
display: block;
width: 145px;
height: 34px;
padding-top: 0;
padding-bottom: 0;
margin-top: 2px;
margin-left: 10px;
overflow: hidden;
line-height: 600px;
color: #333;
background: url(../img/logo.png) no-repeat 0 0;
}
.fun-brand {
display: block;
width: 215px;
height: 43px;
padding-top: 0;
padding-bottom: 0;
margin-top: 2px;
margin-left: 10px;
overflow: hidden;
line-height: 600px;
color: #333;
}
.navbar .navbar-brand {
position: relative;
top: 5px;
margin-left: 0;
font-weight: 600;
}
.navbar .nav > li > a {
font-size: 14px;
font-weight: normal;
text-shadow: 1px 1px 2px rgba(0,0,0,.5);
}
.navbar .nav > li > a:hover {
color: #BBB;
}
.navbar .nav > li.active > a,
.navbar .nav > li.active > a:hover {
background: transparent;
color: #81994D;
}
.jumbotron p.text-muted {
font-size: 14px;
}
.nav-tabs {
margin-bottom: 1.7em;
}
.dropdown-menu li label {
color: #777;
padding: 5px 15px 5px 25px;
line-height: 20px;
}
.dropdown-menu li label .fa{
font-size: 17px !important;
}
.navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus {
background-color: inherit;
}
.navbar-inverse .navbar-toggle {
border-color: inherit;
}
.navbar-toggle {
border: none !important;
}
#landing {
height: auto;
border: none;
overflow: hidden;
}
#landing .inner {
color: #FFF;
background: #98B740;
text-shadow: 1px 1px 2px rgba(0,0,0,.4);
}
#landing .container {
padding-top: 30px;
}
#flotTip {
background-color: #222222 !important;
border: 1px solid #000000 !important;
border-radius: 3px 3px 3px 3px !important;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset;
color: #FFFFFF !important;
font-size: 11px !important;
padding: 3px 6px !important;
text-align: center !important;
text-decoration: none !important;
}
.chart-holder {
height: 325px;
width: 100%;
}
.clear {
clear: both;
}
#content {
border: none;
}
#content .inner {
min-height: 400px;
padding-top: 0;
padding-bottom: 2em;
background: #fff;
}
#content .container {
padding-top: 3em;
border-top: 8px solid #81994D;
}
.marketing-header {
text-align: center;
}
/* Center align the text within the three columns below the marketing header */
.marketing .col-md-6 {
margin-bottom: 20px;
text-align: center;
}
.marketing h2 {
font-weight: normal;
}
.marketing .col-md-6 p {
margin-right: 10px;
margin-left: 10px;
}
#extra {
border-top: 1px solid #000;
}
#extra .inner {
color: #fff;
background-color: #222;
border-top: 1px solid #555;
}
.vcard-stat {
float: left;
width: 33.333%;
font-size: 11px;
text-transform: capitalize;
}
.vcard-username {
display: block;
overflow: hidden;
width: 100%;
font-size: 20px;
font-style: normal;
font-weight: 300;
line-height: 24px;
color: #666;
text-overflow: ellipsis;
}
.vcard-fullname {
display: block;
overflow: hidden;
width: 100%;
font-size: 26px;
line-height: 30px;
text-overflow: ellipsis;
}
.vcard-names {
margin-top: 5px;
line-height: 1;
}
.vcard-details {
list-style: none;
padding-top: 15px;
padding-bottom: 15px;
border-top: 1px solid #eee;
}
.vcard-stats {
margin-bottom: 10px;
padding-top: 15px;
padding-bottom: 15px;
text-align: center;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.vcard-stat-count {
display: block;
font-size: 28px;
font-weight: bold;
line-height: 1;
}
/* repo list */
.repolist {
padding-top: 10px;
}
.repolist > li {
position: relative;
min-height: 66px;
padding-left: 45px;
padding-bottom: 20px;
margin: 0 0 20px;
list-style: none;
border-bottom: 1px solid #eee;
}
.repolist .repolist-icon {
float: left;
margin-left: -45px;
text-align: center;
width: 35px;
color: #bbb;
}
/* blankslate state */
.blankslate {
position: relative;
padding: 64px;
margin-bottom: 1.7em;
text-align: center;
background-color: #f3f3f3;
margin-top: 81px;
}
#footer {
border-top: 1px solid #000;
bottom: 0;
}
#footer .inner {
padding: 20px 0;
color: #777;
background-color: #111;
border-top: 1px solid #222;
}
#footer h3 {
font-weight: 400;
}
.footer-links {
width: 49%;
display: inline-block;
margin: 0;
list-style: none;
}
.footer-links li {
margin-bottom: 1.25em;
}
.footer-links a {
color: #777;
}
#subpage {
margin-top: 3em;
margin-bottom: 2.5em;
}
#subheader {
color: #EEE;
background: #444;
border-bottom: 1px solid #222;
}
#subheader .inner {
padding: 20px 0;
}
#subheader h1
, #subheader h2
, #subheader h3
, #subheader h4
, #subheader h5
, #subheader h6 {
margin-bottom: 0;
font-size: 27px;
font-weight: 400;
text-shadow: 1px 1px 2px rgba(0,0,0,.4);
}
.sidebar {
padding: 15px;
background: #EEE;
-moz-border-radius: 5px;
-<API key>: 5px;
border-radius: 5px;
}
.<API key> {
width: 100%;
display: table;
padding: 0;
margin: 2.5em 0 0;
list-style: none;
}
.<API key> li {
width: 33%;
display: table-cell;
text-align: center;
}
.error {
background-color: #CA9194;
background-image: none;
color: #FFFFFF;
}
.margin-signin {
margin-top: 86px;
} |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Rgaa42019 Test.10.04.01 Failed 07_5</title>
</head>
<body>
<div>
<h1>Rgaa42019 Test.10.04.01 Failed 07_5</h1>
<div class="test-detail" lang="fr"> Dans les
<a href="http://references.modernisation.gouv.fr/<API key>#mFeuilleStyle">feuilles de styles</a> du
<a href="http://references.modernisation.gouv.fr/<API key>
<code>pt</code>,
<code>pc</code>,
<code>mm</code>,
<code>cm</code>,
<code>in</code>) ne doivent pas être utilisées pour les types de média
<code>screen</code>,
<code>tv</code>,
<code>handheld</code>,
<code>projection</code>. Cette règle est-elle respectée ?
</div>
<div class="testcase" style="font-size: 15pc;">
Any text here
</div>
<p class="test-explanation"> Failed: The pc unit is used in an inline style. </p>
</div>
</body>
</html> |
DELETE FROM `landblock_instance` WHERE `landblock` = 0xCAB9;
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9000, 9686, 0xCAB90100, 153.594, 61.8864, 150.85, 0.948324, 0, 0, -0.317305, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90100 [153.594000 61.886400 150.850000] 0.948324 0.000000 0.000000 -0.317305 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9001, 9686, 0xCAB90100, 150.394, 61.9364, 150.85, 0.948324, 0, 0, 0.317305, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90100 [150.394000 61.936400 150.850000] 0.948324 0.000000 0.000000 0.317305 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9002, 9686, 0xCAB90103, 161.259, 63.155, 150.85, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [161.259000 63.155000 150.850000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9003, 9686, 0xCAB90103, 155.859, 63.155, 150.85, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [155.859000 63.155000 150.850000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9004, 9686, 0xCAB90103, 154.809, 61.8058, 149.85, 0.707107, 0, 0, 0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [154.809000 61.805800 149.850000] 0.707107 0.000000 0.000000 0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9005, 9686, 0xCAB90103, 158.809, 57.255, 151.5, 0, 0, 0, -1, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [158.809000 57.255000 151.500000] 0.000000 0.000000 0.000000 -1.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9006, 9686, 0xCAB90103, 162.609, 60.405, 152.45, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [162.609000 60.405000 152.450000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9007, 11697, 0xCAB90103, 156.551, 58.2077, 148.1, 0.303202, 0, 0, 0.952926, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90103 [156.551000 58.207700 148.100000] 0.303202 0.000000 0.000000 0.952926 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9008, 11697, 0xCAB90103, 161.546, 62.0672, 148.1, -0.885799, 0, 0, 0.464069, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90103 [161.546000 62.067200 148.100000] -0.885799 0.000000 0.000000 0.464069 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9009, 11698, 0xCAB90103, 158.843, 60.3864, 152.75, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Ceiling Hook */
/* @teleloc 0xCAB90103 [158.843000 60.386400 152.750000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB900A, 11697, 0xCAB90103, 158.927, 60.0764, 148.1, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90103 [158.927000 60.076400 148.100000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB900B, 9686, 0xCAB90105, 155.901, 64.1078, 146.45, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90105 [155.901000 64.107800 146.450000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB900C, 9686, 0xCAB90105, 159.398, 60.8738, 146.45, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90105 [159.398000 60.873800 146.450000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB900D, 9686, 0xCAB90105, 157.144, 57.6238, 146.45, 0, 0, 0, -1, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90105 [157.144000 57.623800 146.450000] 0.000000 0.000000 0.000000 -1.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB900E, 11697, 0xCAB90105, 151.277, 58.8249, 144.1, -0.462522, 0, 0, -0.886608, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90105 [151.277000 58.824900 144.100000] -0.462522 0.000000 0.000000 -0.886608 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB900F, 11697, 0xCAB90105, 158.26, 63.263, 144.1, -0.936672, 0, 0, 0.350208, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90105 [158.260000 63.263000 144.100000] -0.936672 0.000000 0.000000 0.350208 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9010, 9687, 0xCAB90105, 158.894, 58.0864, 144.001, 0.305695, 0, 0, -0.952129, False, '2019-02-10 00:00:00'); /* Storage */
/* @teleloc 0xCAB90105 [158.894000 58.086400 144.001000] 0.305695 0.000000 0.000000 -0.952129 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9011, 412, 0xCAB90033, 152.044, 54.8764, 148.082, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Door */
/* @teleloc 0xCAB90033 [152.044000 54.876400 148.082000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9013, 12455, 0xCAB90100, 152.796, 59.9063, 147.9995, -0.99949, 0, 0, 0.031945, False, '2019-02-10 00:00:00'); /* Cottage */
/* @teleloc 0xCAB90100 [152.796000 59.906300 147.999500] -0.999490 0.000000 0.000000 0.031945 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9014, 12461, 0xCAB90033, 156.274, 55.6837, 148, -0.999992, 0, 0, -0.004036, False, '2019-02-10 00:00:00'); /* Quarrelsum's Cottage */
/* @teleloc 0xCAB90033 [156.274000 55.683700 148.000000] -0.999992 0.000000 0.000000 -0.004036 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9015, 9686, 0xCAB90100, 152.001, 62.4578, 153.1, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90100 [152.001000 62.457800 153.100000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9016, 9686, 0xCAB90100, 154.348, 59.3238, 151.55, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90100 [154.348000 59.323800 151.550000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9017, 9686, 0xCAB90100, 153.594, 56.6364, 150.85, 0.471782, 0, 0, -0.881715, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90100 [153.594000 56.636400 150.850000] 0.471782 0.000000 0.000000 -0.881715 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9018, 9686, 0xCAB90100, 150.244, 56.6364, 150.85, -0.431298, 0, 0, -0.90221, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90100 [150.244000 56.636400 150.850000] -0.431298 0.000000 0.000000 -0.902210 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9019, 9686, 0xCAB90100, 151.994, 55.4238, 151.55, 0, 0, 0, -1, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90100 [151.994000 55.423800 151.550000] 0.000000 0.000000 0.000000 -1.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB901A, 11697, 0xCAB90100, 151.946, 62.1172, 148.1, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90100 [151.946000 62.117200 148.100000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB901B, 11697, 0xCAB90100, 153.846, 61.0672, 148.1, 0.900698, 0, 0, -0.434445, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90100 [153.846000 61.067200 148.100000] 0.900698 0.000000 0.000000 -0.434445 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB901C, 11697, 0xCAB90103, 158.396, 62.5672, 148.1, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90103 [158.396000 62.567200 148.100000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB901D, 9686, 0xCAB90103, 161.358, 57.255, 151.5, 0, 0, 0, -1, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [161.358000 57.255000 151.500000] 0.000000 0.000000 0.000000 -1.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB901E, 9686, 0xCAB90103, 156.015, 57.255, 151.5, 0, 0, 0, -1, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [156.015000 57.255000 151.500000] 0.000000 0.000000 0.000000 -1.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB901F, 9686, 0xCAB90103, 162.609, 62.1201, 151.35, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [162.609000 62.120100 151.350000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9020, 9686, 0xCAB90103, 162.609, 58.1719, 151.35, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [162.609000 58.171900 151.350000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9021, 9686, 0xCAB90103, 158.399, 63.155, 151.55, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [158.399000 63.155000 151.550000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9022, 9686, 0xCAB90103, 154.809, 62.1058, 151.45, 0.707107, 0, 0, 0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [154.809000 62.105800 151.450000] 0.707107 0.000000 0.000000 0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9023, 9686, 0xCAB90103, 154.809, 60.1543, 151.45, 0.707107, 0, 0, 0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [154.809000 60.154300 151.450000] 0.707107 0.000000 0.000000 0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9024, 9686, 0xCAB90103, 154.809, 58.1502, 151.45, 0.707107, 0, 0, 0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90103 [154.809000 58.150200 151.450000] 0.707107 0.000000 0.000000 0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9025, 11698, 0xCAB90103, 160.894, 60.3864, 152.75, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Ceiling Hook */
/* @teleloc 0xCAB90103 [160.894000 60.386400 152.750000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9026, 11698, 0xCAB90103, 156.85, 60.3864, 152.75, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Ceiling Hook */
/* @teleloc 0xCAB90103 [156.850000 60.386400 152.750000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9027, 11697, 0xCAB90103, 157.234, 60.0764, 148.1, 0.707107, 0, 0, 0.707107, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90103 [157.234000 60.076400 148.100000] 0.707107 0.000000 0.000000 0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9028, 11697, 0xCAB90103, 160.534, 60.0764, 148.1, 0.678955, 0, 0, -0.73418, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90103 [160.534000 60.076400 148.100000] 0.678955 0.000000 0.000000 -0.734180 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9029, 11697, 0xCAB90103, 155.801, 62.3577, 148.1, 0.954761, 0, 0, 0.297375, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90103 [155.801000 62.357700 148.100000] 0.954761 0.000000 0.000000 0.297375 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB902A, 11697, 0xCAB90103, 158.646, 57.7672, 148.1, 0, 0, 0, -1, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90103 [158.646000 57.767200 148.100000] 0.000000 0.000000 0.000000 -1.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB902B, 11697, 0xCAB90105, 158.51, 60.313, 144.1, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90105 [158.510000 60.313000 144.100000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB902C, 9686, 0xCAB90105, 152.001, 64.1078, 146.45, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90105 [152.001000 64.107800 146.450000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB902D, 9686, 0xCAB90105, 153.894, 57.6238, 146.45, 0, 0, 0, -1, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90105 [153.894000 57.623800 146.450000] 0.000000 0.000000 0.000000 -1.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB902E, 9686, 0xCAB90105, 149.448, 62.0738, 146.45, 0.707107, 0, 0, 0.707107, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90105 [149.448000 62.073800 146.450000] 0.707107 0.000000 0.000000 0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB902F, 11698, 0xCAB90105, 155.415, 60.2236, 147.5, 0.707107, 0, 0, -0.707107, False, '2019-02-10 00:00:00'); /* Ceiling Hook */
/* @teleloc 0xCAB90105 [155.415000 60.223600 147.500000] 0.707107 0.000000 0.000000 -0.707107 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9030, 11697, 0xCAB90105, 154.81, 63.263, 144.1, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90105 [154.810000 63.263000 144.100000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9031, 11697, 0xCAB90105, 155.427, 58.0749, 144.1, 0, 0, 0, -1, False, '2019-02-10 00:00:00'); /* Floor Hook */
/* @teleloc 0xCAB90105 [155.427000 58.074900 144.100000] 0.000000 0.000000 0.000000 -1.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9032, 9686, 0xCAB90033, 152.001, 54.7078, 151.35, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90033 [152.001000 54.707800 151.350000] 1.000000 0.000000 0.000000 0.000000 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9033, 9686, 0xCAB90033, 149.701, 55.6078, 150.1, 0.911044, 0, 0, -0.41231, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90033 [149.701000 55.607800 150.100000] 0.911044 0.000000 0.000000 -0.412310 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9034, 9686, 0xCAB90033, 154.201, 55.6078, 150.1, 0.887011, 0, 0, 0.461749, False, '2019-02-10 00:00:00'); /* Wall Hook */
/* @teleloc 0xCAB90033 [154.201000 55.607800 150.100000] 0.887011 0.000000 0.000000 0.461749 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9035, 12679, 0xCAB90033, 148.896, 55.3172, 148.1, 0.915311, 0, 0, -0.402747, False, '2019-02-10 00:00:00'); /* Yard Hook */
/* @teleloc 0xCAB90033 [148.896000 55.317200 148.100000] 0.915311 0.000000 0.000000 -0.402747 */
INSERT INTO `landblock_instance` (`guid`, `weenie_Class_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`, `is_Link_Child`, `last_Modified`)
VALUES (0x7CAB9036, 12679, 0xCAB90033, 158.896, 56.2672, 148.1, 1, 0, 0, 0, False, '2019-02-10 00:00:00'); /* Yard Hook */
/* @teleloc 0xCAB90033 [158.896000 56.267200 148.100000] 1.000000 0.000000 0.000000 0.000000 */ |
fast.modules.cli.i18n = fast.modules.cli.i18n || {
en: {
placeholder: "To add an entry just type and hit enter or type / to search"
},
de: {
placeholder: "Um einen Eintrag hinzu zu fügen einfach tippen und mit Enter bestätigen oder / zum Suchen eingeben"
}
}; |
package com.jd.survey.domain.settings;
public enum Month {
JANUARY("JAN"),
FEBRUARY("FEB"),
MARCH("MAR"),
APRIL("APR"),
MAY("MAY"),
JUNE("JUN"),
JULY("JUL"),
AUGUST("AUG"),
SEPTEMBER("SEP"),
OCTOBER("OCT"),
NOVEMBER("NOV"),
DECEMBER("DEC");
private String code;
private Month(String c) {
code =c; ;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
} |
<?php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\<API key>::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Sensio\Bundle\<API key>\<API key>::class => ['all' => true],
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
]; |
# -*- coding: utf8 -*-
# This program is free software: you can redistribute it and/or modify
# published by the Free Software Foundation, either version 3 of the
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
from datetime import datetime
from openerp.tools import <API key>
from openerp.tests import common
class <API key>(common.TransactionCase):
def setUp(self):
super(<API key>, self).setUp()
self.env['product.template'].update_seller_ids()
def <API key>(self):
"""Test PO scheduling when no specific calendar is defined."""
company = self.browse_ref('base.main_company')
proc_env = self.env["procurement.order"]
proc = proc_env.create({
'name': 'Test Purchase Schedule',
'date_planned': '2015-02-02 00:00:00',
'product_id': self.ref('stock_working_days.<API key>'),
'product_qty': 1,
'product_uom': self.ref('product.product_uom_unit'),
'warehouse_id': self.ref('stock.warehouse0'),
'location_id': self.ref('stock_working_days.stock_location_a')
})
# Force company po_lead to 1, just in case
company.po_lead = 1
# Run the proc_in_a procurement
proc.run()
proc.check()
# RFQ has been created
self.assertTrue(proc.purchase_id.id)
# RFQ expected date
rfq = proc.purchase_id
self.assertEquals(len(rfq.order_line), 1)
order_line = rfq.order_line[0]
self.assertEqual(order_line.date_planned[0:10], '2015-01-30')
self.assertEqual(rfq.<API key>[0:10], '2015-01-30')
# RFQ order date
self.assertEqual(rfq.date_order[0:10],'2015-01-21')
def <API key>(self):
"""PO schedule test with fallback on defined company calendar."""
company = self.browse_ref('base.main_company')
company.calendar_id = self.browse_ref('stock_working_days.demo_calendar_1')
proc_env = self.env["procurement.order"]
proc = proc_env.create({
'name': 'Test Purchase Schedule',
'date_planned': '2015-02-02 00:00:00',
'product_id': self.ref('stock_working_days.<API key>'),
'product_qty': 1,
'product_uom': self.ref('product.product_uom_unit'),
'warehouse_id': self.ref('stock.warehouse0'),
'location_id': self.ref('stock_working_days.stock_location_a')
})
# Force company po_lead to 1, just in case
company.po_lead = 1
# Run the proc_in_a procurement
proc.run()
proc.check()
# RFQ has been created
self.assertTrue(proc.purchase_id.id)
# RFQ expected date
rfq = proc.purchase_id
self.assertEquals(len(rfq.order_line), 1)
order_line = rfq.order_line[0]
self.assertEqual(order_line.date_planned[0:10], '2015-01-26')
self.assertEqual(rfq.<API key>[0:10], '2015-01-26')
# RFQ order date => Check we falled back on default calendar and not company calendar
self.assertEqual(rfq.date_order[0:10],'2015-01-15')
def <API key>(self):
"""Schedule test with a defined supplier resource."""
company = self.browse_ref('base.main_company')
proc_env = self.env["procurement.order"]
resource_env = self.env["resource.resource"]
leave_env = self.env["resource.calendar.leaves"]
warehouse_id = self.browse_ref('stock.warehouse0')
supplier_id = self.browse_ref('<API key>.test_supplier')
resource_s = resource_env.create({
'name': "Supplier resource",
'calendar_id': self.ref('stock_working_days.demo_calendar_1')
})
leave_s = leave_env.create({
'name': "Supplier leave",
'resource_id': resource_s.id,
'calendar_id': self.ref('stock_working_days.demo_calendar_1'),
'date_from': "2014-12-15 00:00:00",
'date_to': "2015-01-10 23:00:00",
})
supplier_id.resource_id = resource_s.id
proc = proc_env.create({
'name': 'Test Purchase Schedule',
'date_planned': '2015-02-02 00:00:00',
'product_id': self.ref('stock_working_days.<API key>'),
'product_qty': 1,
'product_uom': self.ref('product.product_uom_unit'),
'warehouse_id': warehouse_id.id,
'location_id': self.ref('stock_working_days.stock_location_a')
})
# Force company po_lead to 1, just in case
company.po_lead = 1
# Run the proc_in_a procurement
proc.run()
proc.check()
# RFQ has been created
self.assertTrue(proc.purchase_id.id)
# RFQ expected date
rfq = proc.purchase_id
self.assertEquals(len(rfq.order_line), 1)
order_line = rfq.order_line[0]
self.assertEqual(order_line.date_planned[0:10], '2015-01-30')
self.assertEqual(rfq.<API key>[0:10], '2015-01-30')
# RFQ order date
self.assertEqual(rfq.date_order[0:10],'2014-12-08')
def <API key>(self):
"""Check correct date_planned in manual purchase_order_line creation."""
# Note: Forward calculation starts from this morning 00:00, so it counts the first day
# No calendar
supplier_info = self.browse_ref("<API key>.<API key>")
date1 = self.env['purchase.order.line']._get_date_planned(supplier_info, "2015-01-21 22:00:00")
self.assertEqual(date1.strftime(<API key>)[0:10], "2015-01-30")
# With default company calendar
company = self.browse_ref('base.main_company')
company.calendar_id = self.browse_ref('stock_working_days.demo_calendar_1')
date2 = self.env['purchase.order.line']._get_date_planned(supplier_info, "2015-01-15 22:00:00")
self.assertEqual(date2.strftime(<API key>)[0:10], "2015-01-26")
# With supplier calendar
resource_env = self.env["resource.resource"]
leave_env = self.env["resource.calendar.leaves"]
supplier_id = self.browse_ref('<API key>.test_supplier')
resource_s = resource_env.create({
'name': "Supplier resource",
'calendar_id': self.ref('stock_working_days.demo_calendar_1')
})
leave_s = leave_env.create({
'name': "Supplier leave",
'resource_id': resource_s.id,
'calendar_id': self.ref('stock_working_days.demo_calendar_1'),
'date_from': "2014-12-15",
'date_to': "2015-01-10",
})
supplier_id.resource_id = resource_s.id
date3 = self.env['purchase.order.line']._get_date_planned(supplier_info, "2014-12-08 12:00:00")
self.assertEqual(date3.strftime(<API key>)[0:10], "2015-02-02") |
# Releasing children from poverty in Jesus' name
# The licence is in the file __manifest__.py
import math
from datetime import datetime, timedelta
from odoo import api, models, fields, exceptions, _
from odoo.exceptions import ValidationError
class EventCompassion(models.Model):
"""A Compassion event. """
_name = "crm.event.compassion"
_description = "Compassion event"
_order = "start_date desc"
_inherit = ["mail.thread", "mail.activity.mixin"]
# FIELDS #
name = fields.Char(size=128, required=True, track_visibility="onchange")
full_name = fields.Char(compute="_compute_full_name")
type = fields.Selection(
[
("stand", _("Stand")),
("concert", _("Concert")),
("presentation", _("Presentation")),
("meeting", _("Meeting")),
("sport", _("Sport event")),
("tour", _("Sponsor tour")),
],
required=True,
track_visibility="onchange",
)
start_date = fields.Datetime(required=True)
year = fields.Char(compute="_compute_year", store=True)
end_date = fields.Datetime(required=True)
partner_id = fields.Many2one(
"res.partner", "Customer", track_visibility="onchange", readonly=False
)
zip_id = fields.Many2one("res.city.zip", "Address", readonly=False)
street = fields.Char(size=128)
street2 = fields.Char(size=128)
city = fields.Char(size=128)
state_id = fields.Many2one("res.country.state", "State", readonly=False)
zip = fields.Char(size=24)
country_id = fields.Many2one("res.country", "Country", readonly=False)
user_id = fields.Many2one(
"res.users", "Ambassador", track_visibility="onchange", readonly=False
)
hold_ids = fields.One2many("compassion.hold", "event_id", readonly=True)
allocate_child_ids = fields.One2many(
"compassion.child",
compute="<API key>",
string="Allocated children",
readonly=False,
)
effective_allocated = fields.Integer(compute="<API key>")
staff_ids = fields.Many2many(
"res.partner",
"<API key>",
"event_id",
"partner_id",
"Staff",
track_visibility="onchange",
readonly=False,
)
user_ids = fields.Many2many(
"res.users",
compute="_compute_users",
track_visibility="onchange",
readonly=False,
)
description = fields.Text()
analytic_id = fields.Many2one(
"account.analytic.account", "Analytic Account",
copy=False, readonly=False
)
origin_id = fields.Many2one(
"recurring.contract.origin", "Origin", copy=False, readonly=False
)
contract_ids = fields.One2many(
"recurring.contract", related="origin_id.contract_ids", readonly=True
)
expense_line_ids = fields.One2many(
"account.analytic.line",
compute="<API key>",
string="Expenses",
readonly=False,
)
invoice_line_ids = fields.One2many(
"account.invoice.line", "event_id", readonly=True
)
income_line_ids = fields.One2many(
"account.invoice.line",
compute="<API key>",
string="Income",
readonly=False,
)
total_expense = fields.Float(
compute="_compute_expense", readonly=True, store=True)
total_income = fields.Float(
compute="_compute_income", readonly=True, store=True)
balance = fields.Float(
compute="_compute_balance", readonly=True, store=True)
<API key> = fields.Integer(
"Number of children to allocate",
track_visibility="onchange",
required=True,
default=0,
)
<API key> = fields.Integer(
"Expected sponsorships", track_visibility="onchange",
required=True, default=0
)
lead_id = fields.Many2one(
"crm.lead", "Opportunity", track_visibility="onchange", readonly=False
)
won_sponsorships = fields.Integer(
related="origin_id.won_sponsorships", store=True)
conversion_rate = fields.Float(
related="origin_id.conversion_rate", store=True)
calendar_event_id = fields.Many2one("calendar.event", readonly=False)
hold_start_date = fields.Date(required=True)
hold_end_date = fields.Date()
campaign_id = fields.Many2one("utm.campaign", "Campaign", readonly=False)
# Multi-company
company_id = fields.Many2one(
"res.company",
"Company",
required=True,
index=True,
default=lambda self: self.env.user.company_id.id,
readonly=False,
)
# FIELDS METHODS #
@api.multi
def <API key>(self):
for event in self:
event.expense_line_ids = event.analytic_id.line_ids.filtered(
lambda l: l.amount < 0.0
)
@api.multi
def <API key>(self):
for event in self:
event.income_line_ids = event.invoice_line_ids.filtered(
lambda l: l.state == "paid"
and not l.contract_id
and l.invoice_id.type == "out_invoice"
)
@api.multi
@api.depends("analytic_id.line_ids")
def _compute_expense(self):
for event in self:
expenses = event.expense_line_ids.filtered(lambda l: l.amount < 0)
event.total_expense = abs(sum(expenses.mapped("amount") or [0]))
@api.multi
@api.depends("invoice_line_ids.state")
def _compute_income(self):
for event in self:
incomes = event.income_line_ids
event.total_income = sum(incomes.mapped("price_subtotal") or [0])
@api.multi
@api.depends("total_income", "total_expense")
def _compute_balance(self):
for event in self:
if event.total_expense and event.total_income:
event.balance = event.total_income / float(event.total_expense)
else:
event.balance = 0.0
@api.multi
@api.depends("start_date")
def _compute_year(self):
for event in self.filtered("start_date"):
event.year = str(event.start_date.year)
@api.multi
def _compute_full_name(self):
for event in self:
event.full_name = \
event.type.title() + " " + event.name + " " + event.year
@api.multi
@api.depends("hold_ids")
def <API key>(self):
for event in self:
children = event.hold_ids.mapped("child_id")
event.allocate_child_ids = children
nb_child = 0
for child in children:
if child.state in ("N", "I"):
nb_child += 1
event.effective_allocated = nb_child
@api.constrains("hold_start_date", "start_date")
def <API key>(self):
for event in self:
if event.hold_start_date > event.start_date.date():
raise ValidationError(
_("The hold start date must "
"be before the event starting date !")
)
def <API key>(self, start=None):
delta = self.env["res.config.settings"].sudo().get_param(
"<API key>")
return (start if start else self.start_date.date()) - \
timedelta(days=delta)
@api.multi
@api.depends("staff_ids")
def _compute_users(self):
for event in self:
event.user_ids = event.staff_ids.mapped("user_ids").filtered(
lambda u: not u.share
)
# ORM METHODS #
@api.model
def create(self, vals):
""" When an event is created:
- Format the name to remove year of it,
- Create an analytic_account,
- Create an origin for sponsorships.
"""
# Avoid putting twice the date in linked objects name
event_year = str(datetime.today().year)
if vals.get("start_date") and isinstance(vals["start_date"], str):
event_year = str(fields.Date.from_string(vals["start_date"]).year)
event_name = vals.get("name", "0000")
if event_name[-4:] == event_year:
vals["name"] = event_name[:-4]
elif event_name[-2:] == event_year[-2:]:
vals["name"] = event_name[:-2]
# Compute hold_start_date from vals if it hasn't been set
if not vals.get("hold_start_date"):
hold_start_date = \
self.<API key>(start=vals["start_date"])
vals["hold_start_date"] = hold_start_date
event = super().create(vals)
# Analytic account and Origin linked to this event
analytic_id = (
self.env["account.analytic.account"].create(
event._get_analytic_vals()).id
)
origin_id = (
self.env["recurring.contract.origin"]
.create(event._get_origin_vals(analytic_id))
.id
)
event.with_context(no_sync=True).write(
{"origin_id": origin_id, "analytic_id": analytic_id, }
)
# Workaround, default_start_date must be removed from context,
# details in commit
context = dict(self._context)
context.pop("default_start_date", None)
calendar_obj = self.env["calendar.event"].with_context({}, context)
# Add calendar event
calendar_event = calendar_obj.create(event._get_calendar_vals())
event.with_context(no_calendar=True).calendar_event_id = calendar_event
return event
@api.multi
def write(self, vals):
""" Push values to linked objects. """
super().write(vals)
if not self.env.context.get("no_sync"):
for event in self:
# Update Analytic Account and Origin
event.analytic_id.write(event._get_analytic_vals())
if "user_id" in vals and event.origin_id:
event.origin_id.partner_id = event.user_id.partner_id
if "name" in vals:
# Only administrator has write access to origins.
self.env["recurring.contract.origin"].sudo().browse(
event.origin_id.id
).write({"name": event.full_name})
if not self.env.context.get("no_calendar"):
event.calendar_event_id.write(event._get_calendar_vals())
return True
@api.multi
def copy(self, default=None):
this_year = str(datetime.now().year)
if self.year == this_year:
if default is None:
default = {}
default["name"] = self.name + " (copy)"
return super().copy(default)
@api.multi
def unlink(self):
"""Check that the event is not linked with expenses or won
sponsorships."""
for event in self:
if event.contract_ids or event.balance:
raise exceptions.UserError(
_(
"The event is linked to expenses or sponsorships. "
"You cannot delete it."
)
)
else:
if event.analytic_id:
event.analytic_id.unlink()
event.origin_id.unlink()
event.calendar_event_id.unlink()
return super().unlink()
# PUBLIC METHODS #
@api.model
def <API key>(self):
"""Put calendar event for old events missing it."""
events = self.with_context(no_calendar=True).search([])
calendar_obj = self.env["calendar.event"]
for event in events:
calendar_vals = event._get_calendar_vals()
if event.calendar_event_id:
event.calendar_event_id.write(calendar_vals)
else:
calendar_event = calendar_obj.create(calendar_vals)
event.calendar_event_id = calendar_event
return True
@api.multi
def <API key>(self):
for event in self:
event.origin_id.<API key>()
# VIEW CALLBACKS #
@api.multi
def show_sponsorships(self):
self.ensure_one()
return {
"name": _("Sponsorships"),
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"view_type": "form",
"res_model": "recurring.contract",
"src_model": "crm.event.compassion",
"context": self.with_context(
default_type="S", group_by=False).env.context,
"domain": [("id", "in", self.origin_id.contract_ids.ids)],
}
@api.multi
def show_expenses(self):
self.ensure_one()
return {
"name": _("Expenses"),
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"view_type": "form",
"res_model": "account.analytic.line",
"src_model": "crm.event.compassion",
"context": self.with_context(
group_by="general_account_id").env.context,
"domain": [("id", "in", self.expense_line_ids.ids)],
}
@api.multi
def show_income(self):
return {
"name": _("Income"),
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"view_type": "form",
"res_model": "account.invoice.line",
"src_model": "crm.event.compassion",
"context": self.env.context,
"domain": [("id", "in", self.income_line_ids.ids)],
}
@api.multi
def show_children(self):
return {
"name": _("Allocated Children"),
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"view_type": "form",
"res_model": "compassion.child",
"src_model": "crm.event.compassion",
"context": self.with_context(
<API key>=1).env.context,
"domain": [("id", "in", self.allocate_child_ids.ids)],
}
@api.onchange("type")
def onchange_type(self):
""" Update analytic account """
for event in self.filtered("type"):
tag_ids = (
self.env["account.analytic.tag"]
.search([("name", "ilike", event.type)])
.ids
)
event.analytic_id.write({"account_tag_ids": [(6, 0, tag_ids)]})
@api.onchange("start_date")
@api.multi
def onchange_start_date(self):
"""
Update end_date and hold_start_date as soon as start_date is changed
"""
for event in self.filtered("start_date"):
event.hold_start_date = event.<API key>()
if not event.end_date or event.end_date < event.start_date:
event.end_date = event.start_date
@api.onchange("end_date")
@api.multi
def onchange_end_date(self):
days_after = self.env["res.config.settings"].get_param(
"<API key>")
for event in self.filtered("end_date"):
event.hold_end_date = \
(event.end_date + timedelta(days=days_after)).date()
# PRIVATE METHODS #
def _get_analytic_vals(self):
name = self.name
tag_ids = (
self.env["account.analytic.tag"].search(
[("name", "ilike", self.type)]).ids
)
if self.city:
name += " " + self.city
return {
"name": name,
"year": self.year,
"tag_ids": [(6, 0, tag_ids)],
"partner_id": self.user_id.partner_id.id,
"event_id": self.id,
}
def _get_origin_vals(self, analytic_id):
return {
"type": "event",
"event_id": self.id,
"analytic_id": analytic_id,
"partner_id": self.user_id.partner_id.id,
}
def _get_calendar_vals(self):
"""
Gets the calendar event values given the event
:return: dictionary of calendar.event values
"""
self.ensure_one()
time_delta = self.end_date - self.start_date
duration_in_hours = math.ceil(
time_delta.days * 24 + time_delta.seconds / 3600.0
)
calendar_vals = {
"name": self.name,
"compassion_event_id": self.id,
"categ_ids":
[(6, 0, [self.env.ref("crm_compassion.calendar_event").id])],
"duration": max(duration_in_hours, 3),
"description": self.description,
"location": self.city,
"user_id": self.user_id.id,
"partner_ids": [
(6, 0, (self.staff_ids |
# self.partner_id | has been commented to avoid
# partner to get notified with meeting invites
self.user_id.partner_id).ids)],
"start": self.start_date,
"stop": self.end_date or self.start_date,
"allday": self.end_date and
self.start_date.date() != self.end_date.date(),
"state": "open", # to block that meeting date in the calendar
}
return calendar_vals
@api.multi
def allocate_children(self):
no_money_yield = float(self.<API key>)
yield_rate = \
float(self.<API key> - self.<API key>)
if self.<API key> > 1:
no_money_yield /= self.<API key>
yield_rate /= self.<API key>
expiration_date = self.end_date + timedelta(
days=self.env["res.config.settings"].get_param(
"<API key>")
)
return {
"name": _("Global Childpool"),
"type": "ir.actions.act_window",
"view_type": "form",
"view_mode": "form",
"res_model": "compassion.childpool.search",
"target": "current",
"context": self.with_context(
{
"default_take": self.<API key>,
"default_event_id": self.id,
"default_channel": "event",
"default_ambassador": self.user_id.partner_id.id,
"default_source_code": self.name,
"<API key>": no_money_yield * 100,
"default_yield_rate": yield_rate * 100,
"<API key>": expiration_date,
"default_campaign_id": self.campaign_id.id,
}
).env.context,
}
# SUBSCRIPTION METHODS TO SUBSCRIBE STAFF ONLY #
@api.multi
def <API key>(self, updated_fields, values=None):
"""
Subscribe from user_ids field which is a computed field.
"""
if "staff_ids" in updated_fields and values:
updated_fields = ["user_ids"]
for event in self:
users = event.user_ids
# Subscribe each staff individually
ambassador = event.user_id
for user in users:
# Hack to address the mail to the correct user, change
# user_id field(bypass ORM to avoid tracking field change)
self.env.cr.execute(
"UPDATE <API key> "
f"SET user_id = {user.id} WHERE id = {event.id}"
)
values = {"user_ids": user.id}
super(EventCompassion, event).<API key>(
updated_fields, values
)
# Restore ambassador
user_id = "NULL"
if ambassador.id:
user_id = ambassador.id
self.env.cr.execute(
"UPDATE <API key> "
f"SET user_id = {user_id} WHERE id = {event.id}"
)
return True
@api.model
def <API key>(
self, updated_fields, auto_follow_fields=None
):
""" Add user_ids field to followers """
auto_follow_fields = ["user_ids"]
if "staff_ids" in updated_fields:
updated_fields.append("user_ids")
return super().<API key>(
updated_fields, auto_follow_fields
) |
from odoo import api, fields, models
class IrMailServer(models.Model):
_inherit = "ir.mail_server"
smtp_from = fields.Char(
string="Email From", help="Set this in order to email from a specific address."
)
@api.model
def send_email(
self, message, mail_server_id=None, smtp_server=None, *args, **kwargs
):
# Replicate logic from core to get mail server
mail_server = None
if mail_server_id:
mail_server = self.sudo().browse(mail_server_id)
elif not smtp_server:
mail_server = self.sudo().search([], order="sequence", limit=1)
if mail_server and mail_server.smtp_from:
split_from = message["From"].rsplit(" <", 1)
if len(split_from) > 1:
email_from = "{} <{}>".format(split_from[0], mail_server.smtp_from)
else:
email_from = mail_server.smtp_from
message.replace_header("From", email_from)
bounce_alias = (
self.env["ir.config_parameter"].sudo().get_param("mail.bounce.alias")
)
if not bounce_alias:
# then, bounce handling is disabled and we want
# Return-Path = From
if "Return-Path" in message:
message.replace_header("Return-Path", email_from)
else:
message.add_header("Return-Path", email_from)
return super(IrMailServer, self).send_email(
message, mail_server_id, smtp_server, *args, **kwargs
) |
#include "dash.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "sha3/sph_blake.h"
#include "sha3/sph_bmw.h"
#include "sha3/sph_groestl.h"
#include "sha3/sph_jh.h"
#include "sha3/sph_keccak.h"
#include "sha3/sph_skein.h"
#include "sha3/sph_luffa.h"
#include "sha3/sph_cubehash.h"
#include "sha3/sph_shavite.h"
#include "sha3/sph_simd.h"
#include "sha3/sph_echo.h"
void dash_hash(const char* input, char* output)
{
<API key> ctx_blake;
sph_bmw512_context ctx_bmw;
<API key> ctx_groestl;
<API key> ctx_skein;
sph_jh512_context ctx_jh;
<API key> ctx_keccak;
<API key> ctx_luffa1;
<API key> ctx_cubehash1;
<API key> ctx_shavite1;
sph_simd512_context ctx_simd1;
sph_echo512_context ctx_echo1;
//these uint512 in the c++ source of the client are backed by an array of uint32
uint32_t hashA[16], hashB[16];
sph_blake512_init(&ctx_blake);
sph_blake512 (&ctx_blake, input, 80);
sph_blake512_close (&ctx_blake, hashA);
sph_bmw512_init(&ctx_bmw);
sph_bmw512 (&ctx_bmw, hashA, 64);
sph_bmw512_close(&ctx_bmw, hashB);
sph_groestl512_init(&ctx_groestl);
sph_groestl512 (&ctx_groestl, hashB, 64);
<API key>(&ctx_groestl, hashA);
sph_skein512_init(&ctx_skein);
sph_skein512 (&ctx_skein, hashA, 64);
sph_skein512_close (&ctx_skein, hashB);
sph_jh512_init(&ctx_jh);
sph_jh512 (&ctx_jh, hashB, 64);
sph_jh512_close(&ctx_jh, hashA);
sph_keccak512_init(&ctx_keccak);
sph_keccak512 (&ctx_keccak, hashA, 64);
sph_keccak512_close(&ctx_keccak, hashB);
sph_luffa512_init (&ctx_luffa1);
sph_luffa512 (&ctx_luffa1, hashB, 64);
sph_luffa512_close (&ctx_luffa1, hashA);
<API key> (&ctx_cubehash1);
sph_cubehash512 (&ctx_cubehash1, hashA, 64);
<API key>(&ctx_cubehash1, hashB);
sph_shavite512_init (&ctx_shavite1);
sph_shavite512 (&ctx_shavite1, hashB, 64);
<API key>(&ctx_shavite1, hashA);
sph_simd512_init (&ctx_simd1);
sph_simd512 (&ctx_simd1, hashA, 64);
sph_simd512_close(&ctx_simd1, hashB);
sph_echo512_init (&ctx_echo1);
sph_echo512 (&ctx_echo1, hashB, 64);
sph_echo512_close(&ctx_echo1, hashA);
memcpy(output, hashA, 32);
} |
class AssignInboxToSample < ActiveRecord::Migration[5.2]
def change
channel = Channel.find_by(subject: Channel::<API key>)
if (channel.nil?)
attributes = {
subject: Channel::<API key>,
channel_type: 8,
msg_template: {"data": "This file [%{filename}] has been moved to the sample[%{info}] successfully."}
}
Channel.create(attributes)
end
end
end |
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
$mod_strings = array (
'LBL_MODULE_NAME' => 'Tasks',
'LBL_TASK' => 'Tasks: ',
'LBL_MODULE_TITLE' => ' Tasks: Home',
'<API key>' => ' Task Search',
'LBL_LIST_FORM_TITLE' => ' Task List',
'LBL_NEW_FORM_TITLE' => ' Create Task',
'<API key>' => 'Subject:',
'<API key>' => 'Due Date:',
'<API key>' => 'Due Time:',
'LBL_NEW_TIME_FORMAT' => '(24:00)',
'LBL_LIST_CLOSE' => 'Close',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_CONTACT' => 'Contact',
'LBL_LIST_PRIORITY' => 'Priority',
'LBL_LIST_RELATED_TO' => 'Related to',
'LBL_LIST_DUE_DATE' => 'Due Date',
'LBL_LIST_DUE_TIME' => 'Due Time',
'LBL_SUBJECT' => 'Subject:',
'LBL_STATUS' => 'Status:',
'LBL_DUE_DATE' => 'Due Date:',
'LBL_DUE_TIME' => 'Due Time:',
'LBL_PRIORITY' => 'Priority:',
'LBL_COLON' => ':',
'<API key>' => 'Due Date & Time:',
'<API key>' => 'Start Date & Time:',
'LBL_START_DATE' => 'Start Date:',
'LBL_LIST_START_DATE' => 'Start Date',
'LBL_START_TIME' => 'Start Time:',
'LBL_LIST_START_TIME' => 'Start Time',
'DATE_FORMAT' => '(yyyy-mm-dd)',
'LBL_NONE' => 'None',
'LBL_CONTACT' => 'Contact:',
'LBL_EMAIL_ADDRESS' => 'Email Address:',
'LBL_PHONE' => 'Phone:',
'LBL_EMAIL' => 'Email Address:',
'<API key>' => 'Description Information',
'LBL_DESCRIPTION' => 'Description:',
'LBL_NAME' => 'Name:',
'LBL_CONTACT_NAME' => 'Contact Name ',
'LBL_LIST_COMPLETE' => 'Complete:',
'LBL_LIST_STATUS' => 'Status',
'LBL_DATE_DUE_FLAG' => 'No Due Date',
'LBL_DATE_START_FLAG' => 'No Start Date',
'ERR_DELETE_RECORD' => 'You must specify a record number to delete the contact.',
'ERR_INVALID_HOUR' => 'Please enter an hour between 0 and 24',
'<API key>' => 'Medium',
'LBL_LIST_MY_TASKS' => 'My Open Tasks',
'LNK_NEW_TASK' => 'Create Task',
'LNK_TASK_LIST' => 'View Tasks',
'LNK_IMPORT_TASKS' => 'Import Tasks',
'<API key>'=>'Contact First Name',
'<API key>'=>'Contact Last Name',
'<API key>' => 'Assigned User',
'<API key>'=>'Assigned to:',
'<API key>' => 'Date Modified',
'LBL_CONTACT_ID' => 'Contact ID:',
'LBL_PARENT_ID' => 'Parent ID:',
'LBL_CONTACT_PHONE' => 'Contact Phone:',
'LBL_PARENT_NAME' => 'Parent Type:',
'<API key>' => 'Activities Report',
'<API key>' => 'Task Overview',
);
?> |
#ifndef HQLATTR_HPP
#define HQLATTR_HPP
#include "hqlexpr.hpp"
#define MAX_MAXLENGTH (INFINITE_LENGTH-1)
extern HQL_API IHqlExpression * queryProperty(ITypeInfo * type, _ATOM search);
extern HQL_API IHqlExpression * queryPropertyChild(ITypeInfo * type, _ATOM search, unsigned idx);
extern HQL_API void cloneFieldModifier(Owned<ITypeInfo> & type, ITypeInfo * donorType, _ATOM attr);
extern HQL_API ITypeInfo * <API key>(ITypeInfo * donor, ITypeInfo * rawtype);
extern HQL_API ITypeInfo * removeProperty(ITypeInfo * type, _ATOM search);
extern HQL_API size32_t getMinRecordSize(IHqlExpression * record);
extern HQL_API size32_t <API key>(IHqlExpression * record);
extern HQL_API unsigned getMaxRecordSize(IHqlExpression * record, unsigned <API key>, bool & hasKnownSize, bool & usedDefault);
extern HQL_API unsigned getMaxRecordSize(IHqlExpression * record, unsigned <API key>);
extern HQL_API bool <API key>(IHqlExpression * record); // wrapper around above.
extern HQL_API bool <API key>(IHqlExpression * record, size32_t & specifiedSize, size32_t & derivedSize);
extern HQL_API bool <API key>(IHqlExpression * record);
extern HQL_API bool reducesRowSize(IHqlExpression * expr);
extern HQL_API bool increasesRowSize(IHqlExpression * expr);
extern HQL_API bool <API key>(IHqlExpression * record);
inline bool isFixedSizeRecord(IHqlExpression * record) { return !<API key>(record); }
extern HQL_API bool <API key>(IHqlExpression * expr);
extern HQL_API bool <API key>(IHqlExpression * expr);
extern HQL_API IHqlExpression * getSerializedForm(IHqlExpression * expr);
extern HQL_API ITypeInfo * getSerializedForm(ITypeInfo * type);
extern HQL_API IHqlExpression * getPackedRecord(IHqlExpression * expr);
extern HQL_API IHqlExpression * getUnadornedExpr(IHqlExpression * expr);
extern HQL_API IHqlExpression * queryUID(IHqlExpression * expr);
extern HQL_API IHqlExpression * querySelf(IHqlExpression * record);
extern HQL_API IHqlExpression * queryNewSelector(node_operator op, IHqlExpression * datasetOrRow);
extern HQL_API IHqlExpression * <API key>(IHqlExpression * expr);
extern HQL_API ITypeInfo * <API key>(ITypeInfo * ownedType, IHqlExpression * donor);
extern HQL_API bool <API key>(HqlExprArray & args, ITypeInfo * donor);
extern HQL_API IHqlExpression * <API key>(IHqlExpression * ownedField, ITypeInfo * donor);
extern unsigned <API key>(node_operator op);
extern HQL_API bool isLinkedRowset(ITypeInfo * t);
extern HQL_API bool isArrayRowset(ITypeInfo * t);
extern HQL_API bool hasLinkedRow(ITypeInfo * t);
inline bool <API key>(ITypeInfo * t) { return queryProperty(t, _linkCounted_Atom) != NULL; }
inline bool hasOutOfLineRows(ITypeInfo * type) { return (<API key>(type) || <API key>(type)); }
inline bool <API key>(IHqlExpression * expr) { return <API key>(expr->queryType()); }
inline bool hasStreamedModifier(ITypeInfo * t) { return queryProperty(t, streamedAtom) != NULL; }
extern HQL_API ITypeInfo * setLinkCountedAttr(ITypeInfo * _type, bool setValue);
extern HQL_API ITypeInfo * setStreamedAttr(ITypeInfo * _type, bool setValue);
extern HQL_API bool isSmallGrouping(IHqlExpression * sortlist);
extern HQL_API void getRecordCountText(StringBuffer & result, IHqlExpression * expr);
extern HQL_API IHqlExpression * <API key>(IHqlExpression * expr);
extern HQL_API IHqlExpression * getRecordCountInfo(IHqlExpression * expr);
extern HQL_API bool hasNoMoreRowsThan(IHqlExpression * expr, __int64 limit);
extern HQL_API bool <API key>(IHqlExpression * expr);
#endif |
-- brittany { <API key>: { tag: <API key> }, <API key>: IndentPolicyLeft }
func :: (((((((((())))))))))
-- current output is.. funny. wonder if that can/needs to be improved.. |
#ifndef SCALAR_H_
#define SCALAR_H_ (1)
#include <cmath>
// Scalar: Our basic numerical type. double for now;
typedef double Scalar;
#define SCALAR_SQRT(s) std::sqrt(s)
#define SCALAR_ABS(s) std::abs(s)
#define SCALAR_ACOS(s) std::acos(s)
#define SCALAR_SIN(s) std::sin(s)
#define SCALAR_COS(s) std::cos(s)
// See float.h for details on these
#define SCALAR_EPSILON DBL_EPSILON
#define SCALAR_MAX std::numeric_limits<double>::max()
#define SCALAR_MIN -SCALAR_MAX
namespace libthing {
/** (t)olerance (equals)
* @returns true if two Scalar values are approximately the same using tolerance
*/
bool tequals(Scalar const& a, Scalar const& b, Scalar const& tol);
/** (t)olerance (lower)
* @returns true if a is less than b using tolerance
*/
bool tlower(Scalar const& a, Scalar const& b, Scalar const& tol);
}
typdef to indicate index behavior/use of unsigned int
typedef unsigned int index_t;
#endif /*SCALAR_H_ */ |
using System;
using System.Windows.Forms;
namespace HybrasylEditor.UI
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void newItem_Click(object sender, EventArgs e)
{
var form = new NewItemForm();
form.MdiParent = this;
form.Show();
}
private void newMap_Click(object sender, EventArgs e)
{
if (!<API key>())
return;
var form = new NewMapForm();
form.MdiParent = this;
form.Show();
}
private void newMonster_Click(object sender, EventArgs e)
{
}
private void newNpc_Click(object sender, EventArgs e)
{
}
private void newSkillSpell_Click(object sender, EventArgs e)
{
var form = new SkillForm();
form.MdiParent = this;
form.Show();
}
private void openItem_Click(object sender, EventArgs e)
{
}
private void openMap_Click(object sender, EventArgs e)
{
if (!<API key>())
return;
var form = new OpenMapForm();
form.MdiParent = this;
form.Show();
}
private void openMonster_Click(object sender, EventArgs e)
{
}
private void openNpc_Click(object sender, EventArgs e)
{
}
private void <API key>(object sender, EventArgs e)
{
}
private void <API key>(object sender, EventArgs e)
{
Application.Exit();
}
private void <API key>(object sender, EventArgs e)
{
}
private void <API key>(object sender, EventArgs e)
{
var dialog = new SkillIconForm(0, "skill");
dialog.ShowDialog();
int icon = dialog.SelectedIcon;
}
private void <API key>(object sender, EventArgs e)
{
var dialog = new SkillIconForm(0, "spell");
dialog.ShowDialog();
int icon = dialog.SelectedIcon;
}
private bool <API key>()
{
// returns true/false to indicate if required options exist
if (string.IsNullOrEmpty(Configuration.Current.<API key>) ||
!System.IO.Directory.Exists(Configuration.Current.<API key>))
{
MessageBox.Show("Please select your Darkages Install Directory in: Tools > Options");
return false;
}
if (string.IsNullOrEmpty(Configuration.Current.<API key>) ||
!System.IO.Directory.Exists(Configuration.Current.<API key>))
{
MessageBox.Show("Please select your Hybrasyl World Directory in: Tools > Options");
return false;
}
return true;
}
private void <API key>(object sender, EventArgs e)
{
var dialog = new OptionsForm() { Configuration = Configuration.Current };
dialog.ShowDialog(this);
}
}
} |
layout: blog
title: Blog
permalink: /blog/
layoutCls: x-wide
{% for post in site.posts %}
{% include post-excerpt.html %}
{% endfor %} |
package gplx.xowa.xtns.dynamicPageList; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
class Dpl_itm_keys {
public static byte Parse(byte[] src, int bgn, int end, byte or) {
Object o = keys.Get_by_mid(src, bgn, end);
return o == null ? or : ((Byte_obj_val)o).Val();
}
public static byte Parse(byte[] bry, byte or) {
Object o = keys.Get_by_bry(bry);
return o == null ? or : ((Byte_obj_val)o).Val();
}
public static boolean Parse_as_bool(byte[] bry, boolean or) {
byte key = Dpl_itm_keys.Parse(bry, Key_null);
switch (key) {
case Dpl_itm_keys.Key_false: return false;
case Dpl_itm_keys.Key_true: return true;
case Dpl_itm_keys.Key_null: return or;
default: throw Err_mgr._.unhandled_(String_.new_utf8_(bry)); // shouldn't happen; should always go to or;
}
}
public static final byte
Key_null = Byte_.MaxValue_127
, Key_category = 1
, Key_notcategory = 2
, Key_ns = 3
, Key_count = 4
, Key_offset = 5
, Key_imagewidth = 6
, Key_imageheight = 7
, Key_imagesperow = 8
, Key_mode = 9
, Key_gallery = 10
, Key_none = 11
, Key_ordered = 12
, Key_unordered = 13
, Key_inline = 14
, Key_gallerycaption = 15
, <API key> = 16
, <API key> = 17
, Key_order = 18
, Key_ordermethod = 19
, Key_lastedit = 20
, Key_length = 21
, Key_created = 22
, Key_sortkey = 23
, Key_categorysortkey = 24
, Key_popularity = 25
, Key_categoryadd = 26
, Key_redirects = 27
, Key_include = 28
, Key_only = 29
, Key_exclude = 30
, Key_stablepages = 31
, Key_qualitypages = 32
, Key_suppresserrors = 33
, <API key> = 34
, Key_shownamespace = 35
, Key_googlehack = 36
, Key_nofollow = 37
, Key_descending = 38
, Key_ascending = 39
, Key_false = 40
, Key_true = 41
;
private static final Hash_adp_bry keys = Hash_adp_bry.ci_()
.Add_str_byte("category", Dpl_itm_keys.Key_category)
.Add_str_byte("notcategory", Dpl_itm_keys.Key_notcategory)
.Add_str_byte("namespace", Dpl_itm_keys.Key_ns)
.Add_str_byte("count", Dpl_itm_keys.Key_count)
.Add_str_byte("offset", Dpl_itm_keys.Key_offset)
.Add_str_byte("imagewidth", Dpl_itm_keys.Key_imagewidth)
.Add_str_byte("imageheight", Dpl_itm_keys.Key_imageheight)
.Add_str_byte("imagesperow", Dpl_itm_keys.Key_imagesperow)
.Add_str_byte("mode", Dpl_itm_keys.Key_mode)
.Add_str_byte("gallery", Dpl_itm_keys.Key_gallery)
.Add_str_byte("none", Dpl_itm_keys.Key_none)
.Add_str_byte("ordered", Dpl_itm_keys.Key_ordered)
.Add_str_byte("unordered", Dpl_itm_keys.Key_unordered)
.Add_str_byte("inline", Dpl_itm_keys.Key_inline)
.Add_str_byte("gallerycaption", Dpl_itm_keys.Key_gallerycaption)
.Add_str_byte("galleryshowfilesize", Dpl_itm_keys.<API key>)
.Add_str_byte("galleryshowfilename", Dpl_itm_keys.<API key>)
.Add_str_byte("order", Dpl_itm_keys.Key_order)
.Add_str_byte("ordermethod", Dpl_itm_keys.Key_ordermethod)
.Add_str_byte("lastedit", Dpl_itm_keys.Key_lastedit)
.Add_str_byte("length", Dpl_itm_keys.Key_length)
.Add_str_byte("created", Dpl_itm_keys.Key_created)
.Add_str_byte("sortkey", Dpl_itm_keys.Key_sortkey)
.Add_str_byte("categorysortkey", Dpl_itm_keys.Key_categorysortkey)
.Add_str_byte("popularity", Dpl_itm_keys.Key_popularity)
.Add_str_byte("categoryadd", Dpl_itm_keys.Key_categoryadd)
.Add_str_byte("redirects", Dpl_itm_keys.Key_redirects)
.Add_str_byte("include", Dpl_itm_keys.Key_include)
.Add_str_byte("only", Dpl_itm_keys.Key_only)
.Add_str_byte("exclude", Dpl_itm_keys.Key_exclude)
.Add_str_byte("stablepages", Dpl_itm_keys.Key_stablepages)
.Add_str_byte("qualitypages", Dpl_itm_keys.Key_qualitypages)
.Add_str_byte("suppresserrors", Dpl_itm_keys.Key_suppresserrors)
.Add_str_byte("<API key>", Dpl_itm_keys.<API key>)
.Add_str_byte("shownamespace", Dpl_itm_keys.Key_shownamespace)
.Add_str_byte("googlehack", Dpl_itm_keys.Key_googlehack)
.Add_str_byte("nofollow", Dpl_itm_keys.Key_nofollow)
.Add_str_byte("descending", Dpl_itm_keys.Key_descending)
.Add_str_byte("ascending", Dpl_itm_keys.Key_ascending)
.Add_str_byte("false", Dpl_itm_keys.Key_false)
.Add_str_byte("true", Dpl_itm_keys.Key_true)
;
} |
<?php
// See the LICENCE file in the repository root for full licence text.
namespace App\Models\Match;
use App\Models\Beatmap;
use App\Traits\Scoreable;
/**
* @property int $count100
* @property int $count300
* @property int $count50
* @property int $countgeki
* @property int $countkatu
* @property int $countmiss
* @property int|null $enabled_mods
* @property int $frame
* @property Game $game
* @property int $game_id
* @property int $maxcombo
* @property int $pass
* @property int $perfect
* @property mixed $rank
* @property int $score
* @property int $slot
* @property int $team
* @property int $user_id
*/
class Score extends Model
{
use Scoreable;
protected $table = 'game_scores';
protected $primaryKey = null;
protected $hidden = ['frame', 'game_id'];
public $timestamps = false;
const TEAMS = [
0 => 'none',
1 => 'blue',
2 => 'red',
];
public function game()
{
return $this->belongsTo(Game::class, 'game_id');
}
public function gameModeString()
{
return Beatmap::modeStr($this->game->play_mode);
}
public function getScoringType()
{
return $this->game->scoring_type;
}
public function getTeamAttribute($value)
{
return self::TEAMS[$value];
}
public function scopeDefault($query)
{
return $query->orderBy('slot', 'asc');
}
} |
use pool_crate::Reset;
use std::io::{self,Write};
use std::cmp::{min,max};
use std::{fmt,str};
use pool::{Pool,Checkout};
#[derive(Debug,PartialEq,Clone)]
pub enum InputElement {
length in the stream
Slice(usize),
Splice(usize), // x bytes copied in kernel
}
#[derive(Debug,PartialEq,Clone)]
pub enum OutputElement {
length in the stream
Slice(usize),
Delete(usize),
Insert(Vec<u8>),
Splice(usize), // should copy x bytes from kernel to socket
}
The BufferQueue has two roles: holding incoming data, and indicating
which data will go out. When new data arrives, it is added at the
end of the internal buffer. This new data is then eventually parsed or
handled in some way by external code. The external code then adds
element to the queue, indicating what to do with the data:
- copy a subset of the input data (and advance if needed)
- insert external data, like a HTTP header
- splice out of the kernel some data that was spliced in
position is the index in the stream of data already handled.
it corresponds to the beginning of available data in the Buffer
a Slice(begin, end) would point to buffer.data()[begin-position..end-position]
(in the easiest case)
unparsed_position is the index in the stream of data that was
not parsed yet
The buffer's available data may be smaller than `end - begin`.
It can happen if the parser indicated we need to copy more data than is available,
like with a content length
should the buffer queue indicate how much data it needs?
pub struct BufferQueue {
position of buffer start in stream
pub buffer_position: usize,
pub parsed_position: usize,
pub <API key>: usize,
pub buffer: Checkout,
Vec<(start, length)>
pub input_queue: Vec<InputElement>,
pub output_queue: Vec<OutputElement>,
}
impl BufferQueue {
pub fn with_buffer(buffer: Checkout) -> BufferQueue {
BufferQueue {
buffer_position: 0,
parsed_position: 0,
<API key>: 0,
input_queue: Vec::with_capacity(8),
output_queue: Vec::with_capacity(8),
buffer,
}
}
pub fn invariant(&self) {
debug_assert!(self.buffer_position <= self.parsed_position,
"buffer_position {} should be smaller than parsed_position {}",
self.buffer_position, self.parsed_position);
debug_assert!(self.parsed_position <= self.<API key>,
"parsed_position {} should be smaller than <API key> {}",
self.parsed_position, self.<API key>);
}
pub fn <API key>(&self) -> usize {
self.input_queue.iter().fold(0, |acc, el| {
acc + match el {
&InputElement::Slice(sz) | &InputElement::Splice(sz) => sz
}
})
}
pub fn sliced_input(&mut self, count: usize) {
let needed = self.<API key> - self.parsed_position;
if needed > 0 {
if count > needed {
self.parsed_position = self.<API key>;
self.input_queue.push(InputElement::Slice(count - needed));
} else if count <= needed {
self.parsed_position += count;
}
} else if count > 0 {
self.input_queue.push(InputElement::Slice(count));
}
self.invariant();
//println!("sliced_input: buffer size: {}, parsed_position: {} <API key>: {}, input_queue: {:?}, output_queue: {:?}",
// self.buffer.available_data(), self.parsed_position, self.<API key>,
// self.input_queue, self.output_queue);
}
pub fn spliced_input(&mut self, count: usize) {
//FIXME: do the same thing with needed data as in sliced_input
if count > 0 {
self.input_queue.push(InputElement::Splice(count));
}
}
pub fn needs_input(&self) -> bool {
self.<API key> > self.parsed_position
}
pub fn can_restart_parsing(&self) -> bool {
self.<API key> == self.buffer_position
}
pub fn empty(&self) -> bool {
self.input_queue.is_empty() && self.output_queue.is_empty() && self.buffer.empty()
}
pub fn merge_input_slices(&self) -> usize {
let mut acc = 0usize;
for el in self.input_queue.iter() {
match el {
&InputElement::Splice(_) => break,
&InputElement::Slice(sz) => acc += sz,
}
}
assert!(acc <= self.buffer.available_data(), "the merged input slices can't be larger than current data in buffer");
acc
}
pub fn input_data_size(&self) -> usize {
let mut acc = 0usize;
for el in self.input_queue.iter() {
match el {
&InputElement::Splice(sz) => acc += sz,
&InputElement::Slice(sz) => acc += sz,
}
}
acc
}
pub fn unparsed_data(&self) -> &[u8] {
let largest_size = self.merge_input_slices();
//println!("buffer: {}, parsed: {}", self.buffer_position, self.parsed_position);
let start = self.parsed_position - self.buffer_position;
if largest_size == 0 || start >= self.buffer.available_data() {
return &self.buffer.data()[0..0];
}
//println!("available buffer data: {}, buffer position: {}, parsed_position: {}, start: {}, merged slices size: {}",
// self.buffer.available_data(), self.buffer_position,
//self.parsed_position, start, largest_size);
let end = max(self.buffer.available_data(), start+largest_size);
&self.buffer.data()[start..end]
}
should only be called with a count inferior to self.input_data_size()
pub fn consume_parsed_data(&mut self, size: usize) {
//FIXME: to_consume must contain unparsed_position - parsed_position ?
let mut to_consume = size;
while to_consume > 0 {
let new_first_element = match self.input_queue.first() {
None => {
//assert!(to_consume == 0, "no more element in queue, we should not ask to consume {} more bytes", to_consume);
break;
},
Some(&InputElement::Slice(sz)) => {
if to_consume >= sz {
to_consume -= sz;
None
} else {
let new_element = InputElement::Slice(sz - to_consume);
to_consume = 0;
Some(new_element)
}
},
Some(&InputElement::Splice(sz)) => {
if to_consume >= sz {
to_consume -= sz;
None
} else {
panic!("we should not start parsing from inside a splicing buffer. But what if consume_parsed_data was called during a parsing loop? Should only call consume_parsed_data after the parsing loop finished");
}
},
};
match new_first_element {
None => { self.input_queue.remove(0); },
Some(el) => { self.input_queue[0] = el; },
};
}
self.parsed_position += size - to_consume;
self.<API key> += size;
self.invariant();
}
pub fn slice_output(&mut self, count: usize) {
self.output_queue.push(OutputElement::Slice(count));
}
pub fn delete_output(&mut self, count: usize) {
self.output_queue.push(OutputElement::Delete(count));
}
pub fn splice_output(&mut self, count: usize) {
self.output_queue.push(OutputElement::Splice(count));
}
pub fn insert_output(&mut self, v: Vec<u8>) {
self.output_queue.push(OutputElement::Insert(v));
}
pub fn has_output_data(&self) -> bool {
self.output_queue.len() > 0
}
pub fn output_data_size(&self) -> usize {
let mut acc = 0usize;
let mut <API key> = self.buffer.available_data();
for el in self.output_queue.iter() {
match el {
&OutputElement::Splice(sz) => acc += sz,
&OutputElement::Slice(sz) => {
if <API key> >= sz {
acc += sz;
<API key> -= sz;
} else {
let advance = sz - <API key>;
acc += advance;
return acc;
}
},
&OutputElement::Insert(ref v) => acc += v.len(),
&OutputElement::Delete(sz) => {
if <API key> >=sz {
<API key> -= sz;
} else {
return acc;
}
},
}
}
acc
}
pub fn merge_output_slices(&self) -> usize {
let mut acc = 0usize;
for el in self.output_queue.iter() {
match el {
&OutputElement::Slice(sz) => acc += sz,
_ => break,
}
}
assert!(acc <= self.buffer.available_data(), "the merged output slices can't be larger than current data in buffer");
acc
}
pub fn <API key>(&self) -> usize {
let mut acc = 0usize;
for el in self.output_queue.iter() {
match el {
&OutputElement::Delete(sz) => acc += sz,
_ => break,
}
}
assert!(acc <= self.buffer.available_data(), "the merged output deletes can't be larger than current data in buffer");
acc
}
pub fn next_output_data(&self) -> &[u8] {
let it = self.output_queue.iter();
//first, calculate how many bytes we need to jump
let mut start = 0usize;
let mut largest_size = 0usize;
let mut delete_ended = false;
//println!("NEXT OUTPUT DATA:\nqueue:\n{:?}\nbuffer:\n{}", self.output_queue, self.buffer.data().to_hex(16));
for el in it {
//println!("start={}, length={}, el = {:?}", start, largest_size, el);
if !delete_ended {
match el {
&OutputElement::Delete(sz) => start += sz,
_ => {
delete_ended = true;
match el {
&OutputElement::Slice(sz) => largest_size += sz,
&OutputElement::Insert(ref v) => return &v[..],
_ => break,
}
},
}
} else {
match el {
&OutputElement::Slice(sz) => largest_size += sz,
_ => break,
}
}
}
//println!("buffer data: {:?}", self.buffer.data());
//println!("calculated start={}, length={}", start, largest_size);
//FIXME: should not be larger than the buffer
let length = self.buffer.available_data();
if start > length {
&self.buffer.data()[0..0]
} else {
let end = min(start+largest_size, length);
&self.buffer.data()[start..end]
}
}
pub fn as_ioslice(&self) -> Vec<std::io::IoSlice> {
let mut res = Vec::new();
let it = self.output_queue.iter();
//first, calculate how many bytes we need to jump
let mut start = 0usize;
let length = self.buffer.available_data();
//println!("NEXT OUTPUT DATA:\nqueue:\n{:?}\nbuffer:\n{}", self.output_queue, self.buffer.data().to_hex(16));
for el in it {
match el {
&OutputElement::Delete(sz) => start += sz,
&OutputElement::Slice(sz) => {
//println!("Slice({})", sz);
if sz == 0 {
continue
}
let end = min(start+sz, length);
let i = std::io::IoSlice::new(&self.buffer.data()[start..end]);
//println!("iovec size: {}", i.len());
res.push(i);
start = end;
if end == length {
break;
}
}
&OutputElement::Insert(ref v) => {
if v.is_empty() {
continue
}
let i = std::io::IoSlice::new(&v[..]);
//println!("got Insert with {} bytes", v.len());
res.push(i);
},
&OutputElement::Splice(_sz) => { unimplemented!("splice not used in ioslice") },
}
}
//println!("returning iovec: {:?}", res);
//println!("returning iovec with {} bytes", complete_size);
res
}
should only be called with a count inferior to self.input_data_size()
pub fn consume_output_data(&mut self, size: usize) {
let mut to_consume = size;
while to_consume > 0 {
let new_first_element = match self.output_queue.first() {
None => {
assert!(to_consume == 0, "no more element in queue, we should not ask to consume {} more bytes", to_consume);
break;
},
Some(&OutputElement::Slice(sz)) => {
if to_consume >= sz {
to_consume -= sz;
self.buffer_position += sz;
self.buffer.consume(sz);
None
} else {
let new_element = OutputElement::Slice(sz - to_consume);
self.buffer_position += to_consume;
self.buffer.consume(to_consume);
to_consume = 0;
Some(new_element)
}
},
Some(&OutputElement::Delete(sz)) => {
self.buffer_position += sz;
//FIXME: what if we can't delete that much data?
self.buffer.consume(sz);
None
},
Some(&OutputElement::Splice(sz)) => {
if to_consume >= sz {
to_consume -= sz;
None
} else {
let new_element = OutputElement::Splice(sz - to_consume);
to_consume = 0;
Some(new_element)
}
},
Some(&OutputElement::Insert(ref v)) => {
if to_consume >= v.len() {
to_consume = to_consume - v.len();
None
} else {
let new_element = OutputElement::Insert(Vec::from(&v[to_consume..]));
to_consume = 0;
Some(new_element)
}
},
};
match new_first_element {
None => { self.output_queue.remove(0); },
Some(el) => { self.output_queue[0] = el; },
};
}
self.invariant();
}
pub fn print_unparsed(&self) {
println!("{:?}", str::from_utf8(self.unparsed_data()));
}
pub fn <API key>(&mut self) {
while self.output_data_size() > 0 {
println!("{:?}", str::from_utf8(self.next_output_data()));
let len = self.next_output_data().len();
self.consume_output_data(len);
}
}
}
impl Write for BufferQueue {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
match self.buffer.write(buf) {
Err(e) => Err(e),
Ok(sz) => {
if sz > 0 {
self.input_queue.push(InputElement::Slice(sz));
}
Ok(sz)
}
}
}
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
}
impl Reset for BufferQueue {
fn reset(&mut self) {
self.parsed_position = 0;
self.buffer_position = 0;
self.<API key> = 0;
self.buffer.reset();
self.input_queue.clear();
self.output_queue.clear();
}
}
impl fmt::Debug for BufferQueue {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
//let b: &Buffer = &self.buffer;
write!(f, "BufferQueue {{\nbuffer_position: {},\nparsed_position: {},\<API key>: {},\ninput_queue: {:?},\noutput_queue:{:?},\nbuffer: {:?}\n}}",
self.buffer_position, self.parsed_position, self.<API key>,
self.input_queue, self.output_queue, ())
}
}
pub fn buf_with_capacity(capacity: usize) -> (Pool, BufferQueue) {
let mut pool = Pool::with_capacity(1, capacity, 16384);
let b = BufferQueue::with_buffer(pool.checkout().unwrap());
(pool, b)
}
#[cfg(test)]
mod tests {
use super::*;
use sozu_command::buffer::fixed::Buffer;
use nom::HexDisplay;
use std::io::Write;
#[test]
#[cfg(<API key> = "64")]
fn size_test() {
assert_size!(BufferQueue, 88);
assert_size!(Buffer, 16);
}
#[test]
fn consume() {
let (_pool, mut b) = buf_with_capacity(10);
b.buffer.write(&b"ABCDEFGHIJ"[..]).unwrap();
b.buffer.fill(10);
b.input_queue.push(InputElement::Slice(10));
/*let mut b = BufferQueue {
parsed_position: 0,
buffer_position: 0,
<API key>: 0,
buffer: Buffer::from_slice(b"ABCDEFGHIJ"),
input_queue: vec!(InputElement::Slice(10)),
output_queue: vec!()
};*/
// the pool will align the buffer to 16 bytes so there are trailing zeroes
assert_eq!(b.unparsed_data(), &b"ABCDEFGHIJ\0\0\0\0\0\0\0\0\0\0"[..]);
b.consume_parsed_data(4);
assert_eq!(b.parsed_position, 4);
assert_eq!(b.<API key>, 4);
assert_eq!(b.input_queue, vec!(InputElement::Slice(6)));
println!("TEST[{}]", line!());
assert_eq!(b.unparsed_data(), &b"EFGHIJ\0\0\0\0\0\0\0\0\0\0"[..]);
println!("TEST[{}]", line!());
b.slice_output(4);
assert_eq!(b.output_queue, vec!(OutputElement::Slice(4)));
b.insert_output(Vec::from(&b"test"[..]));
assert_eq!(b.output_queue, vec!(
OutputElement::Slice(4),
OutputElement::Insert(Vec::from(&b"test"[..]))
)
);
assert_eq!(b.next_output_data(), &b"ABCD"[..]);
println!("before consume: {:?}", b);
b.consume_output_data(2);
println!("after consume: {:?}", b);
println!("next output data: {}", b.next_output_data().to_hex(8));
assert_eq!(b.next_output_data(), &b"CD"[..]);
println!("TEST[{}]", line!());
b.consume_parsed_data(8);
assert_eq!(b.parsed_position, 10);
assert_eq!(b.<API key>, 12);
assert_eq!(b.input_queue, vec!());
println!("TEST[{}]", line!());
assert_eq!(b.unparsed_data(), &b""[..]);
println!("TEST[{}]", line!());
println!("**test**");
b.consume_output_data(2);
assert_eq!(b.next_output_data(), &b"test"[..]);
b.consume_output_data(2);
assert_eq!(b.next_output_data(), &b"st"[..]);
b.delete_output(2);
b.slice_output(4);
assert_eq!(
b.output_queue,
vec!(
OutputElement::Insert(Vec::from(&b"st"[..])),
OutputElement::Delete(2),
OutputElement::Slice(4)
)
);
b.consume_output_data(2);
assert_eq!(
b.output_queue,
vec!(
OutputElement::Delete(2),
OutputElement::Slice(4)
)
);
assert_eq!(b.next_output_data(), &b"GHIJ"[..]);
b.consume_output_data(1);
assert_eq!(
b.output_queue,
vec!(
OutputElement::Slice(3)
)
);
assert_eq!(b.next_output_data(), &b"HIJ"[..]);
b.write(&b"KLMNOP"[..]).unwrap();
}
} |
<!DOCTYPE html>
<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7"><![endif]-->
<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7"><![endif]-->
<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8"><![endif]-->
<!--[if IE 9]><html class="ng-csp ie ie9 lte9"><![endif]-->
<!--[if gt IE 9]><html class="ng-csp ie"><![endif]-->
<!--[if !IE]><!--><html class="ng-csp"><!--<![endif]-->
<head data-requesttoken="<?php p($_['requesttoken']); ?>">
<title>
<?php p($theme->getTitle()); ?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-itunes-app" content="app-id=543672169">
<link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" />
<link rel="<API key>" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" />
<?php foreach($_['cssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>" type="text/css" media="screen" />
<?php endforeach; ?>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php print_unescaped($jsfile); ?>"></script>
<?php endforeach; ?>
<?php foreach($_['headers'] as $header): ?>
<?php
print_unescaped('<'.$header['tag'].' ');
foreach($header['attributes'] as $name=>$value) {
print_unescaped("$name='$value' ");
};
print_unescaped('/>');
?>
<?php endforeach; ?>
</head>
<body id="body-login">
<div class="wrapper"><!-- for sticky footer -->
<header><div id="header">
<div id="foo"><p class="info">IPIT International</p></div>
<div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
</div></header>
<?php print_unescaped($_['content']); ?>
<div class="push"></div><!-- for sticky footer -->
</div>
<footer>
<p class="info">
<!-- <?php print_unescaped($theme->getLongFooter()); ?>-->
</p>
</footer>
</body>
</html> |
package org.semtix.shared.daten.enums;
/**
* Konstanten zum Status des Antrags (nichtenschieden, genehmigt, abgelehnt)
*/
public enum AntragStatus {
NICHTENTSCHIEDEN (1, "nicht entschieden"),
GENEHMIGT (2, "genehmigt"),
ABGELEHNT (3, "abgelehnt");
private int statusID;
private String statusText;
AntragStatus(int statusID, String statusText) {
this.statusID = statusID;
this.statusText = statusText;
}
public String toString() {
return statusText;
}
} |
package com.rapidminer.example.table;
/**
* Implementation of DataRow that is backed by primitive arrays. Should always be used if more than
* 50% of the data is sparse. As fast (or even faster than map implementation) but needs
* considerably less memory.
*
* @author Niraj Aswani, Julien Nioche, Ingo Mierswa, Shevek Exp $
*/
public class <API key> extends <API key> {
private static final long serialVersionUID = <API key>;
/** Stores the used attribute values. */
private double[] values;
/**
* Creates an empty sparse array data row with size 0.
*/
public <API key>() {
this(0);
}
/**
* Creates a sparse array data row of the given size. @param size the size
*
* @param size the size
*/
public <API key>(int size) {
super(size);
values = new double[size];
}
@Override
protected void swapValues(int a, int b) {
double tt = values[a];
values[a] = values[b];
values[b] = tt;
}
@Override
protected void resizeValues(int length) {
double[] d = new double[length];
System.arraycopy(values, 0, d, 0, Math.min(values.length, length));
values = d;
}
@Override
protected void removeValue(int index) {
System.arraycopy(values, index + 1, values, index, values.length - (index + 1));
}
/** Returns the desired data for the given attribute. */
@Override
protected double getValue(int index) {
return values[index];
}
/** Sets the given data for the given attribute. */
@Override
protected void setValue(int index, double v) {
values[index] = v;
}
@Override
protected double[] getAllValues() {
return this.values;
}
@Override
public int getType() {
return DataRowFactory.<API key>;
}
} |
<!DOCTYPE html>
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../../../style.css');
@import url('../../../../../../../tree.css');
</style>
<script src="../../../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../../../cloud.js" type="text/javascript"></script>
<title><API key> </title>
</head>
<body onload="onLoad('<API key> : com.rapidminer.tools.expression.internal.function.trigonometric.HyperbolicTangent.java')">
<div id="page">
<header id="header" role="banner">
<nav class="aui-header <API key>" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo <API key>">
<a href="http:
</h1>
</div>
<div class="<API key>">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online Clover documentation" target="_blank"
href="https://confluence.atlassian.com/display/CLOVER/Clover+Documentation+Home">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="<API key>">
<div class="aui-page-panel-nav <API key>">
<div class="<API key>" style="margin-bottom: 20px;">
<div class="<API key>">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</div>
<div class="<API key>" >
<h1>
<API key>
</h1>
</div>
</div>
<nav class="aui-navgroup <API key>">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading <API key>">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui <API key>">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="<API key> hidden">
<small>No results found.</small>
</p>
<div class="<API key>" data-root-relative="../../../../../../../" data-package-name="com.rapidminer.tools.expression.internal.function.trigonometric">
<div class="<API key>"></div>
<div class="<API key>"></div>
</div>
</div>
</div>
</nav> </div>
<section class="<API key>">
<div class="<API key>">
<ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../../../dashboard.html">Project Clover database 5 2017 16:40:29 CST</a></li>
<li><a href="pkg-summary.html"> Package com.rapidminer.tools.expression.internal.function.trigonometric</a></li>
</ol>
<h1 class="aui-h2-clover">
File HyperbolicTangent.java
</h1>
<div class="aui-message aui-message-warning">
<p class="title">
<strong>Evaluation License</strong>
</p>
<p>
This report was generated with an evaluation server license. <a href="http:
</p>
</div>
<div class="aui-tabs horizontal-tabs" id="tabs-file">
<div class="tabs-pane <API key> active-pane" id="tabs-file-source">
<div> </div>
<div style="display: table; width: 100%">
<div style="display: table-cell; ">
<div class="dashboard-widget">
<header class="<API key>">
<h3>Code metrics</h3>
</header>
<div class="<API key>">
<div id="td-header-stats" class="aui-item" style="display: ">
<div style="display: table">
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of branches in this file">Branches:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of statements in this file">Statements:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of methods in this file">Methods:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of classes in this file">Classes:</label></div>
<div class="stats-box-value">1</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of lines of code in this file">LOC:</label></div>
<div class="stats-box-value">42</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of non-comment lines of code in this file">NCLOC:</label></div>
<div class="stats-box-value">12</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Cyclomatic complexity is the number of paths in this file">Total complexity:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label">
<label title="Complexity density is the complexity divided by the number of statements in this file">Complexity density:</label>
</div>
<div class="stats-box-value">-</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Number of statements per method.">Statements/Method:</label></div>
<div class="stats-box-value">-</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Number of methods per class.">Methods/Class:</label></div>
<div class="stats-box-value">0</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Complexity divided by the number of methods in this file">Average method complexity:</label></div>
<div class="stats-box-value">-</div>
</div>
</div>
<div class="subtle">
<small><strong>100%</strong> of code in this file is excluded from these metrics.</small>
<label class="aui-button aui-button-subtle" onclick="toggleStats('td-header-stats', '<API key>');"
title="Include or exclude filtered elements from these statistics.">Remove Filter</label>
</div>
</div>
<div id="<API key>" class="aui-item" style="display: none">
<div style="display: table">
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of branches in this file">Branches:</label></div>
<div class="stats-box-value">2</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of statements in this file">Statements:</label></div>
<div class="stats-box-value">2</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of methods in this file">Methods:</label></div>
<div class="stats-box-value">2</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of classes in this file">Classes:</label></div>
<div class="stats-box-value">1</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of lines of code in this file">LOC:</label></div>
<div class="stats-box-value">42</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Total number of non-comment lines of code in this file">NCLOC:</label></div>
<div class="stats-box-value">12</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Cyclomatic complexity is the number of paths in this file">Total complexity:</label></div>
<div class="stats-box-value">3</div>
</div>
<div class="stats-box">
<div class="stats-box-label">
<label title="Complexity density is the complexity divided by the number of statements in this file">Complexity density:</label>
</div>
<div class="stats-box-value">1.5</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Number of statements per method.">Statements/Method:</label></div>
<div class="stats-box-value">1</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Number of methods per class.">Methods/Class:</label></div>
<div class="stats-box-value">2</div>
</div>
<div class="stats-box">
<div class="stats-box-label"><label title="Complexity divided by the number of methods in this file">Average method complexity:</label></div>
<div class="stats-box-value">1.5</div>
</div>
</div>
<div class="subtle">
<small>These metrics include <strong class='bold'>100%</strong> of code marked as filtered.</small>
<label class="aui-button aui-button-subtle" onclick="toggleStats('<API key>', 'td-header-stats');"
title="Include or exclude filtered elements from these statistics.">Apply Filter</label>
</div>
</div> </div>
</div>
</div>
</div>
<h2>Classes</h2>
<table class="aui aui-table-sortable">
<thead>
<tr> <th>Class</th>
<th>Line
<th class="">
<label title="The total number of statements.">Total Statements</label>
</th>
<th class="">
<label title="Cyclomatic complexity is a measure of the number of paths in your code.">Complexity</label>
</th>
<th class="">
<label title="The amount of code that was hit at least once during testing.">TOTAL Coverage</label>
</th>
<th>Actions</th>
</tr> </thead>
<tbody>
<tr> <td id="HyperbolicTangent">
<span><a href="#32" title="HyperbolicTangent" onclick="<API key>('<API key>', '32');">HyperbolicTangent</a></span>
</td>
<td>32<a name="sl-32"></a></td>
<td class="">0</td>
<td class="">0</td>
<td class=""><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></td>
<td><button data-dialog-id="<API key>" class="aui-button aui-button-link dialog-show-button">Show methods</button></td>
</tr> </tbody>
</table>
<section role="dialog" id="<API key>" class="aui-layer aui-dialog2 aui-dialog2-xlarge" aria-hidden="true">
<header class="aui-dialog2-header">
<h1 class="<API key>">Class HyperbolicTangent</h1>
<div class="<API key>">
<input id="<API key>" class="test-filter text" type="text" name="method-filter"
placeholder="Type to filter methods..." autocomplete="off"
onkeyup="filterMethods('<API key>', '<API key>');"/>
</div>
</header>
<div class="aui-dialog2-content">
<table class="aui aui-table-sortable">
<thead>
<tr> <th id="HyperbolicTangent">
Class<br/> <span><a href="#32" title="HyperbolicTangent" onclick="<API key>('<API key>', '32');">HyperbolicTangent</a></span>
</th>
<th>Line #<br/>32<a name="sl-32"></a></th>
<th class=""><label title="The total number of statements.">Total Statements</label><br/>0</th>
<th class=""><label title="Cyclomatic complexity is a measure of the number of paths in your code.">Complexity</label><br/>0</th>
<th class=""><label title="The amount of code that was hit at least once during testing.">TOTAL Coverage</label><br/><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></th>
</tr> </thead>
<tbody id="<API key>">
<tr id="HyperbolicTangent-1">
<td id="summary-34-2">
<span class="sortValue">HyperbolicTangent()</span>
  <a href="?line=29#34" title="HyperbolicTangent()" name="sl-34" onclick="<API key>('<API key>', '34');">HyperbolicTangent()</a>
</td>
<td align="right"><span class="sortValue">34</span>34</td>
<td class="" align="right"><span class="sortValue">0.0</span>0</td>
<td class="" align="right"><span class="sortValue">1.0</span>1</td>
<td class="" align="right"><span class="sortValue">-1.0</span><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></td>
</tr> <tr id="HyperbolicTangent-2">
<td id="summary-38-2">
<span class="sortValue">compute(double) : double</span>
  <a href="?line=29#38" title="compute(double) : double" name="sl-38" onclick="<API key>('<API key>', '38');">compute(double) : double</a>
</td>
<td align="right"><span class="sortValue">38</span>38</td>
<td class="" align="right"><span class="sortValue">0.0</span>0</td>
<td class="" align="right"><span class="sortValue">1.0</span>1</td>
<td class="" align="right"><span class="sortValue">-1.0</span><div style="display: table; width: 100%">
<div class="barGraphValue"><span class="sortValue">-1.0</span> - </div><div style="display: table-cell">
<div title="Empty" class="barEmpty" style="min-width:200px;"></div></div></div></td>
</tr> </tbody>
</table>
<div> </div>
</div>
<footer class="aui-dialog2-footer">
<div class="<API key>">
<button class="aui-button aui-button-primary dialog-close-button"
data-dialog-id="<API key>">Close</button>
</div>
<div class="<API key>">Click on a class or a method name to jump to source.</div>
</footer>
</section>
<div> </div>
<h2>Contributing tests</h2>
<div class="aui-message">
<p>No tests hitting this source file were found.</p>
</div>
<h2>Source view</h2>
<div style="display: table; width: 100%;">
<div style="display: table-cell">
<button class="aui-button aui-button-link"
title="Toggles all methods in the source to be either expanded or collapsed."
onclick="<API key>(this); return false;" id="method-expander">
Collapse all methods
</button>
</div>
<div style="display: table-cell">
<div style="text-align: right; margin-bottom: 10px">
<button class="aui-button aui-button-subtle" id="popupHelp">
<span class="aui-icon aui-icon-small aui-iconfont-help"></span> Show legend
</button>
<script>
AJS.InlineDialog(AJS.$("#popupHelp"), "helpDialog",
function(content, trigger, showPopup) {
content.css({"padding":"20px"}).html(<API key>);
showPopup();
return false;
},
{
width: 700, hideDelay: 60000
}
);
</script> </div>
</div>
</div>
<table cellspacing="0" cellpadding="0" class="srcView" width="100%">
<tbody> <tr id="l1">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=1#src-1">1</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
</tr>
<tr id="l19">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=19#src-19">19</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-19" class="srcLine"><span class="keyword">package</span> com.<a href="../../../../../../rapidminer/pkg-summary.html">rapidminer</a>.<a href="../../../../../tools/pkg-summary.html">tools</a>.<a href="../../../../expression/pkg-summary.html">expression</a>.<a href="../../../internal/pkg-summary.html">internal</a>.<a href="../../function/pkg-summary.html">function</a>.<a href="../trigonometric/pkg-summary.html">trigonometric</a>;</span></td>
</tr>
<tr id="l20">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=20#src-20">20</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-20" class="srcLine"></span></td>
</tr>
<tr id="l21">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=21#src-21">21</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-21" class="srcLine"><span class="keyword">import</span> com.<a href="../../../../../../rapidminer/pkg-summary.html">rapidminer</a>.<a href="../../../../../tools/pkg-summary.html">tools</a>.<a href="../../../../../../../com/rapidminer/tools/Ontology.html#Ontology">Ontology</a>;</span></td>
</tr>
<tr id="l22">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=22#src-22">22</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-22" class="srcLine"><span class="keyword">import</span> com.<a href="../../../../../../rapidminer/pkg-summary.html">rapidminer</a>.<a href="../../../../../tools/pkg-summary.html">tools</a>.<a href="../../../../expression/pkg-summary.html">expression</a>.<a href="../../../internal/pkg-summary.html">internal</a>.<a href="../../function/pkg-summary.html">function</a>.<a href="../../../../../../../com/rapidminer/tools/expression/internal/function/<API key>.html#<API key>"><API key></a>;</span></td>
</tr>
<tr id="l23">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=23#src-23">23</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-23" class="srcLine"></span></td>
</tr>
<tr id="l24">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=24#src-24">24</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-24" class="srcLine"></span></td>
</tr>
<tr id="l25">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=25#src-25">25</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-25" class="srcLine"><span class="comment">/**</span></span></td>
</tr>
<tr id="l26">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=26#src-26">26</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-26" class="srcLine"><span class="comment"> *</span></span></td>
</tr>
<tr id="l27">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=27#src-27">27</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-27" class="srcLine"><span class="comment"> * A {</span><span class="javadoc">@link</span><span class="comment"> Function} computing the trigonometric hyperbolic tangent of an angle.</span></span></td>
</tr>
<tr id="l28">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=28#src-28">28</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-28" class="srcLine"><span class="comment"> *</span></span></td>
</tr>
<tr id="l29">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=29#src-29">29</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-29" class="srcLine"><span class="comment"> * </span><span class="javadoc">@author</span><span class="comment"> Denis Schernov</span></span></td>
</tr>
<tr id="l30">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=30#src-30">30</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-30" class="srcLine"><span class="comment"> *</span></span></td>
</tr>
<tr id="l31">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=31#src-31">31</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-31" class="srcLine"><span class="comment"> */</span></span></td>
</tr>
<tr class="inlineStatsRow" align="right" valign="middle">
<td class="coverageCount"><a name="32" class="nolink"> </a></td>
<td class="coverageCount aui-icon aui-icon-small <API key>" id='<API key>' onclick="toggleInlineStats(this, 'inlinestats-32');"/>
<td align="center" valign="middle">
<table id="inlinestats-32" style="display:none;" class="inlineStats" width="100%" cellspacing="1px" cellpadding="1px">
<tr onclick="toggleInlineStats(document.getElementById('<API key>'), 'inlinestats-32');return true;">
<td><div>
<div title="Empty" class="barEmpty" style="min-width:40px;"></div>
</div></td><td> - </td>
<td class="inlineStat">Uncovered Elements: 0 (0)</td>
<td class="inlineStat">Complexity: 0</td>
<td class="inlineStat">Complexity Density: -</td>
</tr>
</table>
</td>
</tr>
<tr id="l32">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=32#src-32">32</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" id="id-32"><span class="spacer"></span><span id="src-32" class="srcLine"><span class="keyword">public</span> <span class="keyword">class</span> <a href="../../../../../../../com/rapidminer/tools/expression/internal/function/trigonometric/HyperbolicTangent.html#HyperbolicTangent">HyperbolicTangent</a> <span class="keyword">extends</span> <a href="../../../../../../../com/rapidminer/tools/expression/internal/function/<API key>.html#<API key>"><API key></a> {</span></td>
</tr>
<tr id="l33">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=33#src-33">33</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-33" class="srcLine"></span></td>
</tr>
<tr class="inlineStatsRow" align="right" valign="middle">
<td class="coverageCount"><a name="34" class="nolink"> </a></td>
<td class="coverageCount aui-icon aui-icon-small <API key>" id='<API key>' onclick="toggleInlineStats(this, 'inlinestats-34');"/>
<td align="center" valign="middle">
<table id="inlinestats-34" style="display:none;" class="inlineStats" width="100%" cellspacing="1px" cellpadding="1px">
<tr onclick="toggleInlineStats(document.getElementById('<API key>'), 'inlinestats-34');return true;">
<td><div>
<div title="Empty" class="barEmpty" style="min-width:40px;"></div>
</div></td><td> - </td>
<td class="inlineStat">Uncovered Elements: 0 (0)</td>
<td class="inlineStat">Complexity: 1</td>
<td class="inlineStat">Complexity Density: -</td>
</tr>
</table>
</td>
</tr>
<tr id="l34">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=34#src-34">34</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" methodStart srcCell" id="id-34"><img title="Method Statistics" onclick="toggleSrcRowVis(this, 34,36);" id="img-34" src="../../../../../../../img/collapse.gif" alt="toggle" class="icon"/><span id="src-34" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">public</span> <a href="../../../../../../../com/rapidminer/tools/expression/internal/function/trigonometric/HyperbolicTangent.html#HyperbolicTangent">HyperbolicTangent</a>() {</span><span class="foldControl" onclick="toggleSrcRowVis(document.getElementById('img-34'), 34,36);" id="e34" style="display:none;border:none;">...</span></span></td>
</tr>
<tr id="l35">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=35#src-35">35</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-35" class="srcLineFiltered"><span class="nolink" title="Filtered by: constructor"> <span class="keyword">super</span>(<span class="string">"trigonometrical.tanh"</span>, <a href="../../../../../../../com/rapidminer/tools/Ontology.html#Ontology">Ontology</a>.NUMERICAL);</span></span></td>
</tr>
<tr id="l36">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=36#src-36">36</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-36" class="srcLine"> }</span></td>
</tr>
<tr id="l37">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=37#src-37">37</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-37" class="srcLine"></span></td>
</tr>
<tr class="inlineStatsRow" align="right" valign="middle">
<td class="coverageCount"><a name="38" class="nolink"> </a></td>
<td class="coverageCount aui-icon aui-icon-small <API key>" id='<API key>' onclick="toggleInlineStats(this, 'inlinestats-38');"/>
<td align="center" valign="middle">
<table id="inlinestats-38" style="display:none;" class="inlineStats" width="100%" cellspacing="1px" cellpadding="1px">
<tr onclick="toggleInlineStats(document.getElementById('<API key>'), 'inlinestats-38');return true;">
<td><div>
<div title="Empty" class="barEmpty" style="min-width:40px;"></div>
</div></td><td> - </td>
<td class="inlineStat">Uncovered Elements: 0 (0)</td>
<td class="inlineStat">Complexity: 1</td>
<td class="inlineStat">Complexity Density: -</td>
</tr>
</table>
</td>
</tr>
<tr id="l38">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=38#src-38">38</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" methodStart srcCell" id="id-38"><img title="Method Statistics" onclick="toggleSrcRowVis(this, 38,41);" id="img-38" src="../../../../../../../img/collapse.gif" alt="toggle" class="icon"/><span id="src-38" class="srcLineFiltered"><span class="nolink" title="Filtered by: method"> @Override</span><span class="foldControl" onclick="toggleSrcRowVis(document.getElementById('img-38'), 38,41);" id="e38" style="display:none;border:none;">...</span></span></td>
</tr>
<tr id="l39">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=39#src-39">39</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-39" class="srcLine"> <span class="keyword">protected</span> <span class="keyword">double</span> compute(<span class="keyword">double</span> value) {</span></td>
</tr>
<tr id="l40">
<td align="right" class="lineCount Filtered"><a class="lineNumHref" href="?line=40#src-40">40</a></td>
<td align="right" class="coverageCount Filtered missedByTest" >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-40" class="srcLineFiltered"><span class="nolink" title="Filtered by: method"> <span class="keyword">return</span> Double.isNaN(value) ? Double.NaN : Math.tanh(value);</span></span></td>
</tr>
<tr id="l41">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=41#src-41">41</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-41" class="srcLine"> }</span></td>
</tr>
<tr id="l42">
<td align="right" class="lineCount NoHilight"><a class="lineNumHref" href="?line=42#src-42">42</a></td>
<td align="right" class="coverageCount NoHilight " >  </td>
<td class=" srcCell" ><span class="spacer"></span><span id="src-42" class="srcLine">}</span></td>
</tr>
</tbody></table> </div>
</div><!-- .aui-tabs -->
<script type="text/javascript">
var ol_bgclass = "overBG";
var ol_fgclass = "overFG";
var ol_cgclass = "overCaption";
var ol_captionfontclass= "overCaption";
var ol_closefontclass = "closeFont";
var ol_closeclick = 1;
var ol_close = 'X';
var ol_wrap = 1;
var rootRelPath = '../../../../../../../';
var testsPerFile = -1;
</script>
<script src="HyperbolicTangent.js" type="text/javascript"></script>
</div> <!-- class="<API key>" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http:
on 5 2017 17:24:16 CST using coverage data from 1 1970 08:00:00 CST.
</li>
</ul>
<ul>
<li>Clover Evaluation License registered to Clover Plugin. You have 29 day(s) before your license expires.</li>
</ul>
<div id="footer-logo">
<a target="_blank" href="http:
Atlassian
</a>
</div>
</section>
</footer> </section> <!-- class="<API key>" -->
</div> <!-- class="<API key>" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> |
<?php
/**
* Base static class for performing query and update operations on the 'conversion' table.
*
*
*
* @package lib.model.om
*/
abstract class BaseconversionPeer {
/** the default database name for this class */
const DATABASE_NAME = 'propel';
/** the table name for this class */
const TABLE_NAME = 'conversion';
/** the related Propel class for this table */
const OM_CLASS = 'conversion';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'lib.model.conversion';
/** the related TableMap class for this table */
const TM_CLASS = 'conversionTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 16;
/** The number of lazy-loaded columns. */
const <API key> = 0;
/** the column name for the ID field */
const ID = 'conversion.ID';
/** the column name for the ENTRY_ID field */
const ENTRY_ID = 'conversion.ENTRY_ID';
/** the column name for the IN_FILE_NAME field */
const IN_FILE_NAME = 'conversion.IN_FILE_NAME';
/** the column name for the IN_FILE_EXT field */
const IN_FILE_EXT = 'conversion.IN_FILE_EXT';
/** the column name for the IN_FILE_SIZE field */
const IN_FILE_SIZE = 'conversion.IN_FILE_SIZE';
/** the column name for the SOURCE field */
const SOURCE = 'conversion.SOURCE';
/** the column name for the STATUS field */
const STATUS = 'conversion.STATUS';
/** the column name for the CONVERSION_PARAMS field */
const CONVERSION_PARAMS = 'conversion.CONVERSION_PARAMS';
/** the column name for the OUT_FILE_NAME field */
const OUT_FILE_NAME = 'conversion.OUT_FILE_NAME';
/** the column name for the OUT_FILE_SIZE field */
const OUT_FILE_SIZE = 'conversion.OUT_FILE_SIZE';
/** the column name for the OUT_FILE_NAME_2 field */
const OUT_FILE_NAME_2 = 'conversion.OUT_FILE_NAME_2';
/** the column name for the OUT_FILE_SIZE_2 field */
const OUT_FILE_SIZE_2 = 'conversion.OUT_FILE_SIZE_2';
/** the column name for the CONVERSION_TIME field */
const CONVERSION_TIME = 'conversion.CONVERSION_TIME';
/** the column name for the TOTAL_PROCESS_TIME field */
const TOTAL_PROCESS_TIME = 'conversion.TOTAL_PROCESS_TIME';
/** the column name for the CREATED_AT field */
const CREATED_AT = 'conversion.CREATED_AT';
/** the column name for the UPDATED_AT field */
const UPDATED_AT = 'conversion.UPDATED_AT';
/**
* An identiy map to hold any loaded instances of conversion objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array conversion[]
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'EntryId', 'InFileName', 'InFileExt', 'InFileSize', 'Source', 'Status', 'ConversionParams', 'OutFileName', 'OutFileSize', 'OutFileName2', 'OutFileSize2', 'ConversionTime', 'TotalProcessTime', 'CreatedAt', 'UpdatedAt', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'entryId', 'inFileName', 'inFileExt', 'inFileSize', 'source', 'status', 'conversionParams', 'outFileName', 'outFileSize', 'outFileName2', 'outFileSize2', 'conversionTime', 'totalProcessTime', 'createdAt', 'updatedAt', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::ENTRY_ID, self::IN_FILE_NAME, self::IN_FILE_EXT, self::IN_FILE_SIZE, self::SOURCE, self::STATUS, self::CONVERSION_PARAMS, self::OUT_FILE_NAME, self::OUT_FILE_SIZE, self::OUT_FILE_NAME_2, self::OUT_FILE_SIZE_2, self::CONVERSION_TIME, self::TOTAL_PROCESS_TIME, self::CREATED_AT, self::UPDATED_AT, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'entry_id', 'in_file_name', 'in_file_ext', 'in_file_size', 'source', 'status', 'conversion_params', 'out_file_name', 'out_file_size', 'out_file_name_2', 'out_file_size_2', 'conversion_time', 'total_process_time', 'created_at', 'updated_at', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'EntryId' => 1, 'InFileName' => 2, 'InFileExt' => 3, 'InFileSize' => 4, 'Source' => 5, 'Status' => 6, 'ConversionParams' => 7, 'OutFileName' => 8, 'OutFileSize' => 9, 'OutFileName2' => 10, 'OutFileSize2' => 11, 'ConversionTime' => 12, 'TotalProcessTime' => 13, 'CreatedAt' => 14, 'UpdatedAt' => 15, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'entryId' => 1, 'inFileName' => 2, 'inFileExt' => 3, 'inFileSize' => 4, 'source' => 5, 'status' => 6, 'conversionParams' => 7, 'outFileName' => 8, 'outFileSize' => 9, 'outFileName2' => 10, 'outFileSize2' => 11, 'conversionTime' => 12, 'totalProcessTime' => 13, 'createdAt' => 14, 'updatedAt' => 15, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::ENTRY_ID => 1, self::IN_FILE_NAME => 2, self::IN_FILE_EXT => 3, self::IN_FILE_SIZE => 4, self::SOURCE => 5, self::STATUS => 6, self::CONVERSION_PARAMS => 7, self::OUT_FILE_NAME => 8, self::OUT_FILE_SIZE => 9, self::OUT_FILE_NAME_2 => 10, self::OUT_FILE_SIZE_2 => 11, self::CONVERSION_TIME => 12, self::TOTAL_PROCESS_TIME => 13, self::CREATED_AT => 14, self::UPDATED_AT => 15, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'entry_id' => 1, 'in_file_name' => 2, 'in_file_ext' => 3, 'in_file_size' => 4, 'source' => 5, 'status' => 6, 'conversion_params' => 7, 'out_file_name' => 8, 'out_file_size' => 9, 'out_file_name_2' => 10, 'out_file_size_2' => 11, 'conversion_time' => 12, 'total_process_time' => 13, 'created_at' => 14, 'updated_at' => 15, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
);
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
* @throws PropelException - if the specified name could not be found in the fieldname mappings.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. conversionPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(conversionPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(conversionPeer::ID);
$criteria->addSelectColumn(conversionPeer::ENTRY_ID);
$criteria->addSelectColumn(conversionPeer::IN_FILE_NAME);
$criteria->addSelectColumn(conversionPeer::IN_FILE_EXT);
$criteria->addSelectColumn(conversionPeer::IN_FILE_SIZE);
$criteria->addSelectColumn(conversionPeer::SOURCE);
$criteria->addSelectColumn(conversionPeer::STATUS);
$criteria->addSelectColumn(conversionPeer::CONVERSION_PARAMS);
$criteria->addSelectColumn(conversionPeer::OUT_FILE_NAME);
$criteria->addSelectColumn(conversionPeer::OUT_FILE_SIZE);
$criteria->addSelectColumn(conversionPeer::OUT_FILE_NAME_2);
$criteria->addSelectColumn(conversionPeer::OUT_FILE_SIZE_2);
$criteria->addSelectColumn(conversionPeer::CONVERSION_TIME);
$criteria->addSelectColumn(conversionPeer::TOTAL_PROCESS_TIME);
$criteria->addSelectColumn(conversionPeer::CREATED_AT);
$criteria->addSelectColumn(conversionPeer::UPDATED_AT);
}
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
{
// we may modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(conversionPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
conversionPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
$criteria->setDbName(self::DATABASE_NAME); // Set the correct dbName
// BasePeer returns a PDOStatement
$stmt = conversionPeer::doCountStmt($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param PropelPDO $con
* @return conversion
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = conversionPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, PropelPDO $con = null)
{
return conversionPeer::populateObjects(conversionPeer::doSelectStmt($criteria, $con));
}
public static function alternativeCon($con)
{
if($con === null)
$con = myDbHelper::alternativeCon($con);
if($con === null)
$con = Propel::getConnection(conversionPeer::DATABASE_NAME, Propel::CONNECTION_READ);
return $con;
}
/**
* @var criteriaFilter The default criteria filter.
*/
protected static $s_criteria_filter;
public static function <API key> ( $use )
{
$criteria_filter = conversionPeer::getCriteriaFilter();
if ( $use ) $criteria_filter->enable();
else $criteria_filter->disable();
}
/**
* Returns the default criteria filter
*
* @return criteriaFilter The default criteria filter.
*/
public static function &getCriteriaFilter()
{
if(self::$s_criteria_filter == null)
conversionPeer::<API key>();
return self::$s_criteria_filter;
}
/**
* Creates default criteria filter
*/
public static function <API key>()
{
if(self::$s_criteria_filter == null)
self::$s_criteria_filter = new criteriaFilter();
$c = new myCriteria();
self::$s_criteria_filter->setFilter($c);
}
/**
* the filterCriteria will filter out all the doSelect methods - ONLY if the filter is turned on.
* IMPORTANT - the filter is turend on by default and when switched off - should be turned on again manually .
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
*/
protected static function <API key>(Criteria $criteria)
{
conversionPeer::getCriteriaFilter()->applyFilter($criteria);
}
/**
* Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
*
* Use this method directly if you want to work with an executed statement durirectly (for example
* to perform your own object hydration).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con The connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return PDOStatement The executed PDOStatement object.
* @see BasePeer::doCount()
*/
public static function doCountStmt(Criteria $criteria, PropelPDO $con = null)
{
// attach default criteria
conversionPeer::<API key>($criteria);
// set the connection to slave server
$con = conversionPeer::alternativeCon ( $con );
// BasePeer returns a PDOStatement
return BasePeer::doCount($criteria, $con);
}
/**
* Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
*
* Use this method directly if you want to work with an executed statement durirectly (for example
* to perform your own object hydration).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con The connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return PDOStatement The executed PDOStatement object.
* @see BasePeer::doSelect()
*/
public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
{
$con = conversionPeer::alternativeCon($con);
if ($criteria->hasSelectClause())
{
$asColumns = $criteria->getAsColumns();
if(count($asColumns) == 1 && isset($asColumns['_score']))
{
$criteria = clone $criteria;
conversionPeer::addSelectColumns($criteria);
}
}
else
{
$criteria = clone $criteria;
conversionPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// attach default criteria
conversionPeer::<API key>($criteria);
// BasePeer returns a PDOStatement
return BasePeer::doSelect($criteria, $con);
}
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param conversion $value A conversion object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(conversion $obj, $key = null)
{
if (Propel::<API key>()) {
if ($key === null) {
$key = (string) $obj->getId();
}
self::$instances[$key] = $obj;
}
}
/**
* Removes an object from the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doDelete
* methods in your stub classes -- you may need to explicitly remove objects
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed $value A conversion object or a primary key value.
*/
public static function <API key>($value)
{
if (Propel::<API key>() && $value !== null) {
if (is_object($value) && $value instanceof conversion) {
$key = (string) $value->getId();
} elseif (is_scalar($value)) {
// assume we've been passed a primary key
$key = (string) $value;
} else {
$e = new PropelException("Invalid value passed to <API key>(). Expected primary key or conversion object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
throw $e;
}
unset(self::$instances[$key]);
}
} // <API key>()
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param string $key The key (@see getPrimaryKeyHash()) for this instance.
* @return conversion Found object or NULL if 1) no instance exists for specified key or 2) instance pooling has been disabled.
* @see getPrimaryKeyHash()
*/
public static function getInstanceFromPool($key)
{
if (Propel::<API key>()) {
if (isset(self::$instances[$key])) {
return self::$instances[$key];
}
}
return null; // just to be explicit
}
/**
* Clear the instance pool.
*
* @return void
*/
public static function clearInstancePool()
{
self::$instances = array();
}
/**
* Method to invalidate the instance pool of all tables related to conversion
* by a foreign key with ON DELETE CASCADE
*/
public static function <API key>()
{
}
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
*/
public static function <API key>($row, $startcol = 0)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[$startcol] === null) {
return null;
}
return (string) $row[$startcol];
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(PDOStatement $stmt)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = conversionPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = conversionPeer::<API key>($row, 0);
if (null !== ($obj = conversionPeer::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// $obj->hydrate($row, 0, true); // rehydrate
$results[] = $obj;
} else {
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
conversionPeer::addInstanceToPool($obj, $key);
} // if key exists
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining the related entry table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinentry(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(conversionPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
conversionPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$criteria->addJoin(conversionPeer::ENTRY_ID, entryPeer::ID, $join_behavior);
$stmt = conversionPeer::doCountStmt($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of conversion objects pre-filled with their entry objects.
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of conversion objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinentry(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
conversionPeer::addSelectColumns($criteria);
$startcol = (conversionPeer::NUM_COLUMNS - conversionPeer::<API key>);
entryPeer::addSelectColumns($criteria);
$criteria->addJoin(conversionPeer::ENTRY_ID, entryPeer::ID, $join_behavior);
$stmt = conversionPeer::doSelectStmt($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = conversionPeer::<API key>($row, 0);
if (null !== ($obj1 = conversionPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = conversionPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
conversionPeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = entryPeer::<API key>($row, $startcol);
if ($key2 !== null) {
$obj2 = entryPeer::getInstanceFromPool($key2);
if (!$obj2) {
$omClass = entryPeer::getOMClass($row, $startcol);
$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
entryPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (conversion) to $obj2 (entry)
$obj2->addconversion($obj1);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(conversionPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
conversionPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$criteria->addJoin(conversionPeer::ENTRY_ID, entryPeer::ID, $join_behavior);
$stmt = conversionPeer::doCountStmt($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of conversion objects pre-filled with all related objects.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of conversion objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
conversionPeer::addSelectColumns($criteria);
$startcol2 = (conversionPeer::NUM_COLUMNS - conversionPeer::<API key>);
entryPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (entryPeer::NUM_COLUMNS - entryPeer::<API key>);
$criteria->addJoin(conversionPeer::ENTRY_ID, entryPeer::ID, $join_behavior);
$stmt = conversionPeer::doSelectStmt($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = conversionPeer::<API key>($row, 0);
if (null !== ($obj1 = conversionPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = conversionPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
conversionPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined entry rows
$key2 = entryPeer::<API key>($row, $startcol2);
if ($key2 !== null) {
$obj2 = entryPeer::getInstanceFromPool($key2);
if (!$obj2) {
$omClass = entryPeer::getOMClass($row, $startcol2);
$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
entryPeer::addInstanceToPool($obj2, $key2);
} // if obj2 loaded
// Add the $obj1 (conversion) to the collection in $obj2 (entry)
$obj2->addconversion($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this peer class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getDatabaseMap(BaseconversionPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseconversionPeer::TABLE_NAME))
{
$dbMap->addTableObject(new conversionTableMap());
}
}
/**
* The class that the Peer will make instances of.
*
* If $withPrefix is true, the returned path
* uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @param boolean Whether or not to return the path wit hthe class name
* @return string path.to.ClassName
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? conversionPeer::CLASS_DEFAULT : conversionPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a conversion or Criteria object.
*
* @param mixed $values Criteria or conversion object containing data that is used to create the INSERT statement.
* @param PropelPDO $con the PropelPDO connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(conversionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from conversion object
}
if ($criteria->containsKey(conversionPeer::ID) && $criteria->keyContainsValue(conversionPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.conversionPeer::ID.')');
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->beginTransaction();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollBack();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a conversion or Criteria object.
*
* @param mixed $values Criteria or conversion object containing data that is used to create the UPDATE statement.
* @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(conversionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(conversionPeer::ID);
$selectCriteria->add(conversionPeer::ID, $criteria->remove(conversionPeer::ID), $comparison);
} else { // $values is conversion object
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the conversion table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(conversionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += BasePeer::doDeleteAll(conversionPeer::TABLE_NAME, $con);
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
conversionPeer::clearInstancePool();
conversionPeer::<API key>();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a conversion or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or conversion object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param PropelPDO $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(conversionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
// invalidate the cache for all objects of this type, since we have no
// way of knowing (without running a query) what objects should be invalidated
// from the cache based on this Criteria.
conversionPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof conversion) { // it's a model object
// invalidate the cache for this single object
conversionPeer::<API key>($values);
// create criteria based on pk values
$criteria = $values->buildPkeyCriteria();
} else { // it's a primary key, or an array of pks
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(conversionPeer::ID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
conversionPeer::<API key>($singleval);
}
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += BasePeer::doDelete($criteria, $con);
conversionPeer::<API key>();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given conversion object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param conversion $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(conversion $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(conversionPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(conversionPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(conversionPeer::DATABASE_NAME, conversionPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return conversion
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = conversionPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
$criteria = new Criteria(conversionPeer::DATABASE_NAME);
$criteria->add(conversionPeer::ID, $pk);
$v = conversionPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param PropelPDO $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, PropelPDO $con = null)
{
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(conversionPeer::DATABASE_NAME);
$criteria->add(conversionPeer::ID, $pks, Criteria::IN);
$objs = conversionPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseconversionPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
BaseconversionPeer::buildTableMap(); |
CREATE TABLE IF NOT EXISTS `pum_claim_level` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`level` varchar(80) DEFAULT NULL,
`max_amount` decimal(11,2) DEFAULT NULL,
`authorizing_level` varchar(64) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci; |
import {getSortingFromQuery} from './sorting'
export default {getSortingFromQuery} |
import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import * as actions from '../../actions';
import ng from 'core/services/ng';
import {<API key>} from 'core/helpers/dom/<API key>';
/**
* @ngdoc React
* @module superdesk.core.editor3
* @name <API key>
* @param {String} word the text the menu is opened for
* @param {Array} suggestions the list of suggestions for the target word
* @param {Object} position the editor relative position where the context menu will be showed
* @param {replaceWord} replaceWord callback
* @description The context menu for correction spellcheck errors. Contains a list of suggestions
* and 'Add to dictionary' and 'Ignore word' actions.
*/
export class <API key> extends React.Component<any, any> {
static propTypes: any;
static defaultProps: any;
<API key>: any;
dropdownElement: any;
constructor(props) {
super(props);
this.addWord = this.addWord.bind(this);
this.replaceWord = this.replaceWord.bind(this);
this.ignoreWord = this.ignoreWord.bind(this);
}
/**
* @ngdoc method
* @name <API key>#addWord
* @param {Event} e
* @description Handles the add word command.
*/
addWord(e) {
const spellcheck = ng.get('spellcheck');
const {word, refreshWord} = this.props;
spellcheck.addWord(word.text, false);
refreshWord(word);
}
/**
* @ngdoc method
* @name <API key>#replaceWord
* @param {Event} e
* @description Handles the replace word command.
*/
replaceWord(newWord) {
const {word, replaceWord} = this.props;
return (e) => {
replaceWord({word, newWord});
};
}
/**
* @ngdoc method
* @name <API key>#ignoreWord
* @param {Event} e
* @description Handles the ignore word command.
*/
ignoreWord(e) {
const spellcheck = ng.get('spellcheck');
const {word, refreshWord} = this.props;
spellcheck.addWord(word.text, true);
refreshWord(word);
}
componentDidMount() {
this.<API key> = new <API key>(this.props.targetElement, this.dropdownElement);
}
<API key>() {
this.<API key>.destroy();
}
render() {
const {suggestions} = this.props;
return (
<div className={'dropdown open <API key>'}
ref={(el) => this.dropdownElement = el}
style={{zIndex: 999, border: 'solid transparent', borderWidth: '6px 0'}}>
<ul className={'dropdown__menu'} style={{position: 'static'}}>
{suggestions.length === 0 ? <li><button>SORRY, NO SUGGESTIONS.</button></li>
: suggestions.map((suggestion, index) =>
<li key={index}>
<button onMouseDown={this.replaceWord(suggestion.key)}>
{suggestion.value}
</button>
</li>,
)
}
<li className="divider"/>
<li><button onMouseDown={this.addWord}>Add to dictionary</button></li>
<li><button onMouseDown={this.ignoreWord}>Ignore word</button></li>
</ul>
</div>
);
}
}
/** Set the types of props for the spellchecker context menu component*/
<API key>.propTypes = {
word: PropTypes.object,
suggestions: PropTypes.array,
replaceWord: PropTypes.func,
refreshWord: PropTypes.func,
targetElement: PropTypes.object,
};
/**
* @ngdoc method
* @name <API key>#mapDispatchToProps
* @param {Function} dispatch callback to store
* @returns {Object} Returns the props values
* @description Maps the values from state to the component callback type props.
*/
const mapDispatchToProps = (dispatch) => ({
refreshWord: (word) => setTimeout(() => dispatch(actions.refreshWord(word)), 0),
replaceWord: (word) => setTimeout(() => dispatch(actions.replaceWord(word)), 0),
});
export const <API key>: React.StatelessComponent<any> = connect(
null,
mapDispatchToProps,
)(<API key>); |
# -*- coding: utf-8 -*-
import re
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, UserError
from odoo.tools.float_utils import float_split_str
from odoo.tools.misc import mod10r
<API key> = 27
<API key> = 12
class AccountMove(models.Model):
_inherit = 'account.move'
<API key> = fields.Char(compute='<API key>', help='ISR subscription number identifying your company or your bank to generate ISR.')
<API key> = fields.Char(compute='<API key>', help="ISR subscription number your company or your bank, formated with '-' and without the padding zeros, to generate ISR report.")
l10n_ch_isr_number = fields.Char(compute='<API key>', store=True, help='The reference number associated with this invoice')
<API key> = fields.Char(compute='<API key>', help="ISR number split in blocks of 5 characters (right-justified), to generate ISR report.")
<API key> = fields.Char(compute="<API key>", help='Optical reading line, as it will be printed on ISR')
l10n_ch_isr_valid = fields.Boolean(compute='<API key>', help='Boolean value. True iff all the data required to generate the ISR are present')
l10n_ch_isr_sent = fields.Boolean(default=False, help="Boolean value telling whether or not the ISR corresponding to this invoice has already been printed or sent by mail.")
<API key> = fields.Char(related='currency_id.name', readonly=True, string="Currency Name", help="The name of this invoice's currency") #This field is used in the "invisible" condition field of the 'Print ISR' button.
@api.depends('partner_bank_id.<API key>', 'partner_bank_id.<API key>')
def <API key>(self):
""" Computes the ISR subscription identifying your company or the bank that allows to generate ISR. And formats it accordingly"""
def <API key>(isr_subscription):
#format the isr as per specifications
currency_code = isr_subscription[:2]
middle_part = isr_subscription[2:-1]
trailing_cipher = isr_subscription[-1]
middle_part = re.sub('^0*', '', middle_part)
return currency_code + '-' + middle_part + '-' + trailing_cipher
def <API key>(isr_subscription):
# format the isr for scanline
return isr_subscription[:2] + isr_subscription[2:-1].rjust(6, '0') + isr_subscription[-1:]
for record in self:
record.<API key> = False
record.<API key> = False
if record.partner_bank_id:
if record.currency_id.name == 'EUR':
isr_subscription = record.partner_bank_id.<API key>
elif record.currency_id.name == 'CHF':
isr_subscription = record.partner_bank_id.<API key>
else:
#we don't format if in another currency as EUR or CHF
continue
if isr_subscription:
isr_subscription = isr_subscription.replace("-", "") # In case the user put the -
record.<API key> = <API key>(isr_subscription)
record.<API key> = <API key>(isr_subscription)
@api.depends('name', 'partner_bank_id.l10n_ch_postal')
def <API key>(self):
""" The ISR reference number is 27 characters long. The first 12 of them
contain the postal account number of this ISR's issuer, removing the zeros
at the beginning and filling the empty places with zeros on the right if it is
too short. The next 14 characters contain an internal reference identifying
the invoice. For this, we use the invoice sequence number, removing each
of its non-digit characters, and pad the unused spaces on the left of
this number with zeros. The last character of the ISR number is the result
of a recursive modulo 10 on its first 26 characters.
"""
for record in self:
if record.name and record.partner_bank_id and record.partner_bank_id.l10n_ch_postal:
invoice_issuer_ref = record.partner_bank_id.l10n_ch_postal.ljust(<API key>, '0')
invoice_ref = re.sub('[^\d]', '', record.name)
#We only keep the last digits of the sequence number if it is too long
invoice_ref = invoice_ref[-<API key>:]
internal_ref = invoice_ref.zfill(<API key> - <API key> - 1) # -1 for mod10r check character
record.l10n_ch_isr_number = mod10r(invoice_issuer_ref + internal_ref)
else:
record.l10n_ch_isr_number = False
@api.depends('l10n_ch_isr_number')
def <API key>(self):
def _space_isr_number(isr_number):
to_treat = isr_number
res = ''
while to_treat:
res = to_treat[-5:] + res
to_treat = to_treat[:-5]
if to_treat:
res = ' ' + res
return res
for record in self:
if record.name and record.partner_bank_id and record.partner_bank_id.l10n_ch_postal:
record.<API key> = _space_isr_number(record.l10n_ch_isr_number)
else:
record.<API key> = False
@api.depends(
'currency_id.name', 'amount_residual', 'name',
'partner_bank_id.l10n_ch_postal',
'partner_bank_id.<API key>',
'partner_bank_id.<API key>')
def <API key>(self):
""" The optical reading line of the ISR looks like this :
left>isr_ref+ bank_ref>
Where:
- left is composed of two ciphers indicating the currency (01 for CHF,
03 for EUR), followed by ten characters containing the total of the
invoice (with the dot between units and cents removed, everything being
right-aligned and empty places filled with zeros). After the total,
left contains a last cipher, which is the result of a recursive modulo
10 function ran over the rest of it.
- isr_ref is the ISR reference number
- bank_ref is the full postal bank code (aka clearing number) of the
bank supporting the ISR (including the zeros).
"""
for record in self:
record.<API key> = ''
if record.l10n_ch_isr_number and record.<API key> and record.currency_id.name:
#Left part
currency_code = None
if record.currency_id.name == 'CHF':
currency_code = '01'
elif record.currency_id.name == 'EUR':
currency_code = '03'
units, cents = float_split_str(record.amount_residual, 2)
amount_to_display = units + cents
amount_ref = amount_to_display.zfill(10)
left = currency_code + amount_ref
left = mod10r(left)
#Final assembly (the space after the '+' is no typo, it stands in the specs.)
record.<API key> = left + '>' + record.l10n_ch_isr_number + '+ ' + record.<API key> + '>'
@api.depends(
'move_type', 'name', 'currency_id.name',
'partner_bank_id.l10n_ch_postal',
'partner_bank_id.<API key>',
'partner_bank_id.<API key>')
def <API key>(self):
"""Returns True if all the data required to generate the ISR are present"""
for record in self:
record.l10n_ch_isr_valid = record.move_type == 'out_invoice' and\
record.name and \
record.<API key> and \
record.partner_bank_id.l10n_ch_postal and \
record.<API key> in ['EUR', 'CHF']
def split_total_amount(self):
""" Splits the total amount of this invoice in two parts, using the dot as
a separator, and taking two precision digits (always displayed).
These two parts are returned as the two elements of a tuple, as strings
to print in the report.
This function is needed on the model, as it must be called in the report
template, which cannot reference static functions
"""
return float_split_str(self.amount_residual, 2)
def isr_print(self):
""" Triggered by the 'Print ISR' button.
"""
self.ensure_one()
if self.l10n_ch_isr_valid:
self.l10n_ch_isr_sent = True
return self.env.ref('l10n_ch.l10n_ch_isr_report').report_action(self)
else:
raise ValidationError(_("""You cannot generate an ISR yet.\n
For this, you need to :\n
- set a valid postal account number (or an IBAN referencing one) for your company\n
- define its bank\n
- associate this bank with a postal reference for the currency used in this invoice\n
- fill the 'bank account' field of the invoice with the postal to be used to receive the related payment. A default account will be automatically set for all invoices created after you defined a postal account for your company."""))
def print_ch_qr_bill(self):
""" Triggered by the 'Print QR-bill' button.
"""
self.ensure_one()
if not self.partner_bank_id.<API key>('ch_qr', self.partner_id, self.currency_id):
raise UserError(_("Cannot generate the QR-bill. Please check you have configured the address of your company and debtor. If you are using a QR-IBAN, also check the invoice's payment reference is a QR reference."))
self.l10n_ch_isr_sent = True
return self.env.ref('l10n_ch.l10n_ch_qr_report').report_action(self)
def action_invoice_sent(self):
# OVERRIDE
rslt = super(AccountMove, self).action_invoice_sent()
if self.l10n_ch_isr_valid:
rslt['context']['<API key>'] = True
return rslt
@api.returns('mail.message', lambda value: value.id)
def message_post(self, **kwargs):
if self.env.context.get('<API key>'):
self.filtered(lambda inv: not inv.l10n_ch_isr_sent).write({'l10n_ch_isr_sent': True})
return super(AccountMove, self.with_context(<API key>=True)).message_post(**kwargs)
def <API key>(self):
""" This sets ISR reference number which is generated based on customer's `Bank Account` and set it as
`Payment Reference` of the invoice when invoice's journal is using Switzerland's communication standard
"""
self.ensure_one()
return self.l10n_ch_isr_number
def <API key>(self):
""" This sets ISR reference number which is generated based on customer's `Bank Account` and set it as
`Payment Reference` of the invoice when invoice's journal is using Switzerland's communication standard
"""
self.ensure_one()
return self.l10n_ch_isr_number |
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace HearthAnalyzer.Core.Cards
{
<summary>
Represents a deck of cards
</summary>
public class Deck
{
internal int TopDeckIndex { get { return this.Cards.Count - 1; } }
internal int fatigueDamage;
public List<BaseCard> Cards;
<summary>
Initialize a new empty deck
</summary>
public Deck()
{
this.Cards = new List<BaseCard>();
this.fatigueDamage = 0;
}
<summary>
Initialize a deck with a list of cards
</summary>
<param name="cards">The cards to fill the deck with</param>
public Deck(List<BaseCard> cards)
{
this.Cards = cards;
this.fatigueDamage = 0;
}
<summary>
Draws a card from the player's deck
</summary>
<returns>The card that was drawn</returns>
public BaseCard DrawCard()
{
if (TopDeckIndex < 0)
{
fatigueDamage++;
return new FatigueCard(fatigueDamage);
}
BaseCard card = this.Cards[TopDeckIndex];
this.Cards.RemoveAt(TopDeckIndex);
return card;
}
<summary>
Draws n cards
</summary>
<param name="n">The number of cards to draw</param>
<returns>The list of cards drawn.</returns>
public List<BaseCard> DrawCards(int n = 1)
{
List<BaseCard> cards = new List<BaseCard>();
for (int i = 0; i < n; i++)
{
cards.Add(DrawCard());
}
return cards;
}
<summary>
Adds a card to the current deck
</summary>
<param name="card">The card to add</param>
<remarks>Adds to the end of the deck by default</remarks>
public void AddCard(BaseCard card)
{
this.Cards.Add(card);
}
<summary>
Adds a list of cards to the current deck
</summary>
<param name="cards">The list of cards to add</param>
<remarks>Adds to the end of the deck by default</remarks>
public void AddCards(IEnumerable<BaseCard> cards)
{
this.Cards.AddRange(cards);
}
<summary>
Shuffle the deck
</summary>
<param name="n">The number of times to shuffle the deck</param>
public void Shuffle(int n = 5)
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < this.Cards.Count; j++)
{
var swapIndex = GameEngine.Random.Next(this.Cards.Count);
BaseCard temp = this.Cards[swapIndex];
this.Cards[swapIndex] = this.Cards[j];
this.Cards[j] = temp;
}
}
}
<summary>
Creates a deck from a deck file
</summary>
<param name="pathToFile">Path to the deck file</param>
<returns>The deck based on the deck file</returns>
<remarks>
A deck file follows the following format:
[count], [card name]
with each card on a separate line
</remarks>
public static Deck FromDeckFile(string pathToFile)
{
var deck = new Deck();
using (var stream = new StreamReader(pathToFile))
{
while (stream.Peek() >= 0)
{
var line = stream.ReadLine();
if (line == null) continue;
// lines follow the format of [count], [card name]
var splitLine = line.Split(',');
if (splitLine.Count() != 2)
{
throw new <API key>(string.Format("Expected format of line is \"[count], [card name]\". Got {0} instead", line));
}
var count = int.Parse(splitLine[0]);
var cardName = splitLine[1];
var cleanedCardName = Regex.Replace(cardName, @"[\W]", "", RegexOptions.None);
for (int i = 0; i < count; i++)
{
var assembly = Assembly.Load("HearthAnalyzer.Core");
var cardType = assembly.GetTypes().FirstOrDefault(t => String.Equals(t.Name, cleanedCardName, StringComparison.<API key>));
if (cardType == null)
{
throw new <API key>(string.Format("Failed to find card type with name: {0}", cleanedCardName));
}
var createCardMethod = typeof (HearthEntityFactory).GetMethod("CreateCard");
var <API key> = createCardMethod.MakeGenericMethod(new[] {cardType});
dynamic card = <API key>.Invoke(null, null);
deck.AddCard(card);
}
}
}
if (deck.Cards.Count() > Constants.MAX_CARDS_IN_DECK)
{
throw new <API key>("There are too many cards in this deck!");
}
if (deck.Cards.Count() < Constants.MAX_CARDS_IN_DECK)
{
throw new <API key>("There are too few cards in this deck!");
}
return deck;
}
}
} |
/* eslint-disable react/<API key> */
// TODO(*): Fix above?
import React from 'react';
import ReactDOM from 'react-dom';
import _ from 'lodash';
import {ItemList as ItemListComponent} from 'apps/search/components';
import {<API key>} from 'apps/authoring/authoring/services/<API key>;
ItemList.$inject = [
'$location',
'$timeout',
'$injector',
'$filter',
'search',
'datetime',
'superdesk',
'workflowService',
'archiveService',
'activityService',
'multi',
'desks',
'familyService',
'Keys',
'dragitem',
'highlightsService',
'TranslationService',
'monitoringState',
'authoringWorkspace',
'$rootScope',
'config',
'$interpolate',
'metadata',
'storage',
'keyboardManager',
'session',
'content',
];
/**
* @ngdoc directive
* @module superdesk.apps.ItemList
* @name sdItemList
*
* @requires $location
* @requires $timeout
* @requires $injector
* @requires $filter
* @requires search
* @requires datetime
* @requires superdesk
* @requires workflowService
* @requires archiveService
* @requires activityService
* @requires multi
* @requires desks
* @requires familyService
* @requires Keys
* @requires dragitem
* @requires highlightsService
* @requires TranslationService
* @requires monitoringState
* @requires authoringWorkspace
* @requires $rootScope
* @requires config
* @requires $interpolate
* @requires metadata
* @requires storage
* @requires keyboardManager
* @requires session
*
* @description Handles the functionality displaying list of items from repos (archive, ingest, publish,
* external, content api, archived)
*/
export function ItemList(
$location,
$timeout,
$injector,
$filter,
search,
datetime,
superdesk,
workflowService,
archiveService,
activityService,
multi,
desks,
familyService,
Keys,
dragitem,
highlightsService,
TranslationService,
monitoringState,
authoringWorkspace: <API key>,
$rootScope,
config,
$interpolate,
metadata,
storage,
keyboardManager,
session,
content,
) {
// contains all the injected services to be passed down to child
// components via props
const services = {
$location: $location,
$timeout: $timeout,
$injector: $injector,
$filter: $filter,
search: search,
datetime: datetime,
superdesk: superdesk,
workflowService: workflowService,
archiveService: archiveService,
activityService: activityService,
multi: multi,
desks: desks,
familyService: familyService,
Keys: Keys,
dragitem: dragitem,
highlightsService: highlightsService,
TranslationService: TranslationService,
monitoringState: monitoringState,
authoringWorkspace: authoringWorkspace,
$rootScope: $rootScope,
config: config,
$interpolate: $interpolate,
metadata: metadata,
storage: storage,
keyboardManager: keyboardManager,
session: session,
content: content,
};
return {
link: function(scope, elem) {
elem.attr('tabindex', 0);
var groupId = scope.$id;
var groups = monitoringState.state.groups || [];
monitoringState.setState({
groups: groups.concat(scope.$id),
activeGroup: monitoringState.state.activeGroup || groupId,
});
scope.$watch(() => monitoringState.state.activeGroup, (activeGroup) => {
if (activeGroup === groupId) {
elem.focus();
}
});
monitoringState.init().then(() => {
var itemList = React.createElement(ItemListComponent,
angular.extend({
svc: services,
scope: scope,
<API key>: scope.<API key>,
<API key>: scope.<API key>,
<API key>: scope.<API key>,
<API key>: scope.<API key>,
}, monitoringState.state));
var listComponent = ReactDOM.render(itemList, elem[0]);
/**
* Test if item a equals to item b
*
* @param {Object} a
* @param {Object} b
* @return {Boolean}
*/
function isSameVersion(a, b) {
return a._etag === b._etag && a._current_version === b._current_version &&
a._updated === b._updated && <API key>(a, b);
}
/**
* Test if item a and item b have same elastic highlights
*
* @param {Object} a
* @param {Object} b
* @return {Boolean}
*/
function <API key>(a, b) {
if (!a.es_highlight && !b.es_highlight) {
return true;
}
if (!a.es_highlight && b.es_highlight || a.es_highlight && !b.es_highlight) {
return false;
}
function getEsHighlight(item) {
return item[0];
}
return _.map(a.es_highlight, getEsHighlight).join('-') ===
_.map(b.es_highlight, getEsHighlight).join('-');
}
/**
* Test if archive_item of a equals to archive_item of b
*
* @param {Object} a
* @param {Object} b
* @return {Boolean}
*/
function <API key>(a, b) {
if (!a.archive_item && !b.archive_item) {
return true;
}
if (a.archive_item && b.archive_item) {
if (b.archive_item.takes) {
return false; // take package of the new item might have changed
}
return a.archive_item._current_version === b.archive_item._current_version &&
a.archive_item._updated === b.archive_item._updated;
}
return false;
}
/**
* @ngdoc method
* @name sdItemList#<API key>
* @private
* @description
* @param {object} oldItem Existing scope item
* @param {object} newItem From search results
* @return {boolean} returns true if the id of the featuremedia is same
*/
function <API key>(oldItem, newItem) {
if (_.get(oldItem, '_type') !== 'items' || _.get(newItem, '_type') !== 'items') {
return true;
}
if (oldItem && newItem) {
return _.get(oldItem, 'associations.featuremedia._id') ===
_.get(newItem, 'associations.featuremedia._id');
}
return false;
}
scope.$watch('items', (items) => {
if (!items || !items._items) {
return;
}
var itemsList = [];
var currentItems = {};
var itemsById = angular.extend({}, listComponent.state.itemsById);
items._items.forEach((item) => {
var itemId = search.<API key>(item);
var oldItem = itemsById[itemId] || null;
if (!oldItem || !isSameVersion(oldItem, item) ||
!<API key>(oldItem, item) ||
!<API key>(oldItem, item)) {
itemsById[itemId] = angular.extend({}, oldItem, item);
}
if (!currentItems[itemId]) { // filter out possible duplicates
currentItems[itemId] = true;
itemsList.push(itemId);
}
});
listComponent.setState({
itemsList: itemsList,
itemsById: itemsById,
view: scope.view,
}, () => {
scope.rendering = scope.loading = false;
});
}, true);
scope.$watch('view', (newValue, oldValue) => {
if (newValue !== oldValue) {
listComponent.setState({view: newValue});
}
});
scope.$watch('viewColumn', (newValue, oldValue) => {
if (newValue !== oldValue) {
scope.$applyAsync(() => {
listComponent.setState({swimlane: newValue});
scope.refreshGroup();
});
}
});
scope.$on('item:lock', (_e, data) => {
var itemId = search.<API key>(data.item, data.item_version);
listComponent.updateItem(itemId, {
lock_user: data.user,
lock_session: data.lock_session,
lock_time: data.lock_time,
_etag: data._etag,
});
});
scope.$on('item:unlock', (_e, data) => {
listComponent.updateAllItems(data.item, {
lock_user: null,
lock_session: null,
lock_time: null,
_etag: data._etag,
});
});
scope.$on('item:unselect', () => {
listComponent.setState({selected: null});
listComponent.<API key>();
});
scope.$on('item:expired', (_e, data) => {
var itemsById = angular.extend({}, listComponent.state.itemsById);
var shouldUpdate = false;
_.forOwn(itemsById, (item, key) => {
if (data.items[item._id]) {
itemsById[key] = angular.extend({gone: true}, item);
shouldUpdate = true;
}
});
if (shouldUpdate) {
listComponent.setState({itemsById: itemsById});
}
});
scope.$on('item:unlink', (_e, data) => {
listComponent.updateAllItems(data.item, {
sequence: null,
anpa_take_key: null,
takes: undefined,
});
});
scope.$on('item:highlights', (_e, data) => updateMarkedItems('highlights', data));
scope.$on('item:marked_desks', (_e, data) => updateMarkedItems('marked_desks', data));
function updateMarkedItems(field, data) {
var item = listComponent.findItemByPrefix(data.item_id);
function filterMark(mark) {
return mark !== data.mark_id;
}
if (item) {
var itemId = search.<API key>(item);
var markedItems = item[field] || [];
if (field === 'marked_desks' && item[field]) {
markedItems = _.isString(markedItems[0]) ? markedItems : _.map(markedItems, 'desk_id');
}
if (data.marked) {
markedItems = markedItems.concat([data.mark_id]);
} else {
markedItems = markedItems.filter(filterMark);
}
listComponent.updateItem(itemId, {[field]: markedItems});
}
}
scope.$on('multi:reset', (e, data) => {
var ids = data.ids || [];
var shouldUpdate = false;
var itemsById = angular.extend({}, listComponent.state.itemsById);
_.forOwn(itemsById, (value, key) => {
ids.forEach((id) => {
if (_.startsWith(key, id)) {
shouldUpdate = true;
itemsById[key] = angular.extend({}, value, {selected: null});
}
});
});
if (shouldUpdate) {
listComponent.setState({itemsById: itemsById});
}
});
scope.singleLine = search.singleLine;
scope.$on('rowview:narrow', () => {
listComponent.setNarrowView(true);
});
scope.$on('rowview:default', () => {
listComponent.setNarrowView(false);
});
var updateTimeout;
/**
* Function for creating small delay,
* before activating render function
*/
function handleScroll($event) {
// force refresh the group or list, if scroll bar hits the top of list.
if (elem[0].scrollTop === 0) {
$rootScope.$broadcast('refresh:list', scope.group);
}
if (scope.rendering) { // ignore
$event.preventDefault();
return;
}
// only scroll the list, not its parent
$event.stopPropagation();
listComponent.closeActionsMenu();
$timeout.cancel(updateTimeout);
if (!scope.noScroll) {
updateTimeout = $timeout(renderIfNeeded, 100, false);
}
}
/**
* Trigger render in case user scrolls to the very end of list
*/
function renderIfNeeded() {
if (!scope.items) {
return; // automatic scroll after removing items
}
if (isListEnd(elem[0]) && !scope.rendering) {
scope.rendering = scope.loading = true;
scope.fetchNext(listComponent.state.itemsList.length);
}
}
/**
* Check if we reached end of the list elem
*
* @param {Element} elem
* @return {Boolean}
*/
function isListEnd(element) {
return element.scrollTop + element.offsetHeight + 200 >= element.scrollHeight;
}
elem.on('keydown', listComponent.handleKey);
elem.on('scroll', handleScroll);
// remove react elem on destroy
scope.$on('$destroy', () => {
elem.off();
listComponent.<API key>();
ReactDOM.<API key>(elem[0]);
});
});
},
};
} |
<?php
require_once 'base/fs_model.php';
class <API key> extends fs_model
{
public $pvptotal;
public $dtopor;
public $recargo;
public $irpf;
public $pvpsindto;
public $cantidad;
public $codimpuesto;
public $pvpunitario;
public $idlinea;
public $idfactura;
public $idalbaran;
public $descripcion;
public $dtolineal;
public $referencia;
public $iva;
private $codigo;
private $fecha;
private $factura_url;
private $albaran_codigo;
private $albaran_numero;
private $albaran_fecha;
private $albaran_url;
private $articulo_url;
private static $facturas;
private static $albaranes;
private static $articulos;
public function __construct($l=FALSE)
{
parent::__construct('lineasfacturascli');
if( !isset(self::$facturas) )
self::$facturas = array();
if( !isset(self::$albaranes) )
self::$albaranes = array();
if( !isset(self::$articulos) )
self::$articulos = array();
if($l)
{
$this->idlinea = $this->intval($l['idlinea']);
$this->idfactura = $this->intval($l['idfactura']);
$this->idalbaran = $this->intval($l['idalbaran']);
$this->referencia = $l['referencia'];
$this->descripcion = $l['descripcion'];
$this->cantidad = floatval($l['cantidad']);
$this->pvpunitario = floatval($l['pvpunitario']);
$this->pvpsindto = floatval($l['pvpsindto']);
$this->dtopor = floatval($l['dtopor']);
$this->dtolineal = floatval($l['dtolineal']);
$this->pvptotal = floatval($l['pvptotal']);
$this->codimpuesto = $l['codimpuesto'];
$this->iva = floatval($l['iva']);
$this->recargo = floatval($l['recargo']);
$this->irpf = floatval($l['irpf']);
}
else
{
$this->idlinea = NULL;
$this->idfactura = NULL;
$this->idalbaran = NULL;
$this->referencia = '';
$this->descripcion = '';
$this->cantidad = 0;
$this->pvpunitario = 0;
$this->pvpsindto = 0;
$this->dtopor = 0;
$this->dtolineal = 0;
$this->pvptotal = 0;
$this->codimpuesto = NULL;
$this->iva = 0;
$this->recargo = 0;
$this->irpf = 0;
}
}
protected function install()
{
return '';
}
private function fill()
{
$encontrado = FALSE;
foreach(self::$facturas as $f)
{
if($f->idfactura == $this->idfactura)
{
$this->codigo = $f->codigo;
$this->fecha = $f->fecha;
$this->factura_url = $f->url();
$encontrado = TRUE;
break;
}
}
if( !$encontrado )
{
$fac = new factura_cliente();
$fac = $fac->get($this->idfactura);
if($fac)
{
$this->codigo = $fac->codigo;
$this->fecha = $fac->fecha;
$this->factura_url = $fac->url();
self::$facturas[] = $fac;
}
}
$encontrado = FALSE;
foreach(self::$albaranes as $a)
{
if($a->idalbaran == $this->idalbaran)
{
$this->albaran_codigo = $a->codigo;
if( is_null($a->numero2) OR $a->numero2 == '')
$this->albaran_numero = $a->numero;
else
$this->albaran_numero = $a->numero2;
$this->albaran_fecha = $a->fecha;
$this->albaran_url = $a->url();
$encontrado = TRUE;
break;
}
}
if( !$encontrado )
{
$alb = new albaran_cliente();
$alb = $alb->get($this->idalbaran);
if($alb)
{
$this->albaran_codigo = $alb->codigo;
if( is_null($alb->numero2) OR $alb->numero2 == '')
$this->albaran_numero = $alb->numero;
else
$this->albaran_numero = $alb->numero2;
$this->albaran_fecha = $alb->fecha;
$this->albaran_url = $alb->url();
self::$albaranes[] = $alb;
}
}
$encontrado = FALSE;
foreach(self::$articulos as $a)
{
if($a->referencia == $this->referencia)
{
$this->articulo_url = $a->url();
$encontrado = TRUE;
break;
}
}
if( !$encontrado )
{
$art = new articulo();
$art = $art->get($this->referencia);
if($art)
{
$this->articulo_url = $art->url();
self::$articulos[] = $art;
}
}
}
public function total_iva()
{
return $this->pvptotal*(100+$this->iva)/100;
}
public function show_codigo()
{
if( !isset($this->codigo) )
$this->fill();
return $this->codigo;
}
public function show_fecha()
{
if( !isset($this->fecha) )
$this->fill();
return $this->fecha;
}
public function url()
{
if( !isset($this->factura_url) )
$this->fill();
return $this->factura_url;
}
public function albaran_codigo()
{
if( !isset($this->albaran_codigo) )
$this->fill();
return $this->albaran_codigo;
}
public function albaran_url()
{
if( !isset($this->albaran_url) )
$this->fill();
return $this->albaran_url;
}
public function albaran_numero()
{
if( !isset($this->albaran_numero) )
$this->fill();
return $this->albaran_numero;
}
public function albaran_fecha()
{
if( !isset($this->albaran_fecha) )
$this->fill();
return $this->albaran_fecha;
}
public function articulo_url()
{
if( !isset($this->articulo_url) )
$this->fill();
return $this->articulo_url;
}
public function exists()
{
if( is_null($this->idlinea) )
return FALSE;
else
return $this->db->select("SELECT * FROM ".$this->table_name.
" WHERE idlinea = ".$this->var2str($this->idlinea).";");
}
public function new_idlinea()
{
$newid = $this->db->nextval($this->table_name.'_idlinea_seq');
if($newid)
$this->idlinea = intval($newid);
}
public function test()
{
$this->descripcion = $this->no_html($this->descripcion);
$total = $this->pvpunitario * $this->cantidad * (100 - $this->dtopor) / 100;
$totalsindto = $this->pvpunitario * $this->cantidad;
if( !$this->floatcmp($this->pvptotal, $total, 2, TRUE) )
{
$this->new_error_msg("Error en el valor de pvptotal de la línea ".$this->referencia.
" de la factura. Valor correcto: ".$total);
return FALSE;
}
else if( !$this->floatcmp($this->pvpsindto, $totalsindto, 2, TRUE) )
{
$this->new_error_msg("Error en el valor de pvpsindto de la línea ".$this->referencia.
" de la factura. Valor correcto: ".$totalsindto);
return FALSE;
}
else
return TRUE;
}
public function save()
{
if( $this->test() )
{
if( $this->exists() )
{
$sql = "UPDATE ".$this->table_name." SET idfactura = ".$this->var2str($this->idfactura).",
idalbaran = ".$this->var2str($this->idalbaran).",
referencia = ".$this->var2str($this->referencia).",
descripcion = ".$this->var2str($this->descripcion).",
cantidad = ".$this->var2str($this->cantidad).",
pvpunitario = ".$this->var2str($this->pvpunitario).",
pvpsindto = ".$this->var2str($this->pvpsindto).",
dtopor = ".$this->var2str($this->dtopor).",
dtolineal = ".$this->var2str($this->dtolineal).",
pvptotal = ".$this->var2str($this->pvptotal).",
codimpuesto = ".$this->var2str($this->codimpuesto).",
iva = ".$this->var2str($this->iva).",
recargo = ".$this->var2str($this->recargo).",
irpf = ".$this->var2str($this->irpf).
" WHERE idlinea = ".$this->var2str($this->idlinea).";";
}
else
{
$this->new_idlinea();
$sql = "INSERT INTO ".$this->table_name." (idlinea,idfactura,idalbaran,referencia,
descripcion,cantidad,pvpunitario,pvpsindto,dtopor,dtolineal,pvptotal,codimpuesto,
iva,recargo,irpf) VALUES (".$this->var2str($this->idlinea).",
".$this->var2str($this->idfactura).",".$this->var2str($this->idalbaran).",
".$this->var2str($this->referencia).",".$this->var2str($this->descripcion).",
".$this->var2str($this->cantidad).",".$this->var2str($this->pvpunitario).",
".$this->var2str($this->pvpsindto).",".$this->var2str($this->dtopor).",
".$this->var2str($this->dtolineal).",".$this->var2str($this->pvptotal).",
".$this->var2str($this->codimpuesto).",".$this->var2str($this->iva).",
".$this->var2str($this->recargo).",".$this->var2str($this->irpf).");";
}
return $this->db->exec($sql);
}
else
return FALSE;
}
public function delete()
{
return $this->db->exec("DELETE FROM ".$this->table_name.
" WHERE idlinea = ".$this->var2str($this->idlinea).";");
}
public function all_from_factura($id)
{
$linlist = array();
$lineas = $this->db->select("SELECT * FROM ".$this->table_name.
" WHERE idfactura = ".$this->var2str($id)." ORDER BY idlinea ASC;");
if($lineas)
{
$aux = array();
foreach($lineas as $l)
$aux[] = new <API key>($l);
ordenamos por fecha del albarán
$lids = array();
while( count($linlist) != count($aux) )
{
$selection = FALSE;
foreach($aux as $linea)
{
if( !in_array($linea->idlinea, $lids) )
{
if( !$selection )
$selection = $linea;
else if( $linea->albaran_fecha() < $selection->albaran_fecha() )
$selection = $linea;
}
}
if($selection)
{
$linlist[] = $selection;
$lids[] = $selection->idlinea;
}
}
}
return $linlist;
}
public function all_from_articulo($ref, $offset=0)
{
$linealist = array();
$lineas = $this->db->select_limit("SELECT * FROM ".$this->table_name.
" WHERE referencia = ".$this->var2str($ref).
" ORDER BY idalbaran DESC", FS_ITEM_LIMIT, $offset);
if( $lineas )
{
foreach($lineas as $l)
$linealist[] = new <API key>($l);
}
return $linealist;
}
public function <API key>($id)
{
$facturalist = array();
$lineas = $this->db->select("SELECT DISTINCT idfactura FROM ".$this->table_name.
" WHERE idalbaran = ".$this->var2str($id).";");
if($lineas)
{
$factura = new factura_cliente();
foreach($lineas as $l)
$facturalist[] = $factura->get( $l['idfactura'] );
}
return $facturalist;
}
}
?> |
package com.rapidminer.operator.libraries;
import com.rapidminer.gui.tools.VersionNumber;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.<API key>;
import com.rapidminer.operator.OperatorDescription;
import com.rapidminer.repository.BlobEntry;
import com.rapidminer.tools.OperatorService;
import com.rapidminer.tools.documentation.OperatorDocBundle;
import com.rapidminer.tools.documentation.<API key>;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
/**
* This is the interface for all OperatorLibraries. These are objects that contain the description
* of an arbitrary number of Operators, together with their documentation.
*
* @author Sebastian Land
*/
public interface OperatorLibrary extends Serializable {
/**
* This is the repository location where this library is stored.
*/
public String <API key>();
/**
* This method returns the keys of all defined operators.
*/
public Set<String> getOperatorKeys();
/**
* This method returns the {@link OperatorDescription} associated with the given key.
*/
public <API key> getDescription(String key);
/**
* This method must return the {@link OperatorDescription}'s of all defined operators.
*/
public List<<API key>> <API key>();
/**
* This method will register this {@link OperatorLibrary}s operators to the
* {@link OperatorService}.
*
* @throws <API key>
*/
public void registerOperators() throws <API key>;
/**
* This method will unregister this {@link OperatorLibrary}s operators from the
* {@link OperatorService}.
*/
public void unregisterOperators();
/**
* This method has to return a {@link <API key>} for the given key. The result must
* be not null! If no documentation exists, use a default one, with just the key as name.
*/
public <API key> <API key>(String operatorKey);
/**
* This returns a {@link OperatorDocBundle} that contains information about each single
* delivered {@link Operator} of this library.
*/
public OperatorDocBundle <API key>();
/**
* This returns the name of the library. This name will be displayed as Subgroup name in the
* NewOperatorTree below the top group for libraries.
*/
public String getName();
/**
* This returns a short textual description of the functionality provided by this
* {@link OperatorLibrary}.
*/
public String getSynopsis();
/**
* This returns a HTML fragment that in detail describes the inner working of this
* {@link OperatorLibrary}.
*/
public String getDocumentation();
/**
* This method returns a {@link VersionNumber} that is the version of this
* {@link OperatorLibrary}.
*/
public VersionNumber getVersion();
/**
* This method returns the namespace of this OperatorLibrary. These namespaces are used to
* distinguish between different libraries. The namespace should be unique and must be of the
* form: rmol_"Qualifier".
*/
public String getNamespace();
/**
* This method returns the speaking name of the namespace of this OperatorLibrary. These
* namespaces are used to distinguish between different libraries. The namespace should be
* unique and must be of the form: rmol_"Qualifier". In order to make it unique a random suffix
* is added. This returns the original namespace name given by user.
*/
public String getNamespaceName();
/**
* This sets the name of the library. This name will be displayed as Subgroup name in the
* NewOperatorTree below the top group for libraries.
*/
public void setName(String newName);
/**
* This sets a short textual description of the functionality provided by this
* {@link OperatorLibrary}.
*/
public void setSynopsis(String newSyopsis);
/**
* This sets a HTML fragment that in detail describes the inner working of this
* {@link OperatorLibrary}.
*/
public void setDocumentation(String newDocumentation);
/**
* This method sets a {@link VersionNumber} that is the version of this {@link OperatorLibrary}.
*/
public void setVersion(VersionNumber newVersion);
/**
* This method will save the current state of the library to the given repository entry
*/
public void save(BlobEntry entry);
/**
* This method will save the current state of the library into the given stream.
*/
public void save(OutputStream out);
} |
package com.rapidminer.gui.new_plotter;
/**
* An exception which is thrown if an error occurs during plotting. Think of this as a
* RuntimeException in the context of the plotter framework.
*
* For errors during chart configuration {@see <API key>}.
*
* @author Marius Helf
*
*/
public class <API key> extends <API key> {
private static final long serialVersionUID = 1L;
public <API key>(<API key> changeResponse) {
super(changeResponse);
}
public <API key>(<API key> error) {
super(error);
}
public <API key>(String string, Object... params) {
super(string, params);
}
} |
<?php
/**
* @package api
* @subpackage filters.base
* @abstract
*/
abstract class <API key> extends KalturaFilter
{
static private $map_between_objects = array
(
"idEqual" => "_eq_id",
"idIn" => "_in_id",
"systemNameEqual" => "_eq_system_name",
"systemNameIn" => "_in_system_name",
"<API key>" => "_gte_created_at",
"<API key>" => "_lte_created_at",
);
static private $order_by_map = array
(
"+createdAt" => "+created_at",
"-createdAt" => "-created_at",
);
public function <API key>()
{
return array_merge(parent::<API key>(), self::$map_between_objects);
}
public function getOrderByMap()
{
return array_merge(parent::getOrderByMap(), self::$order_by_map);
}
/**
* @var int
*/
public $idEqual;
/**
* @var string
*/
public $idIn;
/**
* @var string
*/
public $systemNameEqual;
/**
* @var string
*/
public $systemNameIn;
/**
* @var time
*/
public $<API key>;
/**
* @var time
*/
public $<API key>;
} |
#ifndef <API key>
#define <API key>
#include <vector>
#include "rpc/serialize_macros.hpp"
class printf_buffer_t;
/* Binary blob that represents some unknown POD type */
class binary_blob_t {
public:
binary_blob_t() { }
template<class obj_t>
explicit binary_blob_t(const obj_t &o) : storage(reinterpret_cast<const uint8_t *>(&o), reinterpret_cast<const uint8_t *>(&o + 1)) { }
binary_blob_t(const uint8_t *data, size_t size) : storage(data, data+size) { }
template<class InputIterator>
binary_blob_t(InputIterator begin, InputIterator end) : storage(begin, end) { }
/* Constructor in static method form so we can use it as a functor */
template<class obj_t>
static binary_blob_t make(const obj_t &o) {
return binary_blob_t(o);
}
size_t size() const {
return storage.size();
}
template<class obj_t>
static const obj_t &get(const binary_blob_t &blob) {
guarantee(blob.size() == sizeof(obj_t), "blob.size() = %zu, sizeof(obj_t) = %zu", blob.size(), sizeof(obj_t));
return *reinterpret_cast<const obj_t *>(blob.data());
}
void *data() {
return storage.data();
}
const void *data() const {
return storage.data();
}
private:
std::vector<uint8_t> storage;
<API key>;
};
inline bool operator==(const binary_blob_t &left, const binary_blob_t &right) {
return left.size() == right.size() && memcmp(left.data(), right.data(), left.size()) == 0;
}
inline bool operator!=(const binary_blob_t &left, const binary_blob_t &right) {
return !(left == right);
}
void debug_print(printf_buffer_t *buf, const binary_blob_t &blob);
#endif // <API key> |
DELETE FROM `weenie` WHERE `class_Id` = 27851;
INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`)
VALUES (27851, 'guidesingularity', 8, '2019-02-10 00:00:00') /* Book */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (27851, 1, 8192) /* ItemType - Writable */
, (27851, 5, 5) /* EncumbranceVal */
, (27851, 16, 8) /* ItemUseable - Contained */
, (27851, 19, 50) /* Value */
, (27851, 93, 1044) /* PhysicsState - Ethereal, IgnoreCollisions, Gravity */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (27851, 39, 0.4) /* DefaultScale */
, (27851, 54, 1) /* UseRadius */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (27851, 1, 'The Weapons of the Singularity') /* Name */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (27851, 1, 33559084) /* Setup */
, (27851, 3, 536870932) /* SoundTable */
, (27851, 6, 67112626) /* PaletteBase */
, (27851, 8, 100675751) /* Icon */
, (27851, 22, 872415275) /* PhysicsEffectTable */
, (27851, 8001, 2113592) /* <API key> - Value, Usable, UseRadius, Container, Burden */
, (27851, 8003, 272) /* <API key> - Attackable, Book */
, (27851, 8005, 6273) /* <API key> - CSetup, ObjScale, STable, PeTable */
, (27851, 8044, 29916) /* <API key> - Pack Asheron */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (27851, 8000, 27851) /* <API key> */;
INSERT INTO `<API key>` (`object_Id`, `sub_Palette_Id`, `offset`, `length`)
VALUES (27851, 67113862, 0, 0); |
DELETE FROM `weenie` WHERE `class_Id` = 10807;
INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`)
VALUES (10807, 'tumerokaugmented', 10, '2019-02-10 00:00:00') /* Creature */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10807, 1, 16) /* ItemType - Creature */
, (10807, 2, 6) /* CreatureType - Tumerok */
, (10807, 6, -1) /* ItemsCapacity */
, (10807, 7, -1) /* ContainersCapacity */
, (10807, 16, 1) /* ItemUseable - No */
, (10807, 25, 100) /* Level */
, (10807, 93, 1032) /* PhysicsState - ReportCollisions, Gravity */
, (10807, 133, 2) /* ShowableOnRadar - ShowMovement */
, (10807, 307, 5) /* DamageRating */
, (10807, 8007, 0) /* <API key> */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10807, 1, True ) /* Stuck */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10807, 39, 1.3) /* DefaultScale */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10807, 1, 'Augmented Tumerok') /* Name */
, (10807, 8006, 'AAA9AAAAAAA=') /* <API key> */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10807, 1, 33559566) /* Setup */
, (10807, 2, 150994954) /* MotionTable */
, (10807, 3, 536870931) /* SoundTable */
, (10807, 6, 67116625) /* PaletteBase */
, (10807, 8, 100667452) /* Icon */
, (10807, 22, 872415270) /* PhysicsEffectTable */
, (10807, 8001, 8388630) /* <API key> - ItemsCapacity, ContainersCapacity, Usable, RadarBehavior */
, (10807, 8003, 20) /* <API key> - Stuck, Attackable */
, (10807, 8005, 104579) /* <API key> - CSetup, MTable, ObjScale, STable, PeTable, Position, Movement */;
INSERT INTO `<API key>` (`object_Id`, `position_Type`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`)
VALUES (10807, 8040, 1138556968, 110.9951, 176.0678, 5.833363, 0.9238795, 0, 0, -0.3826835) /* <API key> */
/* @teleloc 0x43DD0028 [110.995100 176.067800 5.833363] 0.923880 0.000000 0.000000 -0.382684 */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (10807, 8000, 3696861218) /* <API key> */;
INSERT INTO `<API key>` (`object_Id`, `type`, `init_Level`, `level_From_C_P`, `c_P_Spent`)
VALUES (10807, 1, 250, 0, 0) /* Strength */
, (10807, 2, 300, 0, 0) /* Endurance */
, (10807, 3, 275, 0, 0) /* Quickness */
, (10807, 4, 250, 0, 0) /* Coordination */
, (10807, 5, 200, 0, 0) /* Focus */
, (10807, 6, 270, 0, 0) /* Self */;
INSERT INTO `<API key>` (`object_Id`, `type`, `init_Level`, `level_From_C_P`, `c_P_Spent`, `current_Level`)
VALUES (10807, 1, 200, 0, 0, 350) /* MaxHealth */
, (10807, 3, 300, 0, 0, 600) /* MaxStamina */
, (10807, 5, 0, 0, 0, 270) /* MaxMana */;
INSERT INTO `<API key>` (`object_Id`, `destination_Type`, `weenie_Class_Id`, `stack_Size`, `palette`, `shade`, `try_To_Bond`)
VALUES (10807, 2, 23710, 1, 0, 0, False) /* Create Yaoji (23710) for Wield */
, (10807, 2, 23684, 1, 0, 0, False) /* Create Kite Shield (23684) for Wield */
, (10807, 2, 23665, 1, 0, 0, False) /* Create Heavy Crossbow (23665) for Wield */
, (10807, 2, 23637, 1, 0, 0, False) /* Create Cestus (23637) for Wield */
, (10807, 2, 23734, 1, 0, 0, False) /* Create Yumi (23734) for Wield */
, (10807, 2, 15429, 1, 0, 0, False) /* Create Deadly Arrow (15429) for Wield */
, (10807, 2, 15438, 1, 0, 0, False) /* Create Deadly Quarrel (15438) for Wield */
, (10807, 2, 23707, 1, 0, 0, False) /* Create Fire Tachi (23707) for Wield */
, (10807, 2, 23696, 1, 0, 0, False) /* Create Spear (23696) for Wield */
, (10807, 2, 23700, 1, 0, 0, False) /* Create Tachi (23700) for Wield */
, (10807, 2, 23680, 1, 0, 0, False) /* Create Nekode (23680) for Wield */
, (10807, 2, 23718, 1, 0, 0, False) /* Create Fire Yaoji (23718) for Wield */
, (10807, 2, 23674, 1, 0, 0, False) /* Create Katar (23674) for Wield */
, (10807, 9, 43306, 0, 0, 0, False) /* Create Scroll of Nether Bolt V (43306) for ContainTreasure */
, (10807, 9, 20492, 0, 0, 0, False) /* Create Scroll of Robustify (20492) for ContainTreasure */
, (10807, 9, 8328, 1, 0, 0, False) /* Create Iron Pea (8328) for ContainTreasure */
, (10807, 9, 3695, 0, 0, 0, False) /* Create Gold Tumerok Insignia (3695) for ContainTreasure */
, (10807, 9, 7897, 0, 0, 0, False) /* Create Steel Toed Boots (7897) for ContainTreasure */
, (10807, 9, 94, 0, 0, 0, False) /* Create Diamond Shield (94) for ContainTreasure */
, (10807, 9, 41485, 0, 0, 0, False) /* Create Pocket Watch (41485) for ContainTreasure */
, (10807, 9, 22156, 0, 0, 0, False) /* Create Flaming Jo (22156) for ContainTreasure */
, (10807, 9, 2435, 0, 0, 0, False) /* Create Mana Stone (2435) for ContainTreasure */
, (10807, 9, 31771, 0, 0, 0, False) /* Create Lightning War Axe (31771) for ContainTreasure */
, (10807, 9, 2426, 1, 0, 0, False) /* Create Gem (2426) for ContainTreasure */
, (10807, 9, 55, 0, 0, 0, False) /* Create Chainmail Gauntlets (55) for ContainTreasure */
, (10807, 9, 630, 0, 0, 0, False) /* Create Gifted Healing Kit (630) for ContainTreasure */
, (10807, 9, 49331, 0, 0, 0, False) /* Create Frost Wisp Essence (50) (49331) for ContainTreasure */
, (10807, 9, 30616, 0, 0, 0, False) /* Create Arbalest (30616) for ContainTreasure */
, (10807, 9, 311, 0, 0, 0, False) /* Create Heavy Crossbow (311) for ContainTreasure */
, (10807, 9, 363, 0, 0, 0, False) /* Create Yumi (363) for ContainTreasure */
, (10807, 9, 7790, 0, 0, 0, False) /* Create Electric Spiked Club (7790) for ContainTreasure */
, (10807, 9, 793, 0, 0, 0, False) /* Create Scalemail Coif (793) for ContainTreasure */
, (10807, 9, 45322, 0, 0, 0, False) /* Create Scroll of Shield Mastery Other VII (45322) for ContainTreasure */
, (10807, 9, 20493, 0, 0, 0, False) /* Create Scroll of Tenaciousness (20493) for ContainTreasure */
, (10807, 9, 312, 0, 0, 0, False) /* Create Light Crossbow (312) for ContainTreasure */
, (10807, 9, 273, 443, 0, 0, False) /* Create Pyreal (273) for ContainTreasure */
, (10807, 9, 91, 0, 0, 0, False) /* Create Kite Shield (91) for ContainTreasure */
, (10807, 9, 31769, 0, 0, 0, False) /* Create Lugian Axe (31769) for ContainTreasure */
, (10807, 9, 49475, 0, 0, 0, False) /* Create Scroll of Summoning Mastery Self VI (49475) for ContainTreasure */
, (10807, 9, 45114, 0, 0, 0, False) /* Create Acid Hammer (45114) for ContainTreasure */
, (10807, 9, 359, 0, 0, 0, False) /* Create War Hammer (359) for ContainTreasure */
, (10807, 9, 3311, 0, 0, 0, False) /* Create Scroll of Item Enchantment Mastery Other V (3311) for ContainTreasure */
, (10807, 9, 631, 0, 0, 0, False) /* Create Excellent Healing Kit (631) for ContainTreasure */
, (10807, 9, 622, 0, 0, 0, False) /* Create Necklace (622) for ContainTreasure */
, (10807, 9, 63, 0, 0, 0, False) /* Create Studded Leather Girth (63) for ContainTreasure */
, (10807, 9, 28607, 0, 0, 0, False) /* Create Lace Shirt (28607) for ContainTreasure */
, (10807, 9, 3852, 0, 0, 0, False) /* Create Frost Scimitar (3852) for ContainTreasure */
, (10807, 9, 31759, 0, 0, 0, False) /* Create Dericost Blade (31759) for ContainTreasure */
, (10807, 9, 25652, 0, 0, 0, False) /* Create Leather Tassets (25652) for ContainTreasure */
, (10807, 9, 2599, 0, 0, 0, False) /* Create Trousers (2599) for ContainTreasure */
, (10807, 9, 49213, 0, 0, 0, False) /* Create Acid Skeleton Minion Essence (50) (49213) for ContainTreasure */
, (10807, 9, 2595, 0, 0, 0, False) /* Create Baggy Tunic (2595) for ContainTreasure */
, (10807, 9, 43362, 0, 0, 0, False) /* Create Scroll of Void Magic Mastery Other V (43362) for ContainTreasure */
, (10807, 9, 25638, 0, 0, 0, False) /* Create Leather Vest (25638) for ContainTreasure */
, (10807, 9, 31787, 0, 0, 0, False) /* Create Flaming Claw (31787) for ContainTreasure */;
INSERT INTO `<API key>` (`object_Id`, `sub_Palette_Id`, `offset`, `length`)
VALUES (10807, 67116625, 57, 48)
, (10807, 67116625, 153, 47)
, (10807, 67116628, 1, 48)
, (10807, 67116641, 105, 48)
, (10807, 67116641, 208, 48)
, (10807, 67116642, 200, 8); |
"""
Test for asset XML generation / parsing.
"""
import unittest
import pytest
from contracts import <API key>
from lxml import etree
from opaque_keys.edx.locator import CourseLocator
from path import Path as path
from six.moves import zip
from xmodule.assetstore import AssetMetadata
from xmodule.modulestore.tests.test_assetstore import AssetStoreTestData
class TestAssetXml(unittest.TestCase):
"""
Tests for storing/querying course asset metadata.
"""
def setUp(self):
super(TestAssetXml, self).setUp() # lint-amnesty, pylint: disable=<API key>
xsd_filename = "assets.xsd"
self.course_id = CourseLocator('org1', 'course1', 'run1')
self.course_assets = []
for asset in AssetStoreTestData.all_asset_data:
asset_dict = dict(list(zip(AssetStoreTestData.asset_fields[1:], asset[1:])))
asset_md = AssetMetadata(self.course_id.make_asset_key('asset', asset[0]), **asset_dict)
self.course_assets.append(asset_md)
# Read in the XML schema definition and make a validator.
xsd_path = path(__file__).realpath().parent / xsd_filename
with open(xsd_path, 'rb') as f:
schema_root = etree.XML(f.read())
schema = etree.XMLSchema(schema_root)
self.xmlparser = etree.XMLParser(schema=schema)
def <API key>(self):
"""
Export a single AssetMetadata to XML and verify the structure and fields.
"""
asset_md = self.course_assets[0]
root = etree.Element("assets")
asset = etree.SubElement(root, "asset")
asset_md.to_xml(asset)
# If this line does *not* raise, the XML is valid.
etree.fromstring(etree.tostring(root), self.xmlparser)
new_asset_key = self.course_id.make_asset_key('tmp', 'tmp')
new_asset_md = AssetMetadata(new_asset_key)
new_asset_md.from_xml(asset)
# Compare asset_md to new_asset_md.
for attr in AssetMetadata.XML_ATTRS:
if attr in AssetMetadata.XML_ONLY_ATTRS:
continue
orig_value = getattr(asset_md, attr)
new_value = getattr(new_asset_md, attr)
assert orig_value == new_value
def <API key>(self):
"""
Export and import a single AssetMetadata to XML with a None created_by field, without causing an exception.
"""
asset_md = AssetMetadata(
self.course_id.make_asset_key('asset', 'none_value'),
created_by=None,
)
asset = etree.Element("asset")
asset_md.to_xml(asset)
asset_md.from_xml(asset)
def <API key>(self):
"""
Export all AssetMetadatas to XML and verify the structure and fields.
"""
root = etree.Element("assets")
AssetMetadata.<API key>(root, self.course_assets)
# If this line does *not* raise, the XML is valid.
etree.fromstring(etree.tostring(root), self.xmlparser)
def <API key>(self):
"""
Ensure full asset sections with the wrong tag are detected.
"""
root = etree.Element("glassets")
with pytest.raises(<API key>):
AssetMetadata.<API key>(root, self.course_assets)
def <API key>(self):
"""
Ensure single asset blocks with the wrong tag are detected.
"""
asset_md = self.course_assets[0]
root = etree.Element("assets")
asset = etree.SubElement(root, "smashset")
with pytest.raises(<API key>):
asset_md.to_xml(asset) |
<?php
defined( 'BASEPATH' ) or exit( 'No direct script access allowed' );
define( 'FILE_READ_MODE', 0644 );
define( 'FILE_WRITE_MODE', 0666 );
define( 'DIR_READ_MODE', 0755 );
define( 'DIR_WRITE_MODE', 0755 );
define( 'FOPEN_READ', 'rb' );
define( 'FOPEN_READ_WRITE', 'r+b' );
define( '<API key>', 'wb' ); // truncates existing file data, use with care
define( '<API key>', 'w+b' ); // truncates existing file data, use with care
define( 'FOPEN_WRITE_CREATE', 'ab' );
define( '<API key>', 'a+b' );
define( '<API key>', 'xb' );
define( '<API key>', 'x+b' );
define( '<API key>', TRUE );
define( 'EXIT_SUCCESS', 0 ); // no errors
define( 'EXIT_ERROR', 1 ); // generic error
define( 'EXIT_CONFIG', 3 ); // configuration error
define( 'EXIT_UNKNOWN_FILE', 4 ); // file not found
define( 'EXIT_UNKNOWN_CLASS', 5 ); // unknown class
define( 'EXIT_UNKNOWN_METHOD', 6 ); // unknown class member
define( 'EXIT_USER_INPUT', 7 ); // invalid user input
define( 'EXIT_DATABASE', 8 ); // database error
define( 'EXIT__AUTO_MIN', 9 ); // lowest <API key> error code
define( 'EXIT__AUTO_MAX', 125 ); // highest <API key> error code
/*
* constantes programme
*/
define( 'COEF_CM', 1.5 );
define( 'COEF_TD', 1 );
define( 'COEF_TP', 0.75 );
define( 'COEF_DS', 0 ); |
package Schema::Result::Profile;
# DO NOT MODIFY THE FIRST PART OF THIS FILE
use strict;
use warnings;
use Moose;
use MooseX::NonMoose;
use namespace::autoclean;
extends 'DBIx::Class::Core';
__PACKAGE__->load_components("InflateColumn::DateTime");
=head1 NAME
Schema::Result::Profile
=cut
__PACKAGE__->table("profiles");
=head1 ACCESSORS
=head2 profile_id
data_type: 'integer'
extra: {unsigned => 1}
is_auto_increment: 1
is_nullable: 0
=head2 profile_code
data_type: 'char'
is_nullable: 0
size: 30
=head2 display_name
data_type: 'varchar'
default_value: (empty string)
is_nullable: 0
size: 50
=cut
__PACKAGE__->add_columns(
"profile_id",
{
data_type => "integer",
extra => { unsigned => 1 },
is_auto_increment => 1,
is_nullable => 0,
},
"profile_code",
{ data_type => "char", is_nullable => 0, size => 30 },
"display_name",
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
);
__PACKAGE__->set_primary_key("profile_id");
__PACKAGE__-><API key>("profile_code", ["profile_code"]);
=head1 RELATIONS
=head2 buttons
Type: has_many
Related object: L<Schema::Result::Button>
=cut
__PACKAGE__->has_many(
"buttons",
"Schema::Result::Button",
{ "foreign.profile_id" => "self.profile_id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 channels
Type: has_many
Related object: L<Schema::Result::Channel>
=cut
__PACKAGE__->has_many(
"channels",
"Schema::Result::Channel",
{ "foreign.profile_id" => "self.profile_id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 clips
Type: has_many
Related object: L<Schema::Result::Clip>
=cut
__PACKAGE__->has_many(
"clips",
"Schema::Result::Clip",
{ "foreign.profile_id" => "self.profile_id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:<API key>
# You can replace this text with custom code or comments, and it will be preserved on regeneration
__PACKAGE__->meta->make_immutable;
1; |
<API key> = Creature:new {
objectName = "",
socialGroup = "rebel",
faction = "rebel",
level = 100,
chanceHit = 1,
damageMin = 645,
damageMax = 1000,
baseXp = 9429,
baseHAM = 24000,
baseHAMmax = 30000,
armor = 0,
resists = {0,0,0,0,0,0,0,0,-1},
meatType = "",
meatAmount = 0,
hideType = "",
hideAmount = 0,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0,
ferocity = 0,
pvpBitmask = NONE,
creatureBitmask = PACK,
optionsBitmask = INVULNERABLE + CONVERSABLE,
diet = HERBIVORE,
templates = {"object/mobile/<API key>.iff"},
lootGroups = {},
weapons = {},
<API key> = "<API key>",
attacks = {
}
}
CreatureTemplates:addCreatureTemplate(<API key>, "<API key>") |
create table <API key>
(
k_coin int not null AUTO_INCREMENT,
created_by int null,
created_for int null,
redeemed_by int null,
redeemed_for int null,
date_created timestamp null default CURRENT_TIMESTAMP,
date_redeemed timestamp null,
utility_flag int null,
KEY <API key> (k_coin)
); |
package org.restcomm.protocols.ss7.cap.api.service.circuitSwitchedCall.primitive;
import java.io.Serializable;
/**
*
<code>
<API key> ::= SEQUENCE {
<API key> [1] OCTET STRING (SIZE(1)) OPTIONAL,
-- <API key> 'xxxx xx01'B
-- <API key> 'xxxx xx10'B
-- if absent from Connect or <API key>,
-- then CAMEL service does not affect conference treatment
<API key> [2] OCTET STRING (SIZE(1)) OPTIONAL,
-- <API key> 'xxxx xx01'B
-- <API key> 'xxxx xx10'B
-- if absent from Connect or <API key>,
-- then CAMEL service does not affect call diversion treatment
<API key> [4] OCTET STRING (SIZE(1)) OPTIONAL,
-- noINImpact 'xxxx xx01'B
-- <API key> 'xxxx xx10'B
-- if absent from Connect or <API key>,
-- then CAMEL service does not affect calling party restriction treatment
}
</code>
*
* @author sergey vetyutnev
*
*/
public interface <API key> extends Serializable {
<API key> <API key>();
<API key> <API key>();
<API key> <API key>();
} |
// Generated from comp.proto
package org.yamcs.protobuf;
public final class SchemaComp
{
public static final class ComputationDef
{
public static final org.yamcs.protobuf.SchemaComp.ComputationDef.MessageSchema WRITE =
new org.yamcs.protobuf.SchemaComp.ComputationDef.MessageSchema();
public static final org.yamcs.protobuf.SchemaComp.ComputationDef.BuilderSchema MERGE =
new org.yamcs.protobuf.SchemaComp.ComputationDef.BuilderSchema();
public static class MessageSchema implements io.protostuff.Schema<org.yamcs.protobuf.Comp.ComputationDef>
{
public void writeTo(io.protostuff.Output output, org.yamcs.protobuf.Comp.ComputationDef message) throws java.io.IOException
{
if(message.hasName())
output.writeString(1, message.getName(), false);
if(message.hasExpression())
output.writeString(2, message.getExpression(), false);
for(org.yamcs.protobuf.Yamcs.NamedObjectId argument : message.getArgumentList())
output.writeObject(3, argument, org.yamcs.protobuf.SchemaYamcs.NamedObjectId.WRITE, true);
if(message.hasLanguage())
output.writeString(4, message.getLanguage(), false);
}
public boolean isInitialized(org.yamcs.protobuf.Comp.ComputationDef message)
{
return message.isInitialized();
}
public java.lang.String getFieldName(int number)
{
return org.yamcs.protobuf.SchemaComp.ComputationDef.getFieldName(number);
}
public int getFieldNumber(java.lang.String name)
{
return org.yamcs.protobuf.SchemaComp.ComputationDef.getFieldNumber(name);
}
public java.lang.Class<org.yamcs.protobuf.Comp.ComputationDef> typeClass()
{
return org.yamcs.protobuf.Comp.ComputationDef.class;
}
public java.lang.String messageName()
{
return org.yamcs.protobuf.Comp.ComputationDef.class.getSimpleName();
}
public java.lang.String messageFullName()
{
return org.yamcs.protobuf.Comp.ComputationDef.class.getName();
}
//unused
public void mergeFrom(io.protostuff.Input input, org.yamcs.protobuf.Comp.ComputationDef message) throws java.io.IOException {}
public org.yamcs.protobuf.Comp.ComputationDef newMessage() { return null; }
}
public static class BuilderSchema implements io.protostuff.Schema<org.yamcs.protobuf.Comp.ComputationDef.Builder>
{
public void mergeFrom(io.protostuff.Input input, org.yamcs.protobuf.Comp.ComputationDef.Builder builder) throws java.io.IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
builder.setName(input.readString());
break;
case 2:
builder.setExpression(input.readString());
break;
case 3:
builder.addArgument(input.mergeObject(org.yamcs.protobuf.Yamcs.NamedObjectId.newBuilder(), org.yamcs.protobuf.SchemaYamcs.NamedObjectId.MERGE));
break;
case 4:
builder.setLanguage(input.readString());
break;
default:
input.handleUnknownField(number, this);
}
}
}
public boolean isInitialized(org.yamcs.protobuf.Comp.ComputationDef.Builder builder)
{
return builder.isInitialized();
}
public org.yamcs.protobuf.Comp.ComputationDef.Builder newMessage()
{
return org.yamcs.protobuf.Comp.ComputationDef.newBuilder();
}
public java.lang.String getFieldName(int number)
{
return org.yamcs.protobuf.SchemaComp.ComputationDef.getFieldName(number);
}
public int getFieldNumber(java.lang.String name)
{
return org.yamcs.protobuf.SchemaComp.ComputationDef.getFieldNumber(name);
}
public java.lang.Class<org.yamcs.protobuf.Comp.ComputationDef.Builder> typeClass()
{
return org.yamcs.protobuf.Comp.ComputationDef.Builder.class;
}
public java.lang.String messageName()
{
return org.yamcs.protobuf.Comp.ComputationDef.class.getSimpleName();
}
public java.lang.String messageFullName()
{
return org.yamcs.protobuf.Comp.ComputationDef.class.getName();
}
//unused
public void writeTo(io.protostuff.Output output, org.yamcs.protobuf.Comp.ComputationDef.Builder builder) throws java.io.IOException {}
}
public static java.lang.String getFieldName(int number)
{
switch(number)
{
case 1: return "name";
case 2: return "expression";
case 3: return "argument";
case 4: return "language";
default: return null;
}
}
public static int getFieldNumber(java.lang.String name)
{
java.lang.Integer number = fieldMap.get(name);
return number == null ? 0 : number.intValue();
}
private static final java.util.HashMap<java.lang.String,java.lang.Integer> fieldMap = new java.util.HashMap<java.lang.String,java.lang.Integer>();
static
{
fieldMap.put("name", 1);
fieldMap.put("expression", 2);
fieldMap.put("argument", 3);
fieldMap.put("language", 4);
}
}
public static final class ComputationDefList
{
public static final org.yamcs.protobuf.SchemaComp.ComputationDefList.MessageSchema WRITE =
new org.yamcs.protobuf.SchemaComp.ComputationDefList.MessageSchema();
public static final org.yamcs.protobuf.SchemaComp.ComputationDefList.BuilderSchema MERGE =
new org.yamcs.protobuf.SchemaComp.ComputationDefList.BuilderSchema();
public static class MessageSchema implements io.protostuff.Schema<org.yamcs.protobuf.Comp.ComputationDefList>
{
public void writeTo(io.protostuff.Output output, org.yamcs.protobuf.Comp.ComputationDefList message) throws java.io.IOException
{
for(org.yamcs.protobuf.Comp.ComputationDef compDef : message.getCompDefList())
output.writeObject(1, compDef, org.yamcs.protobuf.SchemaComp.ComputationDef.WRITE, true);
if(message.hasAbortOnInvalid())
output.writeBool(2, message.getAbortOnInvalid(), false);
}
public boolean isInitialized(org.yamcs.protobuf.Comp.ComputationDefList message)
{
return message.isInitialized();
}
public java.lang.String getFieldName(int number)
{
return org.yamcs.protobuf.SchemaComp.ComputationDefList.getFieldName(number);
}
public int getFieldNumber(java.lang.String name)
{
return org.yamcs.protobuf.SchemaComp.ComputationDefList.getFieldNumber(name);
}
public java.lang.Class<org.yamcs.protobuf.Comp.ComputationDefList> typeClass()
{
return org.yamcs.protobuf.Comp.ComputationDefList.class;
}
public java.lang.String messageName()
{
return org.yamcs.protobuf.Comp.ComputationDefList.class.getSimpleName();
}
public java.lang.String messageFullName()
{
return org.yamcs.protobuf.Comp.ComputationDefList.class.getName();
}
//unused
public void mergeFrom(io.protostuff.Input input, org.yamcs.protobuf.Comp.ComputationDefList message) throws java.io.IOException {}
public org.yamcs.protobuf.Comp.ComputationDefList newMessage() { return null; }
}
public static class BuilderSchema implements io.protostuff.Schema<org.yamcs.protobuf.Comp.ComputationDefList.Builder>
{
public void mergeFrom(io.protostuff.Input input, org.yamcs.protobuf.Comp.ComputationDefList.Builder builder) throws java.io.IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
builder.addCompDef(input.mergeObject(org.yamcs.protobuf.Comp.ComputationDef.newBuilder(), org.yamcs.protobuf.SchemaComp.ComputationDef.MERGE));
break;
case 2:
builder.setAbortOnInvalid(input.readBool());
break;
default:
input.handleUnknownField(number, this);
}
}
}
public boolean isInitialized(org.yamcs.protobuf.Comp.ComputationDefList.Builder builder)
{
return builder.isInitialized();
}
public org.yamcs.protobuf.Comp.ComputationDefList.Builder newMessage()
{
return org.yamcs.protobuf.Comp.ComputationDefList.newBuilder();
}
public java.lang.String getFieldName(int number)
{
return org.yamcs.protobuf.SchemaComp.ComputationDefList.getFieldName(number);
}
public int getFieldNumber(java.lang.String name)
{
return org.yamcs.protobuf.SchemaComp.ComputationDefList.getFieldNumber(name);
}
public java.lang.Class<org.yamcs.protobuf.Comp.ComputationDefList.Builder> typeClass()
{
return org.yamcs.protobuf.Comp.ComputationDefList.Builder.class;
}
public java.lang.String messageName()
{
return org.yamcs.protobuf.Comp.ComputationDefList.class.getSimpleName();
}
public java.lang.String messageFullName()
{
return org.yamcs.protobuf.Comp.ComputationDefList.class.getName();
}
//unused
public void writeTo(io.protostuff.Output output, org.yamcs.protobuf.Comp.ComputationDefList.Builder builder) throws java.io.IOException {}
}
public static java.lang.String getFieldName(int number)
{
switch(number)
{
case 1: return "compDef";
case 2: return "abortOnInvalid";
default: return null;
}
}
public static int getFieldNumber(java.lang.String name)
{
java.lang.Integer number = fieldMap.get(name);
return number == null ? 0 : number.intValue();
}
private static final java.util.HashMap<java.lang.String,java.lang.Integer> fieldMap = new java.util.HashMap<java.lang.String,java.lang.Integer>();
static
{
fieldMap.put("compDef", 1);
fieldMap.put("abortOnInvalid", 2);
}
}
} |
(function()
{
/**
* Add to collection with DUP examination.
* @param {Object} collection
* @param {Object} element
* @param {Object} database
*/
function addSafely( collection, element, database )
{
// 1. IE doesn't support customData on text nodes;
// 2. Text nodes never get chance to appear twice;
if ( !element.is || !element.getCustomData( 'block_processed' ) )
{
element.is && CKEDITOR.dom.element.setMarker( database, element, 'block_processed', true );
collection.push( element );
}
}
function getNonEmptyChildren( element )
{
var retval = [];
var children = element.getChildren();
for( var i = 0 ; i < children.count() ; i++ )
{
var child = children.getItem( i );
if( ! ( child.type === CKEDITOR.NODE_TEXT
&& ( /^[ \t\n\r]+$/ ).test( child.getText() ) ) )
retval.push( child );
}
return retval;
}
/**
* Dialog reused by both 'creatediv' and 'editdiv' commands.
* @param {Object} editor
* @param {String} command The command name which indicate what the current command is.
*/
function divDialog( editor, command )
{
// Definition of elements at which div operation should stopped.
var divLimitDefinition = ( function(){
// Customzie from specialize blockLimit elements
var definition = CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$blockLimit );
// Exclude 'div' itself.
delete definition.div;
// Exclude 'td' and 'th' when 'wrapping table'
if( editor.config.div_wrapTable )
{
delete definition.td;
delete definition.th;
}
return definition;
})();
// DTD of 'div' element
var dtd = CKEDITOR.dtd.div;
/**
* Get the first div limit element on the element's path.
* @param {Object} element
*/
function getDivLimitElement( element )
{
var pathElements = new CKEDITOR.dom.elementPath( element ).elements;
var divLimit;
for ( var i = 0; i < pathElements.length ; i++ )
{
if ( pathElements[ i ].getName() in divLimitDefinition )
{
divLimit = pathElements[ i ];
break;
}
}
return divLimit;
}
/**
* Init all fields' setup/commit function.
* @memberof divDialog
*/
function setupFields()
{
this.foreach( function( field )
{
// Exclude layout container elements
if( /^(?!vbox|hbox)/.test( field.type ) )
{
if ( !field.setup )
{
// Read the dialog fields values from the specified
// element attributes.
field.setup = function( element )
{
field.setValue( element.getAttribute( field.id ) || '' );
};
}
if ( !field.commit )
{
// Set element attributes assigned by the dialog
// fields.
field.commit = function( element )
{
var fieldValue = this.getValue();
// ignore default element attribute values
if ( 'dir' == field.id && element.getComputedStyle( 'direction' ) == fieldValue )
return;
if ( fieldValue )
element.setAttribute( field.id, fieldValue );
else
element.removeAttribute( field.id );
};
}
}
} );
}
/**
* Wrapping 'div' element around appropriate blocks among the selected ranges.
* @param {Object} editor
*/
function createDiv( editor )
{
// new adding containers OR detected pre-existed containers.
var containers = [];
// node markers store.
var database = {};
// All block level elements which contained by the ranges.
var containedBlocks = [], block;
// Get all ranges from the selection.
var selection = editor.document.getSelection();
var ranges = selection.getRanges();
var bookmarks = selection.createBookmarks();
var i, iterator;
// Calcualte a default block tag if we need to create blocks.
var blockTag = editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p';
// collect all included elements from dom-iterator
for( i = 0 ; i < ranges.length ; i++ )
{
iterator = ranges[ i ].createIterator();
while( ( block = iterator.getNextParagraph() ) )
{
// include contents of blockLimit elements.
if( block.getName() in divLimitDefinition )
{
var j, childNodes = block.getChildren();
for ( j = 0 ; j < childNodes.count() ; j++ )
addSafely( containedBlocks, childNodes.getItem( j ) , database );
}
else
{
// Bypass dtd disallowed elements.
while( !dtd[ block.getName() ] && block.getName() != 'body' )
block = block.getParent();
addSafely( containedBlocks, block, database );
}
}
}
CKEDITOR.dom.element.clearAllMarkers( database );
var blockGroups = groupByDivLimit( containedBlocks );
var ancestor, blockEl, divElement;
for( i = 0 ; i < blockGroups.length ; i++ )
{
var currentNode = blockGroups[ i ][ 0 ];
// Calculate the common parent node of all contained elements.
ancestor = currentNode.getParent();
for ( j = 1 ; j < blockGroups[ i ].length; j++ )
ancestor = ancestor.getCommonAncestor( blockGroups[ i ][ j ] );
divElement = new CKEDITOR.dom.element( 'div', editor.document );
// Normalize the blocks in each group to a common parent.
for( j = 0; j < blockGroups[ i ].length ; j++ )
{
currentNode = blockGroups[ i ][ j ];
while( !currentNode.getParent().equals( ancestor ) )
currentNode = currentNode.getParent();
// This could introduce some duplicated elements in array.
blockGroups[ i ][ j ] = currentNode;
}
// Wrapped blocks counting
var fixedBlock = null;
for ( j = 0 ; j < blockGroups[ i ].length ; j++ )
{
currentNode = blockGroups[ i ][ j ];
// Avoid DUP elements introduced by grouping.
if ( !( currentNode.getCustomData && currentNode.getCustomData( 'block_processed' ) ) )
{
currentNode.is && CKEDITOR.dom.element.setMarker( database, currentNode, 'block_processed', true );
// Establish new container, wrapping all elements in this group.
if ( !j )
divElement.insertBefore( currentNode );
divElement.append( currentNode );
}
}
CKEDITOR.dom.element.clearAllMarkers( database );
containers.push( divElement );
}
selection.selectBookmarks( bookmarks );
return containers;
}
function getDiv( editor )
{
var path = new CKEDITOR.dom.elementPath( editor.getSelection().getStartElement() ),
blockLimit = path.blockLimit,
div = blockLimit && blockLimit.getAscendant( 'div', true );
return div;
}
/**
* Divide a set of nodes to different groups by their path's blocklimit element.
* Note: the specified nodes should be in source order naturally, which mean they are supposed to producea by following class:
* * CKEDITOR.dom.range.Iterator
* * CKEDITOR.dom.domWalker
* @return {Array []} the grouped nodes
*/
function groupByDivLimit( nodes )
{
var groups = [],
lastDivLimit = null,
path, block;
for ( var i = 0 ; i < nodes.length ; i++ )
{
block = nodes[i];
var limit = getDivLimitElement( block );
if ( !limit.equals( lastDivLimit ) )
{
lastDivLimit = limit ;
groups.push( [] ) ;
}
groups[ groups.length - 1 ].push( block ) ;
}
return groups;
}
/**
* Hold a collection of created block container elements.
*/
var containers = [];
/**
* @type divDialog
*/
return {
title : editor.lang.div.title,
minWidth : 400,
minHeight : 165,
contents :
[
{
id :'info',
label :editor.lang.common.generalTab,
title :editor.lang.common.generalTab,
elements :
[
{
type :'hbox',
widths : [ '50%', '50%' ],
children :
[
{
id :'elementStyle',
type :'select',
style :'width: 100%;',
label :editor.lang.div.styleSelectLabel,
'default' : '',
items : [],
setup : function( element )
{
this.setValue( element.$.style.cssText || '' );
},
commit: function( element )
{
if ( this.getValue() )
element.$.style.cssText = this.getValue();
else
element.removeAttribute( 'style' );
}
},
{
id :'class',
type :'text',
label :editor.lang.common.cssClass,
'default' : ''
}
]
}
]
},
{
id :'advanced',
label :editor.lang.common.advancedTab,
title :editor.lang.common.advancedTab,
elements :
[
{
type :'vbox',
padding :1,
children :
[
{
type :'hbox',
widths : [ '50%', '50%' ],
children :
[
{
type :'text',
id :'id',
label :editor.lang.common.id,
'default' : ''
},
{
type :'text',
id :'lang',
label :editor.lang.link.langCode,
'default' : ''
}
]
},
{
type :'hbox',
children :
[
{
type :'text',
id :'style',
style :'width: 100%;',
label :editor.lang.common.cssStyle,
'default' : ''
}
]
},
{
type :'hbox',
children :
[
{
type :'text',
id :'title',
style :'width: 100%;',
label :editor.lang.common.advisoryTitle,
'default' : ''
}
]
},
{
type :'select',
id :'dir',
style :'width: 100%;',
label :editor.lang.common.langDir,
'default' : '',
items :
[
[
editor.lang.common.langDirLtr,
'ltr'
],
[
editor.lang.common.langDirRtl,
'rtl'
]
]
}
]
}
]
}
],
onLoad : function()
{
setupFields.call(this);
},
onShow : function()
{
// Whether always create new container regardless of existed
// ones.
if ( command == 'editdiv' )
{
// Try to discover the containers that already existed in
// ranges
var div = getDiv( editor );
// update dialog field values
div && this.setupContent( this._element = div );
}
},
onOk : function()
{
if( command == 'editdiv' )
containers = [ this._element ];
else
containers = createDiv( editor, true );
// Update elements attributes
for( var i = 0 ; i < containers.length ; i++ )
this.commitContent( containers[ i ] );
this.hide();
}
};
}
CKEDITOR.dialog.add( 'creatediv', function( editor )
{
return divDialog( editor, 'creatediv' );
} );
CKEDITOR.dialog.add( 'editdiv', function( editor )
{
return divDialog( editor, 'editdiv' );
} );
} )();
/*
* @name CKEDITOR.config.div_wrapTable
* Whether to wrap the whole table instead of indivisual cells when created 'div' in table cell.
* @type Boolean
* @default false
* @example config.div_wrapTable = true;
*/ |
from typing import Any, Sequence, Union
from dataclasses import dataclass
from . import RequestMsg, ReplyMsg, Message, SimpleMessage
from hedgehog.protocol.proto import ack_pb2
from hedgehog.utils import protobuf
__all__ = ['Acknowledgement']
# <GSL customizable: module-header>
from hedgehog.protocol.proto.ack_pb2 import OK, UNKNOWN_COMMAND, INVALID_COMMAND, UNSUPPORTED_COMMAND, FAILED_COMMAND
__all__ += ['OK', 'UNKNOWN_COMMAND', 'INVALID_COMMAND', 'UNSUPPORTED_COMMAND', 'FAILED_COMMAND']
# </GSL customizable: module-header>
@ReplyMsg.message(ack_pb2.Acknowledgement, 'acknowledgement', fields=('code', 'message',))
@dataclass(frozen=True, repr=False)
class Acknowledgement(SimpleMessage):
code: int = OK
message: str = ''
def __post_init__(self):
# <default GSL customizable: <API key>>
pass
# </GSL customizable: <API key>>
# <default GSL customizable: <API key> />
@classmethod
def _parse(cls, msg: ack_pb2.Acknowledgement) -> 'Acknowledgement':
code = msg.code
message = msg.message
return cls(code, message=message)
def _serialize(self, msg: ack_pb2.Acknowledgement) -> None:
msg.code = self.code
msg.message = self.message |
package nc.ird.malariaplantdb.service.xls;
import lombok.extern.slf4j.Slf4j;
import nc.ird.malariaplantdb.service.xls.infos.SheetInfo;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
@Slf4j
public class ExcelReaderTest {
@SuppressWarnings("unchecked")
@Test
public void testReadOK() throws Exception {
// List<SheetInfo> sheetInfos = new ArrayList<>();
// SheetInfo sheetInfo = new SheetInfo(
// PublicationLine.class,
// "1 - PUBLI",
// Publication.class,
// new ArrayList<>(),
// PublicationMock.<API key>(PublicationMock.PUBLI_COLUMN_INFOS, ColumnInfo.class, "\\|"));
// sheetInfos.add(sheetInfo);
// InputStream excelInput = new BufferedInputStream(getClass().getResourceAsStream("/xls/test.xlsm"));
// ExcelReader reader = new ExcelReader(sheetInfos, "/xls/publi_mapping.xml");
// ExcelReader.ReaderResult readerRes = reader.read(excelInput);
// List<PublicationLine> importedBeans = readerRes.getDtosMap().getList(sheetInfo.getDtoClass());
// log.debug(String.format("Imported in %s dto beans :", importedBeans.size()));
// importedBeans
// .stream()
// .forEach(p -> log.debug(p.toString()));
// assertTrue(importedBeans.get(1).getEntryType().equals("Journal article"));
// assertTrue(importedBeans.get(2).getYear().equals(1981));
// assertTrue(importedBeans.get(3).getTitle().equals("Antiplasmodial and antipyretic studies on root extracts of" +
// " Anthocleista djalonensis against Plasmodium berghei"));
// assertTrue(importedBeans.get(3).getMonth().equals("FEB"));
// assertTrue(readerRes.getCellErrors().size() == 0);
// assertTrue(readerRes.getDtosMap().getList(PublicationLine.class).size() == 11);
}
@SuppressWarnings("unchecked")
@Test
public void <API key>() throws Exception {
List<SheetInfo> sheetInfos = new ArrayList<>();
// SheetInfo sheetInfo = new SheetInfo(
// PublicationLine.class,
// "1 - PUBLI",
// Publication.class,
// new ArrayList<>(),
// PublicationMock.<API key>(PublicationMock.PUBLI_COLUMN_INFOS, ColumnInfo.class, "\\|"));
// sheetInfos.add(sheetInfo);
// InputStream excelInput = new BufferedInputStream(getClass().getResourceAsStream("/xls/<API key>.xlsm"));
// ExcelReader reader = new ExcelReader(sheetInfos, "/xls/publi_mapping.xml");
// ExcelReader.ReaderResult readerRes = reader.read(excelInput);
// CellError specificError = readerRes.getCellErrors().get(0);
// assertTrue(specificError.getMessage().equals("Error by reading the cell value. Please verify the value has " +
// "the expected format."));
// assertTrue(specificError.getSheet().equals(sheetInfo.getSheetLabel()));
// assertTrue(specificError.getLine().equals(2));
// assertTrue(specificError.getColumn().equals("Year"));
// assertTrue(specificError.<API key>().equals("ConversionException - Error converting from " +
// "'String' to 'Integer' For input string: \"aaa\""));
// log.debug(String.format("line in errors : %s", readerRes.getDtosMap().getList(PublicationLine.class).get(0)));
// assertNull(readerRes.getDtosMap().getList(PublicationLine.class).get(0).getYear());
// assertTrue(readerRes.getDtosMap().getList(PublicationLine.class).size() == 11);
}
//@SuppressWarnings("unchecked")
@Test
public void <API key>() throws Exception {
// List<SheetInfo> sheetInfos = new ArrayList<>();
// String <API key> = PublicationMock.PUBLI_COLUMN_INFOS.replace("ColumnInfo(columnLetterRef=C| " +
// "columnLabel=Year| dtoPropertyName=year| outputProperty=year| " +
// "propertyTransformer=org.apache.commons.collections.functors.NOPTransformer)",
// "ColumnInfo(columnLetterRef=XXX| columnLabel=Year| dtoPropertyName=year| " +
// "outputProperty=year| propertyTransformer=org.apache.commons.collections.functors" +
// ".NOPTransformer)");
// SheetInfo sheetInfo = new SheetInfo(
// PublicationLine.class,
// "1 - PUBLI",
// Publication.class,
// new ArrayList<>(),
// PublicationMock.<API key>(<API key>, ColumnInfo.class, "\\|"));
// sheetInfos.add(sheetInfo);
// InputStream excelInput = new BufferedInputStream(getClass().getResourceAsStream("/xls/<API key>.xlsm"));
// ExcelReader reader = new ExcelReader(sheetInfos, "/xls/publi_mapping.xml");
// ExcelReader.ReaderResult readerRes = reader.read(excelInput);
// assertTrue(readerRes.getCellErrors().get(0).getMessage().equals("Can't read cell C2 on 1 - PUBLI spreadsheet"));
// log.debug(String.format("line in errors : %s", readerRes.getDtosMap().getList(PublicationLine.class).get(0)));
// assertNull(readerRes.getDtosMap().getList(PublicationLine.class).get(0).getYear());
// assertTrue(readerRes.getDtosMap().getList(PublicationLine.class).size() == 11);
}
} |
package com.neverwinterdp.kafka.tool;
import java.util.HashMap;
import java.util.Map;
import com.beust.jcommander.DynamicParameter;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParametersDelegate;
public class KafkaTopicConfig {
@Parameter(names = "--zk-connect", description = "The zk connect string")
public String zkConnect = "127.0.0.1:2181";
@Parameter(names = "--topic", description = "The kafka topic to work in")
public String topic = "hello";
@Parameter(names = "--num-partition", description = "Number of the partition to create for the topic")
public int numberOfPartition = 5;
@Parameter(names = "--replication", description = "The number of the replication for the topic")
public int replication = 1;
@Parameter(names = "--junit-report", description = "The junit report file name. No junit report if the report file is not available")
public String junitReportFile = null;
@ParametersDelegate
public Producer producerConfig = new Producer();
@ParametersDelegate
public Consumer consumerConfig = new Consumer();
public KafkaTopicConfig() {}
public KafkaTopicConfig(String[] args) {
new JCommander(this, args);
consumerConfig.consumeMax = producerConfig.<API key> * numberOfPartition;
}
static public class Producer {
@Parameter(names = "--send-writer-type", description = "The default producer writer or reliable producer writer(ack)")
public String writerType = "default";
@Parameter(names = "--send-period", description = "Write period in ms per partition")
public long sendPeriod = 100;
@Parameter(names = "--send-max-duration", description = "The max send duration in ms")
public long maxDuration = 10000;
@Parameter(names = "--<API key>", description = "The max number of message per partition")
public int <API key> = 1000;
@Parameter(names = "--send-message-size", description = "The message size in bytes")
public int messageSize = 100;
@Parameter(names = "--send-timeout", description = "Timeout when the writer cannot send due to error or the buffer is full")
public long sendTimeout = 10000;
@DynamicParameter(names = "--producer:", description = "The kafka producer properties configuration according to the kafka producer document")
public Map<String, String> producerProperties = new HashMap<String, String>();
}
static public class Consumer {
@Parameter(names = "--<API key>", description = "The max consume duration in ms")
public long maxDuration = 10000;
@Parameter(names = "--consume-max", description = "The max number of messages to consume")
public int consumeMax = 100000000;
@Parameter(names = "--consume-batch-fetch", description = "The number of messages that kafka should fetch from server each time")
public int consumeBatchFetch = 500;
@Parameter(names = "--<API key>", description = "The number of retry when the consumer cannot connect/read from partitions broker")
public int consumeFetchRetries = 5;
@Parameter(names = "--consume-retries", description = "The number of retry when the consumer cannot read more messages")
public int consumeRetries = 5;
@DynamicParameter(names = "--consumer:", description = "The kafka consumer properties configuration according to the kafka consumer document")
public Map<String, String> consumerProperties = new HashMap<String, String>();
}
} |
package com.ephesoft.gxt.core.shared.dto;
import com.google.gwt.user.client.rpc.IsSerializable;
public class PageTypeDTO implements IsSerializable {
private DocumentTypeDTO documentTypeDTO;
private String identifier;
private String name;
private String description;
private boolean isDeleted;
/**
* @return the documentTypeDBBean
*/
public DocumentTypeDTO getDocumentTypeDTO() {
return documentTypeDTO;
}
/**
* @param documentTypeDTO the documentTypeDBBean to set
*/
public void setDocumentTypeDTO(DocumentTypeDTO documentTypeDTO) {
this.documentTypeDTO = documentTypeDTO;
}
/**
* @return the parentPageTypeId
*/
public String getIdentifier() {
return identifier;
}
/**
* @param parentPageTypeId the parentPageTypeId to set
*/
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
public boolean isDeleted() {
return isDeleted;
}
public void setDeleted(boolean isDeleted) {
this.isDeleted = isDeleted;
}
} |
<div id="sidebar-menu-block">
<h3 change:h="">${rootElement/getLabel}</h3>
<tal:block change:menu="menuObject menuObject; class masterUlClass; itemName item; ulClass level%level; liInPathClass inpath">
<tal:block change:menuitem="item" />
</tal:block>
</div> |
#include <stdio.h> /* printf */
#include <stdlib.h> /* system, NULL, EXIT_FAILURE */
#include <string>
#include <iostream>
using namespace std;
int main (int argc, char* argv[])
{
string command = "nohup ";
for (int i = 1; i < argc; ++i) {
//std::cout << argv[i] << std::endl;
command += string(argv[i]) + " ";
}
//cout << command << endl;
//cout << argc << " " << argv << endl;
int ret=1;
int nbTries = 0;
while(ret != 0){
ret = system(command.c_str());
nanosleep((const struct timespec[]){{0, 10000000L}}, NULL);
if(nbTries > 3) exit(1);
nbTries += 1;
}
} |
// module object
var l_module = exports.module = {};
// a pool for all message handlers
var l_handlers = exports.handlers = {};
var l_checkers = exports.checkers = {};
var l_api = exports.api = {};
var l_name = 'SR.Video.ffmpeg';
// SR.Video handlers (copied from /handlers/video.js)
var l_dbVideoChannel = "icVideoChannel";
var l_dbVideoSchedule = 'icVideoSchedule';
SR.DB.useCollections([l_dbVideoChannel, l_dbVideoSchedule]);
//SR.DB.useCollections([l_dbVideoChannel]);
// SR.Schedule (periodic works)
SR.Schedule.patchCallback({
action: "startRecord",
callback: function (arg) {
LOG.warn("schedule: startRecord", l_name);
LOG.warn(arg, l_name);
if (typeof arg === 'array') {
for (var id in arg) {
SR.Video.ffmpeg.record.start({'id': id});
}
}
else if (typeof arg === 'string') {
SR.Video.ffmpeg.record.start({id: arg});
}
else {
LOG.warn("Something wrong with input arg in scheduled startRecord: ", arg);
}
}
});
SR.Schedule.patchCallback({
action:"stopRecord",
callback: function (arg) {
LOG.warn("schedule: stopRecord", l_name);
LOG.warn(arg, l_name);
if (typeof arg === 'array') {
for (var id in arg) {
SR.Video.ffmpeg.record.stop({'id': id});
}
} else if (typeof arg === 'string') {
SR.Video.ffmpeg.record.stop({id: arg});
} else {
LOG.warn("Something wrong with input arg in scheduled startRecord: ", arg);
}
}
});
l_checkers.SR_VIDEO = {
// _groups: ["user", "admin"],
}
// SR.Video
l_handlers.SR_VIDEO = function (event) {
//console.log(event);
switch (event.data.action) {
case "setChannel":
if (event.data.name && event.data.in && event.data.out) {
SR.Video.ffmpeg.setChannel({
name: event.data.name,
in: [event.data.in],
out: [event.data.out],
//parameter: [event.data.parameter],
desc: event.data.desc,
onDone: function (arg) {
event.done(event.data.action, arg);
}
});
}
else {
SR.Video.ffmpeg.setChannel({desc: "test", in:['rtsp://218.204.223.237:554/live/1/66251FC11353191F/e7ooqwcfbqjoo80j.sdp'], out:["out1"]});
SR.Video.ffmpeg.setChannel({desc: "test1", in:['rtsp://218.204.223.237:554/live/1/0547424F573B085C/gsfp90ef4k0a6iap.sdp'], out:["out2"]});
SR.Video.ffmpeg.setChannel({desc: "test2", in:['rtsp://163.22.32.118/live1.sdp'], out:["out3"]});
event.done(event.data.action, {"status": "ok"});
}
break;
case "deleteChannel":
SR.Video.ffmpeg.deleteChannel({id: event.data.id});
event.done(event.data.action, {"status": "ok"});
break;
case 'customChannelOption':
//console.log("in customChannelOption");
//console.log(event.data);
var p = {};
try {
p = JSON.parse(event.data.parameter);
}
catch (e) {
e = e || "no error";
arg.onDone(event.data.action, {"status": e});
}
LOG.warn(p , l_name);
SR.Video.ffmpeg.channel.custom({id: event.data.id, option: p, onDone: function(x) {
event.done(event.data.action, {"status": x});
} });
break;
case "startStream":
event.done(event.data.action, SR.Video.ffmpeg.stream.start({id: event.data.id}));
break;
case "stopStream":
event.done(event.data.action, SR.Video.ffmpeg.stream.stop({id: event.data.id}));
break;
case "startRecord":
event.done(event.data.action, SR.Video.ffmpeg.record.start({id: event.data.id}));
break;
case "stopRecord":
event.done(event.data.action, SR.Video.ffmpeg.record.stop({id: event.data.id}));
break;
case 'storedConvert':
LOG.warn(event.data , l_name);
var query = event.data;
query.onDone = function (result) {
event.done(event.data.action,result);
};
SR.Video.ffmpeg.stored.convert(query);
break;
case '<API key>':
event.done('SR_RESOURCE', {address: event.data.filename, header: {}});
//SR.Video.ffmpeg.stored.convert({});
break;
case 'clearConverted':
event.done(event.data.action, SR.Video.ffmpeg.stored.clearConverted(event.data));
break;
case '<API key>':
event.done(event.data.action, SR.Video.ffmpeg.stored.convertingStatus());
break;
case 'oldestAvailable':
event.done(event.data.action, SR.Video.ffmpeg.stored.oldestAvailable());
break;
case "getChannel":
SR.Video.ffmpeg.getChannel({id: event.data.id, onDone: function (xx) {
event.done(event.data.action,{channel: xx});
} });
break;
case "query":
LOG.debug("in SR_VIDEO?action=query", l_name);
var query = {event_data: event.data, onDone: function (argu) {
//console.log("argu");
//console.log(argu);
var arg = [];
if (typeof(argu) === 'string') {
arg = argu;
}
else {
var prev = 0;
for (var i in argu) {
//console.log("i " + i + " argu[i]:" );
//console.log(argu[i]);
if ( argu[i] && argu[i].file && typeof(argu[i].file) === 'string' && argu[i].file.match(/_.[0-9]*-[0-9]*\./) !== null ) {
var item = {file: argu[i].file, };
if (argu[i].stat == undefined) item.end = new Date();
else item.end = new Date(argu[i].stat.mtime);
if (arg[i-1] && arg[i-1].end ) {
item.start = arg[i-1].end;
//console.log("a");
}
else {
item.start = new Date(item.end);
item.start.setSeconds(item.end.getSeconds() -5);
//item.start.setMinutes(item.end.getMinutes() -5);
//console.log("b");
}
arg.push(item);
}
}
}
if (event.data.listOnly && event.data.listOnly === 'true' ) {
event.done(event.data.action,{list: arg});
}
else {
//console.log("list arg");
//console.log(arg);
if (typeof(arg) === 'string') {
event.done(event.data.action,{list: arg});
}
else if (typeof(arg) === 'object') {
if (arg.length < 3) return;
//for (var i in arg) console.log(arg[i]);
var xx = {};
if ( event.data.live && event.data.live === 'true') {
if (arg[0] && arg[0].file)
xx = { address: arg[arg.length -1].file, header: {'current': arg[arg.length -1].file, 'list': arg}};
}
else {
if (arg[0] && arg[0].file)
xx = { address: arg[0].file, header: {'current': arg[0].file, 'list': arg}};
}
LOG.debug("xx", l_name);
LOG.debug(xx, l_name);
event.done("SR_RESOURCE", xx);
}
}
}}; //end of var query =
if ( event.data.live && event.data.live === 'true') {
query.start = new Date();
query.end = new Date(query.start);
query.start.setMinutes(query.end.getMinutes()-1);
}
else {
query.start = new Date(event.data.year, parseInt(event.data.month)-1, event.data.day, event.data.hour, event.data.minute, event.data.second, 0 );
query.end = new Date(event.data.year, parseInt(event.data.month)-1, event.data.day, parseInt(event.data.hour)+1, parseInt(event.data.minute) , event.data.second, 0 );
}
SR.Video.ffmpeg.query(query);
break;
case 'retrieve':
var path = SR.Video.Record.getRecordedFilePath(event.data.vid, event.data.fid);
LOG.warn('retriving path: ' + path, l_name);
event.done("SR_RESOURCE", {address: path,
header: {}
});
break;
case "<API key>":
LOG.warn(event.data , l_name);
SR.DB.getData(l_dbVideoChannel, {camera_id: event.data.camera_id}, function(dat){
LOG.warn("dat" , l_name);
LOG.warn(dat , l_name);
if ( dat.id ) {
LOG.warn("dat.id channel id" , l_name);
LOG.warn(dat.id , l_name);
}
else {
}
}, function(dat){
event.done(event.data.action,{error: "DB failure"});
} );
event.done(event.data.action,{});
return;
break;
case "queryLiveBinary":
//console.log("in queryLiveBinary /////////////////////////////////////////////////");
SR.Video.ffmpeg.queryLive({id: event.data.id, type: event.data.type, num: event.data.num, onDone: function (re) {
//console.log("re %j", re);
if (typeof re.num === 'string') {
re.num = parseInt(re.num);
}
if ( re.video ){
//console.log("reply a binary file");
var xx = { address: re.video, header: {'video-num':re.num}};
event.done("SR_RESOURCE", xx);
//console.log(xx);
}
else {
//console.log("file not yet generated");
event.done("readStreaming", {status: ['err', 'nomore']});
}
}});
break;
case "queryLive":
SR.Video.ffmpeg.queryLive({id: event.data.id, type: event.data.type, onDone: function (re) {
for (var i in re) delete re[i].stat;
event.done(event.data.action, re);
//console.log("re %j", re);
//console.log(re);
}});
break;
case '<API key>':
break;
case "playStored":
if ( ! event.data.id && ! event.data.camera_id ) {
event.done(event.data.action, {error: "no id and no camera_id"});
return;
}
var start = new Date(event.data.year, parseInt(event.data.month)-1, event.data.day, event.data.hour, event.data.minute, event.data.second, 1 );
var end = new Date(event.data.year, parseInt(event.data.month)-1, event.data.day, parseInt(event.data.hour), parseInt(event.data.minute)+1 , event.data.second, 1 );
var query = {
path: 'swap',
sortOption: "ctime",
rexmatch: new RegExp(event.data.id + "\/" + event.data.id),
reverse: false,
mtime: { start: start, end: end},
outputFilenameOnly: true,
limit: 100,
onDone: function (result) {
if (result.length >1) {
event.done('SR_RESOURCE', {address: result[0], header: {'video-num': event.data.num}, addition: result});
}
else {
event.done("readStreaming", {status: ['err', 'nomore']});
}
}
};
switch (event.data.type) {
case 'originalVideo':
query.path = 'swap';
break;
case 'snapshot':
query.path = 'web/snapshot';
break;
default:
break;
}
LOG.warn(query , l_name);
UTIL.findFiles(query);
break;
var path = event.data.id + "/" + event.data.id + "-startTS" + event.data.date + "-EndTS";
if ( ! event.data.type ) {
LOG.warn("no given type" , l_name);
event.done("readStreaming", {status: ['err', 'nomore']});
return;
}
switch (event.data.type) {
case 'originalVideo':
path = UTIL.userSettings("cacheAddress") + path + "-video-" + event.data.num + ".mp4";
break;
case 'snapshot':
path = UTIL.userSettings("snapshotAddress") + path + "-image-" + event.data.num + ".jpg";
break;
default:
break;
}
//console.log(UTIL.userSettings("snapshotAddress"));
//console.log(UTIL.userSettings("cacheAddress"));
event.done('SR_RESOURCE', {address: path, header: {'video-num': event.data.num}});
break;
case "retrieveBinary":
var path = event.data.id + "/" + event.data.id + "-startTS" + event.data.date + "-EndTS";
if ( ! event.data.type ) {
LOG.warn("no given type" , l_name);
event.done("readStreaming", {status: ['err', 'nomore']});
return;
}
switch (event.data.type) {
case 'originalVideo':
path = UTIL.userSettings("cacheAddress") + path + "-video-" + event.data.num + ".mp4";
break;
case 'snapshot':
path = UTIL.userSettings("snapshotAddress") + path + "-image-" + event.data.num + ".jpg";
break;
default:
break;
}
//console.log(UTIL.userSettings("snapshotAddress"));
//console.log(UTIL.userSettings("cacheAddress"));
event.done('SR_RESOURCE', {address: path, header: {'video-num': event.data.num}});
break;
case "queryStored":
if ( ! event.data.id) {
event.done(event.data.action, {error: "no id"});
return;
}
var limit = undefined;
if ( event.data.limit && parseInt(event.data.limit) > 0 && parseInt(event.data.limit) < 1000 ) {
limit = parseInt(event.data.limit);
}
var start = new Date(event.data.startYear, parseInt(event.data.startMonth)-1, event.data.startDay, event.data.startHour, event.data.startMinute, event.data.startSecond, 1 );
var end = new Date(event.data.endYear, parseInt(event.data.endMonth)-1, event.data.endDay, event.data.endHour, event.data.endMinute, event.data.endSecond, 1 );
var query = {
path: 'swap',
sortOption: "ctime",
rexmatch: new RegExp(event.data.id + "\/" + event.data.id),
reverse: false,
mtime: { start: start, end: end},
outputFilenameOnly: true,
limit: limit || 1000,
onDone: function (result) {
event.done(event.data.action, result);
}
};
if (event.data.reverse && event.data.reverse === 'true') {
query.reverse = true;
}
else {
query.reverse = false;
}
switch (event.data.type) {
case 'originalVideo':
query.path = 'swap';
break;
case 'snapshot':
query.path = 'web/snapshot';
break;
default:
break;
}
LOG.warn(query , l_name);
UTIL.findFiles(query);
break;
//var startDateTime = [2014, 12, 22, 15, 55, 15];
//var endDateTime = [2014, 12, 22, 17, 29, 53];
SR.Video.ffmpeg.queryStored(
{ startDateTime: [
parseInt( event.data.startYear ),
parseInt( event.data.startMonth ),
parseInt( event.data.startDay ),
parseInt( event.data.startHour),
parseInt( event.data.startMinute),
parseInt( event.data.startSecond)],
endDateTime: [
parseInt( event.data.endYear ),
parseInt( event.data.endMonth ),
parseInt( event.data.endDay ),
parseInt( event.data.endHour),
parseInt( event.data.endMinute),
parseInt( event.data.endSecond)],
id: event.data.id, type: event.data.type, onDone: function (re) {
//console.log("re %j", re);
event.done(event.data.action, re);
}});
break;
case "getOldestSearchable":
event.done(event.data.action, SR.Video.ffmpeg.getOldestSearchable({}));
break;
case "getStatus":
event.done(event.data.action, SR.Video.ffmpeg.getStatus({}));
break;
case "setSchedule":
SR.Schedule.setTask({id: event.data.scheduleId, name: event.data.scheduleName, cycle: event.data.cycle, monthday: parseInt(event.data.monthday), weekday: event.data.weekday, hour: parseInt(event.data.hour), minute: parseInt(event.data.minute), do: event.data.channelId, description: event.data.description, /*callback: l_startRecord({}),*/ action: event.data.scheduleAction, onDone: function (arg) {
var schedule = SR.Schedule.getStatus();
LOG.debug(schedule, 'SR.Schedule');
var taskPair = {};
for (var i in schedule) {
if (schedule[i].do) {
if (! taskPair[schedule[i].do]) taskPair[schedule[i].do] = {};
if (schedule[i].action === 'stopRecord')
taskPair[schedule[i].do].stopRecord = schedule[i];
else if (schedule[i].action === 'startRecord')
taskPair[schedule[i].do].startRecord = schedule[i];
}
}
LOG.debug(" ==== taskPair ====", 'SR.Schedule');
LOG.debug(taskPair, 'SR.Schedule');
for (var i in taskPair) {
if (taskPair[i].startRecord && taskPair[i].stopRecord) {
LOG.debug(" ==== " + i + "is a Pair ====", 'SR.Schedule');
if (SR.Schedule.checkRange({start:taskPair[i].startRecord, end:taskPair[i].stopRecord}))
SR.Schedule.triggerTask(i);
}
}
event.done(event.data.action, {result: arg});
} });
break;
case "deleteSchedule":
SR.Schedule.deleteTask({id: event.data.scheduleId, onDone: function (arg) {
event.done(event.data.action, {result: arg});
}});
break;
case "suspendSchedule":
SR.Schedule.suspendTask({id: event.data.scheduleId, onDone: function (arg) {
event.done(event.data.action, {result: arg});
}});
break;
case "resumeSchedule":
SR.Schedule.resumeTask({id: event.data.scheduleId, onDone: function (arg) {
event.done(event.data.action, {result: arg});
}});
break;
case "listSchedule":
event.done(event.data.action, {schedule: SR.Schedule.getStatus()});
break;
case 'ffmpegVerboseOn':
SR.Video.ffmpeg.debug({action: 'ffmpegVerboseOn'});
event.done(event.data.action, {});
break;
case 'ffmpegVerboseOff':
SR.Video.ffmpeg.debug({action:'ffmpegVerboseOff'});
event.done(event.data.action, {});
break;
case 'daemonStart':
l_daemon({action:"start"});
event.done(event.data.action, {});
break;
case 'daemonStop':
l_daemon({action:"stop"});
event.done(event.data.action, {});
break;
case 'daemonVerboseOn':
l_daemon({action:"verboseOn"});
event.done(event.data.action, {});
break;
case 'daemonVerboseOff':
l_daemon({action:"verboseOff"});
event.done(event.data.action, {});
break;
default:
event.done("action=??", {"error": "Please assign a valid action."});
break;
}
}
SR.Callback.onStart(function () {
l_daemon({action:"start"});
});
var schedulePool = {};
SR.DB.useCollections([l_dbVideoSchedule]);
l_handlers.SR_VIDEO_SCHEDULE = function (event) {
LOG.warn(event.data , l_name);
switch (event.data.action){
case 'setSchedule':
//todo: check input
var data = {
id: event.data.id,
cycle: event.data.cycle,
monthday: parseInt(event.data.monthday),
weekday: event.data.weekday,
hour: parseInt(event.data.hour),
minute: parseInt(event.data.minute),
do: event.data.do,
suspend: false,
description: event.data.description,
latestExecuted: new Date(),
created: new Date(),
};
SR.Schedule.setTask(data);
break;
case 'deleteSchedule':
break;
case 'getStatus':
event.done("schedule", SR.Schedule.getStatus({}));
return;
break;
}
event.done("",{});
}
/* Note:
handler
*/
// SR.Video API
// default settings can be modified
var <API key> = 3; // ffmpeg
var maxListNum = 100;
var maxCacheNum = 5;
var conf = {
path: {
jpg: "store" + SR.Settings.SLASH + "jpg",
mp4: "store" + SR.Settings.SLASH + "mp4",
store: "store",
},
<API key>: 'deleteOld',
spareSpace: 3000, //spareThreshold: 7000,
criticalSpace: 2000, //criticalThreshold: 3000,
callbackPool: {},
diskFullAction: "deleteOld",
convertingJob: {},
//streamingQueues: {},
};
exports.getStreamingQueues = function (arg) {
return conf.streamingQueues;
}
/ input: {action: }
/
exports.setDiskFullAction = function (arg) {
if (!arg) {
LOG.debug("in setDiskFullAction: no arg", l_name);
return false;
}
if (!arg.action) {
LOG.debug("in setDiskFullAction: no arg.action", l_name)
return false;
}
switch (arg.action) {
case 'deleteOld':
conf.diskFullAction = arg.action;
return true;
break;
case 'stopAll':
conf.diskFullAction = arg.action;
return true;
break;
default:
LOG.debug("arg.action should be either deleteOld or stopAll", l_name);
return false;
break;
}
}
var l_enabled = true;
var fs = require('fs');
// define local variables
// reference to video object
//var l_videoStreamPool = {}; // stores all channel
var l_videoStreamPool = SR.State.get('l_videoStreamPool');
var l_debug = {};
var l_status = {};
var spawn = require('child_process').spawn,
exec = require('child_process').exec;
SR.Callback.onStart(function () {
// make sure we have proper directories created
exec("mkdir -pv " + conf.path.jpg + " " + conf.path.mp4, function (err, stdout, stderr) {});
});
// define local functions
var l_videoLossEvent = function (arg) {
LOG.debug("The video loss event is triggered. channel id: " + arg, l_name);
};
// test:$ fallocate -l 3G gentoo_root.img
conf.callbackPool.onNotify = function (arg) {
LOG.debug("in SR.Video default onNotify, you can override this callback function. arg", l_name);
LOG.debug(arg, l_name);
return true;
}
exports.setNotify = function (arg) {
if (!arg) {
LOG.debug("no arg", l_name);
return false;
}
if (!arg.onNotify || typeof(arg.onNotify) !== 'function') {
LOG.debug("no onNotify", l_name);
return false;
}
conf.callbackPool.onNotify = arg.onNotify;
return true;
}
exports.preserve = function (arg) {
if (!arg) {
LOG.debug("no arg", l_name);
return false;
}
if (!arg.id) {
LOG.debug("no id", l_name);
return false;
}
if (!l_videoStreamPool[arg.id]) {
LOG.debug("The assigned channel id does not exist.", l_name);
return false;
}
if (!arg.action) {
LOG.debug("in preserve: no arg.action", l_name);
return false;
}
switch (arg.action) {
case 'start':
l_videoStreamPool[arg.id].preserve = true;
return true;
break;
case 'stop':
l_videoStreamPool[arg.id].preserve = false;
return true;
break;
case 'get':
return l_videoStreamPool[arg.id];
break;
default:
break;
}
}
exports.<API key> = function (arg) {
if (typeof(arg.onNotify) === 'function') {
l_videoLossEvent = arg.onNotify;
}
}
var l_pushStreaming = function (arg) {
if (!l_videoStreamPool[arg.channelId]) return;
obj = {
status: l_videoStreamPool[arg.channelId].status,
filename: arg.filename
};
if (l_videoStreamPool[arg.channelId].incoming) {
l_videoStreamPool[arg.channelId].incoming.push(obj);
}
//LOG.debug( l_videoStreamPool[arg.channelId].incoming.length);
if (l_videoStreamPool[arg.channelId].incoming && l_videoStreamPool[arg.channelId].incoming.length > 19) {
for (var i in l_videoStreamPool[arg.channelId].incoming) {
//LOG.debug( "i: " + i + " " + l_videoStreamPool[arg.channelId].incoming[i].status + " " + (parseInt(i)+1) + " " + l_videoStreamPool[arg.channelId].incoming[i].status);
//else LOG.debug( 'd');
if (l_videoStreamPool[arg.channelId].incoming[i].status === 'streaming') {
if (l_videoStreamPool[arg.channelId].incoming[(parseInt(i) + 1)] && l_videoStreamPool[arg.channelId].incoming[(parseInt(i) + 1)].status === 'recording') {
//LOG.debug( 'a');
//LOG.debug( "defined as pre-recording");
l_videoStreamPool[arg.channelId].incoming[i].status = 'pre-recording';
} else {
//LOG.debug( 'b');
}
} else {
//LOG.debug( "do nothing");
}
}
switch (l_videoStreamPool[arg.channelId].incoming[0].status) {
case 'streaming':
var x = l_videoStreamPool[arg.channelId].incoming.shift();
setTimeout(function () {
fs.unlink(x.filename, function (err) {
if (err) //throw err;
setTimeout(function () {
fs.unlink(x.filename, function (err2) {});
}, 2000);
});
}, 500);
break;
case 'pre-recording':
var x = l_videoStreamPool[arg.channelId].incoming.shift();
break;
case 'recording':
var x = l_videoStreamPool[arg.channelId].incoming.shift();
break;
default:
LOG.error('error: video.js172', l_name);
//process.exit(99);
break;
}
}
};
var l_checkStreaming = function (id) {
var formatData = {}
if (l_videoStreamPool[id]) {
formatData.connect = 1;
} else {
formatData.connect = 0;
}
return formatData;
};
var l_getCollection = function (clt_name, onFail) {}
var l_db_setChannel = function (data) {
LOG.debug("l_db_setChannel: ", l_name);
LOG.debug(data, l_name);
// filtering??
var x = {};
if (data.id) {
x.id = data.id
};
if (data.camera_id) {
x.camera_id = data.camera_id
};
if (data.desc) {
x.desc = data.desc
};
if (data.in) {
x.in = data.in
};
if (data.out) {
x.out = data.out
};
if (data.name) {
x.name = data.name
};
if (data.status) {
x.status = data.status
};
if (data.option) {
x.option = data.option
};
SR.DB.updateData(l_dbVideoChannel, {
id: data.id
}, x,
function () {
//l_videoStreamPool[data.id] = x; //problem: clean the running ffmpeg process
//LOG.debug( "db setdata success, l_videoStreamPool cache updated");
},
function () {
LOG.debug("db setdata not success", l_name);
});
}
var l_partiallyUpdate = function (origin, update) {
if (Object.keys(update).length > 0) {
for (var key in update) {
if (update[key] || update[key] === '' || update[key] === 0) {
origin[key] = update[key];
};
};
};
};
function getTimestamp() {
var date = new Date();
var hour = date.getHours();
hour = (hour < 10 ? "0" : "") + hour;
var min = date.getMinutes();
min = (min < 10 ? "0" : "") + min;
var sec = date.getSeconds();
sec = (sec < 10 ? "0" : "") + sec;
var year = date.getFullYear();
var month = date.getMonth() + 1;
month = (month < 10 ? "0" : "") + month;
var day = date.getDate();
day = (day < 10 ? "0" : "") + day;
return year + "" + month + "" + day + "-" + hour + "" + min + "" + sec;
}
// Find the longest common starting substring in a set of strings
// input: ["strings"]
// output: string
function sharedStart(array) {
var A = array.slice(0).sort(),
word1 = A[0],
word2 = A[A.length - 1],
L = word1.length,
i = 0;
while (i < L && word1.charAt(i) === word2.charAt(i)) {
i++;
}
return word1.substring(0, i);
}
////////////////////////// stable
// clean 'null' elements for an array
// input: array
// output: array
function cleanArray(actual) {
var newArray = new Array();
for (var i = 0; i < actual.length; i++) {
if (actual[i]) {
newArray.push(actual[i]);
}
}
return newArray;
}
////////////////////////////// stable
// to check whether available partition space is sufficient or insufficient
// input: {videoDisk: ["mount point"], spare: number (MB), onDone: callback function}
// output:
var checkDisk = function (cmd) {
if (!cmd) {
LOG.debug("error: cmd is necessary", l_name);
return;
}
if (!cmd.videoDisk) {
LOG.debug("error: no videoDisk", l_name);
return;
}
if (typeof cmd.videoDisk !== 'object') {
LOG.debug("error: videoDisk should be an array", l_name);
return;
}
if (!cmd.spare) {
LOG.debug("error: no spare", l_name);
return;
}
//LOG.debug( typeof cmd.spare);
if (typeof cmd.spare !== 'number') {
LOG.debug("error: spare shoud be a number", l_name);
return;
}
return;
exec("df --block-size=M",
function (error, stdout, stderr) {
//LOG.debug( stdout);
var list = stdout.split("\n");
for (var i in list) {
if (list[i] || typeof(list[i]) === 'string') {
list[i] = cleanArray(list[i].split(" "));
}
//LOG.debug( "found / : " + list[i].indexOf("/"));
for (var j in cmd.videoDisk) {
if (list[i].indexOf(cmd.videoDisk[j]) == 5) {
var partition = list[i][5];
var remainingSpace = parseInt(list[i][3].replace("M", ""));
//LOG.debug( partition + " remaining disk space: " + remainingSpace);
//LOG.debug( typeof(remainingSpace) + " " + typeof(cmd.spare) + " " + typeof(cmd.critical));
//LOG.debug( (remainingSpace) + " " + (cmd.spare) + " " + (cmd.critical));
if (remainingSpace < cmd.spare) {
// callback function
//LOG.debug( "onInsufficientSpace");
if (cmd && cmd.onInsufficientSpace && typeof cmd.onInsufficientSpace === 'function') {
//LOG.debug( "running callback");
cmd.onInsufficientSpace(partition);
}
} else if (remainingSpace < cmd.critical) {
// callback function
//LOG.debug( "onCritical");
if (cmd && cmd.onCritical && typeof cmd.onCritical === 'function') {
//LOG.debug( "running callback");
cmd.onCritical(partition);
}
} else {
//LOG.debug( "enough space: " + list[i][5]);
}
}
}
}
//LOG.debug( list);
});
}
/////////////////////////////////// stable
// setChannel
// input: { id: channel_id "optional", in: ["rtsp://..."], out: ["output_filename"], descritpion: "", name: "" }
// output: true if success | false if not success | channel_id if new
exports.setChannel = function (data) {
LOG.debug("SR.Video.ffmpeg.setChannel====================", l_name);
LOG.debug(data, l_name);
if (!data) {
LOG.debug("no arg", l_name);
return false;
}
// if (!data.id ) {
// LOG.debug( "no arg.id");
// return false;
if (!data.in) {
LOG.debug("no arg.in", l_name);
return false;
}
//todo:
//todo: partial update
if (data.id) {
if (l_videoStreamPool[data.id]) {
//delete l_videoStreamPool[data.id];
//l_videoStreamPool[data.id] = {};
//l_videoStreamPool[data.id] = data;
l_partiallyUpdate(l_videoStreamPool[data.id], data);
l_db_setChannel(l_videoStreamPool[data.id]); // problem
data.onDone({
id: data.id,
message: "updated"
});
return true;
} else {
LOG.warn("incorrect id of channel", l_name);
data.onDone({
error: "id is invalid"
});
return false;
}
} else {
if (data.options == "allowDuplication" || data.in[0] == 'stdin') {} else {
// to check if
for (var i in l_videoStreamPool) {
if (l_videoStreamPool[i].hasOwnProperty('in') && data.hasOwnProperty('in') && l_videoStreamPool[i].in[0] === data.in[0]) {
LOG.debug("duplicated input!", l_name);
if (data.onDone && typeof data.onDone === 'function') {
data.onDone({
error: "duplicate"
});
}
return false;
}
}
}
// to create a new channel
var id = UTIL.createUUID();
data.id = id;
data.errorCount = 0;
l_videoStreamPool[id] = data;
l_db_setChannel(l_videoStreamPool[id]);
if (data.onDone && typeof data.onDone === 'function') {
data.onDone({
id: data.id,
message: "created"
});
}
return id;
}
}
//////////////////////////////////// stable
// sync channel information from DB to memory and get available channels
// input: {id: channel_id}
// output {"channel information"} | false if not success | undefined if not exists | {"all channel information"} if channel_id not assigned
var getChannel = exports.getChannel = function (channel_data) {
//LOG.debug( "in exports.getChannel");
if (!channel_data) {
LOG.debug("no args", l_name);
return false;
}
if (!channel_data.onDone) {
LOG.debug("xxxxxxxxxxx no .onDone", l_name);
return false;
}
if (!typeof channel_data.onDone === 'function') {
LOG.debug("xxxxxxxxxxx .onDone is not a function", l_name);
return false;
}
if (channel_data.id && typeof channel_data.id === 'string') {
if (l_videoStreamPool[channel_data.id]) {
channel_data.onDone(l_videoStreamPool[channel_data.id]);
} else {
<API key>(
function () {
if (l_videoStreamPool[channel_data.id]) {
channel_data.onDone(l_videoStreamPool[channel_data.id]);
} else {
channel_data.onDone({});
}
}
);
}
} else if (channel_data.in && typeof channel_data.in === 'string') {
SR.DB.getArray(
l_dbVideoChannel,
function (db_data) {
channel_data.onDone(db_data);
},
function (db_data) {
LOG.debug("fail = query channel", l_name);
LOG.debug(db_data, l_name);
return false;
}, {
"in": {
$in: [channel_data.in]
}
}
);
} else {
<API key>(
function () {
channel_data.onDone(l_videoStreamPool);
}
);
}
}
// reload (sync) channel information from DB to memory
// input: onDone, passthroughData
// output passthroughData
var <API key> = exports.reloadChannelCache = function (onDone, passthroughData) {
if (typeof onDone !== 'function') {
LOG.error("onDone is not a function", l_name);
return false;
}
// load channel data from db
SR.DB.getArray(
l_dbVideoChannel,
function (db_data) {
//LOG.debug( "data restoring: %j", db_data);
for (var i in db_data) {
//LOG.debug( i);
//LOG.debug( db_data[i]);
l_videoStreamPool[db_data[i].id] = db_data[i];
delete l_videoStreamPool[db_data[i].id]._id;
}
onDone(passthroughData);
},
function (db_data) {
LOG.debug("fail = data restoring", l_name);
LOG.debug(db_data, l_name);
return false;
}
);
}
//////////////////////////////////// stable
// delete a single channel
// input: {id: "channel_id"}
// output: true if success | false if not success
exports.deleteChannel = function (data) {
if (!data) {
LOG.debug("no args", l_name);
return false;
}
if (!data.id) {
LOG.debug("id must be assigned", l_name);
return;
}
if (!typeof data.id === 'string') {
LOG.debug("id must be a string", l_name);
return;
}
if (!l_videoStreamPool[data.id]) {
LOG.debug("channel id does not exist", l_name);
return;
}
if (l_videoStreamPool[data.id].status === "recording") {
LOG.debug("Still Recording, going to l_record.stop() for ", data);
l_record.stop(data);
LOG.debug("Recording stopped for ", data);
}
if (l_videoStreamPool[data.id].status === "streaming") {
LOG.debug("Still Streaming, going to l_stream.stop() for ", data);
l_stream.stop(data);
LOG.debug("Streaming stopped for ", data);
}
delete l_videoStreamPool[data.id];
SR.DB.deleteData(l_dbVideoChannel,
function (re) {
LOG.debug("deleteData success", l_name);
},
function (re) {
LOG.debug("deleteData fail", l_name);
}, {
id: data.id
});
}
// SR.Video.ffmpeg.stdinWrite({id: , onData: function (arg) {} });
exports.stdinWrite = function stdinWrite(arg) {
//LOG.debug( arg);
if (!arg) {
LOG.debug("no assigned arg ", l_name);
return;
}
if (!arg.id) {
LOG.debug("no assigned id ", l_name);
return;
}
if (!l_videoStreamPool[arg.id]) {
LOG.debug("not existing: " + arg.id, l_name);
return;
}
arg.encode = arg.encode || 'binary';
if (l_videoStreamPool[arg.id].process && l_videoStreamPool[arg.id].process.stdin) {
//LOG.debug( "stdin --> ffmpeg");
l_videoStreamPool[arg.id].process.stdin.write(arg.data, arg.encode);
}
}
// to start stream for a video channel
// input: {id : 'id_string'}
// output:
var l_startStream = function (data) {
if (!l_videoStreamPool[data.id]) {
LOG.debug("The assigned channel id does not exist.", l_name);
return false;
}
var url;
if (l_videoStreamPool[data.id].hasOwnProperty('in')) {
url = l_videoStreamPool[data.id].in[0];
}
//LOG.debug( "url");
//LOG.debug( url);
if (url === undefined || url === null) {
LOG.debug("error: no input source", l_name);
return;
}
if (!typeof url === 'string') {
LOG.debug("url is not a string", l_name);
return;
}
// stream
if (l_videoStreamPool[data.id] && l_videoStreamPool[data.id].process) {
LOG.debug("already actived: " + data.id, l_name);
return;
//l_videoStreamPool[data.id].process.kill('SIGHUP');
};
if (l_videoStreamPool[data.id] && !l_videoStreamPool[data.id].incoming) {
l_videoStreamPool[data.id].incoming = [];
}
var timestamp = getTimestamp();
var mkdircmd = "mkdir -pv " + conf.path.jpg + SR.Settings.SLASH + data.id + " " + conf.path.mp4 + SR.Settings.SLASH + data.id;
exec(mkdircmd, function (error, stdout, stderr) {});
var commandDVR = {
// ffmpeg
ffmpeg: 'avconv',
input: [
'-y',
'-loglevel', 'debug',
'-c', 'h264',
'-f', 'm4v',
'-i', 'pipe:0',
// '-force_key_frames', '0,0.1',
'-force_key_frames', 'expr:gte(t,n_forced*5)',
],
output: [
[
// '-c', 'copy', // ?
// '-map', '1:0', // 0
//'-map', '0',
// '-b:v', '128k',
//'-vcodec', 'libx264',
// '-r', '20',
//'-f', 'segment',
//'-reset_timestamps', '1',
//'-segment_time', '5', // 5
// '-segment_atclocktime', '1',
//'-segment_wrap', '100',
//'-segment_list', cacheAddress + data.id + "-xxx",
//'-segment_list_size', '4',
//'-segment_list_type', 'flat',
//'-segment_list_flags', 'live',
//'-segment_format', 'mp4',
//cacheAddress + data.id + '/' + data.id + '_startTS' + timestamp + '-EndTS-video-%00001d.mp4',
//'swap/' + '_%01d.mp4'
//'-probesize','100000',
//'-analyzeduration','100000',
],
[
// '-c', 'copy', // ?
// '-map', '1:0', // 0
'-map', '0',
// '-b:v', '128k',
'-vcodec', 'libx264',
// '-r', '20',
'-f', 'segment',
'-reset_timestamps', '1',
'-segment_time', '5',
// '-segment_atclocktime', '1',
'-segment_wrap', '100',
'-segment_list', conf.path.mp4 + SR.Settings.SLASH + data.id + "-segment_list",
'-segment_list_size', '4',
'-segment_list_type', 'flat',
'-segment_list_flags', 'live',
'-segment_format', 'mp4',
//'-strftime', '1',
conf.path.mp4 + SR.Settings.SLASH + data.id + SR.Settings.SLASH + data.id + '_%01d.mp4',
//'swap/' + '_%01d.mp4'
//'-probesize','100000',
//'-analyzeduration','100000',
],
[
'-r', '1',
'-f', 'image2',
'-strftime', '1',
conf.path.jpg + SR.Settings.SLASH + data.id + SR.Settings.SLASH + data.id + '_%Y%m%d-%H%M%S.jpg',
]
]
};
var optionDVR = commandDVR.input;
for (var key in commandDVR.output) {
optionDVR = optionDVR.concat(commandDVR.output[key]);
};
var command = 'ffmpeg';
var option = [
'-y',
'-loglevel', 'debug',
'-rtsp_transport', 'tcp', // To force TCP is stable.
'-i', l_videoStreamPool[data.id].in[0],
'-force_key_frames', '0,0.1',
'-c', 'copy',
//'-map', '0:0', // 0
//'-map','0', // but
//'-map', '0:0',
'-f', 'ssegment',
'-segment_time', '5',
'-reset_timestamps', '1',
'-segment_atclocktime', '1',
'-segment_format', 'mp4',
//'-segment_wrap', maxListNum,
//'-segment_list', cacheAddress + data.id + "-segment_list",
//'-segment_list_size', maxCacheNum - 1,
//'-segment_list_type', 'flat',
//'-segment_list_flags', 'live',
//'-strftime', '1',
conf.path.mp4 + SR.Settings.SLASH + data.id + SR.Settings.SLASH + data.id + '_%01d.mp4',
'-r', '1',
'-f', 'image2',
'-strftime', '1',
conf.path.jpg + SR.Settings.SLASH + data.id + SR.Settings.SLASH + data.id + '_%Y%m%d-%H%M%S.jpg',
];
var rtsp = true;
if (url.match(/^rtsp:\/\
rtsp = true;
} else {
rtsp = false;
option = optionDVR;
}
l_videoStreamPool[data.id].defaultOption = option;
l_videoStreamPool[data.id].ffmpegCommand = command + " " + option.join(' ');
LOG.debug("ffmpeg command: " + command + " " + option.join(' '), l_name);
//LOG.debug( "ffmpeg command: " + command + " " + option.join(' '));
// ffmpeg child process l_videoStreamPool
l_videoStreamPool[data.id].process = spawn(command, option);
l_videoStreamPool[data.id].timestamp = timestamp
var rename4date = function (arg) {
//LOG.debug( arg);
var ts = UTIL.getDateTimeTS();
var source = arg.filename;
var target = '';
if (source.indexOf(".mp4") > -1) {
target = source.replace(/_.*\.mp4/, '_' + ts + ".mp4");
} else if (source.indexOf(".jpg") > -1) {
target = source.replace(/_.*\.jpg/, '_' + ts + ".jpg");
} else {
LOG.debug("input ERROR: " + source, l_name);
}
fs.rename(source, target, function (err) {
if (err) {
LOG.error(err);
setTimeout(function () {
//just for windows
fs.rename(source, target, function (err) {
if (err) {} else {
l_pushStreaming({
filename: target,
channelId: data.id
});
}
});
}, 1200);
} else {
//LOG.debug( "success: " + source + " -> " + target );
l_pushStreaming({
filename: target,
channelId: data.id
});
}
});
}
l_videoStreamPool[data.id].process.stdout.on('data', function (dat) {
//fs.appendFile(cacheAddress + data.id + "-ffmpeg-stdout", dat, function (err) { });
//LOG.debug( 'stdout: ' + dat);
});
l_videoStreamPool[data.id].process.stderr.on('data', function (dat) {
//todo: There is no error output if ffmpeg is not well installed. Should be done.
//LOG.debug( 'stderr: ' + dat);
fs.appendFile(conf.path.jpg + SR.Settings.SLASH + data.id + "-ffmpeg-stderr", dat, function (err) {});
// to detect current filename when ffmpeg creates a new segment
var da = dat.toString('utf8');
if (da.indexOf(data.id) > -1 && da.indexOf("segment:") > -1 && da.indexOf("ended") > -1) {
fs.appendFile(conf.path.jpg + SR.Settings.SLASH + data.id + "-ffmpeg-segment", da, function (err) {});
var d = da.match(/segment:.*ended/);
if (d && typeof(d) === 'object' && d[0]) {
var filename = d[0].replace(/^segment:'/, '').replace(/' count:.* ended$/, '');
//LOG.debug( '-' + filename + '-');
rename4date({
filename: filename,
id: data.id
});
}
}
//for input format, codec detection
if (l_videoStreamPool[data.id] && l_videoStreamPool[data.id].inputFormat) {
} else {
if (l_videoStreamPool[data.id]) l_videoStreamPool[data.id].inputFormat = {};
else return;
}
if (da.indexOf("video codec set to:") > -1) {
var vcodec = da;
vcodec = vcodec.match(/video codec set to: .*\n/);
if (vcodec && vcodec[0]) {
vcodec = vcodec[0];
vcodec = vcodec.replace('video codec set to: ', '').replace('\n', '');
//l_videoStreamPool[data.id].inputFormat.vcodec = vcodec;
}
}
if (da.indexOf("audio codec set to:") > -1) {
var acodec = da;
acodec = acodec.match(/audio codec set to: .*\n/);
if (acodec && acodec[0]) {
acodec = acodec[0];
acodec = acodec.replace('audio codec set to: ', '').replace('\n', '');
//l_videoStreamPool[data.id].inputFormat.acodec = acodec;
}
}
if (da.indexOf(" Stream #0") > -1) {
//LOG.debug( " Stream #0 da");
var fps = da.match(/[0-9]* fps,/);
//LOG.debug( fps);
if (fps && typeof(fps) === "object" && fps[0]) {
fps = fps[0].replace(' fps,', '');
fps = parseInt(fps);
}
//LOG.debug( fps);
if (!l_videoStreamPool[data.id].inputFormat.fps || l_videoStreamPool[data.id].inputFormat.fps < fps) {
l_videoStreamPool[data.id].inputFormat.fps = fps;
}
var resolution = da.match(/ [0-9]*x[0-9]*,/);
if (resolution && typeof(resolution) === 'object' && resolution[0]) {
resolution = resolution[0].replace(' ', '').replace(',', '');
}
//LOG.debug( resolution);
l_videoStreamPool[data.id].inputFormat.resolution = resolution;
}
});
// ffmpeg child process
l_videoStreamPool[data.id].process.on('close', function (code) {
LOG.warn('stream: ' + data.id + ' is down (cleaup and closing inotifywait)', l_name);
//LOG.event();
var pid = this.pid;
try {
for (var key in l_videoStreamPool) {
//LOG.debug( ">>>>>> key %j", l_videoStreamPool[key]);
//LOG.debug( ">>>>>> key " + key + " " + " " + pid);
if (l_videoStreamPool[key] && l_videoStreamPool[key].process && l_videoStreamPool[key].process.pid)
if (l_videoStreamPool[key].process.pid === pid) {
// cleanup inotifywait
if (l_videoStreamPool[key].inotifywait) {
LOG.debug("closing inotifywait", l_name);
//~ l_videoStreamPool[key].inotifywait.close( function (err) { if (err){LOG.debug( "Error when closing inotifywait: " + err)}} );
//~ l_videoStreamPool[key].inotifywait.close();
l_videoStreamPool[key].inotifywait.kill();
delete l_videoStreamPool[key].inotifywait;
};
delete l_videoStreamPool[key].process;
} else {
//LOG.debug( "l_videoStreamPool[key].process.pid" + l_videoStreamPool[key].process.pid);
};
};
} catch (e) {
LOG.debug("error: process on close", l_name);
LOG.debug(e, l_name);
}
});
return true;
}
//query : start, end time, cam_id, //for playback
// input: {id: "channel_id", type: "snapshot | originalVideo | highResolution | lowResoluation", start: {year: 2014, month: 11, day: 11, hour: 11, minute: 11, second: 12}, end: {year: 2014, month: 12, day: 23, hour: 10, minute: 10, second: 10}
// output: {file: ["filename with url", ""], start: ["video's starting time"], length:["time length of video"] }
exports.queryStored = function (data) {
if (!data) {
LOG.debug("no args", l_name);
return false;
}
if (!data.id) {
LOG.debug("no arg.id", l_name);
return false;
}
LOG.debug("in queryStored", l_name);
LOG.debug(data, l_name);
if (!data.onDone || typeof data.onDone !== 'function') {
LOG.debug("incorrect callback must be assigned", l_name);
return;
}
UTIL.findFiles({
path: snapshotAddress + data.id,
option: "mtime",
onDone: function (result) {
}
});
return;
}
// query live snapshot or video
// input: {id: ["channel_id"], type: "snapshot"}
// output: {["uri for snapshot or video"]}
exports.queryLive = function (data) {
LOG.debug(data)
if (!data) {
LOG.debug("no args", l_name);
return false;
}
if (!data.id) {
LOG.debug("no arg.id", l_name);
return false;
}
if (!data.type) {
LOG.debug("no arg.type", l_name);
return false;
}
if (!data.onDone) {
LOG.debug("callback must be assigned", l_name);
return;
}
if (!typeof data.onDone === 'function') {
LOG.debug("callback function must be assigned", l_name);
return;
}
switch (data.type) {
case 'snapshot':
UTIL.findFiles({
path: snapshotAddress + data.id,
option: "ctime",
rexmatch: /startTS/,
reverse: true,
outputArray: true,
onDone: function (result) {
//LOG.debug( "result");
data.onDone(result);
}
});
return;
var cmd = 'ls -t ' + snapshotAddress + '' + data.id + "/" + data.id + "-" + "startTS" + l_videoStreamPool[data.id].timestamp + '*image*.jp*g | head ';
//LOG.debug( cmd, l_name);
exec(cmd,
function (err, stdout, stderr) {
//LOG.debug( "stdout" + stdout);
var list = stdout.split('\n');
LOG.debug(list);
data.onDone({
snapshotLive: list[1]
});
});
break;
case 'originalVideo':
if (!l_videoStreamPool[data.id]) {
LOG.debug("no assigned channel: " + data.id, l_name);
return;
}
if (!l_videoStreamPool[data.id].timestamp) {
LOG.debug("no timestamp", l_name);
return;
}
// : 1) num ; 2) num
var cmd = 'ls -t ' + cacheAddress + '' + data.id + "/" + data.id + "-" + "startTS" + l_videoStreamPool[data.id].timestamp + '*video*.mp4 | head -5 ';
//LOG.debug( "cmd:" + cmd);
var assigned = cacheAddress + '' + data.id + "/" + data.id + "-" + "startTS" + l_videoStreamPool[data.id].timestamp + '-EndTS-video-' + data.num + '.mp4';
//LOG.debug( "assigned: " + assigned);
exec(cmd,
function (err, stdout, stderr) {
//LOG.debug( "stdout" + stdout);
var list = stdout.split('\n');
//LOG.debug( "list");
//LOG.debug( list);
var number = [];
var position = 0;
for (var i in list) {
if (list[i]) {
number[i] = list[i].match(/-video-.*.mp4/);
number[i] = number[i][0].replace("-video-", "").replace(".mp4", "");
if (assigned === list[i]) {
position = i;
}
}
}
//LOG.debug( "number " + position);
//LOG.debug( number);
//LOG.debug( "num: " + number);
var result = {};
if (data.num) {
// ffmpeg list[0]
if (position === 0) {
result = {};
} else if (position > 0) {
result = {
video: list[position],
num: data.num,
position: position
};
//LOG.debug( "result", l_name);
//LOG.debug( result, l_name);
}
data.onDone(result);
} else {
result = {
video: list[1],
num: number[1],
position: 1
};
//LOG.debug( "result", l_name);
//LOG.debug( result, l_name);
data.onDone(result);
}
});
break;
default:
break;
}
if (data.id) {
if (l_videoStreamPool[data.id]) {
if (l_videoStreamPool[data.id].process) {
} else {
}
} else {
LOG.debug("The channel does not exist.", l_name);
return false;
}
} else {
LOG.debug("The channel id must be assigned.", l_name);
return false;
}
}
exports.query = function (arg) {
LOG.debug("in SR.Video.ffmpeg.query arg:", l_name);
LOG.debug(arg, l_name);
if (!arg) {
LOG.debug("no args", l_name);
return false;
}
if (!arg.event_data) {
LOG.debug("no arg.event_data", l_name);
return false;
}
if (!arg.event_data.id) {
LOG.debug("no arg.event_data.id", l_name);
return false;
}
if (!arg.event_data.format) {
LOG.debug("no arg.event_data.format", l_name);
return false;
}
if (!arg.onDone) {
LOG.debug("callback must be assigned", l_name);
return;
}
if (!typeof arg.onDone === 'function') {
LOG.debug("callback function must be assigned", l_name);
return;
}
//if ( ! l_videoStreamPool[arg.id] ) {
// LOG.debug( "The assigned channel id does not exist.");
// return false;
var query = {
path: 'swap',
sortOption: "mtime",
rexmatch: new RegExp(arg.event_data.id + ".*" + arg.event_data.id),
reverse: false,
mtime: {
start: arg.start,
end: arg.end
},
outputFilenameOnly: false,
limit: 500,
onDone: function (result) {
LOG.debug("============================= video result", l_name);
LOG.debug(result, l_name);
if (result.length > 1) {} else {
result = "no result";
//LOG.debug( "no result");
}
arg.onDone(result);
}
};
switch (arg.event_data.format) {
case 'jpg':
query.path = conf.path.jpg;
break;
case 'mp4':
query.path = conf.path.mp4;
break;
default:
arg.onDone({
error: "invalid format"
});
return false;
break;
}
LOG.debug(new Date(), l_name);
LOG.debug(query, l_name);
UTIL.findFiles(query);
}
// set caption text for a channel
// input: {id: "channel_id", caption:["caption text"] }
// output: true if success | false if not success
exports.setCaptionText = function (data) {}
// get caption text for a channel
// input: {id: "channel_id"}
exports.getCaptionText = function (data) {}
// return the oldest searchable video file
exports.getOldestSearchable = function (arg) {
return l_status.oldest;
}
var l_channel = exports.channel = {
custom: function (arg) {
LOG.debug("in SR.Video.ffmpeg.channel.custom.option", l_name);
LOG.debug(arg, l_name);
if (!arg) {
LOG.debug("no arg", l_name);
return false;
}
if (!arg.id) {
LOG.debug("no arg.id", l_name);
return false;
}
if (!arg.onDone) {
LOG.debug("no arg.onDone", l_name);
return false;
}
if (typeof(arg.onDone) !== 'function') {
LOG.debug("The given arg.onDone is not a function.", l_name);
return false;
}
if (!l_videoStreamPool[arg.id]) {
LOG.debug("The assigned channel id does not exist.", l_name);
return false;
}
l_partiallyUpdate(l_videoStreamPool[arg.id], arg);
l_db_setChannel(l_videoStreamPool[arg.id]);
arg.onDone();
return true;
},
}
var l_record = exports.record = {
start: function (data) {
LOG.debug("SR.Video.ffmpeg.record.start", l_name);
if (!data) {
LOG.debug("no arg", l_name);
return false;
}
if (!data.id) {
LOG.debug("no arg.id", l_name);
return false;
}
if (!l_videoStreamPool[data.id]) {
LOG.debug("The assigned channel id does not exist.", l_name);
return false;
}
// to start preserve recording files
l_videoStreamPool[data.id].status = "recording";
l_db_setChannel(l_videoStreamPool[data.id]);
LOG.debug(l_videoStreamPool);
l_startStream(data);
},
stop: function (data) {
LOG.debug("SR.Video.ffmpeg.record.stop", l_name);
if (!data) {
LOG.debug("no arg", l_name);
return false;
}
if (!data.id) {
LOG.debug("no arg.id", l_name);
return false;
}
if (!l_videoStreamPool[data.id]) {
LOG.debug("The assigned channel id does not exist.", l_name);
return false;
}
// to start delete recording files
l_videoStreamPool[data.id].status = "streaming";
l_db_setChannel(l_videoStreamPool[data.id]);
LOG.debug(l_videoStreamPool);
},
schedule: function (arg) {
LOG.debug("SR.Video.ffmpeg.record.schedule", l_name);
},
};
// NOTE: this is ffmpeg-based stream management
var l_stream = exports.stream = {
//////////////////////////////////// stable
// starting a streaming for a channel
// input: {id: "channel_id"}
// output: true if success | false if not success
start: function (data) {
LOG.debug("SR.Video.ffmpeg.stream.start", l_name);
LOG.debug(data);
if (!data) {
LOG.debug("no arg", l_name);
return false;
}
if (!data.id) {
LOG.debug("no arg.id", l_name);
return false;
}
if (!data.id) {
LOG.debug("id must be assigned", l_name);
return false;
}
if (typeof data.id !== 'string') {
LOG.debug("error: id input must be a string", l_name);
return false;
} else if (!l_videoStreamPool[data.id]) {
LOG.debug("error: profile is not existing", l_name);
LOG.debug(l_videoStreamPool[data.id], l_name);
return false;
}
l_videoStreamPool[data.id].status = "streaming";
l_db_setChannel(l_videoStreamPool[data.id]);
l_startStream(data);
return true;
},
/////////////////////////////////// stable
// stop a video streaming
// input: {id: channel_id}
// output: true if exists a channel_id | false if exists no channel_id
stop: function (data) {
LOG.debug("SR.Video.ffmpeg.stream.stop", l_name);
//stopStream(arg);
//LOG.debug( data);
if (!data) {
LOG.debug("no arg", l_name);
return false;
}
if (!data.id) {
LOG.debug("id must be assigned", l_name);
return false;
}
if (!l_videoStreamPool[data.id]) {
LOG.debug("id does not exist", l_name);
return false;
}
if (l_videoStreamPool[data.id].status === "recording") {
LOG.debug("Still Recording, going to l_record.stop() for ", data);
l_record.stop(data);
LOG.debug("Recording stopped for ", data);
}
// ffmpeg/inotifywait child process
l_videoStreamPool[data.id].status = "off";
l_db_setChannel(l_videoStreamPool[data.id]);
if (l_videoStreamPool[data.id] && l_videoStreamPool[data.id].process && l_videoStreamPool[data.id].process.kill) {
l_videoStreamPool[data.id].process.kill('SIGHUP');
}
if (l_videoStreamPool[data.id] && l_videoStreamPool[data.id].inotifywait) {
LOG.debug("closing inotifywait");
l_videoStreamPool[data.id].inotifywait.kill();
delete l_videoStreamPool[data.id].inotifywait;
}
return true;
},
schedule: function (arg) {
LOG.debug("SR.Video.ffmpeg.stream.schedule", l_name);
},
};
// to stop all streaming channels
var stopAllStream = exports.stopAllStream = function (data) {
LOG.debug("to stop ALL streaming", l_name);
for (var i in l_videoStreamPool) {
if (l_videoStreamPool[i].status) {
LOG.debug("to stop " + i, l_name);
l_stream.stop({
id: i
});
}
}
}
// listGenerate -> convert ->
l_convert = exports.stored = {
convert: function (arg) {
// to make a list.txt
//UTIL.
LOG.debug("in SR.Video.ffmpeg.stored.list arg:", l_name);
LOG.debug(arg, l_name);
if (!arg) {
LOG.debug("no arg", l_name);
return false;
}
if (!arg.id) {
LOG.debug("no arg.id", l_name);
return false;
}
if (!arg.onDone) {
LOG.debug("no arg.onDone", l_name);
return false;
}
if (typeof(arg.onDone) !== 'function') {
LOG.debug("The given onDone is not a function.", l_name);
return false;
}
//if ( ! l_videoStreamPool[arg.id] ) {
// LOG.debug( "The assigned channel id does not exist.");
// return false;
var query = {
path: conf.path.mp4,
sortOption: "mtime",
rexmatch: new RegExp(arg.id + ".*" + arg.id),
reverse: false,
mtime: {
start: arg.start,
end: arg.end
},
outputFilenameOnly: true,
limit: 1500,
onDone: function (result) {
var out = "";
for (var i in result) out += "file '" + result[i] + "'\n";
LOG.debug(out, l_name);
SR.fs.writeFile('exportAVI.txt', out, function (err, written, string) {
if (err) throw err;
LOG.debug('converting video...', l_name);
var cmd = conf.path.store + SR.Settings.SLASH + 'outputAVI' + current.toString() + '.avi';
cmd = cmd.replace('(', '');
cmd = cmd.replace(')', '');
cmd = cmd.replace(':', '');
cmd = cmd.replace(':', '');
cmd = cmd.replace('+', '');
cmd = cmd.replace(/ /gi, '');
arg.onDone({
list: result,
output: cmd
});
var outputFilename = cmd;
conf.convertingJob[outputFilename] = {
status: "converting"
};
cmd = 'ffmpeg -f concat -i exportAVI.txt ' + cmd;
LOG.debug(cmd, l_name + "_exportAVI");
exec(cmd, function (err, stdout, stderr) {
if (err) conf.convertingJob[outputFilename].status = "error";
else conf.convertingJob[outputFilename].status = "converted";
LOG.debug(stdout, l_name + "_exportAVI");
LOG.debug(stderr, l_name + "_exportAVI");
});
});
}
};
query.mtime.start = new Date(arg.year, parseInt(arg.month) - 1, arg.day, arg.hour, arg.minute, arg.second, 0);
query.mtime.end = new Date(arg.year, parseInt(arg.month) - 1, arg.day, arg.hour, arg.minute, arg.second, 0);
query.mtime.end.setMinutes(query.mtime.end.getMinutes() + parseInt(arg.length));
var current = new Date();
LOG.debug(new Date(), l_name);
LOG.debug(query, l_name);
UTIL.findFiles(query);
},
convertingStatus: function (arg) {
fs.readdir(conf.path.store, function (err, files) {
if (err) throw err;
for (var i in files) {
var regex = new RegExp(/\.avi$/);
if (regex.test(files[i]) && !conf.convertingJob.hasOwnProperty(conf.path.store + SR.Settings.SLASH + files[i]))
conf.convertingJob[conf.path.store + SR.Settings.SLASH + files[i]] = {
status: "old"
};
}
});
return conf.convertingJob;
},
clearConverted: function (arg) {
//to delete temp files.
if (!arg) return {
code: 1,
verbose: "The given arg is invalid."
};
if (!arg.filename) return {
code: 1,
verbose: "The given arg.filename is invalid."
};
if (!conf.convertingJob[arg.filename]) return {
code: 1,
verbose: "The given filename is not existing."
};
SR.fs.unlink(arg.filename, function (err) {
if (err) return {
code: 1,
verbose: "error: The given file cannot be deleted."
};
else return {
code: 0,
verbose: "The given file was deleted."
};
LOG.debug("The given file was deleted.", l_name);
});
},
oldestAvailable: function (arg) {
var basedir = conf.path.mp4;
var structure = {};
var x = new Date();
var channelDir = SR.fs.readdirSync(basedir);
LOG.debug(channelDir, l_name);
for (var i in channelDir) {
//structure[channelDir] = {files: vfiles};
var vfiles = SR.fs.readdirSync(SR.path.join(basedir, channelDir[i]));
structure[channelDir[i]] = {};
for (var j in vfiles) {
var fullFile = SR.path.join(basedir, channelDir[i], vfiles[j])
//LOG.debug( fullFile, l_name);
//continue;
var rex = new RegExp(/_[0-9]*-[0-9]*.mp4$/);
if (rex.test(fullFile)) {
//LOG.debug( fullFile);
var stat = SR.fs.statSync(fullFile);
if (structure[channelDir[i]].oldestMtime) {
//LOG.debug( fullFile + ' - ' + (x.getTime() - stat.mtime.getTime()));
if (structure[channelDir[i]].oldestMtime.getTime() > stat.mtime.getTime()) {
structure[channelDir[i]].oldestMtime = stat.mtime;
structure[channelDir[i]].oldestFilename = fullFile;
}
} else {
structure[channelDir[i]].oldestMtime = stat.mtime;
structure[channelDir[i]].oldestFilename = fullFile;
}
} else {
//var stat = SR.fs.statSync(fullFile);
//LOG.debug( fullFile);
//fs.unlink(fullFile, function (err) {
}
}
}
return structure;
},
export: function (arg) {
},
import: function (arg) {
}
}
// to run some functions automatically
// input: "start" | "stop"
// output: true if success | false if not success
var daemonX = {};
var l_daemon = function (data) {
if (!data) {
LOG.error("no arg", l_name);
return false;
}
if (!data.action) {
LOG.error("no arg.action", l_name);
return false;
}
switch (data.action) {
case 'start':
daemonX.schedule = setInterval(function () {
switch (l_enabled) {
case false:
//LOG.debug( "SR.Video.ffmpeg. is disabled.", l_name);
return;
break;
case true:
//LOG.debug( "SR.Video.ffmpeg. is enabled.");
break;
default:
//LOG.debug( "SR.Video.ffmpeg. switch is broken.");
break;
}
//LOG.debug( "daemon" + new Date());
// channel
var numberOfChannel = Object.keys(l_videoStreamPool).length;
//LOG.debug( "number of channel: " + Object.keys(l_videoStreamPool).length);
if (Object.keys(l_videoStreamPool).length == 0) {
getChannel({
onDone: function (arg) {}
});
return;
}
// schedule
SR.Standalone.isEnoughDiskSpace({
path: conf.path.mp4,
M: 4096,
onDone: function (err, enough, remaining) {
if (err) {
LOG.debug("error: please check SR.Standalone.isEnoughDiskSpace(", l_name);
} else {
l_status.diskSpace = {
enough: enough,
remaining: remaining
};
if (!enough) {
LOG.debug("
LOG.debug(remaining);
switch (conf.diskFullAction) {
case 'deleteOld':
var xx = {
path: conf.path.store,
sortOption: 'mtime',
limit: 1000,
outputFilenameOnly: true,
onDone: function (result) {
fs.appendFile(conf.path.store + '/deleted-log.txt', "\n
for (var i in result) {
LOG.debug("to delete:" + result[i]);
fs.unlink(result[i], function (err) {
if (err) throw err;
LOG.debug('deleted: ' + result[i]);
});
}
}
};
LOG.debug(xx);
UTIL.findFiles(xx);
break;
case 'stopAll':
stopAllStream({});
break;
default:
break;
}
if (remaining < -1024) {
LOG.debug("
stopAllStream({});
}
}
}
}
});
// cache
// channel
for (var key in l_videoStreamPool) {
// DVR
if (l_videoStreamPool[key].status && (l_videoStreamPool[key].status === 'streaming' || l_videoStreamPool[key].status === 'recording') && l_videoStreamPool[key].hasOwnProperty('in') && !l_videoStreamPool[key].process) {
LOG.debug("auto-reconnecting " + key + " " + l_videoStreamPool[key].status + " " + l_videoStreamPool[key].autoReconnectCount, l_name);
l_startStream({
id: key
});
//todo: , ,
if (typeof l_videoStreamPool[key].autoReconnectCount === 'number') {
if (l_videoStreamPool[key].autoReconnectCount > <API key>) {
//l_videoLossEvent(l_videoStreamPool[key]);
conf.callbackPool.onNotify({
notify: "videoLoss",
id: key
});
l_videoStreamPool[key].autoReconnectCount = 0;
} else {
l_videoStreamPool[key].autoReconnectCount++;
}
} else if (typeof l_videoStreamPool[key].autoReconnectCount === 'undefined') {
l_videoStreamPool[key].autoReconnectCount = 0;
}
}
}
}, 7000);
LOG.warn("SR.Video daemon started...", l_name);
break;
case 'stop':
clearInterval(daemonX.schedule);
LOG.warn("SR.Video daemon stopped...", l_name);
break;
default:
LOG.warn("{ start | stop }", l_name);
break;
}
}
///////////////////////////////// stable
// just for debug purpose
// input: {action: "action"}
// output: none
exports.debug = function (data) {
if (!data) {
LOG.debug("no arg", l_name);
return false;
}
if (!data.action) {
LOG.debug("no arg.action", l_name);
return false;
}
switch (data.action) {
case 'ffmpegVerboseOn':
LOG.debug("ffmpegVerbose on", l_name);
l_debug.ffmpegVerbose = true;
break;
case 'ffmpegVerboseOff':
LOG.debug("ffmpegVerbose off", l_name);
l_debug.ffmpegVerbose = false;
break;
case 'show':
LOG.debug(l_debug, l_name);
LOG.debug(l_status, l_name);
break;
case 'verboseOn':
l_debug.verbose = true;
break;
case 'verboseOff':
l_debug.verbose = false;
break;
default:
break;
}
}
// module init
l_module.start = function (config, onDone) {
LOG.warn('video/ffmpeg module started...', l_name);
UTIL.safeCall(onDone);
}
// module shutdown
l_module.stop = function (onDone) {
UTIL.safeCall(onDone);
}
// make this global
SR.Video.ffmpeg = exports; |
DELETE FROM `weenie` WHERE `class_Id` = 41229;
INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`)
VALUES (41229, '<API key>', 10, '2019-02-10 00:00:00') /* Creature */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (41229, 1, 16) /* ItemType - Creature */
, (41229, 2, 19) /* CreatureType - Virindi */
, (41229, 6, -1) /* ItemsCapacity */
, (41229, 7, -1) /* ContainersCapacity */
, (41229, 16, 1) /* ItemUseable - No */
, (41229, 25, 220) /* Level */
, (41229, 93, 1032) /* PhysicsState - ReportCollisions, Gravity */
, (41229, 133, 2) /* ShowableOnRadar - ShowMovement */
, (41229, 8007, 0) /* <API key> */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (41229, 1, True ) /* Stuck */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (41229, 1, 'Apostate Reaving Master') /* Name */
, (41229, 8006, 'AAA9AAAAAAA=') /* <API key> */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (41229, 1, 33561076) /* Setup */
, (41229, 2, 150994984) /* MotionTable */
, (41229, 3, 536870930) /* SoundTable */
, (41229, 6, 67111346) /* PaletteBase */
, (41229, 8, 100667943) /* Icon */
, (41229, 22, 872415273) /* PhysicsEffectTable */
, (41229, 8001, 8388630) /* <API key> - ItemsCapacity, ContainersCapacity, Usable, RadarBehavior */
, (41229, 8003, 20) /* <API key> - Stuck, Attackable */
, (41229, 8005, 104451) /* <API key> - CSetup, MTable, STable, PeTable, Position, Movement */;
INSERT INTO `<API key>` (`object_Id`, `position_Type`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`)
VALUES (41229, 8040, 1068564802, 394.876, -357.863, -45.571, 0.9305075, 0, 0, 0.3662728) /* <API key> */
/* @teleloc 0x3FB10142 [394.876000 -357.863000 -45.571000] 0.930508 0.000000 0.000000 0.366273 */;
INSERT INTO `<API key>` (`object_Id`, `type`, `value`)
VALUES (41229, 8000, 3706412870) /* <API key> */;
INSERT INTO `<API key>` (`object_Id`, `type`, `init_Level`, `level_From_C_P`, `c_P_Spent`, `current_Level`)
VALUES (41229, 1, 0, 0, 0, 8000) /* MaxHealth */;
INSERT INTO `<API key>` (`object_Id`, `destination_Type`, `weenie_Class_Id`, `stack_Size`, `palette`, `shade`, `try_To_Bond`)
VALUES (41229, 9, 49424, 0, 0, 0, False) /* Create Acid Spectre Essence (125) (49424) for ContainTreasure */
, (41229, 9, 31810, 0, 0, 0, False) /* Create Frost Compound Crossbow (31810) for ContainTreasure */
, (41229, 9, 351, 0, 0, 0, False) /* Create Long Sword (351) for ContainTreasure */
, (41229, 9, 142, 0, 0, 0, False) /* Create Chalice (142) for ContainTreasure */
, (41229, 9, 31759, 0, 0, 0, False) /* Create Dericost Blade (31759) for ContainTreasure */
, (41229, 9, 2587, 0, 0, 0, False) /* Create Shirt (2587) for ContainTreasure */
, (41229, 9, 29247, 0, 0, 0, False) /* Create Electric Crossbow (29247) for ContainTreasure */
, (41229, 9, 41230, 0, 0, 0, False) /* Create Arrival Chamber Key (41230) for ContainTreasure */
, (41229, 9, 339, 0, 0, 0, False) /* Create Scimitar (339) for ContainTreasure */
, (41229, 9, 7768, 0, 0, 0, False) /* Create Spiked Club (7768) for ContainTreasure */
, (41229, 9, 623, 0, 0, 0, False) /* Create Heavy Necklace (623) for ContainTreasure */
, (41229, 9, 31783, 0, 0, 0, False) /* Create Frost Claw (31783) for ContainTreasure */
, (41229, 9, 6045, 0, 0, 0, False) /* Create Celdon Leggings (6045) for ContainTreasure */
, (41229, 9, 624, 0, 0, 0, False) /* Create Ring (624) for ContainTreasure */
, (41229, 9, 30602, 0, 0, 0, False) /* Create Lightning Stiletto (30602) for ContainTreasure */;
INSERT INTO `<API key>` (`object_Id`, `sub_Palette_Id`, `offset`, `length`)
VALUES (41229, 67113145, 0, 0); |
var metaData = (function() {
var <API key> = {
type: "",
id: "",
name: "",
description: ""
},
<API key> = {
id: "",
name: "",
type: "",
description: ""
},
geneticProfiles = {},
clinicalAttrs = [],
retrieve_status = -1; //data not yet retrieved (-1), retrieved (1)
function <API key>() {
var paramsGetProfiles = {
cancer_study_id: window.QuerySession.getCancerStudyIds()[0],
case_set_id: window.QuerySession.getCaseSetId(),
case_ids_key: window.QuerySession.getCaseIdsKey(),
gene_list: window.QuerySession.getQueryGenes().join(" ")
};
$.post("getGeneticProfile.json", paramsGetProfiles, <API key>, "json");
}
function <API key>(<API key>) {
var <API key> = {
cmd : "getClinicalData",
cancer_study_id: window.QuerySession.getCancerStudyIds()[0],
case_set_id : window.QuerySession.getCaseSetId(),
case_ids_key: window.QuerySession.getCaseIdsKey(),
format : "json"
};
$.post("webservice.do", <API key>, function(result) {
registerMetaData(result.attributes, <API key>);
}, "json");
}
function registerMetaData(<API key>, <API key>) {
var _tmp_id_arr = []; //temporary instore profile id
var _profile_arr = [];
for (var gene in <API key>) { //merge all genetic profiles from all queried genes
var _gene_obj = <API key>[gene];
for (var _profile_name in _gene_obj) {
var obj = _gene_obj[_profile_name];
if ($.inArray(obj.STABLE_ID, _tmp_id_arr) === -1) {
var _datum = jQuery.extend(true, {}, <API key>);
_datum.type = obj.<API key>;
_datum.id = obj.STABLE_ID;
_datum.name = obj.NAME;
_datum.description = obj.DESCRIPTION;
_profile_arr.push(_datum);
_tmp_id_arr.push(obj.STABLE_ID);
}
}
}
for (var gene in <API key>) {
geneticProfiles[gene] = _profile_arr;
}
$.each(<API key>, function(index, obj) {
var _datum = jQuery.extend(true, {}, <API key>);
_datum.id = obj.attr_id;
_datum.type = obj.datatype;
_datum.name = obj.display_name;
_datum.description = obj.description;
clinicalAttrs.push(_datum);
});
//sort genetic profiles
for(var gene in geneticProfiles) {
var _gene_obj = geneticProfiles[gene];
$.each(_gene_obj, function(index, _profile_obj) {
$.each(_gene_obj, function(index, _profile_obj) {
if (_profile_obj.id.toLowerCase().indexOf("gistic") !== -1) {
bubble_up(_gene_obj, index);
}
});
_gene_obj.sort(function(a, b) {
if (<API key>.indexOf(a.type) < <API key>.indexOf(b.type)) {
return 1;
} else if (<API key>.indexOf(a.type) > <API key>.indexOf(b.type)) {
return -1;
} else if (<API key>.indexOf(a.type) === <API key>.indexOf(b.type)) {
return 0;
}
});
$.each(_gene_obj, function(index, _profile_obj) {
if (_profile_obj.id.toLowerCase().indexOf("zscores") !== -1) {
bubble_up(_gene_obj, index);
}
});
$.each(_gene_obj, function(index, _profile_obj) {
if (_profile_obj.id.toLowerCase().indexOf("zscores") === -1 &&
_profile_obj.id.toLowerCase().indexOf("rna_seq") !== -1) {
bubble_up(_gene_obj, index);
}
});
$.each(_gene_obj, function(index, _profile_obj) {
if (_profile_obj.id.toLowerCase().indexOf("zscores") === -1 &&
_profile_obj.id.toLowerCase().indexOf("rna_seq_v2") !== -1) {
bubble_up(_gene_obj, index);
}
});
});
//sort clinical attribute alphabetically
clinicalAttrs.sort(function(a, b){
if((a.name.toLowerCase()) < (b.name.toLowerCase())) return -1;
if((a.name.toLowerCase()) > (b.name.toLowerCase())) return 1;
return 0;
});
}
retrieve_status = 1;
}
return {
fetch: function() {
retrieve_status = -1;
<API key>();
},
getClinAttrsMeta: function() {
return clinicalAttrs;
},
<API key>: function(_gene) {
return geneticProfiles[_gene];
},
getRetrieveStatus: function() {
return retrieve_status;
},
<API key>: function(_gene, attr_id) {
$.each(metaData.<API key>(_gene), function(index, obj) {
if (obj.id === attr_id) {
_result = obj.description;
}
});
return _result;
},
<API key>: function(attr_id) {
var _result = "";
$.each(clinicalAttrs, function(index, obj) {
if (obj.id === attr_id) {
_result = obj.description;
}
});
return _result;
},
getClinicalAttrType: function(attr_id) {
var _result = "";
$.each(clinicalAttrs, function(index, obj) {
if (obj.id === attr_id) {
_result = obj.type;
}
});
return _result;
}
};
}()); |
void calculate_weights(conjugrad_float_t *w, unsigned char *msa, uint64_t ncol, uint64_t nrow, conjugrad_float_t threshold);
void uniform_weights(conjugrad_float_t *w, uint64_t nrow); |
package com.ephesoft.gxt.core.shared.dto.propertyAccessors;
import com.ephesoft.gxt.core.shared.dto.ImportPoolDTO;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
* This interface provides Property Accessors for {@link ImportPoolDTO}
*
* @author Ephesoft
* @version 1.0
*
*/
public interface <API key> extends PropertyAccess<ImportPoolDTO> {
ModelKeyProvider<ImportPoolDTO> identifier();
ValueProvider<ImportPoolDTO, String> zipFileLocation();
} |
Stizun::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.<API key> = false
config.action_controller.perform_caching = true
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile"
# For nginx:
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
# If you have no front-end server that supports something like X-Sendfile,
# just comment this out and Rails will serve the files
# See everything in the log (default is :info)
# config.log_level = :debug
# Compress JavaScript and CSS
config.assets.compress = true
# Don't fallback to assets pipeline
config.assets.compile = false
# But gimme those extra assets
config.assets.precompile += %w( theme-lincomp.css theme-lincomp-print.css general.css general_admin.css admin_blank.css in_place_styles.css modal.css scaffold.css public.js administration.js )
# Generate digests for assets URLs
config.assets.digest = true
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
config.cache_store = :memory_store
# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = false
# Enable serving of images, stylesheets, and javascripts from an asset server
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.<API key> = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { :host => "www.lincomp.ch" }
config.action_mailer.perform_deliveries = false
config.middleware.use Rack::SslEnforcer, :only => [/^\/admin/, /^\/users/, /^\/orders/, /^\/login/, /\/^user_sessions/]
end |
#!/bin/bash
set -eEuo pipefail
# External dependencies:
# s3cmd expects AWS_ACCESS_KEY_ID and <API key> to be set in the
# environment.
# For signing the script expects the private signing key to already be
# imported and PGPKEYID and <API key> to be set in the
# environment.
# - generate_index.py
# For generating the index.html of each directory. It's available in the
# packaging/bin directory of the k6 repo, and should be in $PATH.
_s3bucket="${S3_BUCKET-dl.k6.io}"
_usage="Usage: $0 <pkgdir> <repodir> [s3bucket=${_s3bucket}]"
PKGDIR="${1?${_usage}}" # The directory where .deb files are located
REPODIR="${2?${_usage}}" # The package repository working directory
S3PATH="${3-${_s3bucket}}/deb"
# Remove packages older than N number of days (730 is roughly ~2 years).
REMOVE_PKG_DAYS=730
log() {
echo "$(date -Iseconds) $*"
}
delete_old_pkgs() {
find "$1" -name '*.deb' -type f -daystart -mtime "+${REMOVE_PKG_DAYS}" -print0 | xargs -r0 rm -v
# Remove any dangling .asc files
find "$1" -name '*.asc' -type f -print0 | while read -r -d $'\0' f; do
if ! [ -r "${f%.*}" ]; then
rm -v "$f"
fi
done
}
sync_to_s3() {
log "Syncing to S3 ..."
s3cmd sync --delete-removed "${REPODIR}/" "s3://${S3PATH}/"
# Set a short cache expiration for index and repo metadata files.
s3cmd modify --recursive --exclude='*' \
--include='index.html' --include='*Release*' --include='Packages*' \
--add-header='Cache-Control: max-age=60,must-revalidate' "s3://${S3PATH}/"
}
# We don't publish i386 packages, but the repo structure is needed for
architectures="amd64 i386"
pushd . > /dev/null
mkdir -p "$REPODIR" && cd "$_"
for arch in $architectures; do
bindir="dists/stable/main/binary-$arch"
mkdir -p "$bindir"
# Download existing files
# TODO: Consider doing this over the CDN with curl to avoid S3 egress costs,
# but that would involve parsing the index.html, checking the checksum
# manually, etc.
s3cmd sync --exclude='*' --include='*.deb' --include='*.asc' \
"s3://${S3PATH}/${bindir}/" "$bindir/"
# Copy the new packages in
find "$PKGDIR" -name "*$arch*.deb" -type f -print0 | xargs -r0 cp -avt "$bindir"
# Generate signatures for files that don't have it
# TODO: Switch to debsign instead? This is currently done as Bintray did it,
# but the signature is not validated by apt/dpkg.
find "$bindir" -type f -name '*.deb' -print0 | while read -r -d $'\0' f; do
if ! [ -r "${f}.asc" ]; then
gpg2 --default-key="$PGPKEYID" --passphrase="$<API key>" \
--pinentry-mode=loopback --yes --detach-sign --armor -o "${f}.asc" "$f"
fi
done
apt-ftparchive packages "$bindir" | tee "$bindir/Packages"
gzip -fk "$bindir/Packages"
bzip2 -fk "$bindir/Packages"
delete_old_pkgs "$bindir"
done
log "Creating release file..."
apt-ftparchive release \
-o APT::FTPArchive::Release::Origin="k6" \
-o APT::FTPArchive::Release::Label="k6" \
-o APT::FTPArchive::Release::Suite="stable" \
-o APT::FTPArchive::Release::Codename="stable" \
-o APT::FTPArchive::Release::Architectures="$architectures" \
-o APT::FTPArchive::Release::Components="main" \
-o APT::FTPArchive::Release::Date="$(date -Ru)" \
"dists/stable" > "dists/stable/Release"
# Sign release file
gpg2 --default-key="$PGPKEYID" --passphrase="$<API key>" \
--pinentry-mode=loopback --yes --detach-sign --armor \
-o "dists/stable/Release.gpg" "dists/stable/Release"
gpg2 --default-key="$PGPKEYID" --passphrase="$<API key>" \
--pinentry-mode=loopback --yes --clear-sign \
-o "dists/stable/InRelease" "dists/stable/Release"
log "Generating index.html ..."
generate_index.py -r
popd > /dev/null
sync_to_s3 |
/** \file
* Functionals for domain initialization -- generic implementation.
*/
#ifndef <API key>
#define <API key>
#include "plbWrapper/block/<API key>.h"
#include "core/cell.h"
#include "atomicBlock/dataField3D.h"
namespace plb {
template<typename T>
<API key><T>::<API key> (
std::vector<T> const& value_ )
: value(value_)
{ }
template<typename T>
void <API key><T>::process (
Box3D domain, NTensorField3D<T>& field )
{
PLB_PRECONDITION( field.getNdim() == (plint) value.size() );
for (plint iX=domain.x0; iX<=domain.x1; ++iX) {
for (plint iY=domain.y0; iY<=domain.y1; ++iY) {
for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) {
for (pluint iDim=0; iDim<value.size(); ++iDim) {
field.get(iX,iY,iZ)[iDim] = value[iDim];
}
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Include boundary right away, to avoid need for envelope update.
return BlockDomain::bulkAndEnvelope;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::staticVariables;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key> (
std::vector<T> const& value_ )
: value(value_)
{ }
template<typename T>
void <API key><T>::process (
Box3D domain,
NTensorField3D<T>& field,
NTensorField3D<int>& mask )
{
PLB_PRECONDITION( field.getNdim() == (plint) value.size() );
Dot3D maskOfs = <API key>(field, mask);
for (plint iX=domain.x0; iX<=domain.x1; ++iX) {
for (plint iY=domain.y0; iY<=domain.y1; ++iY) {
for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) {
if (*mask.get(iX+maskOfs.x,iY+maskOfs.y, iZ+maskOfs.z)) {
for (pluint iDim=0; iDim<value.size(); ++iDim) {
field.get(iX,iY,iZ)[iDim] = value[iDim];
}
}
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Include boundary right away, to avoid need for envelope update.
return BlockDomain::bulkAndEnvelope;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::staticVariables;
modified[1] = modif::nothing;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key>(plint index_)
: index(index_)
{
PLB_ASSERT( index >= 0 && index <=2 );
}
template<typename T>
void <API key><T>::process(Box3D domain, NTensorField3D<T>& field) {
PLB_PRECONDITION( field.getNdim()==1 );
Dot3D relativeOffset = field.getLocation();
Array<plint,3> ofs(relativeOffset.x, relativeOffset.y, relativeOffset.z);
Array<plint,3> pos;
for ( pos[0]=domain.x0; pos[0]<=domain.x1; ++pos[0] ) {
for ( pos[1]=domain.y0; pos[1]<=domain.y1; ++pos[1] ) {
for ( pos[2]=domain.z0; pos[2]<=domain.z1; ++pos[2] ) {
*field.get(pos[0],pos[1],pos[2]) = (T) (pos[index]+ofs[index]);
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Boundary cannot be included, because periodic boundaries
// would get the wrong value.
return BlockDomain::bulk;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::staticVariables;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key>(plint index_)
: index(index_)
{
PLB_ASSERT( index >= 0 && index <=1 );
}
template<typename T>
void <API key><T>::process (
Box3D domain, NTensorField3D<T>& field,
NTensorField3D<int>& mask)
{
PLB_PRECONDITION( field.getNdim()==1 );
Dot3D relativeOffset = field.getLocation();
Dot3D maskOfs = <API key>(field, mask);
Array<plint,3> ofs(relativeOffset.x, relativeOffset.y, relativeOffset.z);
Array<plint,3> pos;
for ( pos[0]=domain.x0; pos[0]<=domain.x1; ++pos[0] ) {
for ( pos[1]=domain.y0; pos[1]<=domain.y1; ++pos[1] ) {
for ( pos[2]=domain.z0; pos[2]<=domain.z1; ++pos[2] ) {
if (*mask.get(pos[0]+maskOfs.x,pos[1]+maskOfs.y,pos[2]+maskOfs.z)) {
*field.get(pos[0],pos[1],pos[2]) = (T) (pos[index]+ofs[index]);
}
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Boundary cannot be included, because periodic boundaries
// would get the wrong value.
return BlockDomain::bulk;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::staticVariables;
modified[1] = modif::nothing;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key>()
{ }
template<typename T>
void <API key><T>::process(Box3D domain, NTensorField3D<T>& field) {
PLB_PRECONDITION( field.getNdim()==3 );
Dot3D relativeOffset = field.getLocation();
Array<plint,3> ofs(relativeOffset.x, relativeOffset.y, relativeOffset.z);
Array<plint,3> pos;
for ( pos[0]=domain.x0; pos[0]<=domain.x1; ++pos[0] ) {
for ( pos[1]=domain.y0; pos[1]<=domain.y1; ++pos[1] ) {
for ( pos[2]=domain.z0; pos[2]<=domain.z1; ++pos[2] ) {
T* cell = field.get(pos[0], pos[1], pos[2]);
cell[0] = (T) (pos[0]+ofs[0]);
cell[1] = (T) (pos[1]+ofs[1]);
cell[2] = (T) (pos[2]+ofs[2]);
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Boundary cannot be included, because periodic boundaries
// would get the wrong value.
return BlockDomain::bulk;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::staticVariables;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key>()
{ }
template<typename T>
void <API key><T>::process (
Box3D domain, NTensorField3D<T>& field,
NTensorField3D<int>& mask )
{
PLB_PRECONDITION( field.getNdim()==3 );
Dot3D maskOfs = <API key>(field, mask);
Dot3D relativeOffset = field.getLocation();
Array<plint,3> ofs(relativeOffset.x, relativeOffset.y, relativeOffset.z);
Array<plint,3> pos;
for ( pos[0]=domain.x0; pos[0]<=domain.x1; ++pos[0] ) {
for ( pos[1]=domain.y0; pos[1]<=domain.y1; ++pos[1] ) {
for ( pos[2]=domain.z0; pos[2]<=domain.z1; ++pos[2] ) {
if (*mask.get(pos[0]+maskOfs.x,pos[1]+maskOfs.y,pos[2]+maskOfs.z)) {
T* cell = field.get(pos[0], pos[1], pos[2]);
cell[0] = (T) (pos[0]+ofs[0]);
cell[1] = (T) (pos[1]+ofs[1]);
cell[2] = (T) (pos[2]+ofs[2]);
}
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Boundary cannot be included, because periodic boundaries
// would get the wrong value.
return BlockDomain::bulk;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::staticVariables;
modified[1] = modif::nothing;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key>(int whichDim_)
: whichDim(whichDim_)
{ }
template<typename T>
void <API key><T>::process (
Box3D domain, NTensorField3D<T>& scalarField,
NTensorField3D<T>& tensorField )
{
PLB_PRECONDITION( scalarField.getNdim()==1 );
PLB_PRECONDITION( tensorField.getNdim()==3 );
Dot3D offset = <API key>(scalarField, tensorField);
for (plint iX=domain.x0; iX<=domain.x1; ++iX) {
for (plint iY=domain.y0; iY<=domain.y1; ++iY) {
for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) {
tensorField.get(iX+offset.x, iY+offset.y,iZ+offset.z)[whichDim] =
*scalarField.get(iX,iY,iZ);
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Boundary cannot be included, because periodic boundaries
// would get the wrong value.
return BlockDomain::bulk;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::nothing;
modified[1] = modif::staticVariables;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key>(int whichDim_)
: whichDim(whichDim_)
{ }
template<typename T>
void <API key><T>::process (
Box3D domain, NTensorField3D<T>& scalarField,
NTensorField3D<T>& tensorField,
NTensorField3D<int>& mask )
{
PLB_PRECONDITION( scalarField.getNdim()==1 );
PLB_PRECONDITION( tensorField.getNdim()==3 );
Dot3D offset = <API key>(scalarField, tensorField);
Dot3D maskOfs = <API key>(scalarField, mask);
for (plint iX=domain.x0; iX<=domain.x1; ++iX) {
for (plint iY=domain.y0; iY<=domain.y1; ++iY) {
for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) {
if (*mask.get(iX+maskOfs.x,iY+maskOfs.y, iZ+maskOfs.z)) {
tensorField.get(iX+offset.x, iY+offset.y, iZ+offset.z)[whichDim] =
*scalarField.get(iX,iY,iZ);
}
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Boundary cannot be included, because periodic boundaries
// would get the wrong value.
return BlockDomain::bulk;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::nothing;
modified[1] = modif::staticVariables;
modified[2] = modif::nothing;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key>()
{ }
template<typename T>
void <API key><T>::process (
Box3D domain, NTensorField3D<T>& A,
NTensorField3D<T>& B )
{
PLB_PRECONDITION( A.getNdim() == B.getNdim() );
plint ndim = A.getNdim();
Dot3D offset = <API key>(A,B);
// Improve computational speed if the field is scalar-valued.
if (ndim==1) {
for (plint iX=domain.x0; iX<=domain.x1; ++iX) {
for (plint iY=domain.y0; iY<=domain.y1; ++iY) {
for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) {
*A.get(iX,iY,iZ) = *B.get(iX+offset.x,iY+offset.y,iZ+offset.z);
}
}
}
}
// Generic implementation for any number of dimensions.
else {
for (plint iX=domain.x0; iX<=domain.x1; ++iX) {
for (plint iY=domain.y0; iY<=domain.y1; ++iY) {
for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) {
for (plint iDim=0; iDim<ndim; ++iDim) {
A.get(iX,iY,iZ)[iDim] = B.get(iX+offset.x,iY+offset.y,iZ+offset.z)[iDim];
}
}
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Boundary cannot be included, because periodic boundaries
// would get the wrong value.
return BlockDomain::bulk;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::staticVariables;
modified[1] = modif::nothing;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
template<typename T>
<API key><T>::<API key>()
{ }
template<typename T>
void <API key><T>::process (
Box3D domain, NTensorField3D<T>& A,
NTensorField3D<T>& B,
NTensorField3D<int>& mask )
{
PLB_PRECONDITION( A.getNdim() == B.getNdim() );
plint ndim = A.getNdim();
Dot3D offset = <API key>(A,B);
Dot3D maskOfs = <API key>(A, mask);
// Improve computational speed if the field is scalar-valued.
if (ndim==1) {
for (plint iX=domain.x0; iX<=domain.x1; ++iX) {
for (plint iY=domain.y0; iY<=domain.y1; ++iY) {
for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) {
if (*mask.get(iX+maskOfs.x,iY+maskOfs.y, iZ+maskOfs.z)) {
*A.get(iX,iY,iZ) = *B.get(iX+offset.x,iY+offset.y,iZ+offset.z);
}
}
}
}
}
// Generic implementation for any number of dimensions.
else {
for (plint iX=domain.x0; iX<=domain.x1; ++iX) {
for (plint iY=domain.y0; iY<=domain.y1; ++iY) {
for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) {
if (*mask.get(iX+maskOfs.x,iY+maskOfs.y, iZ+maskOfs.z)) {
for (plint iDim=0; iDim<ndim; ++iDim) {
A.get(iX,iY,iZ)[iDim] = B.get(iX+offset.x,iY+offset.y,iZ+offset.z)[iDim];
}
}
}
}
}
}
}
template<typename T>
<API key><T>* <API key><T>::clone() const {
return new <API key><T>(*this);
}
template<typename T>
BlockDomain::DomainT <API key><T>::appliesTo() const {
// Boundary cannot be included, because periodic boundaries
// would get the wrong value.
return BlockDomain::bulk;
}
template<typename T>
void <API key><T>::<API key> (
std::vector<modif::ModifT>& modified ) const
{
modified[0] = modif::staticVariables;
modified[1] = modif::nothing;
modified[2] = modif::nothing;
}
template<typename T>
void <API key><T>::rescale(double dxScale, double dtScale)
{ }
} // namespace plb
#endif // <API key> |
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using InfinniPlatform.PrintView.Properties;
namespace InfinniPlatform.PrintView.Writers.Pdf
{
internal class HtmlToPdfUtil
{
private const int UtilTimeout = 60 * 1000;
private const string PaddingBottom = "{padding-bottom}";
private const string PaddingLeft = "{padding-left}";
private const string PaddingRight = "{padding-right}";
private const string PaddingTop = "{padding-top}";
private const string PageWidth = "{page-width}";
private const string PageHeight = "{page-height}";
private const string HtmlInput = "{file-html}";
private const string PdfOutput = "{file-pdf}";
public HtmlToPdfUtil(string <API key>, string <API key>, string htmlToPdfTemp)
{
<API key> = string.IsNullOrWhiteSpace(<API key>) ? <API key>() : <API key>;
<API key> = string.IsNullOrWhiteSpace(<API key>) ? <API key>() : <API key>;
_htmlToPdfTemp = string.IsNullOrWhiteSpace(htmlToPdfTemp) ? Path.GetTempPath() : htmlToPdfTemp;
}
private readonly string <API key>;
private readonly string <API key>;
private readonly string _htmlToPdfTemp;
public async Task Convert(PrintSize size, PrintThickness padding, Stream inHtmlStream, Stream outPdfStream)
{
var fileName = Guid.NewGuid().ToString("N");
var fileHtmlPath = Path.Combine(_htmlToPdfTemp, fileName + ".html");
var filePdfPath = Path.Combine(_htmlToPdfTemp, fileName + ".pdf");
try
{
using (var htmlFileStream = File.Create(fileHtmlPath))
{
await inHtmlStream.CopyToAsync(htmlFileStream);
htmlFileStream.Flush();
}
var <API key> = <API key>(size, padding, fileHtmlPath, filePdfPath);
var <API key> = await ProcessHelper.ExecuteShellCommand(<API key>, <API key>, UtilTimeout);
if (<API key>.Completed && <API key>.ExitCode == 0)
{
using (var fileStream = File.OpenRead(filePdfPath))
{
await fileStream.CopyToAsync(outPdfStream);
outPdfStream.Flush();
}
}
else
{
if (<API key>.Completed)
{
throw new <API key>(string.Format(Resources.<API key>, <API key>.Output, <API key>.ExitCode));
}
throw new <API key>(Resources.<API key>);
}
}
finally
{
DeleteFile(fileHtmlPath);
DeleteFile(filePdfPath);
}
}
private static string <API key>()
{
string command;
// Linux
if (IsRunningOnLinux())
{
command = "/usr/local/bin/wkhtmltopdf.sh";
if (!File.Exists(command))
{
command = "wkhtmltopdf";
}
}
// Windows
else
{
// x64
if (<API key>())
{
// "C:\Program Files"
var programFiles = Environment.<API key>("ProgramW6432");
// "C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe"
command = Path.Combine(programFiles ?? "", "wkhtmltopdf", "bin", "wkhtmltopdf.exe");
if (!File.Exists(command))
{
// "C:\Program Files (x86)\wkhtmltopdf\bin\wkhtmltopdf.exe"
var programFilesX86 = Environment.<API key>("ProgramFiles(x86)");
// "C:\Program Files (x86)\wkhtmltopdf\bin\wkhtmltopdf.exe"
command = Path.Combine(programFilesX86 ?? "", "wkhtmltopdf", "bin", "wkhtmltopdf.exe");
}
}
// x32
else
{
var programFiles = Environment.<API key>("ProgramFiles");
command = Path.Combine(programFiles ?? "", "wkhtmltopdf", "bin", "wkhtmltopdf.exe");
}
}
return command;
}
private static string <API key>()
{
string arguments;
if (IsRunningOnLinux())
{
arguments = " ";
}
else
{
arguments = " --<API key> --dpi 96";
}
return $"{arguments} -B {PaddingBottom} -L {PaddingLeft} -R {PaddingRight} -T {PaddingTop} --page-height {PageHeight} --page-width {PageWidth} \"{HtmlInput}\" \"{PdfOutput}\"";
}
private static bool IsRunningOnLinux()
{
return !RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
}
private static bool <API key>()
{
return (RuntimeInformation.OSArchitecture == Architecture.X64)
|| (RuntimeInformation.OSArchitecture == Architecture.Arm64);
}
private string <API key>(PrintSize size, PrintThickness padding, string fileHtmlPath, string filePdfPath)
{
var paddingBottomMm = (int)<API key>.ToSpecifiedSize(padding.Bottom, padding.SizeUnit, PrintSizeUnit.Mm);
var paddingLeftMm = (int)<API key>.ToSpecifiedSize(padding.Left, padding.SizeUnit, PrintSizeUnit.Mm);
var paddingRightMm = (int)<API key>.ToSpecifiedSize(padding.Right, padding.SizeUnit, PrintSizeUnit.Mm);
var paddingTopMm = (int)<API key>.ToSpecifiedSize(padding.Top, padding.SizeUnit, PrintSizeUnit.Mm);
var htmlToPdfUtil = <API key>
.Replace(HtmlInput, fileHtmlPath)
.Replace(PdfOutput, filePdfPath)
.Replace(PaddingBottom, paddingBottomMm.ToString())
.Replace(PaddingLeft, paddingLeftMm.ToString())
.Replace(PaddingRight, paddingRightMm.ToString())
.Replace(PaddingTop, paddingTopMm.ToString())
;
if (size != null)
{
var pageHeightMm = (int)<API key>.ToSpecifiedSize(size.Height, size.SizeUnit, PrintSizeUnit.Mm);
htmlToPdfUtil = htmlToPdfUtil.Replace(PageHeight, pageHeightMm.ToString());
var pageWidthMm = (int)<API key>.ToSpecifiedSize(size.Width, size.SizeUnit, PrintSizeUnit.Mm);
htmlToPdfUtil = htmlToPdfUtil.Replace(PageWidth, pageWidthMm.ToString());
}
else
{
const int defaultPageHeight = 297;
const int defaultPageWidth = 210;
htmlToPdfUtil = htmlToPdfUtil.Replace(PageHeight, defaultPageHeight.ToString());
htmlToPdfUtil = htmlToPdfUtil.Replace(PageWidth, defaultPageWidth.ToString());
}
return htmlToPdfUtil;
}
private static void DeleteFile(string path)
{
try
{
if (File.Exists(path))
{
File.Delete(path);
}
}
catch
{
// ignored
}
}
}
} |
package org.voltdb;
import java.util.ArrayList;
import java.util.Iterator;
import org.voltdb.VoltTable.ColumnInfo;
import com.google_voltpatches.common.collect.ImmutableSet;
public class DRProducerStatsBase {
public static interface Columns {
// column for both tables
public static final String CLUSTER_ID = "CLUSTER_ID";
public static final String REMOTE_CLUSTER_ID = "REMOTE_CLUSTER_ID";
// columns for the node-level table
public static final String STATE = "STATE";
public static final String SYNC_SNAPSHOT_STATE = "SYNCSNAPSHOTSTATE";
public static final String <API key> = "ROWSINSYNCSNAPSHOT";
public static final String <API key> = "<API key>";
public static final String QUEUE_DEPTH = "QUEUEDEPTH";
// columns for partition-level table
public static final String STREAM_TYPE = "STREAMTYPE";
public static final String TOTAL_BYTES = "TOTALBYTES";
public static final String <API key> = "TOTALBYTESINMEMORY";
public static final String TOTAL_BUFFERS = "TOTALBUFFERS";
public static final String LAST_QUEUED_DRID = "LASTQUEUEDDRID";
public static final String LAST_ACK_DRID = "LASTACKDRID";
public static final String QUEUE_GAP = "QUEUE_GAP";
public static final String <API key> = "LASTQUEUEDTIMESTAMP";
public static final String LAST_ACK_TIMESTAMP = "LASTACKTIMESTAMP";
public static final String IS_SYNCED = "ISSYNCED";
public static final String MODE = "MODE";
}
public static class <API key> extends StatsSource {
public <API key>() {
super(false);
}
@Override
protected void <API key>(ArrayList<VoltTable.ColumnInfo> columns) {
super.<API key>(columns);
columns.add(new ColumnInfo(Columns.CLUSTER_ID, VoltType.SMALLINT));
columns.add(new ColumnInfo(Columns.REMOTE_CLUSTER_ID, VoltType.SMALLINT));
columns.add(new ColumnInfo(Columns.STATE, VoltType.STRING));
columns.add(new ColumnInfo(Columns.SYNC_SNAPSHOT_STATE, VoltType.STRING));
columns.add(new ColumnInfo(Columns.<API key>, VoltType.BIGINT));
columns.add(new ColumnInfo(Columns.<API key>, VoltType.BIGINT));
columns.add(new ColumnInfo(Columns.QUEUE_DEPTH, VoltType.BIGINT));
}
@Override
protected Iterator<Object> <API key>(boolean interval) {
return ImmutableSet.of().iterator();
}
}
public static class <API key> extends StatsSource {
public <API key>() {
super(false);
}
@Override
protected void <API key>(ArrayList<VoltTable.ColumnInfo> columns) {
super.<API key>(columns);
columns.add(new ColumnInfo(Columns.CLUSTER_ID, VoltType.SMALLINT));
columns.add(new ColumnInfo(Columns.REMOTE_CLUSTER_ID, VoltType.SMALLINT));
columns.add(new ColumnInfo(VoltSystemProcedure.CNAME_PARTITION_ID, VoltType.INTEGER));
columns.add(new ColumnInfo(Columns.STREAM_TYPE, VoltType.STRING));
columns.add(new ColumnInfo(Columns.TOTAL_BYTES, VoltType.BIGINT));
columns.add(new ColumnInfo(Columns.<API key>, VoltType.BIGINT));
columns.add(new ColumnInfo(Columns.TOTAL_BUFFERS, VoltType.BIGINT));
columns.add(new ColumnInfo(Columns.LAST_QUEUED_DRID, VoltType.BIGINT));
columns.add(new ColumnInfo(Columns.LAST_ACK_DRID, VoltType.BIGINT));
columns.add(new ColumnInfo(Columns.<API key>, VoltType.TIMESTAMP));
columns.add(new ColumnInfo(Columns.LAST_ACK_TIMESTAMP, VoltType.TIMESTAMP));
columns.add(new ColumnInfo(Columns.IS_SYNCED, VoltType.STRING));
columns.add(new ColumnInfo(Columns.MODE, VoltType.STRING));
columns.add(new ColumnInfo(Columns.QUEUE_GAP, VoltType.BIGINT));
}
@Override
protected Iterator<Object> <API key>(boolean interval) {
return ImmutableSet.of().iterator();
}
}
} |
const axios = require('axios')
const Pino = require('pino')
class Telegram {
constructor () {
this.logger = new Pino({ level: process.env.LOG_LEVEL })
}
async sendMessage (chatId, message, options = {}) {
const url = `https://api.telegram.org/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMessage`
const data = {
options,
chat_id: chatId,
text: message
}
this.logger.debug(`data: ${JSON.stringify(data)}`)
const response = await axios.post(url, data)
this.logger.debug('response.status', response.status)
this.logger.debug(`response.data: ${JSON.stringify(response.data)}`)
return response
}
async isAdmin ({ chatId, userId }) {
const url = `https://api.telegram.org/bot${process.env.TELEGRAM_BOT_TOKEN}/<API key>`
const config = {
params: {
chat_id: chatId
}
}
const response = await axios.get(url, config)
this.logger.debug(`response.status: ${response.status}`)
this.logger.debug(`response.data: ${JSON.stringify(response.data)}`)
const data = response.data
const adminIds = data.result.map(o => o.user.id)
const isAdmin = adminIds.includes(userId)
this.logger.info(`isAdmin: ${isAdmin}`)
return isAdmin
}
}
module.exports = Telegram |
{% ckan_extends %}
{% block bodytag %} class="resource-page"{% endblock %}
{% block banner %}
<h1 class="page-heading">{{ h.<API key>(res) | truncate(50) }}</h1>
{% endblock %}
{% block resource_read_title %}{% endblock %}
{{ super() }} |
<?php
require_once('modules/RestaurantBookings/RestaurantBookings.php');
class Viewexport2word extends SugarView{
var $ss ;
function Viewexport2word() {
parent::SugarView();
}
function display(){
global $sugar_config,$mod_strings,$app_strings;
$focus = new RestaurantBookings();
$db = DBManagerFactory::getInstance();
// ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
// A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
$record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
$template = file_get_contents('modules/RestaurantBookings/tpls/export.tpl');
/* Delete by Hieu Nguyen 270712
//$sql = "select * from tours where id ='".$record."' and deleted = 0";
$sql = " SELECT
srv.res_address
, srv.code
, srv.attn_res_name
, srv.attn_res_phone
, srv.res_tel
, srv.res_fax
, srv.company
, srv.attn_name
, srv.attn_phone
, srv.attn_id
, srv.attn_email
, srv.attn_tel
, srv.attn_fax
, srv.nationlity
, srv.notes
, srv.confirm
, srv.date
, srv.deparment
, srv.date_time
, srv.operating_date
, srv.quantity_pax
, srv.guide
, srv.guide_id
, srv.guide_phone
,res.name
,res.code as res_code
,grp.groupprogram_code
FROM
restaurantbookings srv LEFT JOIN <API key> ressvr ON srv.id = ressvr.<API key> LEFT JOIN restaurants res
ON ressvr.<API key> = res.id LEFT JOIN <API key> grpsrv ON srv.id = grpsrv.<API key>
LEFT JOIN groupprograms grp ON grpsrv.<API key> =grp.id
WHERE srv.deleted = 0 AND ressvr.deleted = 0 AND res.deleted = 0 AND grpsrv.deleted = 0 AND grp.deleted =0 AND srv.id = '".$record."'";
$result = $db->query($sql);
$row = $db->fetchByAssoc($result);
*/
$template = str_replace("{LBL_TO}",$mod_strings['LBL_TO'],$template );
$template = str_replace("{LBL_RES_ADDRESS}",$mod_strings['LBL_RES_ADDRESS'],$template );
$template = str_replace("{LBL_ATTN_RES_NAME}",$mod_strings['LBL_ATTN_RES_NAME'],$template );
$template = str_replace("{LBL_RES_TEL}",$mod_strings['LBL_RES_TEL'],$template );
$template = str_replace("{LBL_RES_FAX}",$mod_strings['LBL_RES_FAX'],$template );
$template = str_replace("{LBL_FROM}",$mod_strings['LBL_FROM'],$template );
$template = str_replace("{LBL_ATTN_NAME}",$mod_strings['LBL_ATTN_NAME'],$template );
$template = str_replace("{LBL_EMAIL}",$mod_strings['LBL_EMAIL'],$template );
$template = str_replace("{LBL_TEL}",$mod_strings['LBL_TEL'],$template );
$template = str_replace("{LBL_TITLE}",$mod_strings['LBL_TITLE'],$template );
$template = str_replace("{LBL_OPERATING_DATE}",$mod_strings['LBL_OPERATING_DATE'],$template );
$template = str_replace("{LBL_MADE_TOUR}",$mod_strings['LBL_MADE_TOUR'],$template );
$template = str_replace("{LBL_NATIONLITY}",$mod_strings['LBL_NATIONLITY'],$template );
$template = str_replace("{LBL_QUANTITY_PAX}",$mod_strings['LBL_QUANTITY_PAX'],$template );
$template = str_replace("{LBL_GUIDE}",$mod_strings['LBL_GUIDE'],$template );
$template = str_replace("{LBL_TIME}",$mod_strings['LBL_TIME'],$template );
$template = str_replace("{LBL_QUANTITY}",$mod_strings['LBL_QUANTITY'],$template );
$template = str_replace("{LBL_UNIT_PRICE}",$mod_strings['LBL_UNIT_PRICE'],$template );
$template = str_replace("{LBL_MENU}",$mod_strings['LBL_MENU'],$template );
$template = str_replace("{LBL_NOTES}",$mod_strings['LBL_NOTES'],$template );
$template = str_replace("{LBL_CONFIRM_SERVICE}",$mod_strings['LBL_CONFIRM_SERVICE'],$template );
$template = str_replace("{LBL_DATE}",$mod_strings['LBL_DATE'],$template );
$template = str_replace("{<API key>}",$mod_strings['<API key>'],$template );
$template = str_replace("{SITE_URL}",$sugar_config['site_url'],$template );
$template = str_replace("{RES}",$this->bean-><API key>,$template);
$template = str_replace("{ADDRESS}",$this->bean->res_address,$template);
$template = str_replace("{ATTN_RES_NAME}",$this->bean->attn_res_name,$template);
$template = str_replace("{ATTN_RES_PHONE}",$this->bean->attn_res_phone,$template );
$template = str_replace("{RES_TEL}", $this->bean->res_tel,$template);
$template = str_replace("{RES_FAX}",$this->bean->res_fax,$template );
$template = str_replace("{FROM}", $this->bean->company,$template);
//$template = str_replace("{ATTN_NAME}", $this->bean->attn_name,$template );
$template = str_replace("{ATTN_NAME}", $this->bean->assigned_user_name,$template );
$template = str_replace("{ATTN_PHONE}", $this->bean->attn_phone,$template);
$template = str_replace("{ATTN_EMAIL}", $this->bean->attn_email,$template);
$template = str_replace("{TEL}", $this->bean->attn_tel,$template);
$template = str_replace("{FAX}", $this->bean->attn_fax,$template);
$template = str_replace("{DATE_TIME}", $this->bean->date_time,$template);
$template = str_replace("{OPERATING_DATE}", $this->bean->operating_date,$template);
$template = str_replace("{QUANTITY_PAX}", $this->bean->quantity_pax,$template);
$template = str_replace("{GUIDE}", $this->bean->guide,$template);
$template = str_replace("{GUIDE_PHONE}", $this->bean->guide_phone,$template);
// Lay ra code cua MadeTour
$made_tour = new GroupProgram();
$made_tour->retrieve($this->bean-><API key>);
$template = str_replace("{MADETOUR}", $made_tour->groupprogram_code, $template); // fix bug 1487
if(!empty($this->bean->nationlity)){
$template = str_replace("{NATIONLITY}", translate('countries_dom','',$this->bean->nationlity),$template);
}
else{$template = str_replace("{NATIONLITY}", '',$template); }
$template = str_replace("{BOOKINGLINE}", $focus-><API key>($record),$template);
$template = str_replace("{NOTES}", html_entity_decode(nl2br($this->bean->notes)),$template);
if($this->bean->confirm == 0 ){
$template = str_replace("{CONFIRM}", 'No',$template);
}
else {$template = str_replace("{CONFIRM}", 'Yes',$template); }
$template = str_replace("{DATE}", $this->bean->date,$template);
$template = str_replace("{DEPARMENT}", $this->bean->deparment,$template);
$size=strlen($template);
$filename = "Restaurant_Booking_".strtoupper($this->bean->code)."_To_".mb_strtoupper($this->bean-><API key>, 'UTF-8').".doc"; // fix issue 1485
ob_end_clean();
header("Cache-Control: private");
header("Content-Type: application/force-download;");
header("Content-Disposition:attachment; filename=\"$filename\"");
header("Content-length:$size");
echo $template;
ob_flush();
} // end function
} // end class
?> |
<API key> = Creature:new {
objectName = "@mob/creature_names:<API key>",
socialGroup = "slice_hound",
faction = "",
level = 10,
chanceHit = 0.28,
damageMin = 130,
damageMax = 140,
baseXp = 356,
baseHAM = 675,
baseHAMmax = 825,
armor = 0,
resists = {0,0,0,0,0,0,0,-1,-1},
meatType = "meat_carnivore",
meatAmount = 65,
hideType = "hide_bristley",
hideAmount = 35,
boneType = "bone_mammal",
boneAmount = 30,
milk = 0,
tamingChance = 0.25,
ferocity = 1,
pvpBitmask = ATTACKABLE,
creatureBitmask = PACK + HERD,
optionsBitmask = 128,
diet = CARNIVORE,
templates = {"object/mobile/forest_slice_hound.iff"},
<API key> = "object/intangible/pet/<API key>.iff",
scale = 1.05,
lootGroups = {},
weapons = {},
<API key> = "",
attacks = {
{"posturedownattack",""}
}
}
CreatureTemplates:addCreatureTemplate(<API key>, "<API key>") |
#include "<API key>.h"
#include "Delete.h"
namespace OOX
{
namespace Logic
{
Delete::Delete()
{
}
Delete::~Delete()
{
}
Delete::Delete(const XML::XNode& node)
{
fromXML(node);
}
const Delete& Delete::operator =(const XML::XNode& node)
{
fromXML(node);
return *this;
}
void Delete::fromXML(const XML::XNode& node)
{
const XML::XElement element(node);
Id = element.attribute("id").value();
Author = element.attribute("author").value();
Date = element.attribute("date").value();
XML::Fill(Runs, element, "r");
}
const XML::XNode Delete::toXML() const
{
return XML::XElement();
}
const std::string Delete::toTxt() const
{
std::string text;
const std::vector<Run>& runs = Runs.get();
for (std::vector<Run>::const_iterator iter = runs.begin(); iter != runs.end(); ++iter)
text += (*iter).toTxt();
return text;
}
}
} // namespace OOX |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.