prompt
large_stringlengths 70
991k
| completion
large_stringlengths 0
1.02k
|
---|---|
<|file_name|>pyside.py<|end_file_name|><|fim▁begin|>""" Sets up the Qt environment to work with various Python Qt wrappers """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2012, Projex Software'
__license__ = 'LGPL'
# maintenance information
__maintainer__ = 'Projex Software'
__email__ = '[email protected]'
# requires at least the QtCore module
import PySide
import logging
import re
import sys
import xml.parsers.expat
from PySide import QtCore, QtGui, QtUiTools
from xml.etree import ElementTree
from ..lazyload import lazy_import
log = logging.getLogger(__name__)
class XThreadNone(object):
"""
PySide cannot handle emitting None across threads without crashing.
This variable can be used in place of None.
:usage |class A(QtCore.QObject):
| valueChanged = QtCore.Signal('QVariant')
| def setValue(self, value):
| self._value = value
| emitter = value if value is not None else QtCore.THREADSAFE_NONE
| self.valueChanged.emit(emitter)
|
|class B(QtCore.QObject):
| def __init__(self, a):
| super(B, self).__init__()
| a.valueChanged.connect(self.showValue)
| def showValue(self, value):
| if value == None:
| print 'value does equal none'
| if value is None:
| print 'value unfortunately not IS none'
|
|a = A()
|b = B()
|t = QtCore.QThread()
|a.moveToThread(t)
|t.start()
|a.setValue(None) # will crash if not using THREADSAFE_NONE
"""
def __nonzero__(self):
return False
def __repr__(self):
return 'None'
def __str__(self):
return 'None'
def __eq__(self, other):
return id(other) == id(self) or other is None
#----------------------------------------------------------------------
SIGNAL_BASE = QtCore.SIGNAL
def SIGNAL(signal):
match = re.match(r'^(?P<method>\w+)\(?(?P<args>[^\)]*)\)?$', str(signal))
if not match:
return SIGNAL_BASE(signal)
method = match.group('method')
args = match.group('args')
args = re.sub(r'\bPyQt_PyObject\b', 'QVariant', args)
args = re.sub(r'\bobject\b', 'QVariant', args)
new_signal = '%s(%s)' % (method, args)
return SIGNAL_BASE(new_signal)
#----------------------------------------------------------
class UiLoader(QtUiTools.QUiLoader):
def __init__(self, baseinstance):
super(UiLoader, self).__init__()
self.dynamicWidgets = {}
self._baseinstance = baseinstance
def createAction(self, parent=None, name=''):
"""
Overloads teh create action method to handle the proper base
instance information, similar to the PyQt4 loading system.
:param parent | <QWidget> || None
name | <str>
"""
action = super(UiLoader, self).createAction(parent, name)
if not action.parent():
action.setParent(self._baseinstance)
setattr(self._baseinstance, name, action)
return action
def createActionGroup(self, parent=None, name=''):
<|fim▁hole|>
:param parent | <QWidget> || None
name | <str>
"""
actionGroup = super(UiLoader, self).createActionGroup(parent, name)
if not actionGroup.parent():
actionGroup.setParent(self._baseinstance)
setattr(self._baseinstance, name, actionGroup)
return actionGroup
def createLayout(self, className, parent=None, name=''):
"""
Overloads teh create action method to handle the proper base
instance information, similar to the PyQt4 loading system.
:param className | <str>
parent | <QWidget> || None
name | <str>
"""
layout = super(UiLoader, self).createLayout(className, parent, name)
setattr(self._baseinstance, name, layout)
return layout
def createWidget(self, className, parent=None, name=''):
"""
Overloads the createWidget method to handle the proper base instance
information similar to the PyQt4 loading system.
:param className | <str>
parent | <QWidget> || None
name | <str>
:return <QWidget>
"""
className = str(className)
# create a widget off one of our dynamic classes
if className in self.dynamicWidgets:
widget = self.dynamicWidgets[className](parent)
if parent:
widget.setPalette(parent.palette())
widget.setObjectName(name)
# hack fix on a QWebView (will crash app otherwise)
# forces a URL to the QWebView before it finishes
if className == 'QWebView':
widget.setUrl(QtCore.QUrl('http://www.google.com'))
# create a widget from the default system
else:
widget = super(UiLoader, self).createWidget(className, parent, name)
if parent:
widget.setPalette(parent.palette())
if parent is None:
return self._baseinstance
else:
setattr(self._baseinstance, name, widget)
return widget
#----------------------------------------------------------
class Uic(object):
def compileUi(self, filename, file):
import pysideuic
pysideuic.compileUi(filename, file)
def loadUi(self, filename, baseinstance=None):
"""
Generate a loader to load the filename.
:param filename | <str>
baseinstance | <QWidget>
:return <QWidget> || None
"""
try:
xui = ElementTree.parse(filename)
except xml.parsers.expat.ExpatError:
log.exception('Could not load file: %s' % filename)
return None
loader = UiLoader(baseinstance)
# pre-load custom widgets
xcustomwidgets = xui.find('customwidgets')
if xcustomwidgets is not None:
for xcustom in xcustomwidgets:
header = xcustom.find('header').text
clsname = xcustom.find('class').text
if not header:
continue
if clsname in loader.dynamicWidgets:
continue
# modify the C++ headers to use the Python wrapping
if '/' in header:
header = 'xqt.' + '.'.join(header.split('/')[:-1])
# try to use the custom widgets
try:
__import__(header)
module = sys.modules[header]
cls = getattr(module, clsname)
except (ImportError, KeyError, AttributeError):
log.error('Could not load %s.%s' % (header, clsname))
continue
loader.dynamicWidgets[clsname] = cls
loader.registerCustomWidget(cls)
# load the options
ui = loader.load(filename)
QtCore.QMetaObject.connectSlotsByName(ui)
return ui
class QDialog(QtGui.QDialog):
def __init__(self, *args):
super(QDialog, self).__init__(*args)
self._centered = False
def showEvent(self, event):
"""
Displays this dialog, centering on its parent.
:param event | <QtCore.QShowEvent>
"""
super(QDialog, self).showEvent(event)
if not self._centered:
self._centered = True
try:
window = self.parent().window()
center = window.geometry().center()
except AttributeError:
return
else:
self.move(center.x() - self.width() / 2, center.y() - self.height() / 2)
#----------------------------------------------------------------------
def init(scope):
"""
Initialize the xqt system with the PySide wrapper for the Qt system.
:param scope | <dict>
"""
# define wrapper compatibility symbols
QtCore.THREADSAFE_NONE = XThreadNone()
QtGui.QDialog = QDialog
# define the importable symbols
scope['QtCore'] = QtCore
scope['QtGui'] = QtGui
scope['QtWebKit'] = lazy_import('PySide.QtWebKit')
scope['QtNetwork'] = lazy_import('PySide.QtNetwork')
scope['QtXml'] = lazy_import('PySide.QtXml')
scope['uic'] = Uic()
scope['rcc_exe'] = 'pyside-rcc'
# map overrides
#QtCore.SIGNAL = SIGNAL
# map shared core properties
QtCore.QDate.toPyDate = lambda x: x.toPython()
QtCore.QDateTime.toPyDateTime = lambda x: x.toPython()
QtCore.QTime.toPyTime = lambda x: x.toPython()
QtCore.QStringList = list
QtCore.QString = unicode<|fim▁end|> | """
Overloads teh create action method to handle the proper base
instance information, similar to the PyQt4 loading system.
|
<|file_name|>od_glob.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
"""
Global variables for onedrive_d.
"""
import os
import sys
import logging
import atexit
import json
from calendar import timegm
from datetime import timezone, datetime, timedelta
from pwd import getpwnam
from . import od_ignore_list
config_instance = None
logger_instance = None
update_last_run_timestamp = False
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S%z'
APP_CLIENT_ID = '000000004010C916'
APP_CLIENT_SECRET = 'PimIrUibJfsKsMcd0SqwPBwMTV7NDgYi'
APP_VERSION = '1.1.0dev'
def get_config_instance(force=False, setup_mode=False):
global config_instance
# callingframe = sys._getframe(1)
# print('My caller is the %r function in a %r class' % (
# callingframe.f_code.co_name,
# callingframe.f_locals['self'].__class__.__name__))
if force or config_instance is None:
config_instance = ConfigSet(setup_mode)
atexit.register(dump_config)
return config_instance
def get_logger(level=logging.DEBUG, file_path=None):
global logger_instance
if logger_instance is None:
logging.basicConfig(format='[%(asctime)-15s] %(levelname)s: %(threadName)s: %(message)s')
logger_instance = logging.getLogger(__name__)
logger_instance.setLevel(level)
if file_path is not None:
logger_instance.propagate = False
logger_fh = logging.FileHandler(file_path, 'a')
logger_fh.setLevel(level)
logger_instance.addHandler(logger_fh)
atexit.register(flush_log_at_shutdown)
return logger_instance
def now():
return datetime.now(timezone.utc)
def time_to_str(t):
s = t.strftime(DATETIME_FORMAT)
if '+' not in s:
s = s + '+0000'
return s
def str_to_time(s):
return datetime.strptime(s, DATETIME_FORMAT)
def str_to_timestamp(s):
return timegm(str_to_time(s).timetuple())
def timestamp_to_time(t):
return datetime.fromtimestamp(t, tz=timezone.utc)
def mkdir(path, uid):
"""
Create a path and set up owner uid.
"""
os.mkdir(path)
os.chown(path, uid, -1)
def flush_log_at_shutdown():
global logger_instance
if logger_instance is not None:
logging.shutdown()
def will_update_last_run_time():
update_last_run_timestamp = True<|fim▁hole|> config_instance.set_last_run_timestamp()
if config_instance is not None and ConfigSet.is_dirty:
config_instance.dump()
class ConfigSet:
params = {
'NETWORK_ERROR_RETRY_INTERVAL': 10, # in seconds
'DEEP_SCAN_INTERVAL': 60, # in seconds
'NUM_OF_WORKERS': 4,
# files > 4 MiB will be uploaded with BITS API
'BITS_FILE_MIN_SIZE': 4194304,
# 512 KiB per block for BITS API
'BITS_BLOCK_SIZE': 524288,
'ONEDRIVE_ROOT_PATH': None,
'ONEDRIVE_TOKENS': None,
'ONEDRIVE_TOKENS_EXP': None,
'USE_GUI': False,
'MIN_LOG_LEVEL': logging.DEBUG,
'LOG_FILE_PATH': '/var/log/onedrive_d.log',
'LAST_RUN_TIMESTAMP': '1970-01-01T00:00:00+0000'
}
logger = get_logger()
OS_HOSTNAME = os.uname()[1]
OS_USERNAME = os.getenv('SUDO_USER')
initialized = False
is_dirty = False
def __init__(self, setup_mode=False):
# no locking is necessary because the code is run way before multithreading
if not ConfigSet.initialized:
if ConfigSet.OS_USERNAME is None or ConfigSet.OS_USERNAME == '':
ConfigSet.OS_USERNAME = os.getenv('USER')
if ConfigSet.OS_USERNAME is None or ConfigSet.OS_USERNAME == '':
get_logger().critical('cannot find current logged-in user.')
sys.exit(1)
ConfigSet.OS_USER_ID = getpwnam(ConfigSet.OS_USERNAME).pw_uid
ConfigSet.OS_HOME_PATH = os.path.expanduser('~' + ConfigSet.OS_USERNAME)
ConfigSet.APP_CONF_PATH = ConfigSet.OS_HOME_PATH + '/.onedrive'
if not os.path.exists(ConfigSet.APP_CONF_PATH):
get_logger().critical('onedrive-d may not be installed properly. Exit.')
sys.exit(1)
ConfigSet.APP_CONF_FILE = ConfigSet.APP_CONF_PATH + '/config_v2.json'
if os.path.exists(ConfigSet.APP_CONF_FILE):
try:
with open(ConfigSet.APP_CONF_FILE, 'r') as f:
saved_params = json.loads(f.read())
for key in saved_params:
ConfigSet.params[key] = saved_params[key]
except:
get_logger().info(
'fail to read config file "' + ConfigSet.APP_CONF_FILE + '". Use default.')
elif not setup_mode:
get_logger().critical('onedrive-d config file does not exist. Exit.')
sys.exit(1)
if ConfigSet.params['ONEDRIVE_ROOT_PATH'] is None and not setup_mode:
get_logger().critical('path to local OneDrive repo is not set.')
sys.exit(1)
ConfigSet.LAST_RUN_TIMESTAMP = str_to_time(ConfigSet.params['LAST_RUN_TIMESTAMP'])
ConfigSet.APP_IGNORE_FILE = ConfigSet.APP_CONF_PATH + '/ignore_v2.ini'
ConfigSet.initialized = True
print('Loading configuration ... OK')
if not setup_mode:
if os.path.exists(ConfigSet.APP_IGNORE_FILE):
self.ignore_list = od_ignore_list.IgnoreList(
ConfigSet.APP_IGNORE_FILE, ConfigSet.params['ONEDRIVE_ROOT_PATH'])
else:
ConfigSet.logger.info('ignore list file was not found.')
ConfigSet.ignore_list = None
def set_root_path(self, path):
ConfigSet.params['ONEDRIVE_ROOT_PATH'] = path
ConfigSet.is_dirty = True
def set_last_run_timestamp(self):
ConfigSet.params['LAST_RUN_TIMESTAMP'] = time_to_str(now())
ConfigSet.is_dirty = True
def get_access_token(self):
if ConfigSet.params['ONEDRIVE_TOKENS'] is not None:
return ConfigSet.params['ONEDRIVE_TOKENS']
else:
return None
def is_token_expired(self):
return str_to_time(ConfigSet.params['ONEDRIVE_TOKENS_EXP']) < now()
def set_access_token(self, tokens):
d = now() + timedelta(seconds=tokens['expires_in'])
ConfigSet.params['ONEDRIVE_TOKENS'] = tokens
ConfigSet.params['ONEDRIVE_TOKENS_EXP'] = time_to_str(d)
ConfigSet.is_dirty = True
def dump(self):
try:
with open(ConfigSet.APP_CONF_FILE, 'w') as f:
json.dump(ConfigSet.params, f)
os.chown(ConfigSet.APP_CONF_FILE, ConfigSet.OS_USER_ID, -1)
get_logger().debug('config saved.')
except:
get_logger().warning(
'failed to dump config to file "' + ConfigSet.APP_CONF_FILE + '".')<|fim▁end|> |
def dump_config():
if update_last_run_timestamp and config_instance is not None: |
<|file_name|>video.cpp<|end_file_name|><|fim▁begin|>#include <vector>
#include <iostream>
#include <SDL/SDL.h>
#include <SDL/SDL_gfxPrimitives.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_mixer.h>
#include "base.h"
#include "game.h"
#include "video.h"
void draw3DLine( SDL_Surface *video, Vec3 &camera, Vec3 &p0, Vec3 &p1, int r, int g, int b ) {
float x0 = ( XRES / 2 ) + ( ( p0.x - camera.x ) / ( p0.z - camera.z ) );
float y0 = ( YRES / 2 ) - ( ( p0.y - camera.y ) / ( p0.z - camera.z ) );
float x1 = ( XRES / 2 ) + ( ( p1.x - camera.x ) / ( p1.z - camera.z ) );
float y1 = ( YRES / 2 ) - ( ( p1.y - camera.y ) / ( p1.z - camera.z ) );
lineRGBA( video, x0, y0, x1, y1, r, g, b, 255 );
lineRGBA( video, 100 + p0.x / 10, 100 - p0.z * 10, 100 + p1.x / 10, 100 - p1.z * 10, r, g, b, 255 );
}
void drawXZPlane( SDL_Surface *video, Vec3 &camera, Vec3 &p0, Vec3 &p1, int r, int g, int b ) {
Vec3 _p0;
Vec3 _p1;
Vec3 _p2;
Vec3 _p3;
_p0.set( p0 );
_p1.set( p1 );
_p0.y = p0.y + ( ( p1.y - p0.y ) / 2.0f );
_p1.y = _p0.y;
_p2.y = _p0.y;
_p3.y = _p0.y;
_p1.set( p1.x, _p0.y, p0.z );
_p2.set( p1.x, _p0.y, p1.z );
_p3.set( p0.x, _p0.y, p1.z );
draw3DLine( video, camera, _p0, _p1, r, g, b );
draw3DLine( video, camera, _p2, _p1, r, g, b );
draw3DLine( video, camera, _p2, _p3, r, g, b );
draw3DLine( video, camera, _p0, _p3, r, g, b );
}
void drawCube( SDL_Surface *video, Vec3 &camera, Vec3 &p0, Vec3 &p1, int r, int g, int b ) {
Vec3 _p0( p0 );
Vec3 _p1( p1 );
_p1.y = p0.y;
drawXZPlane( video, camera, _p0, _p1, r, g, b );
_p1.y = p1.y;
_p0.y = p1.y;
drawXZPlane( video, camera, _p0, _p1, r, g, b );
_p0.set( p0 );
_p1.set( p0 );
_p1.y = p1.y;
draw3DLine( video, camera, _p0, _p1, r, g, b );
_p0.set( p1 );
_p1.set( p1 );
_p1.y = p0.y;
draw3DLine( video, camera, _p0, _p1, r, g, b );
_p0.set( p1 );
_p1.set( p1 );
_p1.y = p0.y;
_p0.z = p0.z;
_p1.z = p0.z;
draw3DLine( video, camera, _p0, _p1, r, g, b );
_p0.set( p0 );
_p1.set( p0 );
_p1.y = p1.y;
_p0.z = p1.z;
_p1.z = p1.z;
draw3DLine( video, camera, _p0, _p1, r, g, b );
}
void refreshScreen( SDL_Surface *video, Level &level ) {
Plane *plane;
<|fim▁hole|> SDL_Rect rect;
Uint32 colour;
Vec3 p0;
Vec3 p1;
rect.x = 0;
rect.y = 0;
rect.w = XRES;
rect.h = YRES;
colour = SDL_MapRGB( video->format, 0, 0, 0 );
SDL_FillRect( video, &rect, colour );
rect.x = 0;
rect.y = YRES - 40;
rect.w = ( XRES / DEFAULTJUMPS ) * level.jumps;
rect.h = 20;
colour = SDL_MapRGB( video->format, 255, 255, 255 );
SDL_FillRect( video, &rect, colour );
rect.x = 0;
rect.y = YRES - 20;
rect.w = ( XRES / DEFAULTTIME ) * level.timeLeft;
rect.h = 20;
colour = SDL_MapRGB( video->format, 128, 128, 128 );
SDL_FillRect( video, &rect, colour );
plane = level.planes[ level.nextId ];
rect.x = XRES - 50;
rect.y = 0;
rect.w = 50;
rect.h = 50;
colour = SDL_MapRGB( video->format, plane->r, plane->g, plane->b );
SDL_FillRect( video, &rect, colour );
p0.set( -600, 0, 1 );
p1.set( 600, 0, 10 );
drawXZPlane( video, level.camera, p0, p1, 0, 255, 0 );
for ( int c = 0; c < level.planes.size(); ++c ) {
plane = level.planes[ c ];
drawXZPlane( video, level.camera, plane->p0, plane->p1, plane->r, plane->g, plane->b );
}
Particle *p;
for ( int c = 0; c < level.player.jetpack.particles.size(); ++c ) {
p = level.player.jetpack.particles[ c ];
draw3DLine( video, level.camera, p->position, p->position, 255 - p->size, 0, 0 );
}
p0.set( level.player.bodyRep.position.x - 20, level.player.bodyRep.position.y, level.player.bodyRep.position.z );
p1.set( level.player.bodyRep.position.x + 20, level.player.bodyRep.position.y + 100, level.player.bodyRep.position.z + 0.1f );
drawCube( video, level.camera, p0, p1, 0, 0, 255 );
SDL_UpdateRect( video, 0, 0, 0, 0 );
}
void showScreen( SDL_Surface *video, SDL_Surface *screen ) {
SDL_Event event;
SDL_BlitSurface( screen, NULL, video, NULL );
SDL_Flip( video );
while ( true ) { if ( SDL_PollEvent( &event ) ) { if ( event.type == SDL_KEYDOWN ) { return; }
} } }<|fim▁end|> | |
<|file_name|>tamilvu_wordlist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# (C) 2015 Muthiah Annamalai, <[email protected]>
# Ezhil Language Foundation
#
from __future__ import print_function
import sys
import codecs
import tamil
import json
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
class WordList:
@staticmethod<|fim▁hole|> def extract_words(filename):
ht = json.load( codecs.open(filename,'r','utf-8') )
for word in sorted(ht.keys()):
print(word)
return
@staticmethod
def pull_words_from_json():
for itr in range(1,25):
filename = u"v%02d.json"%itr
WordList.extract_words(filename)
return
class WordFilter:
@staticmethod
def filter_and_save(word_size=4):
match_word_length = lambda word: len(tamil.utf8.get_letters(word.strip().replace(' ',''))) == word_size
filename = u'tamilvu_dictionary_words.txt'
matches = []
with codecs.open(filename,'r','utf-8') as fp:
matches = filter( match_word_length, fp.readlines())
with codecs.open('word_filter_%02d.txt'%word_size,'w','utf-8') as fp:
for word in matches:
fp.write(u'%s\n'%word.replace(' ','').strip())
print(u'we found %d words of length %d\n'%(len(matches),word_size))
return
if __name__ == u"__main__":
# WordList.pull_words_from_json()
for wlen in range(3,20):
WordFilter.filter_and_save( wlen )<|fim▁end|> | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# __init__.py
# Copyright (C) 2013 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
Key Manager is a Nicknym agent for LEAP client.
"""
# let's do a little sanity check to see if we're using the wrong gnupg
import sys
try:
from gnupg.gnupg import GPGUtilities
assert(GPGUtilities) # pyflakes happy
from gnupg import __version__
from distutils.version import LooseVersion as V
assert(V(__version__) >= V('1.2.3'))
except (ImportError, AssertionError):
print "*******"
print "Ooops! It looks like there is a conflict in the installed version "
print "of gnupg."
print
print "Disclaimer: Ideally, we would need to work a patch and propose the "
print "merge to upstream. But until then do: "
print
print "% pip uninstall python-gnupg"
print "% pip install gnupg"
print "*******"
sys.exit(1)
import logging
import requests
from leap.common.check import leap_assert, leap_assert_type
from leap.common.events import signal
from leap.common.events import events_pb2 as proto
from leap.keymanager.errors import KeyNotFound
from leap.keymanager.keys import (
EncryptionKey,
build_key_from_dict,
KEYMANAGER_KEY_TAG,
TAGS_PRIVATE_INDEX,
)
from leap.keymanager.openpgp import (
OpenPGPKey,
OpenPGPScheme,
)
logger = logging.getLogger(__name__)
#
# The Key Manager
#
class KeyManager(object):
#
# server's key storage constants
#
OPENPGP_KEY = 'openpgp'
PUBKEY_KEY = "user[public_key]"
def __init__(self, address, nickserver_uri, soledad, session_id=None,
ca_cert_path=None, api_uri=None, api_version=None, uid=None,
gpgbinary=None):
"""
Initialize a Key Manager for user's C{address} with provider's
nickserver reachable in C{url}.
:param address: The address of the user of this Key Manager.
:type address: str
:param url: The URL of the nickserver.
:type url: str
:param soledad: A Soledad instance for local storage of keys.
:type soledad: leap.soledad.Soledad
:param session_id: The session ID for interacting with the webapp API.
:type session_id: str
:param ca_cert_path: The path to the CA certificate.
:type ca_cert_path: str
:param api_uri: The URI of the webapp API.
:type api_uri: str
:param api_version: The version of the webapp API.
:type api_version: str
:param uid: The users' UID.
:type uid: str
:param gpgbinary: Name for GnuPG binary executable.
:type gpgbinary: C{str}
"""
self._address = address
self._nickserver_uri = nickserver_uri
self._soledad = soledad
self._session_id = session_id
self.ca_cert_path = ca_cert_path
self.api_uri = api_uri
self.api_version = api_version
self.uid = uid
# a dict to map key types to their handlers<|fim▁hole|> self._wrapper_map = {
OpenPGPKey: OpenPGPScheme(soledad, gpgbinary=gpgbinary),
# other types of key will be added to this mapper.
}
# the following are used to perform https requests
self._fetcher = requests
self._session = self._fetcher.session()
#
# utilities
#
def _key_class_from_type(self, ktype):
"""
Return key class from string representation of key type.
"""
return filter(
lambda klass: str(klass) == ktype,
self._wrapper_map).pop()
def _get(self, uri, data=None):
"""
Send a GET request to C{uri} containing C{data}.
:param uri: The URI of the request.
:type uri: str
:param data: The body of the request.
:type data: dict, str or file
:return: The response to the request.
:rtype: requests.Response
"""
leap_assert(
self._ca_cert_path is not None,
'We need the CA certificate path!')
res = self._fetcher.get(uri, data=data, verify=self._ca_cert_path)
# Nickserver now returns 404 for key not found and 500 for
# other cases (like key too small), so we are skipping this
# check for the time being
# res.raise_for_status()
# Responses are now text/plain, although it's json anyway, but
# this will fail when it shouldn't
# leap_assert(
# res.headers['content-type'].startswith('application/json'),
# 'Content-type is not JSON.')
return res
def _put(self, uri, data=None):
"""
Send a PUT request to C{uri} containing C{data}.
The request will be sent using the configured CA certificate path to
verify the server certificate and the configured session id for
authentication.
:param uri: The URI of the request.
:type uri: str
:param data: The body of the request.
:type data: dict, str or file
:return: The response to the request.
:rtype: requests.Response
"""
leap_assert(
self._ca_cert_path is not None,
'We need the CA certificate path!')
leap_assert(
self._session_id is not None,
'We need a session_id to interact with webapp!')
res = self._fetcher.put(
uri, data=data, verify=self._ca_cert_path,
cookies={'_session_id': self._session_id})
# assert that the response is valid
res.raise_for_status()
return res
def _fetch_keys_from_server(self, address):
"""
Fetch keys bound to C{address} from nickserver and insert them in
local database.
:param address: The address bound to the keys.
:type address: str
@raise KeyNotFound: If the key was not found on nickserver.
"""
# request keys from the nickserver
res = None
try:
res = self._get(self._nickserver_uri, {'address': address})
server_keys = res.json()
# insert keys in local database
if self.OPENPGP_KEY in server_keys:
self._wrapper_map[OpenPGPKey].put_ascii_key(
server_keys['openpgp'])
except Exception as e:
logger.warning("Error retrieving the keys: %r" % (e,))
if res:
logger.warning("%s" % (res.content,))
#
# key management
#
def send_key(self, ktype):
"""
Send user's key of type C{ktype} to provider.
Public key bound to user's is sent to provider, which will sign it and
replace any prior keys for the same address in its database.
If C{send_private} is True, then the private key is encrypted with
C{password} and sent to server in the same request, together with a
hash string of user's address and password. The encrypted private key
will be saved in the server in a way it is publicly retrievable
through the hash string.
:param ktype: The type of the key.
:type ktype: KeyType
@raise KeyNotFound: If the key was not found in local database.
"""
leap_assert(
ktype is OpenPGPKey,
'For now we only know how to send OpenPGP public keys.')
# prepare the public key bound to address
pubkey = self.get_key(
self._address, ktype, private=False, fetch_remote=False)
data = {
self.PUBKEY_KEY: pubkey.key_data
}
uri = "%s/%s/users/%s.json" % (
self._api_uri,
self._api_version,
self._uid)
self._put(uri, data)
signal(proto.KEYMANAGER_DONE_UPLOADING_KEYS, self._address)
def get_key(self, address, ktype, private=False, fetch_remote=True):
"""
Return a key of type C{ktype} bound to C{address}.
First, search for the key in local storage. If it is not available,
then try to fetch from nickserver.
:param address: The address bound to the key.
:type address: str
:param ktype: The type of the key.
:type ktype: KeyType
:param private: Look for a private key instead of a public one?
:type private: bool
:return: A key of type C{ktype} bound to C{address}.
:rtype: EncryptionKey
@raise KeyNotFound: If the key was not found both locally and in
keyserver.
"""
leap_assert(
ktype in self._wrapper_map,
'Unkown key type: %s.' % str(ktype))
try:
signal(proto.KEYMANAGER_LOOKING_FOR_KEY, address)
# return key if it exists in local database
key = self._wrapper_map[ktype].get_key(address, private=private)
signal(proto.KEYMANAGER_KEY_FOUND, address)
return key
except KeyNotFound:
signal(proto.KEYMANAGER_KEY_NOT_FOUND, address)
# we will only try to fetch a key from nickserver if fetch_remote
# is True and the key is not private.
if fetch_remote is False or private is True:
raise
signal(proto.KEYMANAGER_LOOKING_FOR_KEY, address)
self._fetch_keys_from_server(address)
key = self._wrapper_map[ktype].get_key(address, private=False)
signal(proto.KEYMANAGER_KEY_FOUND, address)
return key
def get_all_keys_in_local_db(self, private=False):
"""
Return all keys stored in local database.
:return: A list with all keys in local db.
:rtype: list
"""
return map(
lambda doc: build_key_from_dict(
self._key_class_from_type(doc.content['type']),
doc.content['address'],
doc.content),
self._soledad.get_from_index(
TAGS_PRIVATE_INDEX,
KEYMANAGER_KEY_TAG,
'1' if private else '0'))
def refresh_keys(self):
"""
Fetch keys from nickserver and update them locally.
"""
addresses = set(map(
lambda doc: doc.address,
self.get_all_keys_in_local_db(private=False)))
for address in addresses:
# do not attempt to refresh our own key
if address == self._address:
continue
self._fetch_keys_from_server(address)
def gen_key(self, ktype):
"""
Generate a key of type C{ktype} bound to the user's address.
:param ktype: The type of the key.
:type ktype: KeyType
:return: The generated key.
:rtype: EncryptionKey
"""
signal(proto.KEYMANAGER_STARTED_KEY_GENERATION, self._address)
key = self._wrapper_map[ktype].gen_key(self._address)
signal(proto.KEYMANAGER_FINISHED_KEY_GENERATION, self._address)
return key
#
# Setters/getters
#
def _get_session_id(self):
return self._session_id
def _set_session_id(self, session_id):
self._session_id = session_id
session_id = property(
_get_session_id, _set_session_id, doc='The session id.')
def _get_ca_cert_path(self):
return self._ca_cert_path
def _set_ca_cert_path(self, ca_cert_path):
self._ca_cert_path = ca_cert_path
ca_cert_path = property(
_get_ca_cert_path, _set_ca_cert_path,
doc='The path to the CA certificate.')
def _get_api_uri(self):
return self._api_uri
def _set_api_uri(self, api_uri):
self._api_uri = api_uri
api_uri = property(
_get_api_uri, _set_api_uri, doc='The webapp API URI.')
def _get_api_version(self):
return self._api_version
def _set_api_version(self, api_version):
self._api_version = api_version
api_version = property(
_get_api_version, _set_api_version, doc='The webapp API version.')
def _get_uid(self):
return self._uid
def _set_uid(self, uid):
self._uid = uid
uid = property(
_get_uid, _set_uid, doc='The uid of the user.')
#
# encrypt/decrypt and sign/verify API
#
def encrypt(self, data, pubkey, passphrase=None, sign=None,
cipher_algo='AES256'):
"""
Encrypt C{data} using public @{key} and sign with C{sign} key.
:param data: The data to be encrypted.
:type data: str
:param pubkey: The key used to encrypt.
:type pubkey: EncryptionKey
:param sign: The key used for signing.
:type sign: EncryptionKey
:param cipher_algo: The cipher algorithm to use.
:type cipher_algo: str
:return: The encrypted data.
:rtype: str
"""
leap_assert_type(pubkey, EncryptionKey)
leap_assert(pubkey.__class__ in self._wrapper_map, 'Unknown key type.')
leap_assert(pubkey.private is False, 'Key is not public.')
return self._wrapper_map[pubkey.__class__].encrypt(
data, pubkey, passphrase, sign)
def decrypt(self, data, privkey, passphrase=None, verify=None):
"""
Decrypt C{data} using private @{privkey} and verify with C{verify} key.
:param data: The data to be decrypted.
:type data: str
:param privkey: The key used to decrypt.
:type privkey: OpenPGPKey
:param verify: The key used to verify a signature.
:type verify: OpenPGPKey
:return: The decrypted data.
:rtype: str
@raise InvalidSignature: Raised if unable to verify the signature with
C{verify} key.
"""
leap_assert_type(privkey, EncryptionKey)
leap_assert(
privkey.__class__ in self._wrapper_map,
'Unknown key type.')
leap_assert(privkey.private is True, 'Key is not private.')
return self._wrapper_map[privkey.__class__].decrypt(
data, privkey, passphrase, verify)
def sign(self, data, privkey, digest_algo='SHA512', clearsign=False,
detach=True, binary=False):
"""
Sign C{data} with C{privkey}.
:param data: The data to be signed.
:type data: str
:param privkey: The private key to be used to sign.
:type privkey: EncryptionKey
:param digest_algo: The hash digest to use.
:type digest_algo: str
:param clearsign: If True, create a cleartext signature.
:type clearsign: bool
:param detach: If True, create a detached signature.
:type detach: bool
:param binary: If True, do not ascii armour the output.
:type binary: bool
:return: The signed data.
:rtype: str
"""
leap_assert_type(privkey, EncryptionKey)
leap_assert(
privkey.__class__ in self._wrapper_map,
'Unknown key type.')
leap_assert(privkey.private is True, 'Key is not private.')
return self._wrapper_map[privkey.__class__].sign(
data, privkey, digest_algo=digest_algo, clearsign=clearsign,
detach=detach, binary=binary)
def verify(self, data, pubkey):
"""
Verify signed C{data} with C{pubkey}.
:param data: The data to be verified.
:type data: str
:param pubkey: The public key to be used on verification.
:type pubkey: EncryptionKey
:return: The signed data.
:rtype: str
"""
leap_assert_type(pubkey, EncryptionKey)
leap_assert(pubkey.__class__ in self._wrapper_map, 'Unknown key type.')
leap_assert(pubkey.private is False, 'Key is not public.')
return self._wrapper_map[pubkey.__class__].verify(data, pubkey)
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions<|fim▁end|> | |
<|file_name|>Word.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cz.webarchiv.webanalyzer.dictionary;
/**
*
* @author praso
*/<|fim▁hole|>
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
@Override
public boolean equals(Object o) {
if (o instanceof Word) {
Word w = (Word) o;
return getWord().equals(w.getWord());
} else {
return false;
}
}
@Override
public int hashCode() {
return this.getWord().hashCode();
}
public int compareTo(Word o) {
return this.word.compareTo(o.getWord());
}
}<|fim▁end|> | class Word implements java.lang.Comparable<Word> {
private String word; |
<|file_name|>goggle-paper.js<|end_file_name|><|fim▁begin|>/* google-paper.js */
'use strict';
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
var RAD_2_DEG = 180/Math.PI;
function moving_average(period) {
var nums = [];
return function(num) {
nums.push(num);
if (nums.length > period)
nums.splice(0,1);
var sum = 0;
for (var i in nums)
sum += nums[i];
var n = period;
if (nums.length < period)
n = nums.length;
return(sum/n);
}
}
var GP = GP || {};
GP.PaperTracker = function(options){
this.options = options || {};
this.video;
this.canvas;
this.context;
this.camDirection = 'front'; // back
this.imageData;
this.detector;
this.posit;
this.markers;
this.init(options);
};
GP.PaperTracker.prototype.init = function(options){
this.video = document.getElementById('video');
this.canvas = document.getElementById('video-canvas');
this.context = this.canvas.getContext('2d');
this.canvas.width = parseInt(this.canvas.style.width);
this.canvas.height = parseInt(this.canvas.style.height);
this.trackingInfo = {
lastTrackTime: 0,
haveTracking: false,
neverTracked: true,
translation: [0,0,0],
orientation: [0,0,0],
rotation: [0,0,0]
};
this.detector = new AR.Detector();
this.posit = new POS.Posit(this.options.modelSize, this.canvas.width);
};
GP.PaperTracker.prototype.postInit = function(){
var vid = this.video;
navigator.getUserMedia({video:true},
function (stream){
if (window.webkitURL) {
vid.src = window.webkitURL.createObjectURL(stream);
} else if (vid.mozSrcObject !== undefined) {
vid.mozSrcObject = stream;
} else {
vid.src = stream;
}<|fim▁hole|> );
};
GP.PaperTracker.prototype.snapshot = function(){
this.context.drawImage(this.video, 0, 0, this.canvas.width, this.canvas.height);
this.imageData = this.context.getImageData(0, 0, this.canvas.width, this.canvas.height);
};
GP.PaperTracker.prototype.detect = function(){
var markers = this.detector.detect(this.imageData);
this.markers = markers;
return markers;
};
GP.PaperTracker.prototype.process = function(){
if (this.video.readyState === this.video.HAVE_ENOUGH_DATA){
this.snapshot();
this.detect();
this.drawCorners();
return true;
}
return false;
};
GP.PaperTracker.prototype.drawCorners = function(){
var corners, corner, i, j;
this.context.lineWidth = 3;
for (i = 0; i < this.markers.length; ++ i){
corners = this.markers[i].corners;
this.context.strokeStyle = "red";
this.context.beginPath();
for (j = 0; j < corners.length; ++ j){
corner = corners[j];
this.context.moveTo(corner.x, corner.y);
corner = corners[(j + 1) % corners.length];
this.context.lineTo(corner.x, corner.y);
}
this.context.stroke();
this.context.closePath();
this.context.strokeStyle = "blue";
this.context.strokeRect(corners[0].x - 2, corners[0].y - 2, 4, 4);
}
};
GP.PaperTracker.prototype.updateTracking = function(){
var corners, corner, pose, i;
if (this.markers.length == 0) {
this.trackingInfo.haveTracking = false;
return false;
}
this.trackingInfo.neverTracked = false;
this.trackingInfo.haveTracking = true;
corners = this.markers[0].corners;
for (i = 0; i < corners.length; ++ i){
corner = corners[i];
corner.x = corner.x - (this.canvas.width / 2);
corner.y = (this.canvas.height / 2) - corner.y;
}
pose = this.posit.pose(corners);
var rotation = pose.bestRotation;
var translation = pose.bestTranslation;
this.trackingInfo.translation = translation;
this.trackingInfo.rotation = rotation;
return this.trackingInfo;
};<|fim▁end|> | },
function(error){
console.log('stream not found');
} |
<|file_name|>AboutDialog.java<|end_file_name|><|fim▁begin|>package com.churches.by.ui;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import com.churches.by.R;
public class AboutDialog extends DialogFragment {
public AboutDialog() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {<|fim▁hole|>
}<|fim▁end|> | getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
return inflater.inflate(R.layout.about_dialog, container, false);
} |
<|file_name|>MLDB-2107-scalar-format.py<|end_file_name|><|fim▁begin|>#
# MLDB-2107-scalar-format.py
# Mathieu Marquis Bolduc, 2017-01-10
# This file is part of MLDB. Copyright 2017 mldb.ai inc. All rights reserved.
#
from mldb import mldb, MldbUnitTest, ResponseException
class MLDB2107ScalarFormatTest(MldbUnitTest): # noqa
@classmethod
def setUpClass(cls):
ds = mldb.create_dataset({'id' : 'ds', 'type' : 'sparse.mutable'})
ds.record_row('row0', [['x', 'A', 0]])
ds.record_row('row1', [['x', 'B', 0]])
ds.commit()
def test_int(self):
n = mldb.get('/v1/query', q="select x from (select 17 as x)", format='atom').json()
self.assertEqual(17, n)
def test_float(self):
n = mldb.get('/v1/query', q="select x from (select 2.3 as x)", format='atom').json()
self.assertEqual(2.3, n)
def test_string(self):
n = mldb.get('/v1/query', q="select x from (select 'blah' as x)", format='atom').json()
self.assertEqual('blah', n)
def test_bool(self):
n = mldb.get('/v1/query', q="select x from (select false as x)", format='atom').json()
self.assertEqual(False, n)
def test_error_columns(self):
msg = "Query with atom format returned multiple columns"
with self.assertRaisesRegex(ResponseException, msg):
n = mldb.get('/v1/query', q="select x,y from (select false as x, 1 as y)", format='atom').json()
def test_error_rows(self):
msg = "Query with atom format returning multiple rows"
with self.assertRaisesRegex(ResponseException, msg):
n = mldb.get('/v1/query', q="select x from ds", format='atom').json()
<|fim▁hole|>
def test_error_no_rows(self):
msg = "Query with atom format returned no rows."
with self.assertRaisesRegex(ResponseException, msg):
n = mldb.get('/v1/query', q="select x from ds where x = 'patate'", format='atom').json()
def test_error_no_column(self):
msg = "Query with atom format returned no column"
with self.assertRaisesRegex(ResponseException, msg):
n = mldb.get('/v1/query', q="select COLUMN EXPR (WHERE columnName() IN ('Z')) from (select 17 as x)", format='atom').json()
if __name__ == '__main__':
mldb.run_tests()<|fim▁end|> | def test_multiple_rows_limit(self):
n = mldb.get('/v1/query', q="select x from ds limit 1", format='atom').json()
self.assertEqual('B', n) |
<|file_name|>mainStaticPersonTask.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name:
# Purpose: This .py file is the main Framework file
# It ranks images of a specific person of interest in a static manner
#
# Required libs: python-dateutil, numpy,matplotlib,pyparsing
# Author: konkonst
#
# Created: 30/03/2014
# Copyright: (c) ITI (CERTH) 2014
# Licence: <apache licence 2.0>
#-------------------------------------------------------------------------------
import time,os,pickle,glob,shutil, personPopularity
from staticCommPersonTask import communitystatic
print('staticCommPersonCentered')
print(time.asctime( time.localtime(time.time()) ))
'''PARAMETERS'''
#Construct the data class from scratch: 1-yes / 2- from the community detection/ else-perform only the ranking
dataextract = 1
#Provide a time Limit (unix timestamp) about when the dataset begins in case you only want part of the dataset. If it is set to 0 the whole dataset is considered.
timeLimit = 0 #1071561600
#Community detection method. 'Ahn','Demon' and 'Copra' for overlapping and 'Louvain' for non. Ahn carries a threshold.
commDetectMethod = ['Demon', 0.66]
#User sets desired number of displayed top images
topImages = 8
#User sets desired number of most frequent people to retrieve
topPeople = 200
#Provide people set or leave empty to retrieve images for the number of topPeople as set above
peopleSet = ['justin_timberlake','oprah_winfrey','lady_gaga','justin_bieber','michael_schumacher','miley_cyrus','jk_rowling','zinedine_zidane','barack_obama','prince_william','brad_pitt_actor','leonardo_dicaprio','natalie_portman']
peopleSet.sort()
##peopleSet = [] #Uncomment this to activate the use of the rankedPeople.txt pool of users
#Delete all previous folders containing results? (Does not apply to the html files)
delFolders = 0
#If there are any nodes that should not be considered, please place them in './data/txt/stopNodes.txt'
'''Functions'''
t = time.time()
filename = [f for f in os.listdir("./data/txt/")]
for idx,files in enumerate(filename):
print(str(idx+1) + '.' + files)
selection = int(input('Select a dataset from the above: '))-1
dataset_path_results = "./data/"+filename[selection][:-4]+"/staticPersonCentered_"+commDetectMethod[0]+"/results/"
dataset_path_tmp = "./data/"+filename[selection][:-4]+"/staticPersonCentered_"+commDetectMethod[0]+"/tmp/"
datasetFilename = './data/txt/'+filename[selection]
if not os.path.exists(dataset_path_results):
os.makedirs(dataset_path_results)
os.makedirs(dataset_path_tmp)
if not os.path.exists(dataset_path_results+"rankedPeople.txt"):
personPopularity.popPerson(datasetFilename, dataset_path_results, dataset_path_tmp, commDetectMethod,timeLimit=timeLimit)
if dataextract==1:#Start from scratch
data = communitystatic.from_txt(datasetFilename,dataset_path_results,dataset_path_tmp,timeLimit=timeLimit)
dataPck = open(dataset_path_tmp + "allPersondata.pck", "wb")
pickle.dump(data, dataPck , protocol = 2)
dataPck.close()
del(data)
elapsed = time.time() - t
print('Stage 1: %.2f seconds' % elapsed)
if dataextract==1 or dataextract==2:#If the basic data (authors, mentions, time) has been created
data = pickle.load(open(dataset_path_tmp + "allPersondata.pck", "rb"))
captiondict = data.captiondict
print('static Community detection method selected is :'+commDetectMethod[0])
dataStatic=data.extraction(commDetectMethod)
del(data)
elapsed = time.time() - t
print('\nStage 2: %.2f seconds' % elapsed)
decisionforAll = input('\nRetrieve the topImages by screening them one by one???(y or n) ')
if dataextract ==1 or dataextract ==2 or dataextract ==3:#Only ranking beyond this point
data = pickle.load(open(dataset_path_tmp + "allPersondata.pck", "rb"))
captiondict = data.captiondict
del(data)
dataStatic = pickle.load(open(dataset_path_tmp + 'comm_'+commDetectMethod[0]+'.pck','rb'))
#delete folders if you're starting from scratch
if delFolders == 1:
result_files = glob.glob(dataset_path_results+'/analysis/*.txt')
if result_files:
for file in result_files:
os.remove(file)
if not peopleSet:
with open(dataset_path_results+'rankedPeople.txt','r') as f:
for lineId,line in enumerate(f):
if lineId>topPeople-1:
break
line = line.split('\t')
peopleSet.append(line[0])
for person in peopleSet:
if decisionforAll != str('n') and not os.path.exists(dataset_path_results+'html/'+person):
os.makedirs(dataset_path_results+'html/'+person)
if decisionforAll != str('n'):
personDecision = input('\nRetrieve images for '+person+'???(y or n) ')
if decisionforAll == str('n'):
print("\nRetrieval Commences for "+person)
if decisionforAll == str('n') or personDecision == str('y'):
dataStatic.photoRetrieval(topImages, person, captiondict,decisionforAll)
dataStatic.popularity_coappearence(topImages, person, captiondict)
elapsed = time.time() - t<|fim▁hole|><|fim▁end|> | print('\nStage 3: %.2f seconds' % elapsed) |
<|file_name|>reindeer-race-test.js<|end_file_name|><|fim▁begin|>var expect = require("chai").expect;
var reindeerRace = require("../../src/day-14/reindeer-race");
describe("--- Day 14: (1/2) distance traveled --- ", () => {
it("counts the distance traveled after 1000s", () => {
var reindeerSpecs = [
"Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.",
"Dancer can fly 16 km/s for 11 seconds, but then must rest for 162 seconds."<|fim▁hole|> });
});
describe("--- Day 14: (2/2) points awarded --- ", () => {
it("counts the points awarded for being in the lead after 1000s", () => {
var reindeerSpecs = [
"Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.",
"Dancer can fly 16 km/s for 11 seconds, but then must rest for 162 seconds."
];
expect(reindeerRace.race(reindeerSpecs, 1000).winnerByPoints.pointsAwarded).to.equal(689);
});
});<|fim▁end|> | ];
expect(reindeerRace.race(reindeerSpecs, 1000).winnerByDistance.distanceTraveled).to.equal(1120); |
<|file_name|>scan.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import cv
if __name__ == "__main__":
capture = cv.CaptureFromCAM(-1)
cv.NamedWindow("image")
while True:<|fim▁hole|>
k = cv.WaitKey(10)
if k % 256 == 27:
break
cv.DestroyWindow("image")<|fim▁end|> | frame = cv.QueryFrame(capture)
cv.ShowImage("image", frame) |
<|file_name|>test_sig_source_i.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# GNUHAWK is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
# this program. If not, see http://www.gnu.org/licenses/.
#
import unittest
import ossie.utils.testing
import os
from omniORB import any
class ComponentTests(ossie.utils.testing.ScaComponentTestCase):
"""Test for all component implementations in sig_source_i"""
def testScaBasicBehavior(self):
#######################################################################
# Launch the component with the default execparams
execparams = self.getPropertySet(kinds=("execparam",), modes=("readwrite", "writeonly"), includeNil=False)
execparams = dict([(x.id, any.from_any(x.value)) for x in execparams])
self.launch(execparams)
#######################################################################
# Verify the basic state of the component
self.assertNotEqual(self.comp, None)
self.assertEqual(self.comp.ref._non_existent(), False)
self.assertEqual(self.comp.ref._is_a("IDL:CF/Resource:1.0"), True)
self.assertEqual(self.spd.get_id(), self.comp.ref._get_identifier())
#######################################################################
# Simulate regular component startup
# Verify that initialize nor configure throw errors
self.comp.initialize()
configureProps = self.getPropertySet(kinds=("configure",), modes=("readwrite", "writeonly"), includeNil=False)
self.comp.configure(configureProps)<|fim▁hole|> expectedProps = []
expectedProps.extend(self.getPropertySet(kinds=("configure", "execparam"), modes=("readwrite", "readonly"), includeNil=True))
expectedProps.extend(self.getPropertySet(kinds=("allocate",), action="external", includeNil=True))
props = self.comp.query([])
props = dict((x.id, any.from_any(x.value)) for x in props)
# Query may return more than expected, but not less
for expectedProp in expectedProps:
self.assertEquals(props.has_key(expectedProp.id), True)
#######################################################################
# Verify that all expected ports are available
for port in self.scd.get_componentfeatures().get_ports().get_uses():
port_obj = self.comp.getPort(str(port.get_usesname()))
self.assertNotEqual(port_obj, None)
self.assertEqual(port_obj._non_existent(), False)
self.assertEqual(port_obj._is_a("IDL:CF/Port:1.0"), True)
for port in self.scd.get_componentfeatures().get_ports().get_provides():
port_obj = self.comp.getPort(str(port.get_providesname()))
self.assertNotEqual(port_obj, None)
self.assertEqual(port_obj._non_existent(), False)
self.assertEqual(port_obj._is_a(port.get_repid()), True)
#######################################################################
# Make sure start and stop can be called without throwing exceptions
self.comp.start()
self.comp.stop()
#######################################################################
# Simulate regular component shutdown
self.comp.releaseObject()
# TODO Add additional tests here
#
# See:
# ossie.utils.bulkio.bulkio_helpers,
# ossie.utils.bluefile.bluefile_helpers
# for modules that will assist with testing components with BULKIO ports
if __name__ == "__main__":
ossie.utils.testing.main("../sig_source_i.spd.xml") # By default tests all implementations<|fim▁end|> |
#######################################################################
# Validate that query returns all expected parameters
# Query of '[]' should return the following set of properties |
<|file_name|>export-default.js<|end_file_name|><|fim▁begin|>System.register([], function (_export, _context) {
"use strict";
_export("default", function () {
return 'test';
});<|fim▁hole|>
return {
setters: [],
execute: function () {}
};
});<|fim▁end|> | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(collections)]<|fim▁hole|>
use opencl::mem::CLBuffer;
use std::fmt;
fn main()
{
let ker = include_str!("demo.ocl");
println!("ker {}", ker);
let vec_a = vec![0isize, 1, 2, -3, 4, 5, 6, 7];
let vec_b = vec![-7isize, -6, 5, -4, 0, -1, 2, 3];
let ref platform = opencl::hl::get_platforms()[0];
let devices = platform.get_devices();
let ctx = opencl::hl::Context::create_context(&devices[..]);
let queues: Vec<opencl::hl::CommandQueue> = devices.iter()
.map(|d| ctx.create_command_queue(d)).collect();
for (device, queue) in devices.iter().zip(queues.iter()) {
println!("{}", queue.device().name());
let a: CLBuffer<isize> = ctx.create_buffer(vec_a.len(), opencl::cl::CL_MEM_READ_ONLY);
let b: CLBuffer<isize> = ctx.create_buffer(vec_a.len(), opencl::cl::CL_MEM_READ_ONLY);
let c: CLBuffer<isize> = ctx.create_buffer(vec_a.len(), opencl::cl::CL_MEM_WRITE_ONLY);
queue.write(&a, &&vec_a[..], ());
queue.write(&b, &&vec_b[..], ());
let program = ctx.create_program_from_source(ker);
program.build(&device).ok().expect("Couldn't build program.");
let kernel = program.create_kernel("vector_add");
kernel.set_arg(0, &a);
kernel.set_arg(1, &b);
kernel.set_arg(2, &c);
let event = queue.enqueue_async_kernel(&kernel, vec_a.len(), None, ());
let vec_c: Vec<isize> = queue.get(&c, &event);
println!(" {}", string_from_slice(&vec_a[..]));
println!("+ {}", string_from_slice(&vec_b[..]));
println!("= {}", string_from_slice(&vec_c[..]));
}
}
fn string_from_slice<T: fmt::Display>(slice: &[T]) -> String {
let mut st = String::from_str("[");
let mut first = true;
for i in slice.iter() {
if !first {
st.push_str(", ");
}
else {
first = false;
}
st.push_str(&*i.to_string())
}
st.push_str("]");
return st
}<|fim▁end|> |
extern crate opencl; |
<|file_name|>Loops.py<|end_file_name|><|fim▁begin|>''' While x is less than 10 it will print x and add 1 to that number,
then print it and so on until that condition is false, which is
when x equals 10 '''
condition = input('Enter number: ')
x = int(condition)
print (' ')<|fim▁hole|> print (x)
x += 1
# will stop adding 1 when it reaches 11
while x > 10:
print('True')
print (x)
print('Number is higher than 10')
break # otherwise it will print True forever, like this:
# uncomment to run and watch:
'''
while True:
print('infinite')
'''
print (' ')
print ('For Loop: ')
exampleList = [1,6,7,3,6,9,0]
print (' ')
print ('See code for reference')
print (' ')
for thing in exampleList:
print (thing)
print (' ')
print ('For x in range loop:')
print (' ')
for x in range (1,11): # range is not in list, this is separate
print (x)<|fim▁end|> | print ('While loop:')
while x <= 10: |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
// Copyright (c) 2014 Y. T. CHUNG <[email protected]>
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//! Memcached client
use std::net::TcpStream;
use std::io;
use std::rc::Rc;
use std::cell::RefCell;
use std::ops::Deref;
use std::path::Path;
use bufstream::BufStream;
use conhash::{ConsistentHash, Node};
#[cfg(unix)]
use unix_socket::UnixStream;
use proto::{Proto, Operation, NoReplyOperation, CasOperation};
use proto::{MemCachedResult, self};
struct Server {
pub proto: Box<Proto + Send>,
addr: String,
}
impl Server {
fn connect(addr: &str, protocol: proto::ProtoType) -> io::Result<Server> {
let mut split = addr.split("://");
Ok(Server {
proto: match protocol {
proto::ProtoType::Binary => {
match (split.next(), split.next()) {
(Some("tcp"), Some(addr)) => {
let stream = try!(TcpStream::connect(addr));
Box::new(proto::BinaryProto::new(BufStream::new(stream))) as Box<Proto + Send><|fim▁hole|> },
#[cfg(unix)]
(Some("unix"), Some(addr)) => {
let stream = try!(UnixStream::connect(&Path::new(addr)));
Box::new(proto::BinaryProto::new(BufStream::new(stream))) as Box<Proto + Send>
},
(Some(prot), _) => {
panic!("Unsupported protocol: {}", prot);
},
_ => panic!("Malformed address"),
}
}
},
addr: addr.to_owned(),
})
}
}
#[derive(Clone)]
struct ServerRef(Rc<RefCell<Server>>);
impl Node for ServerRef {
fn name(&self) -> String {
self.0.borrow().addr.clone()
}
}
impl Deref for ServerRef {
type Target = Rc<RefCell<Server>>;
fn deref(&self) -> &Rc<RefCell<Server>> {
&self.0
}
}
// impl Clone for Server {
// fn clone(&self) -> Server {
// Server { proto: self.proto.clone() }
// }
// }
/// Memcached client
///
/// ```ignore
/// extern crate collect;
///
/// use collect::BTreeMap;
/// use memcached::client::{Client, AddrType};
/// use memcached::proto::{Operation, MultiOperation, NoReplyOperation, CasOperation, ProtoType};
///
/// let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
///
/// client.set(b"Foo", b"Bar", 0xdeadbeef, 2).unwrap();
/// let (value, flags) = client.get(b"Foo").unwrap();
/// assert_eq!(&value[..], b"Bar");
/// assert_eq!(flags, 0xdeadbeef);
///
/// client.set_noreply(b"key:dontreply", b"1", 0x00000001, 20).unwrap();
///
/// let (_, cas_val) = client.increment_cas(b"key:numerical", 10, 1, 20, 0).unwrap();
/// client.increment_cas(b"key:numerical", 1, 1, 20, cas_val).unwrap();
/// ```
pub struct Client {
servers: ConsistentHash<ServerRef>,
}
impl Client {
/// Connect to Memcached servers
///
/// This function accept multiple servers, servers information should be represented
/// as a array of tuples in this form
///
/// `(address, weight)`.
pub fn connect(svrs: &[(&str, usize)], p: proto::ProtoType) -> io::Result<Client> {
assert!(!svrs.is_empty(), "Server list should not be empty");
let mut servers = ConsistentHash::new();
for &(addr, weight) in svrs.iter() {
let svr = try!(Server::connect(addr, p));
servers.add(&ServerRef(Rc::new(RefCell::new(svr))), weight);
}
Ok(Client {
servers: servers,
})
}
fn find_server_by_key<'a>(&'a mut self, key: &[u8]) -> &'a mut ServerRef {
self.servers.get_mut(key).expect("No valid server found")
}
}
impl Operation for Client {
fn set(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.set(key, value, flags, expiration)
}
fn add(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.add(key, value, flags, expiration)
}
fn delete(&mut self, key: &[u8]) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.delete(key)
}
fn replace(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.replace(key, value, flags, expiration)
}
fn get(&mut self, key: &[u8]) -> MemCachedResult<(Vec<u8>, u32)> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.get(key)
}
fn getk(&mut self, key: &[u8]) -> MemCachedResult<(Vec<u8>, Vec<u8>, u32)> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.getk(key)
}
fn increment(&mut self, key: &[u8], amount: u64, initial: u64, expiration: u32) -> MemCachedResult<u64> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.increment(key, amount, initial, expiration)
}
fn decrement(&mut self, key: &[u8], amount: u64, initial: u64, expiration: u32) -> MemCachedResult<u64> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.increment(key, amount, initial, expiration)
}
fn append(&mut self, key: &[u8], value: &[u8]) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.append(key, value)
}
fn prepend(&mut self, key: &[u8], value: &[u8]) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.prepend(key, value)
}
fn touch(&mut self, key: &[u8], expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.touch(key, expiration)
}
}
impl NoReplyOperation for Client {
fn set_noreply(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.set_noreply(key, value, flags, expiration)
}
fn add_noreply(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.add_noreply(key, value, flags, expiration)
}
fn delete_noreply(&mut self, key: &[u8]) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.delete_noreply(key)
}
fn replace_noreply(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.replace_noreply(key, value, flags, expiration)
}
fn increment_noreply(&mut self, key: &[u8], amount: u64, initial: u64, expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.increment_noreply(key, amount, initial, expiration)
}
fn decrement_noreply(&mut self, key: &[u8], amount: u64, initial: u64, expiration: u32) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.decrement_noreply(key, amount, initial, expiration)
}
fn append_noreply(&mut self, key: &[u8], value: &[u8]) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.append_noreply(key, value)
}
fn prepend_noreply(&mut self, key: &[u8], value: &[u8]) -> MemCachedResult<()> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.prepend_noreply(key, value)
}
}
impl CasOperation for Client {
fn set_cas(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32, cas: u64) -> MemCachedResult<u64> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.set_cas(key, value, flags, expiration, cas)
}
fn add_cas(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32) -> MemCachedResult<u64> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.add_cas(key, value, flags, expiration)
}
fn replace_cas(&mut self, key: &[u8], value: &[u8], flags: u32, expiration: u32, cas: u64) -> MemCachedResult<u64> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.replace_cas(key, value, flags, expiration, cas)
}
fn get_cas(&mut self, key: &[u8]) -> MemCachedResult<(Vec<u8>, u32, u64)> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.get_cas(key)
}
fn getk_cas(&mut self, key: &[u8]) -> MemCachedResult<(Vec<u8>, Vec<u8>, u32, u64)> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.getk_cas(key)
}
fn increment_cas(&mut self, key: &[u8], amount: u64, initial: u64, expiration: u32, cas: u64)
-> MemCachedResult<(u64, u64)> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.increment_cas(key, amount, initial, expiration, cas)
}
fn decrement_cas(&mut self, key: &[u8], amount: u64, initial: u64, expiration: u32, cas: u64)
-> MemCachedResult<(u64, u64)> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.decrement_cas(key, amount, initial, expiration, cas)
}
fn append_cas(&mut self, key: &[u8], value: &[u8], cas: u64) -> MemCachedResult<u64> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.append_cas(key, value, cas)
}
fn prepend_cas(&mut self, key: &[u8], value: &[u8], cas: u64) -> MemCachedResult<u64> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.prepend_cas(key, value, cas)
}
fn touch_cas(&mut self, key: &[u8], expiration: u32, cas: u64) -> MemCachedResult<u64> {
let server = self.find_server_by_key(key);
server.borrow_mut().proto.touch_cas(key, expiration, cas)
}
}
#[cfg(all(test, feature = "nightly"))]
mod test {
use test::Bencher;
use client::Client;
use proto::{Operation, NoReplyOperation, ProtoType};
use rand::random;
fn generate_data(len: usize) -> Vec<u8> {
(0..len).map(|_| random()).collect()
}
#[bench]
fn bench_set_64(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(64);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_noreply_64(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(64);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set_noreply(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_512(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(512);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_noreply_512(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(512);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set_noreply(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_1024(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(1024);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_noreply_1024(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(1024);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set_noreply(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_4096(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(4096);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_noreply_4096(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(4096);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set_noreply(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_16384(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(16384);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set(key, &val[..], 0, 2));
}
#[bench]
fn bench_set_noreply_16384(b: &mut Bencher) {
let key = b"test:test_bench";
let val = generate_data(16384);
let mut client = Client::connect(&[("tcp://127.0.0.1:11211", 1)], ProtoType::Binary).unwrap();
b.iter(|| client.set_noreply(key, &val[..], 0, 2));
}
}<|fim▁end|> | |
<|file_name|>Scanner.py<|end_file_name|><|fim▁begin|># Copyright 2007-2010 by Peter Cock. All rights reserved.
# Revisions copyright 2010 by Uri Laserson. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
# This code is NOT intended for direct use. It provides a basic scanner
# (for use with a event consumer such as Bio.GenBank._FeatureConsumer)
# to parse a GenBank or EMBL file (with their shared INSDC feature table).
#
# It is used by Bio.GenBank to parse GenBank files
# It is also used by Bio.SeqIO to parse GenBank and EMBL files
#
# Feature Table Documentation:
# http://www.insdc.org/files/feature_table.html
# http://www.ncbi.nlm.nih.gov/projects/collab/FT/index.html
# ftp://ftp.ncbi.nih.gov/genbank/docs/
#
# 17-MAR-2009: added wgs, wgs_scafld for GenBank whole genome shotgun master records.
# These are GenBank files that summarize the content of a project, and provide lists of
# scaffold and contig files in the project. These will be in annotations['wgs'] and
# annotations['wgs_scafld']. These GenBank files do not have sequences. See
# http://groups.google.com/group/bionet.molbio.genbank/browse_thread/thread/51fb88bf39e7dc36
# http://is.gd/nNgk
# for more details of this format, and an example.
# Added by Ying Huang & Iddo Friedberg
import warnings
import os
import re
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import generic_alphabet, generic_protein
class InsdcScanner:
"""Basic functions for breaking up a GenBank/EMBL file into sub sections.
The International Nucleotide Sequence Database Collaboration (INSDC)
between the DDBJ, EMBL, and GenBank. These organisations all use the
same "Feature Table" layout in their plain text flat file formats.
However, the header and sequence sections of an EMBL file are very
different in layout to those produced by GenBank/DDBJ."""
#These constants get redefined with sensible values in the sub classes:
RECORD_START = "XXX" # "LOCUS " or "ID "
HEADER_WIDTH = 3 # 12 or 5
FEATURE_START_MARKERS = ["XXX***FEATURES***XXX"]
FEATURE_END_MARKERS = ["XXX***END FEATURES***XXX"]
FEATURE_QUALIFIER_INDENT = 0
FEATURE_QUALIFIER_SPACER = ""
SEQUENCE_HEADERS=["XXX"] #with right hand side spaces removed
def __init__(self, debug=0):
assert len(self.RECORD_START)==self.HEADER_WIDTH
for marker in self.SEQUENCE_HEADERS:
assert marker==marker.rstrip()
assert len(self.FEATURE_QUALIFIER_SPACER)==self.FEATURE_QUALIFIER_INDENT
self.debug = debug
self.line = None
def set_handle(self, handle):
self.handle = handle
self.line = ""
<|fim▁hole|> """Read in lines until find the ID/LOCUS line, which is returned.
Any preamble (such as the header used by the NCBI on *.seq.gz archives)
will we ignored."""
while True:
if self.line:
line = self.line
self.line = ""
else:
line = self.handle.readline()
if not line:
if self.debug : print "End of file"
return None
if line[:self.HEADER_WIDTH]==self.RECORD_START:
if self.debug > 1: print "Found the start of a record:\n" + line
break
line = line.rstrip()
if line == "//":
if self.debug > 1: print "Skipping // marking end of last record"
elif line == "":
if self.debug > 1: print "Skipping blank line before record"
else:
#Ignore any header before the first ID/LOCUS line.
if self.debug > 1:
print "Skipping header line before record:\n" + line
self.line = line
return line
def parse_header(self):
"""Return list of strings making up the header
New line characters are removed.
Assumes you have just read in the ID/LOCUS line.
"""
assert self.line[:self.HEADER_WIDTH]==self.RECORD_START, \
"Not at start of record"
header_lines = []
while True:
line = self.handle.readline()
if not line:
raise ValueError("Premature end of line during sequence data")
line = line.rstrip()
if line in self.FEATURE_START_MARKERS:
if self.debug : print "Found header table"
break
#if line[:self.HEADER_WIDTH]==self.FEATURE_START_MARKER[:self.HEADER_WIDTH]:
# if self.debug : print "Found header table (?)"
# break
if line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS:
if self.debug : print "Found start of sequence"
break
if line == "//":
raise ValueError("Premature end of sequence data marker '//' found")
header_lines.append(line)
self.line = line
return header_lines
def parse_features(self, skip=False):
"""Return list of tuples for the features (if present)
Each feature is returned as a tuple (key, location, qualifiers)
where key and location are strings (e.g. "CDS" and
"complement(join(490883..490885,1..879))") while qualifiers
is a list of two string tuples (feature qualifier keys and values).
Assumes you have already read to the start of the features table.
"""
if self.line.rstrip() not in self.FEATURE_START_MARKERS:
if self.debug : print "Didn't find any feature table"
return []
while self.line.rstrip() in self.FEATURE_START_MARKERS:
self.line = self.handle.readline()
features = []
line = self.line
while True:
if not line:
raise ValueError("Premature end of line during features table")
if line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS:
if self.debug : print "Found start of sequence"
break
line = line.rstrip()
if line == "//":
raise ValueError("Premature end of features table, marker '//' found")
if line in self.FEATURE_END_MARKERS:
if self.debug : print "Found end of features"
line = self.handle.readline()
break
if line[2:self.FEATURE_QUALIFIER_INDENT].strip() == "":
#This is an empty feature line between qualifiers. Empty
#feature lines within qualifiers are handled below (ignored).
line = self.handle.readline()
continue
if skip:
line = self.handle.readline()
while line[:self.FEATURE_QUALIFIER_INDENT] == self.FEATURE_QUALIFIER_SPACER:
line = self.handle.readline()
else:
#Build up a list of the lines making up this feature:
if line[self.FEATURE_QUALIFIER_INDENT]!=" " \
and " " in line[self.FEATURE_QUALIFIER_INDENT:]:
#The feature table design enforces a length limit on the feature keys.
#Some third party files (e.g. IGMT's EMBL like files) solve this by
#over indenting the location and qualifiers.
feature_key, line = line[2:].strip().split(None,1)
feature_lines = [line]
warnings.warn("Overindented %s feature?" % feature_key)
else:
feature_key = line[2:self.FEATURE_QUALIFIER_INDENT].strip()
feature_lines = [line[self.FEATURE_QUALIFIER_INDENT:]]
line = self.handle.readline()
while line[:self.FEATURE_QUALIFIER_INDENT] == self.FEATURE_QUALIFIER_SPACER \
or line.rstrip() == "" : # cope with blank lines in the midst of a feature
#Use strip to remove any harmless trailing white space AND and leading
#white space (e.g. out of spec files with too much intentation)
feature_lines.append(line[self.FEATURE_QUALIFIER_INDENT:].strip())
line = self.handle.readline()
features.append(self.parse_feature(feature_key, feature_lines))
self.line = line
return features
def parse_feature(self, feature_key, lines):
"""Expects a feature as a list of strings, returns a tuple (key, location, qualifiers)
For example given this GenBank feature:
CDS complement(join(490883..490885,1..879))
/locus_tag="NEQ001"
/note="conserved hypothetical [Methanococcus jannaschii];
COG1583:Uncharacterized ACR; IPR001472:Bipartite nuclear
localization signal; IPR002743: Protein of unknown
function DUF57"
/codon_start=1
/transl_table=11
/product="hypothetical protein"
/protein_id="NP_963295.1"
/db_xref="GI:41614797"
/db_xref="GeneID:2732620"
/translation="MRLLLELKALNSIDKKQLSNYLIQGFIYNILKNTEYSWLHNWKK
EKYFNFTLIPKKDIIENKRYYLIISSPDKRFIEVLHNKIKDLDIITIGLAQFQLRKTK
KFDPKLRFPWVTITPIVLREGKIVILKGDKYYKVFVKRLEELKKYNLIKKKEPILEEP
IEISLNQIKDGWKIIDVKDRYYDFRNKSFSAFSNWLRDLKEQSLRKYNNFCGKNFYFE
EAIFEGFTFYKTVSIRIRINRGEAVYIGTLWKELNVYRKLDKEEREFYKFLYDCGLGS
LNSMGFGFVNTKKNSAR"
Then should give input key="CDS" and the rest of the data as a list of strings
lines=["complement(join(490883..490885,1..879))", ..., "LNSMGFGFVNTKKNSAR"]
where the leading spaces and trailing newlines have been removed.
Returns tuple containing: (key as string, location string, qualifiers as list)
as follows for this example:
key = "CDS", string
location = "complement(join(490883..490885,1..879))", string
qualifiers = list of string tuples:
[('locus_tag', '"NEQ001"'),
('note', '"conserved hypothetical [Methanococcus jannaschii];\nCOG1583:..."'),
('codon_start', '1'),
('transl_table', '11'),
('product', '"hypothetical protein"'),
('protein_id', '"NP_963295.1"'),
('db_xref', '"GI:41614797"'),
('db_xref', '"GeneID:2732620"'),
('translation', '"MRLLLELKALNSIDKKQLSNYLIQGFIYNILKNTEYSWLHNWKK\nEKYFNFT..."')]
In the above example, the "note" and "translation" were edited for compactness,
and they would contain multiple new line characters (displayed above as \n)
If a qualifier is quoted (in this case, everything except codon_start and
transl_table) then the quotes are NOT removed.
Note that no whitespace is removed.
"""
#Skip any blank lines
iterator = iter(filter(None, lines))
try:
line = iterator.next()
feature_location = line.strip()
while feature_location[-1:]==",":
#Multiline location, still more to come!
line = iterator.next()
feature_location += line.strip()
qualifiers=[]
for line in iterator:
if line[0]=="/":
#New qualifier
i = line.find("=")
key = line[1:i] #does not work if i==-1
value = line[i+1:] #we ignore 'value' if i==-1
if i==-1:
#Qualifier with no key, e.g. /pseudo
key = line[1:]
qualifiers.append((key,None))
elif value[0]=='"':
#Quoted...
if value[-1]!='"' or value!='"':
#No closing quote on the first line...
while value[-1] != '"':
value += "\n" + iterator.next()
else:
#One single line (quoted)
assert value == '"'
if self.debug : print "Quoted line %s:%s" % (key, value)
#DO NOT remove the quotes...
qualifiers.append((key,value))
else:
#Unquoted
#if debug : print "Unquoted line %s:%s" % (key,value)
qualifiers.append((key,value))
else:
#Unquoted continuation
assert len(qualifiers) > 0
assert key==qualifiers[-1][0]
#if debug : print "Unquoted Cont %s:%s" % (key, line)
qualifiers[-1] = (key, qualifiers[-1][1] + "\n" + line)
return (feature_key, feature_location, qualifiers)
except StopIteration:
#Bummer
raise ValueError("Problem with '%s' feature:\n%s" \
% (feature_key, "\n".join(lines)))
def parse_footer(self):
"""returns a tuple containing a list of any misc strings, and the sequence"""
#This is a basic bit of code to scan and discard the sequence,
#which was useful when developing the sub classes.
if self.line in self.FEATURE_END_MARKERS:
while self.line[:self.HEADER_WIDTH].rstrip() not in self.SEQUENCE_HEADERS:
self.line = self.handle.readline()
if not self.line:
raise ValueError("Premature end of file")
self.line = self.line.rstrip()
assert self.line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS, \
"Not at start of sequence"
while True:
line = self.handle.readline()
if not line : raise ValueError("Premature end of line during sequence data")
line = line.rstrip()
if line == "//" : break
self.line = line
return ([],"") #Dummy values!
def _feed_first_line(self, consumer, line):
"""Handle the LOCUS/ID line, passing data to the comsumer
This should be implemented by the EMBL / GenBank specific subclass
Used by the parse_records() and parse() methods.
"""
pass
def _feed_header_lines(self, consumer, lines):
"""Handle the header lines (list of strings), passing data to the comsumer
This should be implemented by the EMBL / GenBank specific subclass
Used by the parse_records() and parse() methods.
"""
pass
def _feed_feature_table(self, consumer, feature_tuples):
"""Handle the feature table (list of tuples), passing data to the comsumer
Used by the parse_records() and parse() methods.
"""
consumer.start_feature_table()
for feature_key, location_string, qualifiers in feature_tuples:
consumer.feature_key(feature_key)
consumer.location(location_string)
for q_key, q_value in qualifiers:
consumer.feature_qualifier_name([q_key])
if q_value is not None:
consumer.feature_qualifier_description(q_value.replace("\n"," "))
def _feed_misc_lines(self, consumer, lines):
"""Handle any lines between features and sequence (list of strings), passing data to the consumer
This should be implemented by the EMBL / GenBank specific subclass
Used by the parse_records() and parse() methods.
"""
pass
def feed(self, handle, consumer, do_features=True):
"""Feed a set of data into the consumer.
This method is intended for use with the "old" code in Bio.GenBank
Arguments:
handle - A handle with the information to parse.
consumer - The consumer that should be informed of events.
do_features - Boolean, should the features be parsed?
Skipping the features can be much faster.
Return values:
true - Passed a record
false - Did not find a record
"""
#Should work with both EMBL and GenBank files provided the
#equivalent Bio.GenBank._FeatureConsumer methods are called...
self.set_handle(handle)
if not self.find_start():
#Could not find (another) record
consumer.data=None
return False
#We use the above class methods to parse the file into a simplified format.
#The first line, header lines and any misc lines after the features will be
#dealt with by GenBank / EMBL specific derived classes.
#First line and header:
self._feed_first_line(consumer, self.line)
self._feed_header_lines(consumer, self.parse_header())
#Features (common to both EMBL and GenBank):
if do_features:
self._feed_feature_table(consumer, self.parse_features(skip=False))
else:
self.parse_features(skip=True) # ignore the data
#Footer and sequence
misc_lines, sequence_string = self.parse_footer()
self._feed_misc_lines(consumer, misc_lines)
consumer.sequence(sequence_string)
#Calls to consumer.base_number() do nothing anyway
consumer.record_end("//")
assert self.line == "//"
#And we are done
return True
def parse(self, handle, do_features=True):
"""Returns a SeqRecord (with SeqFeatures if do_features=True)
See also the method parse_records() for use on multi-record files.
"""
from Bio.GenBank import _FeatureConsumer
from Bio.GenBank.utils import FeatureValueCleaner
consumer = _FeatureConsumer(use_fuzziness = 1,
feature_cleaner = FeatureValueCleaner())
if self.feed(handle, consumer, do_features):
return consumer.data
else:
return None
def parse_records(self, handle, do_features=True):
"""Returns a SeqRecord object iterator
Each record (from the ID/LOCUS line to the // line) becomes a SeqRecord
The SeqRecord objects include SeqFeatures if do_features=True
This method is intended for use in Bio.SeqIO
"""
#This is a generator function
while True:
record = self.parse(handle, do_features)
if record is None : break
assert record.id is not None
assert record.name != "<unknown name>"
assert record.description != "<unknown description>"
yield record
def parse_cds_features(self, handle,
alphabet=generic_protein,
tags2id=('protein_id','locus_tag','product')):
"""Returns SeqRecord object iterator
Each CDS feature becomes a SeqRecord.
alphabet - Used for any sequence found in a translation field.
tags2id - Tupple of three strings, the feature keys to use
for the record id, name and description,
This method is intended for use in Bio.SeqIO
"""
self.set_handle(handle)
while self.find_start():
#Got an EMBL or GenBank record...
self.parse_header() # ignore header lines!
feature_tuples = self.parse_features()
#self.parse_footer() # ignore footer lines!
while True:
line = self.handle.readline()
if not line : break
if line[:2]=="//" : break
self.line = line.rstrip()
#Now go though those features...
for key, location_string, qualifiers in feature_tuples:
if key=="CDS":
#Create SeqRecord
#================
#SeqRecord objects cannot be created with annotations, they
#must be added afterwards. So create an empty record and
#then populate it:
record = SeqRecord(seq=None)
annotations = record.annotations
#Should we add a location object to the annotations?
#I *think* that only makes sense for SeqFeatures with their
#sub features...
annotations['raw_location'] = location_string.replace(' ','')
for (qualifier_name, qualifier_data) in qualifiers:
if qualifier_data is not None \
and qualifier_data[0]=='"' and qualifier_data[-1]=='"':
#Remove quotes
qualifier_data = qualifier_data[1:-1]
#Append the data to the annotation qualifier...
if qualifier_name == "translation":
assert record.seq is None, "Multiple translations!"
record.seq = Seq(qualifier_data.replace("\n",""), alphabet)
elif qualifier_name == "db_xref":
#its a list, possibly empty. Its safe to extend
record.dbxrefs.append(qualifier_data)
else:
if qualifier_data is not None:
qualifier_data = qualifier_data.replace("\n"," ").replace(" "," ")
try:
annotations[qualifier_name] += " " + qualifier_data
except KeyError:
#Not an addition to existing data, its the first bit
annotations[qualifier_name]= qualifier_data
#Fill in the ID, Name, Description
#=================================
try:
record.id = annotations[tags2id[0]]
except KeyError:
pass
try:
record.name = annotations[tags2id[1]]
except KeyError:
pass
try:
record.description = annotations[tags2id[2]]
except KeyError:
pass
yield record
class EmblScanner(InsdcScanner):
"""For extracting chunks of information in EMBL files"""
RECORD_START = "ID "
HEADER_WIDTH = 5
FEATURE_START_MARKERS = ["FH Key Location/Qualifiers","FH"]
FEATURE_END_MARKERS = ["XX"] #XX can also mark the end of many things!
FEATURE_QUALIFIER_INDENT = 21
FEATURE_QUALIFIER_SPACER = "FT" + " " * (FEATURE_QUALIFIER_INDENT-2)
SEQUENCE_HEADERS=["SQ", "CO"] #Remove trailing spaces
def parse_footer(self):
"""returns a tuple containing a list of any misc strings, and the sequence"""
assert self.line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS, \
"Eh? '%s'" % self.line
#Note that the SQ line can be split into several lines...
misc_lines = []
while self.line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS:
misc_lines.append(self.line)
self.line = self.handle.readline()
if not self.line:
raise ValueError("Premature end of file")
self.line = self.line.rstrip()
assert self.line[:self.HEADER_WIDTH] == " " * self.HEADER_WIDTH \
or self.line.strip() == '//', repr(self.line)
seq_lines = []
line = self.line
while True:
if not line:
raise ValueError("Premature end of file in sequence data")
line = line.strip()
if not line:
raise ValueError("Blank line in sequence data")
if line=='//':
break
assert self.line[:self.HEADER_WIDTH] == " " * self.HEADER_WIDTH, \
repr(self.line)
#Remove tailing number now, remove spaces later
seq_lines.append(line.rsplit(None,1)[0])
line = self.handle.readline()
self.line = line
return (misc_lines, "".join(seq_lines).replace(" ", ""))
def _feed_first_line(self, consumer, line):
assert line[:self.HEADER_WIDTH].rstrip() == "ID"
if line[self.HEADER_WIDTH:].count(";") == 6:
#Looks like the semi colon separated style introduced in 2006
self._feed_first_line_new(consumer, line)
elif line[self.HEADER_WIDTH:].count(";") == 3:
#Looks like the pre 2006 style
self._feed_first_line_old(consumer, line)
else:
raise ValueError('Did not recognise the ID line layout:\n' + line)
def _feed_first_line_old(self, consumer, line):
#Expects an ID line in the style before 2006, e.g.
#ID SC10H5 standard; DNA; PRO; 4870 BP.
#ID BSUB9999 standard; circular DNA; PRO; 4214630 BP.
assert line[:self.HEADER_WIDTH].rstrip() == "ID"
fields = [line[self.HEADER_WIDTH:].split(None,1)[0]]
fields.extend(line[self.HEADER_WIDTH:].split(None,1)[1].split(";"))
fields = [entry.strip() for entry in fields]
"""
The tokens represent:
0. Primary accession number
(space sep)
1. ??? (e.g. standard)
(semi-colon)
2. Topology and/or Molecule type (e.g. 'circular DNA' or 'DNA')
3. Taxonomic division (e.g. 'PRO')
4. Sequence length (e.g. '4639675 BP.')
"""
consumer.locus(fields[0]) #Should we also call the accession consumer?
consumer.residue_type(fields[2])
consumer.data_file_division(fields[3])
self._feed_seq_length(consumer, fields[4])
def _feed_first_line_new(self, consumer, line):
#Expects an ID line in the style introduced in 2006, e.g.
#ID X56734; SV 1; linear; mRNA; STD; PLN; 1859 BP.
#ID CD789012; SV 4; linear; genomic DNA; HTG; MAM; 500 BP.
assert line[:self.HEADER_WIDTH].rstrip() == "ID"
fields = [data.strip() for data in line[self.HEADER_WIDTH:].strip().split(";")]
assert len(fields) == 7
"""
The tokens represent:
0. Primary accession number
1. Sequence version number
2. Topology: 'circular' or 'linear'
3. Molecule type (e.g. 'genomic DNA')
4. Data class (e.g. 'STD')
5. Taxonomic division (e.g. 'PRO')
6. Sequence length (e.g. '4639675 BP.')
"""
consumer.locus(fields[0])
#Call the accession consumer now, to make sure we record
#something as the record.id, in case there is no AC line
consumer.accession(fields[0])
#TODO - How to deal with the version field? At the moment the consumer
#will try and use this for the ID which isn't ideal for EMBL files.
version_parts = fields[1].split()
if len(version_parts)==2 \
and version_parts[0]=="SV" \
and version_parts[1].isdigit():
consumer.version_suffix(version_parts[1])
#Based on how the old GenBank parser worked, merge these two:
consumer.residue_type(" ".join(fields[2:4])) #TODO - Store as two fields?
#consumer.xxx(fields[4]) #TODO - What should we do with the data class?
consumer.data_file_division(fields[5])
self._feed_seq_length(consumer, fields[6])
def _feed_seq_length(self, consumer, text):
length_parts = text.split()
assert len(length_parts) == 2
assert length_parts[1].upper() in ["BP", "BP.", "AA."]
consumer.size(length_parts[0])
def _feed_header_lines(self, consumer, lines):
EMBL_INDENT = self.HEADER_WIDTH
EMBL_SPACER = " " * EMBL_INDENT
consumer_dict = {
'AC' : 'accession',
'SV' : 'version', # SV line removed in June 2006, now part of ID line
'DE' : 'definition',
#'RN' : 'reference_num',
#'RC' : reference comment... TODO
#'RP' : 'reference_bases',
#'RX' : reference cross reference... DOI or Pubmed
'RG' : 'consrtm', #optional consortium
#'RA' : 'authors',
#'RT' : 'title',
'RL' : 'journal',
'OS' : 'organism',
'OC' : 'taxonomy',
#'DR' : data reference
'CC' : 'comment',
#'XX' : splitter
}
#We have to handle the following specially:
#RX (depending on reference type...)
for line in lines:
line_type = line[:EMBL_INDENT].strip()
data = line[EMBL_INDENT:].strip()
if line_type == 'XX':
pass
elif line_type == 'RN':
# Reformat reference numbers for the GenBank based consumer
# e.g. '[1]' becomes '1'
if data[0] == "[" and data[-1] == "]" : data = data[1:-1]
consumer.reference_num(data)
elif line_type == 'RP':
# Reformat reference numbers for the GenBank based consumer
# e.g. '1-4639675' becomes '(bases 1 to 4639675)'
# and '160-550, 904-1055' becomes '(bases 160 to 550; 904 to 1055)'
parts = [bases.replace("-"," to ").strip() for bases in data.split(",")]
consumer.reference_bases("(bases %s)" % "; ".join(parts))
elif line_type == 'RT':
#Remove the enclosing quotes and trailing semi colon.
#Note the title can be split over multiple lines.
if data.startswith('"'):
data = data[1:]
if data.endswith('";'):
data = data[:-2]
consumer.title(data)
elif line_type == 'RX':
# EMBL support three reference types at the moment:
# - PUBMED PUBMED bibliographic database (NLM)
# - DOI Digital Object Identifier (International DOI Foundation)
# - AGRICOLA US National Agriculture Library (NAL) of the US Department
# of Agriculture (USDA)
#
# Format:
# RX resource_identifier; identifier.
#
# e.g.
# RX DOI; 10.1016/0024-3205(83)90010-3.
# RX PUBMED; 264242.
#
# Currently our reference object only supports PUBMED and MEDLINE
# (as these were in GenBank files?).
key, value = data.split(";",1)
if value.endswith(".") : value = value[:-1]
value = value.strip()
if key == "PUBMED":
consumer.pubmed_id(value)
#TODO - Handle other reference types (here and in BioSQL bindings)
elif line_type == 'CC':
# Have to pass a list of strings for this one (not just a string)
consumer.comment([data])
elif line_type == 'DR':
# Database Cross-reference, format:
# DR database_identifier; primary_identifier; secondary_identifier.
#
# e.g.
# DR MGI; 98599; Tcrb-V4.
#
# TODO - How should we store any secondary identifier?
parts = data.rstrip(".").split(";")
#Turn it into "database_identifier:primary_identifier" to
#mimic the GenBank parser. e.g. "MGI:98599"
consumer.dblink("%s:%s" % (parts[0].strip(),
parts[1].strip()))
elif line_type == 'RA':
# Remove trailing ; at end of authors list
consumer.authors(data.rstrip(";"))
elif line_type == 'PR':
# Remove trailing ; at end of the project reference
# In GenBank files this corresponds to the old PROJECT
# line which is being replaced with the DBLINK line.
consumer.project(data.rstrip(";"))
elif line_type in consumer_dict:
#Its a semi-automatic entry!
getattr(consumer, consumer_dict[line_type])(data)
else:
if self.debug:
print "Ignoring EMBL header line:\n%s" % line
def _feed_misc_lines(self, consumer, lines):
#TODO - Should we do something with the information on the SQ line(s)?
lines.append("")
line_iter = iter(lines)
try:
for line in line_iter:
if line.startswith("CO "):
line = line[5:].strip()
contig_location = line
while True:
line = line_iter.next()
if not line:
break
elif line.startswith("CO "):
#Don't need to preseve the whitespace here.
contig_location += line[5:].strip()
else:
raise ValueError('Expected CO (contig) continuation line, got:\n' + line)
consumer.contig_location(contig_location)
return
except StopIteration:
raise ValueError("Problem in misc lines before sequence")
class _ImgtScanner(EmblScanner):
"""For extracting chunks of information in IMGT (EMBL like) files (PRIVATE).
IMGT files are like EMBL files but in order to allow longer feature types
the features should be indented by 25 characters not 21 characters. In
practice the IMGT flat files tend to use either 21 or 25 characters, so we
must cope with both.
This is private to encourage use of Bio.SeqIO rather than Bio.GenBank.
"""
FEATURE_START_MARKERS = ["FH Key Location/Qualifiers",
"FH Key Location/Qualifiers (from EMBL)",
"FH Key Location/Qualifiers",
"FH"]
def parse_features(self, skip=False):
"""Return list of tuples for the features (if present)
Each feature is returned as a tuple (key, location, qualifiers)
where key and location are strings (e.g. "CDS" and
"complement(join(490883..490885,1..879))") while qualifiers
is a list of two string tuples (feature qualifier keys and values).
Assumes you have already read to the start of the features table.
"""
if self.line.rstrip() not in self.FEATURE_START_MARKERS:
if self.debug : print "Didn't find any feature table"
return []
while self.line.rstrip() in self.FEATURE_START_MARKERS:
self.line = self.handle.readline()
bad_position_re = re.compile(r'([0-9]+)>{1}')
features = []
line = self.line
while True:
if not line:
raise ValueError("Premature end of line during features table")
if line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS:
if self.debug : print "Found start of sequence"
break
line = line.rstrip()
if line == "//":
raise ValueError("Premature end of features table, marker '//' found")
if line in self.FEATURE_END_MARKERS:
if self.debug : print "Found end of features"
line = self.handle.readline()
break
if line[2:self.FEATURE_QUALIFIER_INDENT].strip() == "":
#This is an empty feature line between qualifiers. Empty
#feature lines within qualifiers are handled below (ignored).
line = self.handle.readline()
continue
if skip:
line = self.handle.readline()
while line[:self.FEATURE_QUALIFIER_INDENT] == self.FEATURE_QUALIFIER_SPACER:
line = self.handle.readline()
else:
assert line[:2] == "FT"
try:
feature_key, location_start = line[2:].strip().split()
except ValueError:
#e.g. "FT TRANSMEMBRANE-REGION2163..2240\n"
#Assume indent of 25 as per IMGT spec, with the location
#start in column 26 (one-based).
feature_key = line[2:25].strip()
location_start = line[25:].strip()
feature_lines = [location_start]
line = self.handle.readline()
while line[:self.FEATURE_QUALIFIER_INDENT] == self.FEATURE_QUALIFIER_SPACER \
or line.rstrip() == "" : # cope with blank lines in the midst of a feature
#Use strip to remove any harmless trailing white space AND and leading
#white space (copes with 21 or 26 indents and orther variants)
assert line[:2] == "FT"
feature_lines.append(line[self.FEATURE_QUALIFIER_INDENT:].strip())
line = self.handle.readline()
feature_key, location, qualifiers = \
self.parse_feature(feature_key, feature_lines)
#Try to handle known problems with IMGT locations here:
if ">" in location:
#Nasty hack for common IMGT bug, should be >123 not 123>
#in a location string. At least here the meaning is clear,
#and since it is so common I don't want to issue a warning
#warnings.warn("Feature location %s is invalid, "
# "moving greater than sign before position"
# % location)
location = bad_position_re.sub(r'>\1',location)
features.append((feature_key, location, qualifiers))
self.line = line
return features
class GenBankScanner(InsdcScanner):
"""For extracting chunks of information in GenBank files"""
RECORD_START = "LOCUS "
HEADER_WIDTH = 12
FEATURE_START_MARKERS = ["FEATURES Location/Qualifiers","FEATURES"]
FEATURE_END_MARKERS = []
FEATURE_QUALIFIER_INDENT = 21
FEATURE_QUALIFIER_SPACER = " " * FEATURE_QUALIFIER_INDENT
SEQUENCE_HEADERS=["CONTIG", "ORIGIN", "BASE COUNT", "WGS"] # trailing spaces removed
def parse_footer(self):
"""returns a tuple containing a list of any misc strings, and the sequence"""
assert self.line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS, \
"Eh? '%s'" % self.line
misc_lines = []
while self.line[:self.HEADER_WIDTH].rstrip() in self.SEQUENCE_HEADERS \
or self.line[:self.HEADER_WIDTH] == " "*self.HEADER_WIDTH \
or "WGS" == self.line[:3]:
misc_lines.append(self.line.rstrip())
self.line = self.handle.readline()
if not self.line:
raise ValueError("Premature end of file")
self.line = self.line
assert self.line[:self.HEADER_WIDTH].rstrip() not in self.SEQUENCE_HEADERS, \
"Eh? '%s'" % self.line
#Now just consume the sequence lines until reach the // marker
#or a CONTIG line
seq_lines = []
line = self.line
while True:
if not line:
raise ValueError("Premature end of file in sequence data")
line = line.rstrip()
if not line:
import warnings
warnings.warn("Blank line in sequence data")
line = self.handle.readline()
continue
if line=='//':
break
if line.find('CONTIG')==0:
break
if len(line) > 9 and line[9:10]!=' ':
raise ValueError("Sequence line mal-formed, '%s'" % line)
seq_lines.append(line[10:]) #remove spaces later
line = self.handle.readline()
self.line = line
#Seq("".join(seq_lines), self.alphabet)
return (misc_lines,"".join(seq_lines).replace(" ",""))
def _feed_first_line(self, consumer, line):
#####################################
# LOCUS line #
#####################################
GENBANK_INDENT = self.HEADER_WIDTH
GENBANK_SPACER = " "*GENBANK_INDENT
assert line[0:GENBANK_INDENT] == 'LOCUS ', \
'LOCUS line does not start correctly:\n' + line
#Have to break up the locus line, and handle the different bits of it.
#There are at least two different versions of the locus line...
if line[29:33] in [' bp ', ' aa ',' rc ']:
#Old...
#
# Positions Contents
# --------- --------
# 00:06 LOCUS
# 06:12 spaces
# 12:?? Locus name
# ??:?? space
# ??:29 Length of sequence, right-justified
# 29:33 space, bp, space
# 33:41 strand type
# 41:42 space
# 42:51 Blank (implies linear), linear or circular
# 51:52 space
# 52:55 The division code (e.g. BCT, VRL, INV)
# 55:62 space
# 62:73 Date, in the form dd-MMM-yyyy (e.g., 15-MAR-1991)
#
assert line[29:33] in [' bp ', ' aa ',' rc '] , \
'LOCUS line does not contain size units at expected position:\n' + line
assert line[41:42] == ' ', \
'LOCUS line does not contain space at position 42:\n' + line
assert line[42:51].strip() in ['','linear','circular'], \
'LOCUS line does not contain valid entry (linear, circular, ...):\n' + line
assert line[51:52] == ' ', \
'LOCUS line does not contain space at position 52:\n' + line
assert line[55:62] == ' ', \
'LOCUS line does not contain spaces from position 56 to 62:\n' + line
if line[62:73].strip():
assert line[64:65] == '-', \
'LOCUS line does not contain - at position 65 in date:\n' + line
assert line[68:69] == '-', \
'LOCUS line does not contain - at position 69 in date:\n' + line
name_and_length_str = line[GENBANK_INDENT:29]
while name_and_length_str.find(' ')!=-1:
name_and_length_str = name_and_length_str.replace(' ',' ')
name_and_length = name_and_length_str.split(' ')
assert len(name_and_length)<=2, \
'Cannot parse the name and length in the LOCUS line:\n' + line
assert len(name_and_length)!=1, \
'Name and length collide in the LOCUS line:\n' + line
#Should be possible to split them based on position, if
#a clear definition of the standard exists THAT AGREES with
#existing files.
consumer.locus(name_and_length[0])
consumer.size(name_and_length[1])
#consumer.residue_type(line[33:41].strip())
if line[33:51].strip() == "" and line[29:33] == ' aa ':
#Amino acids -> protein (even if there is no residue type given)
#We want to use a protein alphabet in this case, rather than a
#generic one. Not sure if this is the best way to achieve this,
#but it works because the scanner checks for this:
consumer.residue_type("PROTEIN")
else:
consumer.residue_type(line[33:51].strip())
consumer.data_file_division(line[52:55])
if line[62:73].strip():
consumer.date(line[62:73])
elif line[40:44] in [' bp ', ' aa ',' rc ']:
#New...
#
# Positions Contents
# --------- --------
# 00:06 LOCUS
# 06:12 spaces
# 12:?? Locus name
# ??:?? space
# ??:40 Length of sequence, right-justified
# 40:44 space, bp, space
# 44:47 Blank, ss-, ds-, ms-
# 47:54 Blank, DNA, RNA, tRNA, mRNA, uRNA, snRNA, cDNA
# 54:55 space
# 55:63 Blank (implies linear), linear or circular
# 63:64 space
# 64:67 The division code (e.g. BCT, VRL, INV)
# 67:68 space
# 68:79 Date, in the form dd-MMM-yyyy (e.g., 15-MAR-1991)
#
assert line[40:44] in [' bp ', ' aa ',' rc '] , \
'LOCUS line does not contain size units at expected position:\n' + line
assert line[44:47] in [' ', 'ss-', 'ds-', 'ms-'], \
'LOCUS line does not have valid strand type (Single stranded, ...):\n' + line
assert line[47:54].strip() == "" \
or line[47:54].strip().find('DNA') != -1 \
or line[47:54].strip().find('RNA') != -1, \
'LOCUS line does not contain valid sequence type (DNA, RNA, ...):\n' + line
assert line[54:55] == ' ', \
'LOCUS line does not contain space at position 55:\n' + line
assert line[55:63].strip() in ['','linear','circular'], \
'LOCUS line does not contain valid entry (linear, circular, ...):\n' + line
assert line[63:64] == ' ', \
'LOCUS line does not contain space at position 64:\n' + line
assert line[67:68] == ' ', \
'LOCUS line does not contain space at position 68:\n' + line
if line[68:79].strip():
assert line[70:71] == '-', \
'LOCUS line does not contain - at position 71 in date:\n' + line
assert line[74:75] == '-', \
'LOCUS line does not contain - at position 75 in date:\n' + line
name_and_length_str = line[GENBANK_INDENT:40]
while name_and_length_str.find(' ')!=-1:
name_and_length_str = name_and_length_str.replace(' ',' ')
name_and_length = name_and_length_str.split(' ')
assert len(name_and_length)<=2, \
'Cannot parse the name and length in the LOCUS line:\n' + line
assert len(name_and_length)!=1, \
'Name and length collide in the LOCUS line:\n' + line
#Should be possible to split them based on position, if
#a clear definition of the stand exists THAT AGREES with
#existing files.
consumer.locus(name_and_length[0])
consumer.size(name_and_length[1])
if line[44:54].strip() == "" and line[40:44] == ' aa ':
#Amino acids -> protein (even if there is no residue type given)
#We want to use a protein alphabet in this case, rather than a
#generic one. Not sure if this is the best way to achieve this,
#but it works because the scanner checks for this:
consumer.residue_type(("PROTEIN " + line[54:63]).strip())
else:
consumer.residue_type(line[44:63].strip())
consumer.data_file_division(line[64:67])
if line[68:79].strip():
consumer.date(line[68:79])
elif line[GENBANK_INDENT:].strip().count(" ")==0 :
#Truncated LOCUS line, as produced by some EMBOSS tools - see bug 1762
#
#e.g.
#
# "LOCUS U00096"
#
#rather than:
#
# "LOCUS U00096 4639675 bp DNA circular BCT"
#
# Positions Contents
# --------- --------
# 00:06 LOCUS
# 06:12 spaces
# 12:?? Locus name
if line[GENBANK_INDENT:].strip() != "":
consumer.locus(line[GENBANK_INDENT:].strip())
else:
#Must just have just "LOCUS ", is this even legitimate?
#We should be able to continue parsing... we need real world testcases!
warnings.warn("Minimal LOCUS line found - is this correct?\n" + line)
elif len(line.split())>=4 and line.split()[3] in ["aa","bp"]:
#Cope with EMBOSS seqret output where it seems the locus id can cause
#the other fields to overflow. We just IGNORE the other fields!
consumer.locus(line.split()[1])
consumer.size(line.split()[2])
warnings.warn("Malformed LOCUS line found - is this correct?\n" + line)
else:
raise ValueError('Did not recognise the LOCUS line layout:\n' + line)
def _feed_header_lines(self, consumer, lines):
#Following dictionary maps GenBank lines to the associated
#consumer methods - the special cases like LOCUS where one
#genbank line triggers several consumer calls have to be
#handled individually.
GENBANK_INDENT = self.HEADER_WIDTH
GENBANK_SPACER = " "*GENBANK_INDENT
consumer_dict = {
'DEFINITION' : 'definition',
'ACCESSION' : 'accession',
'NID' : 'nid',
'PID' : 'pid',
'DBSOURCE' : 'db_source',
'KEYWORDS' : 'keywords',
'SEGMENT' : 'segment',
'SOURCE' : 'source',
'AUTHORS' : 'authors',
'CONSRTM' : 'consrtm',
'PROJECT' : 'project',
'DBLINK' : 'dblink',
'TITLE' : 'title',
'JOURNAL' : 'journal',
'MEDLINE' : 'medline_id',
'PUBMED' : 'pubmed_id',
'REMARK' : 'remark'}
#We have to handle the following specially:
#ORIGIN (locus, size, residue_type, data_file_division and date)
#COMMENT (comment)
#VERSION (version and gi)
#REFERENCE (eference_num and reference_bases)
#ORGANISM (organism and taxonomy)
lines = filter(None,lines)
lines.append("") #helps avoid getting StopIteration all the time
line_iter = iter(lines)
try:
line = line_iter.next()
while True:
if not line : break
line_type = line[:GENBANK_INDENT].strip()
data = line[GENBANK_INDENT:].strip()
if line_type == 'VERSION':
#Need to call consumer.version(), and maybe also consumer.gi() as well.
#e.g.
# VERSION AC007323.5 GI:6587720
while data.find(' ')!=-1:
data = data.replace(' ',' ')
if data.find(' GI:')==-1:
consumer.version(data)
else:
if self.debug : print "Version [" + data.split(' GI:')[0] + "], gi [" + data.split(' GI:')[1] + "]"
consumer.version(data.split(' GI:')[0])
consumer.gi(data.split(' GI:')[1])
#Read in the next line!
line = line_iter.next()
elif line_type == 'REFERENCE':
if self.debug >1 : print "Found reference [" + data + "]"
#Need to call consumer.reference_num() and consumer.reference_bases()
#e.g.
# REFERENCE 1 (bases 1 to 86436)
#
#Note that this can be multiline, see Bug 1968, e.g.
#
# REFERENCE 42 (bases 1517 to 1696; 3932 to 4112; 17880 to 17975; 21142 to
# 28259)
#
#For such cases we will call the consumer once only.
data = data.strip()
#Read in the next line, and see if its more of the reference:
while True:
line = line_iter.next()
if line[:GENBANK_INDENT] == GENBANK_SPACER:
#Add this continuation to the data string
data += " " + line[GENBANK_INDENT:]
if self.debug >1 : print "Extended reference text [" + data + "]"
else:
#End of the reference, leave this text in the variable "line"
break
#We now have all the reference line(s) stored in a string, data,
#which we pass to the consumer
while data.find(' ')!=-1:
data = data.replace(' ',' ')
if data.find(' ')==-1:
if self.debug >2 : print 'Reference number \"' + data + '\"'
consumer.reference_num(data)
else:
if self.debug >2 : print 'Reference number \"' + data[:data.find(' ')] + '\", \"' + data[data.find(' ')+1:] + '\"'
consumer.reference_num(data[:data.find(' ')])
consumer.reference_bases(data[data.find(' ')+1:])
elif line_type == 'ORGANISM':
#Typically the first line is the organism, and subsequent lines
#are the taxonomy lineage. However, given longer and longer
#species names (as more and more strains and sub strains get
#sequenced) the oragnism name can now get wrapped onto multiple
#lines. The NCBI say we have to recognise the lineage line by
#the presense of semi-colon delimited entries. In the long term,
#they are considering adding a new keyword (e.g. LINEAGE).
#See Bug 2591 for details.
organism_data = data
lineage_data = ""
while True:
line = line_iter.next()
if line[0:GENBANK_INDENT] == GENBANK_SPACER:
if lineage_data or ";" in line:
lineage_data += " " + line[GENBANK_INDENT:]
else:
organism_data += " " + line[GENBANK_INDENT:].strip()
else:
#End of organism and taxonomy
break
consumer.organism(organism_data)
if lineage_data.strip() == "" and self.debug > 1:
print "Taxonomy line(s) missing or blank"
consumer.taxonomy(lineage_data.strip())
del organism_data, lineage_data
elif line_type == 'COMMENT':
if self.debug > 1 : print "Found comment"
#This can be multiline, and should call consumer.comment() once
#with a list where each entry is a line.
comment_list=[]
comment_list.append(data)
while True:
line = line_iter.next()
if line[0:GENBANK_INDENT] == GENBANK_SPACER:
data = line[GENBANK_INDENT:]
comment_list.append(data)
if self.debug > 2 : print "Comment continuation [" + data + "]"
else:
#End of the comment
break
consumer.comment(comment_list)
del comment_list
elif line_type in consumer_dict:
#Its a semi-automatic entry!
#Now, this may be a multi line entry...
while True:
line = line_iter.next()
if line[0:GENBANK_INDENT] == GENBANK_SPACER:
data += ' ' + line[GENBANK_INDENT:]
else:
#We now have all the data for this entry:
getattr(consumer, consumer_dict[line_type])(data)
#End of continuation - return to top of loop!
break
else:
if self.debug:
print "Ignoring GenBank header line:\n" % line
#Read in next line
line = line_iter.next()
except StopIteration:
raise ValueError("Problem in header")
def _feed_misc_lines(self, consumer, lines):
#Deals with a few misc lines between the features and the sequence
GENBANK_INDENT = self.HEADER_WIDTH
GENBANK_SPACER = " "*GENBANK_INDENT
lines.append("")
line_iter = iter(lines)
try:
for line in line_iter:
if line.find('BASE COUNT')==0:
line = line[10:].strip()
if line:
if self.debug : print "base_count = " + line
consumer.base_count(line)
if line.find("ORIGIN")==0:
line = line[6:].strip()
if line:
if self.debug : print "origin_name = " + line
consumer.origin_name(line)
if line.find("WGS ")==0 :
line = line[3:].strip()
consumer.wgs(line)
if line.find("WGS_SCAFLD")==0 :
line = line[10:].strip()
consumer.add_wgs_scafld(line)
if line.find("CONTIG")==0:
line = line[6:].strip()
contig_location = line
while True:
line = line_iter.next()
if not line:
break
elif line[:GENBANK_INDENT]==GENBANK_SPACER:
#Don't need to preseve the whitespace here.
contig_location += line[GENBANK_INDENT:].rstrip()
else:
raise ValueError('Expected CONTIG continuation line, got:\n' + line)
consumer.contig_location(contig_location)
return
except StopIteration:
raise ValueError("Problem in misc lines before sequence")
if __name__ == "__main__":
from StringIO import StringIO
gbk_example = \
"""LOCUS SCU49845 5028 bp DNA PLN 21-JUN-1999
DEFINITION Saccharomyces cerevisiae TCP1-beta gene, partial cds, and Axl2p
(AXL2) and Rev7p (REV7) genes, complete cds.
ACCESSION U49845
VERSION U49845.1 GI:1293613
KEYWORDS .
SOURCE Saccharomyces cerevisiae (baker's yeast)
ORGANISM Saccharomyces cerevisiae
Eukaryota; Fungi; Ascomycota; Saccharomycotina; Saccharomycetes;
Saccharomycetales; Saccharomycetaceae; Saccharomyces.
REFERENCE 1 (bases 1 to 5028)
AUTHORS Torpey,L.E., Gibbs,P.E., Nelson,J. and Lawrence,C.W.
TITLE Cloning and sequence of REV7, a gene whose function is required for
DNA damage-induced mutagenesis in Saccharomyces cerevisiae
JOURNAL Yeast 10 (11), 1503-1509 (1994)
PUBMED 7871890
REFERENCE 2 (bases 1 to 5028)
AUTHORS Roemer,T., Madden,K., Chang,J. and Snyder,M.
TITLE Selection of axial growth sites in yeast requires Axl2p, a novel
plasma membrane glycoprotein
JOURNAL Genes Dev. 10 (7), 777-793 (1996)
PUBMED 8846915
REFERENCE 3 (bases 1 to 5028)
AUTHORS Roemer,T.
TITLE Direct Submission
JOURNAL Submitted (22-FEB-1996) Terry Roemer, Biology, Yale University, New
Haven, CT, USA
FEATURES Location/Qualifiers
source 1..5028
/organism="Saccharomyces cerevisiae"
/db_xref="taxon:4932"
/chromosome="IX"
/map="9"
CDS <1..206
/codon_start=3
/product="TCP1-beta"
/protein_id="AAA98665.1"
/db_xref="GI:1293614"
/translation="SSIYNGISTSGLDLNNGTIADMRQLGIVESYKLKRAVVSSASEA
AEVLLRVDNIIRARPRTANRQHM"
gene 687..3158
/gene="AXL2"
CDS 687..3158
/gene="AXL2"
/note="plasma membrane glycoprotein"
/codon_start=1
/function="required for axial budding pattern of S.
cerevisiae"
/product="Axl2p"
/protein_id="AAA98666.1"
/db_xref="GI:1293615"
/translation="MTQLQISLLLTATISLLHLVVATPYEAYPIGKQYPPVARVNESF
TFQISNDTYKSSVDKTAQITYNCFDLPSWLSFDSSSRTFSGEPSSDLLSDANTTLYFN
VILEGTDSADSTSLNNTYQFVVTNRPSISLSSDFNLLALLKNYGYTNGKNALKLDPNE
VFNVTFDRSMFTNEESIVSYYGRSQLYNAPLPNWLFFDSGELKFTGTAPVINSAIAPE
TSYSFVIIATDIEGFSAVEVEFELVIGAHQLTTSIQNSLIINVTDTGNVSYDLPLNYV
YLDDDPISSDKLGSINLLDAPDWVALDNATISGSVPDELLGKNSNPANFSVSIYDTYG
DVIYFNFEVVSTTDLFAISSLPNINATRGEWFSYYFLPSQFTDYVNTNVSLEFTNSSQ
DHDWVKFQSSNLTLAGEVPKNFDKLSLGLKANQGSQSQELYFNIIGMDSKITHSNHSA
NATSTRSSHHSTSTSSYTSSTYTAKISSTSAAATSSAPAALPAANKTSSHNKKAVAIA
CGVAIPLGVILVALICFLIFWRRRRENPDDENLPHAISGPDLNNPANKPNQENATPLN
NPFDDDASSYDDTSIARRLAALNTLKLDNHSATESDISSVDEKRDSLSGMNTYNDQFQ
SQSKEELLAKPPVQPPESPFFDPQNRSSSVYMDSEPAVNKSWRYTGNLSPVSDIVRDS
YGSQKTVDTEKLFDLEAPEKEKRTSRDVTMSSLDPWNSNISPSPVRKSVTPSPYNVTK
HRNRHLQNIQDSQSGKNGITPTTMSTSSSDDFVPVKDGENFCWVHSMEPDRRPSKKRL
VDFSNKSNVNVGQVKDIHGRIPEML"
gene complement(3300..4037)
/gene="REV7"
CDS complement(3300..4037)
/gene="REV7"
/codon_start=1
/product="Rev7p"
/protein_id="AAA98667.1"
/db_xref="GI:1293616"
/translation="MNRWVEKWLRVYLKCYINLILFYRNVYPPQSFDYTTYQSFNLPQ
FVPINRHPALIDYIEELILDVLSKLTHVYRFSICIINKKNDLCIEKYVLDFSELQHVD
KDDQIITETEVFDEFRSSLNSLIMHLEKLPKVNDDTITFEAVINAIELELGHKLDRNR
RVDSLEEKAEIERDSNWVKCQEDENLPDNNGFQPPKIKLTSLVGSDVGPLIIHQFSEK
LISGDDKILNGVYSQYEEGESIFGSLF"
ORIGIN
1 gatcctccat atacaacggt atctccacct caggtttaga tctcaacaac ggaaccattg
61 ccgacatgag acagttaggt atcgtcgaga gttacaagct aaaacgagca gtagtcagct
121 ctgcatctga agccgctgaa gttctactaa gggtggataa catcatccgt gcaagaccaa
181 gaaccgccaa tagacaacat atgtaacata tttaggatat acctcgaaaa taataaaccg
241 ccacactgtc attattataa ttagaaacag aacgcaaaaa ttatccacta tataattcaa
301 agacgcgaaa aaaaaagaac aacgcgtcat agaacttttg gcaattcgcg tcacaaataa
361 attttggcaa cttatgtttc ctcttcgagc agtactcgag ccctgtctca agaatgtaat
421 aatacccatc gtaggtatgg ttaaagatag catctccaca acctcaaagc tccttgccga
481 gagtcgccct cctttgtcga gtaattttca cttttcatat gagaacttat tttcttattc
541 tttactctca catcctgtag tgattgacac tgcaacagcc accatcacta gaagaacaga
601 acaattactt aatagaaaaa ttatatcttc ctcgaaacga tttcctgctt ccaacatcta
661 cgtatatcaa gaagcattca cttaccatga cacagcttca gatttcatta ttgctgacag
721 ctactatatc actactccat ctagtagtgg ccacgcccta tgaggcatat cctatcggaa
781 aacaataccc cccagtggca agagtcaatg aatcgtttac atttcaaatt tccaatgata
841 cctataaatc gtctgtagac aagacagctc aaataacata caattgcttc gacttaccga
901 gctggctttc gtttgactct agttctagaa cgttctcagg tgaaccttct tctgacttac
961 tatctgatgc gaacaccacg ttgtatttca atgtaatact cgagggtacg gactctgccg
1021 acagcacgtc tttgaacaat acataccaat ttgttgttac aaaccgtcca tccatctcgc
1081 tatcgtcaga tttcaatcta ttggcgttgt taaaaaacta tggttatact aacggcaaaa
1141 acgctctgaa actagatcct aatgaagtct tcaacgtgac ttttgaccgt tcaatgttca
1201 ctaacgaaga atccattgtg tcgtattacg gacgttctca gttgtataat gcgccgttac
1261 ccaattggct gttcttcgat tctggcgagt tgaagtttac tgggacggca ccggtgataa
1321 actcggcgat tgctccagaa acaagctaca gttttgtcat catcgctaca gacattgaag
1381 gattttctgc cgttgaggta gaattcgaat tagtcatcgg ggctcaccag ttaactacct
1441 ctattcaaaa tagtttgata atcaacgtta ctgacacagg taacgtttca tatgacttac
1501 ctctaaacta tgtttatctc gatgacgatc ctatttcttc tgataaattg ggttctataa
1561 acttattgga tgctccagac tgggtggcat tagataatgc taccatttcc gggtctgtcc
1621 cagatgaatt actcggtaag aactccaatc ctgccaattt ttctgtgtcc atttatgata
1681 cttatggtga tgtgatttat ttcaacttcg aagttgtctc cacaacggat ttgtttgcca
1741 ttagttctct tcccaatatt aacgctacaa ggggtgaatg gttctcctac tattttttgc
1801 cttctcagtt tacagactac gtgaatacaa acgtttcatt agagtttact aattcaagcc
1861 aagaccatga ctgggtgaaa ttccaatcat ctaatttaac attagctgga gaagtgccca
1921 agaatttcga caagctttca ttaggtttga aagcgaacca aggttcacaa tctcaagagc
1981 tatattttaa catcattggc atggattcaa agataactca ctcaaaccac agtgcgaatg
2041 caacgtccac aagaagttct caccactcca cctcaacaag ttcttacaca tcttctactt
2101 acactgcaaa aatttcttct acctccgctg ctgctacttc ttctgctcca gcagcgctgc
2161 cagcagccaa taaaacttca tctcacaata aaaaagcagt agcaattgcg tgcggtgttg
2221 ctatcccatt aggcgttatc ctagtagctc tcatttgctt cctaatattc tggagacgca
2281 gaagggaaaa tccagacgat gaaaacttac cgcatgctat tagtggacct gatttgaata
2341 atcctgcaaa taaaccaaat caagaaaacg ctacaccttt gaacaacccc tttgatgatg
2401 atgcttcctc gtacgatgat acttcaatag caagaagatt ggctgctttg aacactttga
2461 aattggataa ccactctgcc actgaatctg atatttccag cgtggatgaa aagagagatt
2521 ctctatcagg tatgaataca tacaatgatc agttccaatc ccaaagtaaa gaagaattat
2581 tagcaaaacc cccagtacag cctccagaga gcccgttctt tgacccacag aataggtctt
2641 cttctgtgta tatggatagt gaaccagcag taaataaatc ctggcgatat actggcaacc
2701 tgtcaccagt ctctgatatt gtcagagaca gttacggatc acaaaaaact gttgatacag
2761 aaaaactttt cgatttagaa gcaccagaga aggaaaaacg tacgtcaagg gatgtcacta
2821 tgtcttcact ggacccttgg aacagcaata ttagcccttc tcccgtaaga aaatcagtaa
2881 caccatcacc atataacgta acgaagcatc gtaaccgcca cttacaaaat attcaagact
2941 ctcaaagcgg taaaaacgga atcactccca caacaatgtc aacttcatct tctgacgatt
3001 ttgttccggt taaagatggt gaaaattttt gctgggtcca tagcatggaa ccagacagaa
3061 gaccaagtaa gaaaaggtta gtagattttt caaataagag taatgtcaat gttggtcaag
3121 ttaaggacat tcacggacgc atcccagaaa tgctgtgatt atacgcaacg atattttgct
3181 taattttatt ttcctgtttt attttttatt agtggtttac agatacccta tattttattt
3241 agtttttata cttagagaca tttaatttta attccattct tcaaatttca tttttgcact
3301 taaaacaaag atccaaaaat gctctcgccc tcttcatatt gagaatacac tccattcaaa
3361 attttgtcgt caccgctgat taatttttca ctaaactgat gaataatcaa aggccccacg
3421 tcagaaccga ctaaagaagt gagttttatt ttaggaggtt gaaaaccatt attgtctggt
3481 aaattttcat cttcttgaca tttaacccag tttgaatccc tttcaatttc tgctttttcc
3541 tccaaactat cgaccctcct gtttctgtcc aacttatgtc ctagttccaa ttcgatcgca
3601 ttaataactg cttcaaatgt tattgtgtca tcgttgactt taggtaattt ctccaaatgc
3661 ataatcaaac tatttaagga agatcggaat tcgtcgaaca cttcagtttc cgtaatgatc
3721 tgatcgtctt tatccacatg ttgtaattca ctaaaatcta aaacgtattt ttcaatgcat
3781 aaatcgttct ttttattaat aatgcagatg gaaaatctgt aaacgtgcgt taatttagaa
3841 agaacatcca gtataagttc ttctatatag tcaattaaag caggatgcct attaatggga
3901 acgaactgcg gcaagttgaa tgactggtaa gtagtgtagt cgaatgactg aggtgggtat
3961 acatttctat aaaataaaat caaattaatg tagcatttta agtataccct cagccacttc
4021 tctacccatc tattcataaa gctgacgcaa cgattactat tttttttttc ttcttggatc
4081 tcagtcgtcg caaaaacgta taccttcttt ttccgacctt ttttttagct ttctggaaaa
4141 gtttatatta gttaaacagg gtctagtctt agtgtgaaag ctagtggttt cgattgactg
4201 atattaagaa agtggaaatt aaattagtag tgtagacgta tatgcatatg tatttctcgc
4261 ctgtttatgt ttctacgtac ttttgattta tagcaagggg aaaagaaata catactattt
4321 tttggtaaag gtgaaagcat aatgtaaaag ctagaataaa atggacgaaa taaagagagg
4381 cttagttcat cttttttcca aaaagcaccc aatgataata actaaaatga aaaggatttg
4441 ccatctgtca gcaacatcag ttgtgtgagc aataataaaa tcatcacctc cgttgccttt
4501 agcgcgtttg tcgtttgtat cttccgtaat tttagtctta tcaatgggaa tcataaattt
4561 tccaatgaat tagcaatttc gtccaattct ttttgagctt cttcatattt gctttggaat
4621 tcttcgcact tcttttccca ttcatctctt tcttcttcca aagcaacgat ccttctaccc
4681 atttgctcag agttcaaatc ggcctctttc agtttatcca ttgcttcctt cagtttggct
4741 tcactgtctt ctagctgttg ttctagatcc tggtttttct tggtgtagtt ctcattatta
4801 gatctcaagt tattggagtc ttcagccaat tgctttgtat cagacaattg actctctaac
4861 ttctccactt cactgtcgag ttgctcgttt ttagcggaca aagatttaat ctcgttttct
4921 ttttcagtgt tagattgctc taattctttg agctgttctc tcagctcctc atatttttct
4981 tgccatgact cagattctaa ttttaagcta ttcaatttct ctttgatc
//"""
# GenBank format protein (aka GenPept) file from:
# http://www.molecularevolution.org/resources/fileformats/
gbk_example2 = \
"""LOCUS AAD51968 143 aa linear BCT 21-AUG-2001
DEFINITION transcriptional regulator RovA [Yersinia enterocolitica].
ACCESSION AAD51968
VERSION AAD51968.1 GI:5805369
DBSOURCE locus AF171097 accession AF171097.1
KEYWORDS .
SOURCE Yersinia enterocolitica
ORGANISM Yersinia enterocolitica
Bacteria; Proteobacteria; Gammaproteobacteria; Enterobacteriales;
Enterobacteriaceae; Yersinia.
REFERENCE 1 (residues 1 to 143)
AUTHORS Revell,P.A. and Miller,V.L.
TITLE A chromosomally encoded regulator is required for expression of the
Yersinia enterocolitica inv gene and for virulence
JOURNAL Mol. Microbiol. 35 (3), 677-685 (2000)
MEDLINE 20138369
PUBMED 10672189
REFERENCE 2 (residues 1 to 143)
AUTHORS Revell,P.A. and Miller,V.L.
TITLE Direct Submission
JOURNAL Submitted (22-JUL-1999) Molecular Microbiology, Washington
University School of Medicine, Campus Box 8230, 660 South Euclid,
St. Louis, MO 63110, USA
COMMENT Method: conceptual translation.
FEATURES Location/Qualifiers
source 1..143
/organism="Yersinia enterocolitica"
/mol_type="unassigned DNA"
/strain="JB580v"
/serotype="O:8"
/db_xref="taxon:630"
Protein 1..143
/product="transcriptional regulator RovA"
/name="regulates inv expression"
CDS 1..143
/gene="rovA"
/coded_by="AF171097.1:380..811"
/note="regulator of virulence"
/transl_table=11
ORIGIN
1 mestlgsdla rlvrvwrali dhrlkplelt qthwvtlhni nrlppeqsqi qlakaigieq
61 pslvrtldql eekglitrht candrrakri klteqsspii eqvdgvicst rkeilggisp
121 deiellsgli dklerniiql qsk
//
"""
embl_example="""ID X56734; SV 1; linear; mRNA; STD; PLN; 1859 BP.
XX
AC X56734; S46826;
XX
DT 12-SEP-1991 (Rel. 29, Created)
DT 25-NOV-2005 (Rel. 85, Last updated, Version 11)
XX
DE Trifolium repens mRNA for non-cyanogenic beta-glucosidase
XX
KW beta-glucosidase.
XX
OS Trifolium repens (white clover)
OC Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta;
OC Spermatophyta; Magnoliophyta; eudicotyledons; core eudicotyledons; rosids;
OC eurosids I; Fabales; Fabaceae; Papilionoideae; Trifolieae; Trifolium.
XX
RN [5]
RP 1-1859
RX PUBMED; 1907511.
RA Oxtoby E., Dunn M.A., Pancoro A., Hughes M.A.;
RT "Nucleotide and derived amino acid sequence of the cyanogenic
RT beta-glucosidase (linamarase) from white clover (Trifolium repens L.)";
RL Plant Mol. Biol. 17(2):209-219(1991).
XX
RN [6]
RP 1-1859
RA Hughes M.A.;
RT ;
RL Submitted (19-NOV-1990) to the EMBL/GenBank/DDBJ databases.
RL Hughes M.A., University of Newcastle Upon Tyne, Medical School, Newcastle
RL Upon Tyne, NE2 4HH, UK
XX
FH Key Location/Qualifiers
FH
FT source 1..1859
FT /organism="Trifolium repens"
FT /mol_type="mRNA"
FT /clone_lib="lambda gt10"
FT /clone="TRE361"
FT /tissue_type="leaves"
FT /db_xref="taxon:3899"
FT CDS 14..1495
FT /product="beta-glucosidase"
FT /EC_number="3.2.1.21"
FT /note="non-cyanogenic"
FT /db_xref="GOA:P26204"
FT /db_xref="InterPro:IPR001360"
FT /db_xref="InterPro:IPR013781"
FT /db_xref="UniProtKB/Swiss-Prot:P26204"
FT /protein_id="CAA40058.1"
FT /translation="MDFIVAIFALFVISSFTITSTNAVEASTLLDIGNLSRSSFPRGFI
FT FGAGSSAYQFEGAVNEGGRGPSIWDTFTHKYPEKIRDGSNADITVDQYHRYKEDVGIMK
FT DQNMDSYRFSISWPRILPKGKLSGGINHEGIKYYNNLINELLANGIQPFVTLFHWDLPQ
FT VLEDEYGGFLNSGVINDFRDYTDLCFKEFGDRVRYWSTLNEPWVFSNSGYALGTNAPGR
FT CSASNVAKPGDSGTGPYIVTHNQILAHAEAVHVYKTKYQAYQKGKIGITLVSNWLMPLD
FT DNSIPDIKAAERSLDFQFGLFMEQLTTGDYSKSMRRIVKNRLPKFSKFESSLVNGSFDF
FT IGINYYSSSYISNAPSHGNAKPSYSTNPMTNISFEKHGIPLGPRAASIWIYVYPYMFIQ
FT EDFEIFCYILKINITILQFSITENGMNEFNDATLPVEEALLNTYRIDYYYRHLYYIRSA
FT IRAGSNVKGFYAWSFLDCNEWFAGFTVRFGLNFVD"
FT mRNA 1..1859
FT /experiment="experimental evidence, no additional details
FT recorded"
XX
SQ Sequence 1859 BP; 609 A; 314 C; 355 G; 581 T; 0 other;
aaacaaacca aatatggatt ttattgtagc catatttgct ctgtttgtta ttagctcatt 60
cacaattact tccacaaatg cagttgaagc ttctactctt cttgacatag gtaacctgag 120
tcggagcagt tttcctcgtg gcttcatctt tggtgctgga tcttcagcat accaatttga 180
aggtgcagta aacgaaggcg gtagaggacc aagtatttgg gataccttca cccataaata 240
tccagaaaaa ataagggatg gaagcaatgc agacatcacg gttgaccaat atcaccgcta 300
caaggaagat gttgggatta tgaaggatca aaatatggat tcgtatagat tctcaatctc 360
ttggccaaga atactcccaa agggaaagtt gagcggaggc ataaatcacg aaggaatcaa 420
atattacaac aaccttatca acgaactatt ggctaacggt atacaaccat ttgtaactct 480
ttttcattgg gatcttcccc aagtcttaga agatgagtat ggtggtttct taaactccgg 540
tgtaataaat gattttcgag actatacgga tctttgcttc aaggaatttg gagatagagt 600
gaggtattgg agtactctaa atgagccatg ggtgtttagc aattctggat atgcactagg 660
aacaaatgca ccaggtcgat gttcggcctc caacgtggcc aagcctggtg attctggaac 720
aggaccttat atagttacac acaatcaaat tcttgctcat gcagaagctg tacatgtgta 780
taagactaaa taccaggcat atcaaaaggg aaagataggc ataacgttgg tatctaactg 840
gttaatgcca cttgatgata atagcatacc agatataaag gctgccgaga gatcacttga 900
cttccaattt ggattgttta tggaacaatt aacaacagga gattattcta agagcatgcg 960
gcgtatagtt aaaaaccgat tacctaagtt ctcaaaattc gaatcaagcc tagtgaatgg 1020
ttcatttgat tttattggta taaactatta ctcttctagt tatattagca atgccccttc 1080
acatggcaat gccaaaccca gttactcaac aaatcctatg accaatattt catttgaaaa 1140
acatgggata cccttaggtc caagggctgc ttcaatttgg atatatgttt atccatatat 1200
gtttatccaa gaggacttcg agatcttttg ttacatatta aaaataaata taacaatcct 1260
gcaattttca atcactgaaa atggtatgaa tgaattcaac gatgcaacac ttccagtaga 1320
agaagctctt ttgaatactt acagaattga ttactattac cgtcacttat actacattcg 1380
ttctgcaatc agggctggct caaatgtgaa gggtttttac gcatggtcat ttttggactg 1440
taatgaatgg tttgcaggct ttactgttcg ttttggatta aactttgtag attagaaaga 1500
tggattaaaa aggtacccta agctttctgc ccaatggtac aagaactttc tcaaaagaaa 1560
ctagctagta ttattaaaag aactttgtag tagattacag tacatcgttt gaagttgagt 1620
tggtgcacct aattaaataa aagaggttac tcttaacata tttttaggcc attcgttgtg 1680
aagttgttag gctgttattt ctattatact atgttgtagt aataagtgca ttgttgtacc 1740
agaagctatg atcataacta taggttgatc cttcatgtat cagtttgatg ttgagaatac 1800
tttgaattaa aagtcttttt ttattttttt aaaaaaaaaa aaaaaaaaaa aaaaaaaaa 1859
//
"""
print "GenBank CDS Iteration"
print "====================="
g = GenBankScanner()
for record in g.parse_cds_features(StringIO(gbk_example)):
print record
g = GenBankScanner()
for record in g.parse_cds_features(StringIO(gbk_example2),
tags2id=('gene','locus_tag','product')):
print record
g = GenBankScanner()
for record in g.parse_cds_features(StringIO(gbk_example + "\n" + gbk_example2),
tags2id=('gene','locus_tag','product')):
print record
print
print "GenBank Iteration"
print "================="
g = GenBankScanner()
for record in g.parse_records(StringIO(gbk_example),do_features=False):
print record.id, record.name, record.description
print record.seq
g = GenBankScanner()
for record in g.parse_records(StringIO(gbk_example),do_features=True):
print record.id, record.name, record.description
print record.seq
g = GenBankScanner()
for record in g.parse_records(StringIO(gbk_example2),do_features=False):
print record.id, record.name, record.description
print record.seq
g = GenBankScanner()
for record in g.parse_records(StringIO(gbk_example2),do_features=True):
print record.id, record.name, record.description
print record.seq
print
print "EMBL CDS Iteration"
print "=================="
e = EmblScanner()
for record in e.parse_cds_features(StringIO(embl_example)):
print record
print
print "EMBL Iteration"
print "=============="
e = EmblScanner()
for record in e.parse_records(StringIO(embl_example),do_features=True):
print record.id, record.name, record.description
print record.seq<|fim▁end|> | def find_start(self): |
<|file_name|>events.rs<|end_file_name|><|fim▁begin|>#[macro_use(with_assets)]
extern crate Lattice;
use Lattice::window::{Window};
use Lattice::view::{View, Text};
use std::rc::Rc;
use std::cell::{RefCell,Cell};
use std::sync::Mutex;
#[macro_use]
extern crate lazy_static;
lazy_static! {<|fim▁hole|>}
fn main() {
let mut w = Window::new("Premadeath").set_fullscreen(true);
with_assets!(w);
w.start(|events| {
let mut v = View::new();
let lh = left_hovered.lock().unwrap();
let tc = text_clicked.lock().unwrap();
v.append(Text::new("assets/Macondo-Regular.ttf", "hover text")
.shadow((if lh.get() {[-3,-3,3,3]} else {[0,0,0,0]}),
(if lh.get() {[0.8,0.8,0.8,0.8]} else {[0.0, 0.0, 0.0, 0.0]}))
.hovered(move |e| {
let lh = left_hovered.lock().unwrap().set(true);
})
.color([0.4, 0.4, 1.0, 1.0])
.scale(2.0, "em")
.width(25.0, "%")
.translate_x(150.0, "px")
.translate_y(150.0, "px"));
lh.set(false);
v.append(Text::new("assets/Macondo-Regular.ttf", "click text")
.shadow((if tc.get() {[-3,-3,3,3]} else {[0,0,0,0]}),
(if tc.get() {[0.8,0.8,0.8,1.0]} else {[0.0,0.0,0.0,0.0]}))
.clicked(move |e| {
let tc = text_clicked.lock().unwrap();
tc.set(true);
})
.color([1.0, 0.4, 0.4, 1.0])
.scale(3.0, "em")
.width(40.0, "%")
.align("right")
.translate_x(50.0, "%")
.translate_y(30.0, "%"));
v
});
}<|fim▁end|> | static ref text_clicked: Mutex<Cell<bool>> = Mutex::new(Cell::new(false));
static ref left_hovered: Mutex<Cell<bool>> = Mutex::new(Cell::new(false)); |
<|file_name|>0020_annotation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-13 03:20
from __future__ import unicode_literals
import django.contrib.postgres.fields.ranges
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('climate_data', '0019_auto_20170613_0241'),
]
<|fim▁hole|> operations = [
migrations.CreateModel(
name='Annotation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)),
('time_range', django.contrib.postgres.fields.ranges.DateTimeRangeField()),
('comment', models.TextField()),
('sensor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='climate_data.Sensor')),
('station', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='climate_data.Station')),
],
),
]<|fim▁end|> | |
<|file_name|>spellbook.js<|end_file_name|><|fim▁begin|>/* Spellbook Class Extension */
if (!Array.prototype.remove) {
Array.prototype.remove = function (obj) {
var self = this;
if (typeof obj !== "object" && !obj instanceof Array) {
obj = [obj];
}
return self.filter(function(e){
if(obj.indexOf(e)<0) {
return e
}
});
};
}
if (!Array.prototype.clear) {
Array.prototype.clear = function() {
this.splice(0, this.length);
};
}
if (!Array.prototype.random) {
Array.prototype.random = function() {
self = this;
var index = Math.floor(Math.random() * (this.length));
return self[index];
};
}
if (!Array.prototype.shuffle) {
Array.prototype.shuffle = function() {
var input = this;
for (var i = input.length-1; i >=0; i--) {
var randomIndex = Math.floor(Math.random()*(i+1));
var itemAtIndex = input[randomIndex];
input[randomIndex] = input[i];
input[i] = itemAtIndex;
}
return input;
}<|fim▁hole|>}
if (!Array.prototype.first) {
Array.prototype.first = function() {
return this[0];
}
}
if (!Array.prototype.last) {
Array.prototype.last = function() {
return this[this.length - 1];
}
}
if (!Array.prototype.inArray) {
Array.prototype.inArray = function (value) {
return !!~this.indexOf(value);
};
}
if (!Array.prototype.contains) {
Array.prototype.contains = function (value) {
return !!~this.indexOf(value);
};
}
if (!Array.prototype.each) {
Array.prototype.each = function (interval, callback, response) {
var self = this;
var i = 0;
if (typeof interval !== "function" ) {
var inter = setInterval(function () {
callback(self[i], i);
i++;
if (i === self.length) {
clearInterval(inter);
if (typeof response === "function") response();
}
}, interval);
} else {
for (var i = 0; i < self.length; i++) {
interval(self[i], i);
if (typeof callback === "function") {
if (i === self.length - 1) callback();
}
}
}
}
}
if (!Array.prototype.eachEnd) {
Array.prototype.eachEnd = function (callback, response) {
var self = this;
var i = 0;
var done = function () {
if (i < self.length -1) {
i++;
callback(self[i], i, done);
} else {
if (typeof response === 'function') {
response();
}
}
}
callback(self[i], i, done);
}
}
if (!Object.prototype.extend) {
Object.prototype.extend = function(obj) {
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
this[i] = obj[i];
};
};
};
}
if (!Object.prototype.remove) {
Object.prototype.remove = function(keys) {
var self = this;
if (typeof obj === "object" && obj instanceof Array) {
arr.forEach(function(key){
delete(self[key]);
});
} else {
delete(self[keys]);
};
};
}
if (!Object.prototype.getKeys) {
Object.prototype.getKeys = function(keys) {
var self = this;
if (typeof obj === "object" && obj instanceof Array) {
var obj = {};
keys.forEach(function(key){
obj[key] = self[key];
});
} else {
obj[keys] = self[keys];
}
return obj;
};
}
if (!String.prototype.repeatify) {
String.prototype.repeatify = function(num) {
var strArray = [];
for (var i = 0; i < num; i++) {
strArray.push(this.normalize());
}
return strArray;
};
}
if (!Number.prototype.times) {
Number.prototype.times = function (callback) {
if (this % 1 === 0)
for (var i = 0; i < this; i++) {
callback()
}
};
}
if (!Number.prototype.isInteger) {
Number.prototype.isInteger = function () {
this.isInteger = function (num) {
return num % 1 === 0;
}
}
}
if (!Array.prototype.isArray) {
this.isArray = function () {
return typeof this === "object" && this instanceof Array;
};
}
if (!Function.prototype.isFunction) {
this.isFunction = function () {
return typeof this === 'function';
};
}
if (!Object.prototype.isObject) {
this.isObject = function () {
return typeof this === "object" && (isArray(this) === false );
};
}
if (!String.prototype.isString) {
this.isString = function () {
return typeof this === "string" || this instanceof String;
};
}
if (!Boolean.prototype.isBoolean) {
this.isBoolean = function () {
return typeof this === "boolean";
};
}
/* Spellbook Utils */
var Spellbook = function () {
this.test = function () {
return "Testing Spellbook";
};
this.range = function(a, b, step) {
var A= [];
if(typeof a == 'number'){
A[0]= a;
step = step || 1;
while(a+step<= b) {
A[A.length]= a+= step;
}
} else {
var s = 'abcdefghijklmnopqrstuvwxyz';
if(a=== a.toUpperCase()) {
b=b.toUpperCase();
s= s.toUpperCase();
}
s= s.substring(s.indexOf(a), s.indexOf(b)+ 1);
A= s.split('');
}
return A;
};
this.isFunction = function (fn) {
return typeof fn === 'function';
};
this.isArray = function (obj) {
return typeof obj === "object" && obj instanceof Array;
};
this.isObject = function (obj) {
return typeof obj === "object" && (isArray(obj) === false );
};
this.isNumber = function (obj) {
return typeof obj === "number" || obj instanceof Number;
};
this.isString = function (obj ) {
return typeof obj === "string" || obj instanceof String;
};
this.isBoolean = function (obj) {
return typeof obj === "boolean";
};
this.isInteger = function (obj) {
return obj % 1 === 0;
}
this.random = function (min, max) {
if (typeof min === "number" && typeof max === "number") {
return Math.floor(Math.random() * (max - min)) + min;
} else {
return 0;
}
};
this.clone = function (obj) {
if(obj === null || typeof(obj) !== 'object' || 'isActiveClone' in obj)
return obj;
var temp = obj.constructor();
for(var key in obj) {
if(Object.prototype.hasOwnProperty.call(obj, key)) {
obj['isActiveClone'] = null;
temp[key] = clone(obj[key]);
delete obj['isActiveClone'];
}
}
return temp;
};
this.assign = function (obj) {
return this.clone(obj);
};
this.remove = function (array, obj) {
if (typeof obj !== "object" && !obj instanceof Array) {
obj = [obj];
}
return array.filter(function(e){
if(obj.indexOf(e)<0) {
return e
}
});
};
this.clear = function (array) {
array.splice(0, array.length);
};
this.inArray = function (a, b) {
return !!~a.indexOf(b);
};
this.contains = function (a, b) {
return !!~a.indexOf(b);
};
this.times = function (number, callback) {
if (typeof number === 'number' && number > 0) {
if ( typeof callback === 'function') {
for (var i = 0; i < number; i++) {
callback();
}
}
}
};
this.each = function (array, interval, callback, response) {
var i = 0;
if (typeof interval !== "function" ) {
var inter = setInterval(function () {
callback(array[i], i);
i++;
if (i === array.length) {
clearInterval(inter);
if (typeof response === "function") response();
}
}, interval);
} else {
for (var i = 0; i < array.length; i++) {
interval(array[i], i);
if (typeof callback === "function") {
if (i === array.length - 1) callback();
}
}
}
}
this.eachEnd = function (array, callback, response) {
var i = 0;
var done = function () {
if (i < array.length -1) {
i++;
callback(array[i], i, done);
} else {
if (typeof response === 'function') {
response();
}
}
}
callback(array[i], i, done);
}
this.checkDate = function (value, userFormat) {
userFormat = userFormat || 'mm/dd/yyyy';
var delimiter = /[^mdy]/.exec(userFormat)[0];
var theFormat = userFormat.split(delimiter);
var theDate = value.split(delimiter);
function isDate(date, format) {
var m, d, y, i = 0, len = format.length, f;
for (i; i < len; i++) {
f = format[i];
if (/m/.test(f)) m = date[i];
if (/d/.test(f)) d = date[i];
if (/y/.test(f)) y = date[i];
}
return (
m > 0 && m < 13 &&
y && y.length === 4 &&
d > 0 &&
d <= (new Date(y, m, 0)).getDate()
);
};
return isDate(theDate, theFormat);
};
this.excerpt = function (str, nwords) {
var words = str.split(' ');
words.splice(nwords, words.length-1);
return words.join(' ');
}
};
if (typeof process === 'object') {
module.exports = new Spellbook;
} else {
Spellbook.prototype.get = function (url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', encodeURI(url));
xhr.onload = function() {
if (xhr.status === 200) {
callback(false, xhr.responseText);
} else {
callback("Request failed. Returned status of " + status);
}
};
xhr.send();
}
Spellbook.prototype.post = function (url, data, header, callback) {
function param(object) {
var encodedString = '';
for (var prop in object) {
if (object.hasOwnProperty(prop)) {
if (encodedString.length > 0) {
encodedString += '&';
}
encodedString += encodeURI(prop + '=' + object[prop]);
}
}
return encodedString;
}
if (typeof header === "function") {
callback = header;
header = "application/json";
var finaldata = JSON.stringify(data);
} else {
var finaldata = param(data);
}
xhr = new XMLHttpRequest();
xhr.open('POST', encodeURI(url));
xhr.setRequestHeader('Content-Type', header);
xhr.onload = function() {
if (xhr.status === 200 && xhr.responseText !== undefined) {
callback(null, xhr.responseText);
} else if (xhr.status !== 200) {
callback('Request failed. Returned status of ' + xhr.status);
}
};
xhr.send(finaldata);
}
var sb = new Spellbook();
}<|fim▁end|> | |
<|file_name|>panel.py<|end_file_name|><|fim▁begin|># Copyright 2015 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁hole|>#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from django.utils.translation import ugettext_lazy as _
import horizon
class AlarmsVitrage(horizon.Panel):
name = _("Alarms")
slug = "vitragealarms"<|fim▁end|> | # You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>logdata.py<|end_file_name|><|fim▁begin|>import RPi.GPIO as GPIO
import os
import time
import datetime
import glob
import MySQLdb
from time import strftime
import serial
ser = serial.Serial(
port='/dev/ttyACM0',
baudrate = 9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
counter = 0
GPIO.setmode(GPIO.BOARD)
GPIO.setup(15,GPIO.IN)
# Variables for MySQL
db = MySQLdb.connect(host="localhost", user="root",passwd="deb280794", db="temp_database")
cur = db.cursor()
while True:
x = ser.readline()<|fim▁hole|> moisture = f[1]
humidity = f[4]
temp = f[7]
print("Moisture: ")
print moisture
print("Humidity: ")
print humidity
print("Temperature: ")
print temp
datetimeWrite = (time.strftime("%Y-%m-%d ") + time.strftime("%H:%M:%S"))
sql = ("""INSERT INTO tempLog (datetime,temperature,humidity,moisture) VALUES (%s,%s,%s,%s)""",(datetimeWrite,temp,humidity,moisture))
try:
print "Writing to database..."
# Execute the SQL command
cur.execute(*sql)
# Commit your changes in the database
db.commit()
print "Write Complete"
except:
# Rollback in case there is any error
db.rollback()
print "Failed writing to database"
time.sleep(0.5)<|fim▁end|> | f=x.split() |
<|file_name|>Person.java<|end_file_name|><|fim▁begin|>package app.intelehealth.client.models.pushRequestApiCall;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class Person {
@SerializedName("uuid")
@Expose
private String uuid;
@SerializedName("gender")
@Expose
private String gender;
@SerializedName("names")
@Expose
private List<Name> names = null;
@SerializedName("birthdate")
@Expose
private String birthdate;
@SerializedName("attributes")
@Expose
private List<Attribute> attributes = null;
@SerializedName("addresses")
@Expose
private List<Address> addresses = null;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public List<Name> getNames() {
return names;
}
public void setNames(List<Name> names) {
this.names = names;
}
public String getBirthdate() {<|fim▁hole|> }
public void setBirthdate(String birthdate) {
this.birthdate = birthdate;
}
public List<Attribute> getAttributes() {
return attributes;
}
public void setAttributes(List<Attribute> attributes) {
this.attributes = attributes;
}
public List<Address> getAddresses() {
return addresses;
}
public void setAddresses(List<Address> addresses) {
this.addresses = addresses;
}
}<|fim▁end|> | return birthdate; |
<|file_name|>routes.ts<|end_file_name|><|fim▁begin|>import { Routes } from '@angular/router';
import { BookExistsGuard } from './guards/book-exists';
import { FindBookPageComponent } from './containers/find-book-page';
import { ViewBookPageComponent } from './containers/view-book-page';
import { CollectionPageComponent } from './containers/collection-page';
import { StatsComponent } from './components/stats.component';
import { NotFoundPageComponent } from './containers/not-found-page';
export const routes: Routes = [
{
path: '',
component: CollectionPageComponent
},
{<|fim▁hole|> path: 'stats',
component: StatsComponent,
},
{
path: 'book/find',
component: FindBookPageComponent
},
{
path: 'book/:id',
canActivate: [ BookExistsGuard ],
component: ViewBookPageComponent
},
{
path: '**',
component: NotFoundPageComponent
}
];<|fim▁end|> | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var q = require('q');
var _ = require('lodash');
var moment = require('moment');
var trello = require('../libs/trello_client');
var ORGANIZATIONS = [
{ id: '4ffb85c372c8548a030144e5', name: 'HuaJiao' },
{ id: '4ffb861572c8548a03015a66', name: 'Asimov' },
{ id: '544765a39570e08b7e6aeccb', name: 'NextTao' },
];
var NEXTTAO = { id: '544765a39570e08b7e6aeccb', name: 'NextTao' };
var SCRUM_NAMES = [ 'Features', 'Bugs', 'Upcoming', 'Today', 'Re-Open', 'Close', ];
function _mapListIds(lists) {
return _.reduce(lists, function (memo, next) {
memo[next.name] = next.id;
return memo;
}, {});
}
function _summarizeBoard(brd) {
var d = q.defer();
q
.all([trello.getCardsOfBoard(brd.id), trello.getListsOfBoard(brd.id)])
.spread(function (cards, lists) {
var aggregated = _.groupBy(cards, 'idList');
var mapping = _mapListIds(lists);
var result = _.map(SCRUM_NAMES, function (name) {
var listId = mapping[name];
var cards = aggregated[listId];
if (cards) {
return name + ": " + cards.length;
} else {
return name + ": 0";
}
});
d.resolve('# ' + brd.name + '\n' + result.join(', '))
})
.fail(function (error) {
d.reject(error);
})
.done();
return d.promise;
}
function _summarizeOrg(org, msg) {
trello.getOpenBoardsOfOrg(org.id)
.then(function (boards) {
var results = _.map(boards, function (brd) {
return _summarizeBoard(brd);
})
return q.all(results);
})
.then(function (results) {
msg.send([
org.name,
'----------------',
results.join('\n'),
].join('\n'));
})
.fail(function (error) {
console.log(error);
})
.done();
}
function _weeklyBoard(board) {
var d = q.defer();
trello.activeCards(board.id, -7)
.then(function (cards) {
var text = [
board.name,
'----------------',
_.map(cards, function (c) {
return [ c.list.name, c.name, c.updated ].join(' ');
}).join('\n')
].join('\n');
d.resolve(text);
})
.fail()
.done();
return d.promise;
}
function _weeklyOrg(org, msg) {
trello.getOpenBoardsOfOrg(org.id)
.then(function (boards) {
var results = _.map(boards, function (brd) {
return _weeklyBoard(brd);
})
<|fim▁hole|> _.each(results, function (r) {
msg.send(r);
})
})
.fail()
.done();
}
module.exports = {
summary: function (msg) {
_.each(ORGANIZATIONS, function (org) {
_summarizeOrg(org, msg);
});
},
weekly: function (msg) {
msg.send('// working on the weekly report of ' + NEXTTAO.name);
_weeklyOrg(NEXTTAO, msg);
}
};<|fim▁end|> | return q.all(results);
})
.then(function (results) { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
# from __future__ import unicode_literals
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
def readme():
"Falls back to just file().read() on any error, because the conversion to rst is only really relevant when uploading the package to pypi"
from subprocess import CalledProcessError
try:
from subprocess import check_output
return check_output(['pandoc', '--from', 'markdown', '--to', 'rst', 'README.md']).decode('utf-8')
except (ImportError, OSError, CalledProcessError) as error:
print('pandoc is required to get the description as rst (as required to get nice rendering in pypi) - using the original markdown instead.',
'See http://johnmacfarlane.net/pandoc/')
return open(path.join(here, 'README.md')).read().decode('utf-8')
setup(
name='simplesuper',
description='Simpler way to call super methods without all the repetition',
long_description=readme(),<|fim▁hole|> "Topic :: Software Development",
"Topic :: Utilities",
"Intended Audience :: Developers",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: ISC License (ISCL)",
],
author='Martin Häcker, Robert Buchholz, Felix Schwarz',
author_email='[email protected], [email protected], [email protected]',
license="ISC",
url='https://github.com/dwt/simplesuper',
keywords='python 2, super, convenience, api',
py_modules=['simplesuper'],
test_suite = "simplesuper",
)<|fim▁end|> | version='1.0.9',
classifiers=[
"Programming Language :: Python :: 2", |
<|file_name|>specification.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details. You should have received a copy of the
# GNU General Public License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
# source code or documentation are not subject to the GNU General Public<|fim▁hole|># Red Hat, Inc.
#
# Red Hat Author(s): Chris Lumens <[email protected]>
#
from blivet.util import stringize, unicodeize
from pykickstart.constants import AUTOPART_TYPE_PLAIN, AUTOPART_TYPE_BTRFS, AUTOPART_TYPE_LVM, \
AUTOPART_TYPE_LVM_THINP
class PartSpec(object):
def __init__(self, mountpoint=None, fstype=None, size=None, max_size=None,
grow=False, btr=False, lv=False, thin=False, weight=0,
required_space=0, encrypted=False, schemes=None):
""" Create a new storage specification. These are used to specify
the default partitioning layout as an object before we have the
storage system up and running. The attributes are obvious
except for the following:
btr -- Should this be allocated as a btrfs subvolume? If not,
it will be allocated as a partition.
lv -- Should this be allocated as a logical volume? If not,
it will be allocated as a partition.
thin -- Should this be allocated as a thin logical volume if it is
being allocated as a logical volume?
weight -- An integer that modifies the sort algorithm for partition
requests. A larger value means the partition will end up
closer to the front of the disk. This is mainly used to
make sure /boot ends up in front, and any special (PReP,
appleboot, etc.) partitions end up in front of /boot.
This value means nothing unless lv and btr are both False.
required_space -- This value is only taken into account if
lv=True, and specifies the size in MiB that the
containing VG must be for this PartSpec to even
get used. The VG's size is calculated before any
other LVs are created inside it. If not enough
space exists, this PartSpec will never get turned
into an LV.
encrypted -- Should this request be encrypted? For logical volume
requests, this is satisfied if the PVs are encrypted
as in the case of encrypted LVM autopart.
schemes -- Create the mount point only for specific schemes if any.
"""
self.mountpoint = mountpoint
self.fstype = fstype
self.size = size
self.max_size = max_size
self.grow = grow
self.lv = lv
self.btr = btr
self.thin = thin
self.weight = weight
self.required_space = required_space
self.encrypted = encrypted
self.schemes = schemes or set()
# Force str and unicode types in case any of the properties are unicode
def _to_string(self):
s = ("%(type)s instance (%(id)s) -- \n"
" mountpoint = %(mountpoint)s lv = %(lv)s"
" thin = %(thin)s btrfs = %(btrfs)s\n"
" weight = %(weight)s fstype = %(fstype)s encrypted = %(enc)s\n"
" size = %(size)s max_size = %(max_size)s grow = %(grow)s\n" %
{"type": self.__class__.__name__, "id": "%#x" % id(self),
"mountpoint": self.mountpoint, "lv": self.lv, "btrfs": self.btr,
"weight": self.weight, "fstype": self.fstype, "size": self.size,
"enc": self.encrypted, "max_size": self.max_size, "grow": self.grow,
"thin": self.thin})
return s
def is_partition(self, scheme):
"""Is the specified device a partition in the given scheme?
:param scheme: a partitioning scheme
:return: True or False
"""
return not self.is_volume(scheme)
def is_volume(self, scheme):
"""Is the specified device a volume in the given scheme?
:param scheme: a partitioning scheme
:return: True or False
"""
if scheme == AUTOPART_TYPE_PLAIN:
return False
return self.is_lvm_volume(scheme) or self.is_btrfs_subvolume(scheme)
def is_lvm_volume(self, scheme):
"""Is the specified device an LVM volume in the given scheme?
:param scheme: a partitioning scheme
:return: True or False
"""
return scheme in (AUTOPART_TYPE_LVM, AUTOPART_TYPE_LVM_THINP) and self.lv
def is_lvm_thin_volume(self, scheme):
"""Is the specified device an LVM thin volume in the given scheme?
:param scheme: a partitioning scheme
:return: True or False
"""
if not self.is_lvm_volume(scheme):
return False
return scheme == AUTOPART_TYPE_LVM_THINP and self.thin
def is_btrfs_subvolume(self, scheme):
"""Is the specified device a Btrfs subvolume in the given scheme?
:param scheme: a partitioning scheme
:return: True or False
"""
return scheme == AUTOPART_TYPE_BTRFS and self.btr
def __str__(self):
return stringize(self._to_string())
def __unicode__(self):
return unicodeize(self._to_string())
def __eq__(self, other):
return isinstance(other, PartSpec) and vars(self) == vars(other)<|fim▁end|> | # License and may only be used or replicated with the express permission of |
<|file_name|>detailsEventCtrl.js<|end_file_name|><|fim▁begin|>angular.module('app.controllers')
.controller('detailsEventCtrl', ['$stateParams', '$window', '$http','eventService','personService','commentService','participantService', '$state', '$filter', '$ionicPopup', 'reviewService',// The following is the constructor function for this page's controller. See https://docs.angularjs.org/guide/controller
// You can include any angular dependencies as parameters for this function
// TIP: Access Route Parameters for your page via $stateParams.parameterName
function ($stateParams, $window, $http, eventService,personService,commentService,participantService, $state, $filter, $ionicPopup, reviewService) {
var vm = this;
vm.data = {};
vm.event;
vm.isRegister;
vm.dateOfDay;
vm.connectedUser;
vm.isLogged;
vm.ListCommentResponse = [];
vm.registerUserToEvent = registerUserToEvent;
vm.unregisterUserToEvent = unregisterUserToEvent;
vm.getCommentMargin = getCommentMargin;
vm.cancelEvent = cancelEvent;
vm.detailsParticipant = detailsParticipant;
vm.swipeOnImage = swipeOnImage;
vm.formatDate = formatDate;
vm.displayRateForm = displayRateForm;
vm.hideRateForm = hideRateForm;
vm.noteEvent = noteEvent;
vm.openPopup = openPopup;
vm.registerComment = registerComment;
vm.showResponse = showResponse;
vm.imageToDisplay = "";
vm.getGoogleImage = getGoogleImage;
vm.images = {};
activate();
function activate(){
vm.dateOfDay = $filter('date')(new Date(), 'yyyy-MM-dd HH:mm');
if (personService.getConnectedUser() == null){
vm.connectedUser = -1;
vm.isLogged = "false"
} else {
vm.connectedUser = personService.getConnectedUser().PersonId;
vm.isLogged = "true"
}
vm.event = eventService.getEvent();
var rng = Math.random();
if(rng < 0.4){
vm.imageToDisplay = "grosChat.jpg";
} else if(rng < 0.8) {
vm.imageToDisplay = "chaton.jpg";
} else if (rng < 0.98){
vm.imageToDisplay = "defaultUser2.jpg";
} else {
vm.imageToDisplay = "d74c8cec9490f925a191d4f677fb37ae.jpg"
}
commentService.getCommentByEvent(vm.event.EventId)
.then(function successCallback(response) {
vm.ListComment = response.reverse();
console.log(response);
}, function erroCallabck(response) {
console.log("Il y a eu des erreurs!")
console.log(response);
});
participantService.getAllParticipantById(vm.event.EventId)
.then(function successCallback(response) {
console.log(response);
vm.ListParticipant = response;
vm.nbParticipants = vm.ListParticipant.length;
if (personService.getConnectedUser() == null){
vm.isRegister = "null";
}else {
var isRegister = "false";
for(i=0;i<vm.ListParticipant.length;i++){
if(vm.ListParticipant[i].PersonId == personService.getConnectedUser().PersonId){
isRegister = "true";
}
}
if (isRegister == "true"){
vm.isRegister = "true";
}else{
vm.isRegister = "false";
}
}
console.log("isRegister");
console.log(vm.isRegister);
}, function erroCallabck(response) {
console.log("Participant: Il y a eu des erreurs!")
console.log(response);
});
}
function registerUserToEvent () {
participantService.saveParticipant(personService.getResponseGoogle().idToken, personService.getConnectedUser().PersonId, eventService.getEvent().EventId)
.then(function(response){
vm.isRegister = "true";
})
}
function unregisterUserToEvent() {
participantService.cancelParticipation(personService.getResponseGoogle().idToken, personService.getConnectedUser().PersonId, eventService.getEvent().EventId)
.then(function(response){
vm.isRegister = "false";
})
}
function getCommentMargin(owner){
if (owner == null){
return "0%";
}else {
return "5%";
}
}
function cancelEvent() {
var responseGoogle = personService.getResponseGoogle();
var eventToSend = {
"EventId" : vm.event.EventId,
"Name" : vm.event.Name,
"DateStart" : vm.event.DateStart,
"DateEnd" : vm.event.DateEnd,
"PlaceId" : vm.event.PlaceId,
"Description": vm.event.Description,
"Image" : vm.event.Image,
"IsCanceled" : 1,
"Owner" : vm.event.Owner,
"EventType" : vm.event.EventType
};
eventService.registerEvent(responseGoogle.idToken,eventToSend);
alert('Votre évènement à bien été annulé');
}
function detailsParticipant(){
var div = document.getElementById("participantDiv");
if (div.style.display == 'none'){
div.style.display = 'block';
}else{
div.style.display = 'none';
}
}
function displayRateForm() {
document.getElementById("ratingForm").style.display = "block";
document.getElementById("beforeRate").style.display = "none";
}
function hideRateForm() {
document.getElementById("ratingForm").style.display = "none";
document.getElementById("beforeRate").style.display = "block";
}
function noteEvent() {
var note = document.getElementById("note").value;
var comment = document.getElementById("comment").value;
console.log(note);
console.log(comment);
var reviewToSend = {
"person" : personService.getConnectedUser().PersonId,
"event" : vm.event.EventId,
"rate" : note,
"text" : comment
};
reviewService.updateReview(personService.getResponseGoogle().idToken, reviewToSend )
.then(function(result){
vm.hideRateForm();
})
}
function registerComment(responseTo) {
if (responseTo == 'NULL'){
responseTo = null;
}
var commentToSend = {
"ResponseTo" : responseTo,
"Text" : document.getElementById("commentText").value,
"DatePost" : $filter('date')(new Date(), 'yyyy-MM-dd HH:mm'),
"EventId" : vm.event.EventId,
"PersonId" : personService.getConnectedUser().PersonId,
"Person" : personService.getConnectedUser()
};
commentService.registerComment(personService.getResponseGoogle().idToken, commentToSend )
.then(function(result){
commentService.getCommentByEvent(vm.event.EventId)
.then(function successCallback(response) {
vm.ListComment = response.reverse();
console.log(response);
}, function erroCallabck(response) {
console.log("Il y a eu des erreurs!")
console.log(response);
});
})
}
function swipeOnImage() {
/*var audio = new Audio('img/986.mp3');
audio.play();*/
}
function formatDate(date){
var dateOut = new Date(date);
return dateOut;
}
function getGoogleImage(email){
var res = personService.getGooglePicture(email)
.then(function(result){
if (!(email in vm.images)){
vm.images[email]=result;
}
return result;
})
.catch(function(error){console.log(error)});
return res;
}
function openPopup(responseTo, $event) {
var myPopup = $ionicPopup.show({
template: '<textarea id="commentText" rows="6" cols="150" maxlength="300" ng-model="data.model" ng-model="vm.data.comment" ></textarea>',
title: 'Commentaire',
subTitle: 'Les commentaires que vous rentrez doivent être assumés, ils ne pourront pas être effacés!',
buttons: [
{ text: 'Annuler' }, {
text: '<b>Commenter</b>',
type: 'button-positive',
onTap: function(e) {
if (!document.getElementById("commentText").value.trim()) {
e.preventDefault();
} else {
return document.getElementById("commentText").value;<|fim▁hole|> });
myPopup.then(function(res) {
if (res){
registerComment(responseTo);
}
});
$event.stopPropagation();
}
function showResponse(eventId, commentId, $event) {
if (vm.ListCommentResponse[commentId] == undefined || vm.ListCommentResponse[commentId].length == 0){
commentService.getResponseList(eventId, commentId)
.then(function(result){
vm.ListCommentResponse[commentId] = result.reverse();
})
$event.stopPropagation();
} else {
vm.ListCommentResponse[commentId] = [];
}
}
}])<|fim▁end|> | }
}
}
] |
<|file_name|>performance.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use actor::{Actor, ActorMessageStatus, ActorRegistry};
use protocol::JsonPacketStream;
use rustc_serialize::json;
use std::net::TcpStream;
pub struct PerformanceActor {
name: String,
}
#[derive(RustcEncodable)]<|fim▁hole|> withTicks: bool,
withAllocations: bool,
withJITOptimizations: bool,
}
#[derive(RustcEncodable)]
struct PerformanceTraits {
features: PerformanceFeatures,
}
#[derive(RustcEncodable)]
struct ConnectReply {
from: String,
traits: PerformanceTraits,
}
impl Actor for PerformanceActor {
fn name(&self) -> String {
self.name.clone()
}
fn handle_message(&self,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &json::Object,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
"connect" => {
let msg = ConnectReply {
from: self.name(),
traits: PerformanceTraits {
features: PerformanceFeatures {
withMarkers: true,
withMemory: true,
withTicks: true,
withAllocations: true,
withJITOptimizations: true,
},
},
};
stream.write_json_packet(&msg);
ActorMessageStatus::Processed
},
_ => ActorMessageStatus::Ignored,
})
}
}
impl PerformanceActor {
pub fn new(name: String) -> PerformanceActor {
PerformanceActor {
name: name,
}
}
}<|fim▁end|> | struct PerformanceFeatures {
withMarkers: bool,
withMemory: bool, |
<|file_name|>testsetXML2intermediateConverter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#===============================================================================
#
# conversion script to create a mbstestlib readable file containing test specifications
# out of an testset file in XML format
#
#===============================================================================
# Input can be given via optional command line parameters.
#
#
# TODO: add check for joint count
# TODO: add model description to output (as comment)
import sys # for io
import xml.dom.minidom # for xml parsing
from glob import glob # for expanding wildcards in cmd line arguements
class _config:
default_input_file = 'testset-example.xml'
output_file_ext = '.txt'
empty_vecn = ""
zero_vec = "0 0 0"
unity_mat = "1 0 0 0 1 0 0 0 1"
case_defaults = { 'delta': "0.001",
'base_r': zero_vec,
'base_R': unity_mat,
'base_v': zero_vec,
'base_omega': zero_vec,
'base_vdot': zero_vec,
'base_omegadot': zero_vec,
'gravitiy': zero_vec,
'joints_q': empty_vecn,
'joints_qdot': empty_vecn,
'joints_qdotdot': empty_vecn,
'joints_tau': empty_vecn,
'tcp_r': zero_vec,
'tcp_R': unity_mat,
'tcp_v': zero_vec,
'tcp_omega': zero_vec,
'tcp_vdot': zero_vec,
'tcp_omegadot': zero_vec,
'f_ext': zero_vec,
'n_ext': zero_vec
}
case_output_order = [
'delta',
'base_r',
'base_R',
'base_v',
'base_omega',
'base_vdot',
'base_omegadot',
'gravitiy',
'joints_q',
'joints_qdot',
'joints_qdotdot',
'joints_tau',
'tcp_r',
'tcp_R',
'tcp_v',
'tcp_omega',
'tcp_vdot',
'tcp_omegadot',
'f_ext',
'n_ext'
]
class _state:
error_occured_while_processing_xml = False
input_file = ''
def getText(nodelist):
# str(method.childNodes[0].nodeValue) # TODO: remove
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc)
# inspired by http://code.activestate.com/recipes/52306-to-sort-a-dictionary/
def sortedDict(adict):
return [ adict[k] for k in sorted(adict.keys()) ]
# parses a specific node and either stores it's value in a dict or the default value
# may set the error bit
def parse_opt(nodename, valuetype, current_case, current_case_value_dict):
# if the node does not exist use the default value
nodelist = current_case.getElementsByTagName(nodename)
if nodelist.length == 0:
current_case_value_dict.update({nodename : _config.case_defaults.get(nodename)})
elif nodelist.length > 1:
_state.error_occured_while_processing_xml = True
print("'" + nodename + "' defined more than once.")
return
else:
# we have one single node to parse
node = nodelist[0]
value = node.getAttribute(valuetype)
if value == None:
# TODO: more advanced checks with regexp
_state.error_occured_while_processing_xml = True
print("'" + nodename + "' has an empty value or wrong type ('"+ valuetype +"').")
return
else :
current_case_value_dict.update({nodename : value})
return
def convert_xml_testset_2_raw_testset(mbs_test_set):
raw_testsets = dict([]) # filename:content dict
for mbs in mbs_test_set.getElementsByTagName('mbs'): # for every file
file = mbs.getAttribute('file')
raw_testset = []
if mbs.getElementsByTagName('model').length != 1:
_state.error_occured_while_processing_xml = True
print("Only one model allowed per file!")
return dict([])
# extract model
raw_testset.append("% " + mbs.getElementsByTagName('model')[0].getAttribute('desc'))
raw_testset.append(getText(mbs.getElementsByTagName('model')[0].childNodes))
# insert separation marker
raw_testset.append("\nendmodel")
# now process the cases
if mbs.getElementsByTagName('case').length == 0:
_state.error_occured_while_processing_xml = True
print("No cases defined!")
return dict([])
cases = dict([])
for case in mbs.getElementsByTagName('case'):
# TODO: sanity check -> number collisions
# parse case
case_nr = case.getAttribute('nr')
case_desc = case.getAttribute('desc')
case_value_dict = dict([])
# everything but joints does not have to be defined explicitly
# TODO: unify these calls in a generic way (e.g. add type to case_output_order and iterate over it)
parse_opt('delta', 'scalar', case, case_value_dict)
parse_opt('base_r', 'vector3', case, case_value_dict)
parse_opt('base_R', 'matrix3x3', case, case_value_dict)
parse_opt('base_v', 'vector3', case, case_value_dict)<|fim▁hole|> parse_opt('base_omega', 'vector3', case, case_value_dict)
parse_opt('base_vdot', 'vector3', case, case_value_dict)
parse_opt('base_omegadot', 'vector3', case, case_value_dict)
parse_opt('gravitiy', 'vector3', case, case_value_dict)
# TODO: checks with n (the number of joints)
parse_opt('joints_q', 'vector_n', case, case_value_dict)
parse_opt('joints_qdot', 'vector_n', case, case_value_dict)
parse_opt('joints_qdotdot', 'vector_n', case, case_value_dict)
parse_opt('joints_tau', 'vector_n', case, case_value_dict)
parse_opt('tcp_r', 'vector3', case, case_value_dict)
parse_opt('tcp_R', 'matrix3x3', case, case_value_dict)
parse_opt('tcp_v', 'vector3', case, case_value_dict)
parse_opt('tcp_omega', 'vector3', case, case_value_dict)
parse_opt('tcp_vdot', 'vector3', case, case_value_dict)
parse_opt('tcp_omegadot', 'vector3', case, case_value_dict)
parse_opt('f_ext', 'vector3', case, case_value_dict)
parse_opt('n_ext', 'vector3', case, case_value_dict)
if _state.error_occured_while_processing_xml: return dict([])
# compile raw case output
case_content = ["\n" + case_desc]
for value_name in _config.case_output_order:
if case_value_dict.get(value_name) is None :
_state.error_occured_while_processing_xml = True
print("Not all values defined in one testcase!")
return dict([])
case_content.append(case_value_dict.get(value_name))
cases.update({case_nr : "\n".join(case_content)})
# flatten cases (and sort)
raw_testset.append("\n".join(sortedDict(cases)))
# update file:testset dict
raw_testsets.update({file : "\n".join(raw_testset)})
# return the dict of files:testsets
return raw_testsets
#===============================================================================
# process command line arguments (i.e. file i/o)
#===============================================================================
script_name = sys.argv[0][sys.argv[0].rfind("\\")+1:]
if len(sys.argv) == 1:
_state.input_file = _config.default_input_file
print("No command line arguments were given. Defaulting to:")
print("Input '" + _state.input_file + "'")
print("Usage hint: " + script_name + " [INPUTFILE(s)]\n")
elif len(sys.argv) == 2:
if sys.argv[1] == "--help":
print("Usage: " + script_name + " [INPUTFILE(s)]")
sys.exit()
else:
_state.input_file = glob(sys.argv[1])
#===============================================================================
# run the conversion
#===============================================================================
for inputfile in _state.input_file :
xmldom = xml.dom.minidom.parse(inputfile)
raw_testsets = convert_xml_testset_2_raw_testset(xmldom.firstChild)
if not _state.error_occured_while_processing_xml :
for k in raw_testsets.keys():
with open(k, 'w') as raw_testset_file:
raw_testset_file.write(raw_testsets.get(k))
print("File '" + k + "' written.")
#===============================================================================
# concluding housekeeping
#===============================================================================
if not _state.error_occured_while_processing_xml:
print("Conversion successful.")
else:
print("The xml file could not be processed properly. It most likely contains errors.")
sys.exit(_state.error_occured_while_processing_xml)<|fim▁end|> | |
<|file_name|>RAuditEventRecord.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010-2013 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evolveum.midpoint.repo.sql.data.audit;
import com.evolveum.midpoint.audit.api.AuditEventRecord;
import com.evolveum.midpoint.audit.api.AuditService;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.polystring.PolyString;
import com.evolveum.midpoint.repo.sql.data.common.enums.ROperationResultStatus;
import com.evolveum.midpoint.repo.sql.data.common.other.RObjectType;
import com.evolveum.midpoint.repo.sql.util.ClassMapper;
import com.evolveum.midpoint.repo.sql.util.DtoTranslationException;
import com.evolveum.midpoint.repo.sql.util.RUtil;
import com.evolveum.midpoint.schema.ObjectDeltaOperation;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import org.apache.commons.lang.Validate;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.ForeignKey;
import javax.persistence.*;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author lazyman
*/
@Entity
@Table(name = RAuditEventRecord.TABLE_NAME, indexes = {
@Index(name = "iTimestampValue", columnList = RAuditEventRecord.COLUMN_TIMESTAMP)}) // TODO correct index name
public class RAuditEventRecord implements Serializable {
public static final String TABLE_NAME = "m_audit_event";
public static final String COLUMN_TIMESTAMP = "timestampValue";
private long id;
private Timestamp timestamp;
private String eventIdentifier;
private String sessionIdentifier;
private String taskIdentifier;
private String taskOID;
private String hostIdentifier;
//prism object - user
private String initiatorOid;
private String initiatorName;
//prism object
private String targetOid;
private String targetName;
private RObjectType targetType;
//prism object - user
private String targetOwnerOid;
private String targetOwnerName;
private RAuditEventType eventType;
private RAuditEventStage eventStage;
//collection of object deltas
private Set<RObjectDeltaOperation> deltas;
private String channel;
private ROperationResultStatus outcome;
private String parameter;
private String message;
private String result;
public String getResult() {
return result;
}
@Column(length = 1024)
public String getMessage() {
return message;
}
public String getParameter() {
return parameter;
}
public String getChannel() {
return channel;
}
@ForeignKey(name = "fk_audit_delta")
@OneToMany(mappedBy = "record", orphanRemoval = true)
@Cascade({org.hibernate.annotations.CascadeType.ALL})
public Set<RObjectDeltaOperation> getDeltas() {
if (deltas == null) {
deltas = new HashSet<RObjectDeltaOperation>();
}
return deltas;
}
public String getEventIdentifier() {
return eventIdentifier;
}
@Enumerated(EnumType.ORDINAL)
public RAuditEventStage getEventStage() {
return eventStage;
}
@Enumerated(EnumType.ORDINAL)
public RAuditEventType getEventType() {
return eventType;
}
public String getHostIdentifier() {
return hostIdentifier;
}
@Id
@GeneratedValue
public long getId() {
return id;
}
@Column(length = RUtil.COLUMN_LENGTH_OID)
public String getInitiatorOid() {
return initiatorOid;
}
public String getInitiatorName() {
return initiatorName;
}
@Enumerated(EnumType.ORDINAL)
public ROperationResultStatus getOutcome() {
return outcome;
}
public String getSessionIdentifier() {
return sessionIdentifier;
}
public String getTargetName() {
return targetName;
}
@Column(length = RUtil.COLUMN_LENGTH_OID)
public String getTargetOid() {
return targetOid;
}
@Enumerated(EnumType.ORDINAL)
public RObjectType getTargetType() {
return targetType;
}
public String getTargetOwnerName() {
return targetOwnerName;
}
@Column(length = RUtil.COLUMN_LENGTH_OID)
public String getTargetOwnerOid() {
return targetOwnerOid;
}
public String getTaskIdentifier() {
return taskIdentifier;
}
public String getTaskOID() {
return taskOID;
}
@Column(name = COLUMN_TIMESTAMP)
public Timestamp getTimestamp() {
return timestamp;
}
public void setMessage(String message) {
this.message = message;
}
public void setParameter(String parameter) {
this.parameter = parameter;
}
public void setChannel(String channel) {
this.channel = channel;
}
public void setDeltas(Set<RObjectDeltaOperation> deltas) {
this.deltas = deltas;
}
public void setEventIdentifier(String eventIdentifier) {
this.eventIdentifier = eventIdentifier;
}
public void setEventStage(RAuditEventStage eventStage) {
this.eventStage = eventStage;
}
public void setEventType(RAuditEventType eventType) {
this.eventType = eventType;
}
public void setHostIdentifier(String hostIdentifier) {
this.hostIdentifier = hostIdentifier;
}
public void setId(long id) {
this.id = id;
}
public void setInitiatorName(String initiatorName) {
this.initiatorName = initiatorName;
}
public void setInitiatorOid(String initiatorOid) {
this.initiatorOid = initiatorOid;
}
public void setOutcome(ROperationResultStatus outcome) {
this.outcome = outcome;
}
public void setSessionIdentifier(String sessionIdentifier) {
this.sessionIdentifier = sessionIdentifier;
}
public void setTargetName(String targetName) {
this.targetName = targetName;
}
public void setTargetOid(String targetOid) {
this.targetOid = targetOid;
}
public void setTargetType(RObjectType targetType) {
this.targetType = targetType;
}
public void setTargetOwnerName(String targetOwnerName) {
this.targetOwnerName = targetOwnerName;
}
public void setTargetOwnerOid(String targetOwnerOid) {
this.targetOwnerOid = targetOwnerOid;
}
public void setTaskIdentifier(String taskIdentifier) {
this.taskIdentifier = taskIdentifier;
}
public void setTaskOID(String taskOID) {
this.taskOID = taskOID;
}
public void setTimestamp(Timestamp timestamp) {
this.timestamp = timestamp;
}
public void setResult(String result) {
this.result = result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RAuditEventRecord that = (RAuditEventRecord) o;
if (channel != null ? !channel.equals(that.channel) : that.channel != null) return false;
if (deltas != null ? !deltas.equals(that.deltas) : that.deltas != null) return false;
if (eventIdentifier != null ? !eventIdentifier.equals(that.eventIdentifier) : that.eventIdentifier != null)
return false;
if (eventStage != that.eventStage) return false;
if (eventType != that.eventType) return false;
if (hostIdentifier != null ? !hostIdentifier.equals(that.hostIdentifier) : that.hostIdentifier != null)
return false;
if (initiatorOid != null ? !initiatorOid.equals(that.initiatorOid) : that.initiatorOid != null) return false;
if (initiatorName != null ? !initiatorName.equals(that.initiatorName) : that.initiatorName != null)
return false;
if (outcome != that.outcome) return false;
if (sessionIdentifier != null ? !sessionIdentifier.equals(that.sessionIdentifier) : that.sessionIdentifier != null)
return false;
if (targetOid != null ? !targetOid.equals(that.targetOid) : that.targetOid != null) return false;
if (targetName != null ? !targetName.equals(that.targetName) : that.targetName != null) return false;
if (targetType != null ? !targetType.equals(that.targetType) : that.targetType != null) return false;
if (targetOwnerOid != null ? !targetOwnerOid.equals(that.targetOwnerOid) : that.targetOwnerOid != null)
return false;
if (targetOwnerName != null ? !targetOwnerName.equals(that.targetOwnerName) : that.targetOwnerName != null)
return false;
if (taskIdentifier != null ? !taskIdentifier.equals(that.taskIdentifier) : that.taskIdentifier != null)
return false;
if (taskOID != null ? !taskOID.equals(that.taskOID) : that.taskOID != null) return false;
if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false;
if (parameter != null ? !parameter.equals(that.parameter) : that.parameter != null) return false;
if (message != null ? !message.equals(that.message) : that.message != null) return false;
if (result != null ? !result.equals(that.result) : that.result != null) return false;
return true;
}
@Override
public int hashCode() {
int result = timestamp != null ? timestamp.hashCode() : 0;
result = 31 * result + (eventIdentifier != null ? eventIdentifier.hashCode() : 0);
result = 31 * result + (sessionIdentifier != null ? sessionIdentifier.hashCode() : 0);
result = 31 * result + (taskIdentifier != null ? taskIdentifier.hashCode() : 0);
result = 31 * result + (taskOID != null ? taskOID.hashCode() : 0);
result = 31 * result + (hostIdentifier != null ? hostIdentifier.hashCode() : 0);
result = 31 * result + (initiatorName != null ? initiatorName.hashCode() : 0);
result = 31 * result + (initiatorOid != null ? initiatorOid.hashCode() : 0);
result = 31 * result + (targetOid != null ? targetOid.hashCode() : 0);
result = 31 * result + (targetName != null ? targetName.hashCode() : 0);
result = 31 * result + (targetType != null ? targetType.hashCode() : 0);
result = 31 * result + (targetOwnerOid != null ? targetOwnerOid.hashCode() : 0);
result = 31 * result + (targetOwnerName != null ? targetOwnerName.hashCode() : 0);
result = 31 * result + (eventType != null ? eventType.hashCode() : 0);
result = 31 * result + (eventStage != null ? eventStage.hashCode() : 0);
result = 31 * result + (deltas != null ? deltas.hashCode() : 0);
result = 31 * result + (channel != null ? channel.hashCode() : 0);
result = 31 * result + (outcome != null ? outcome.hashCode() : 0);
result = 31 * result + (parameter != null ? parameter.hashCode() : 0);
result = 31 * result + (message != null ? message.hashCode() : 0);
result = 31 * result + (this.result != null ? this.result.hashCode() : 0);
return result;
}
public static RAuditEventRecord toRepo(AuditEventRecord record, PrismContext prismContext)
throws DtoTranslationException {
Validate.notNull(record, "Audit event record must not be null.");
Validate.notNull(prismContext, "Prism context must not be null.");
RAuditEventRecord repo = new RAuditEventRecord();
repo.setChannel(record.getChannel());
if (record.getTimestamp() != null) {
repo.setTimestamp(new Timestamp(record.getTimestamp()));
}
repo.setEventStage(RAuditEventStage.toRepo(record.getEventStage()));
repo.setEventType(RAuditEventType.toRepo(record.getEventType()));
repo.setSessionIdentifier(record.getSessionIdentifier());
repo.setEventIdentifier(record.getEventIdentifier());
repo.setHostIdentifier(record.getHostIdentifier());
repo.setParameter(record.getParameter());
repo.setMessage(trimMessage(record.getMessage()));
if (record.getOutcome() != null) {
repo.setOutcome(RUtil.getRepoEnumValue(record.getOutcome().createStatusType(), ROperationResultStatus.class));
}
repo.setTaskIdentifier(record.getTaskIdentifier());
repo.setTaskOID(record.getTaskOID());
repo.setResult(record.getResult());
try {
if (record.getTarget() != null) {
PrismObject target = record.getTarget();
repo.setTargetName(getOrigName(target));
repo.setTargetOid(target.getOid());
QName type = ObjectTypes.getObjectType(target.getCompileTimeClass()).getTypeQName();
repo.setTargetType(ClassMapper.getHQLTypeForQName(type));
}
if (record.getTargetOwner() != null) {
PrismObject targetOwner = record.getTargetOwner();
repo.setTargetOwnerName(getOrigName(targetOwner));
repo.setTargetOwnerOid(targetOwner.getOid());
}
if (record.getInitiator() != null) {
PrismObject<UserType> initiator = record.getInitiator();
repo.setInitiatorName(getOrigName(initiator));
repo.setInitiatorOid(initiator.getOid());
}
for (ObjectDeltaOperation<?> delta : record.getDeltas()) {
if (delta == null) {
continue;
}
RObjectDeltaOperation rDelta = RObjectDeltaOperation.toRepo(repo, delta, prismContext);
rDelta.setTransient(true);
rDelta.setRecord(repo);
repo.getDeltas().add(rDelta);
}
} catch (Exception ex) {
throw new DtoTranslationException(ex.getMessage(), ex);
}
return repo;
}
public static AuditEventRecord fromRepo(RAuditEventRecord repo, PrismContext prismContext) throws DtoTranslationException{
AuditEventRecord audit = new AuditEventRecord();
audit.setChannel(repo.getChannel());
audit.setEventIdentifier(repo.getEventIdentifier());
if (repo.getEventStage() != null){
audit.setEventStage(repo.getEventStage().getStage());
}
if (repo.getEventType() != null){
audit.setEventType(repo.getEventType().getType());
}
audit.setHostIdentifier(repo.getHostIdentifier());
audit.setMessage(repo.getMessage());
if (repo.getOutcome() != null){
audit.setOutcome(repo.getOutcome().getStatus());
}
audit.setParameter(repo.getParameter());<|fim▁hole|> audit.setResult(repo.getResult());
audit.setSessionIdentifier(repo.getSessionIdentifier());
audit.setTaskIdentifier(repo.getTaskIdentifier());
audit.setTaskOID(repo.getTaskOID());
if (repo.getTimestamp() != null){
audit.setTimestamp(repo.getTimestamp().getTime());
}
List<ObjectDeltaOperation> odos = new ArrayList<ObjectDeltaOperation>();
for (RObjectDeltaOperation rodo : repo.getDeltas()){
try {
ObjectDeltaOperation odo = RObjectDeltaOperation.fromRepo(rodo, prismContext);
if (odo != null){
odos.add(odo);
}
} catch (Exception ex){
//TODO: for now thi is OK, if we cannot parse detla, just skipp it.. Have to be resolved later;
}
}
audit.getDeltas().addAll((Collection) odos);
return audit;
//initiator, target, targetOwner
}
private static String trimMessage(String message) {
if (message == null || message.length() <= AuditService.MAX_MESSAGE_SIZE) {
return message;
}
return message.substring(0, AuditService.MAX_MESSAGE_SIZE - 4) + "...";
}
private static String getOrigName(PrismObject object) {
PolyString name = (PolyString) object.getPropertyRealValue(ObjectType.F_NAME, PolyString.class);
return name != null ? name.getOrig() : null;
}
}<|fim▁end|> | |
<|file_name|>any.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at<|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Traits for dynamic typing of any `'static` type (through runtime reflection)
//!
//! This module implements the `Any` trait, which enables dynamic typing
//! of any `'static` type through runtime reflection.
//!
//! `Any` itself can be used to get a `TypeId`, and has more features when used
//! as a trait object. As `&Any` (a borrowed trait object), it has the `is` and
//! `as_ref` methods, to test if the contained value is of a given type, and to
//! get a reference to the inner value as a type. As`&mut Any`, there is also
//! the `as_mut` method, for getting a mutable reference to the inner value.
//! `Box<Any>` adds the `move` method, which will unwrap a `Box<T>` from the
//! object. See the extension traits (`*Ext`) for the full details.
//!
//! Note that &Any is limited to testing whether a value is of a specified
//! concrete type, and cannot be used to test whether a type implements a trait.
//!
//! # Examples
//!
//! Consider a situation where we want to log out a value passed to a function.
//! We know the value we're working on implements Show, but we don't know its
//! concrete type. We want to give special treatment to certain types: in this
//! case printing out the length of String values prior to their value.
//! We don't know the concrete type of our value at compile time, so we need to
//! use runtime reflection instead.
//!
//! ```rust
//! use std::fmt::Show;
//! use std::any::{Any, AnyRefExt};
//!
//! // Logger function for any type that implements Show.
//! fn log<T: Any+Show>(value: &T) {
//! let value_any = value as &Any;
//!
//! // try to convert our value to a String. If successful, we want to
//! // output the String's length as well as its value. If not, it's a
//! // different type: just print it out unadorned.
//! match value_any.downcast_ref::<String>() {
//! Some(as_string) => {
//! println!("String ({}): {}", as_string.len(), as_string);
//! }
//! None => {
//! println!("{}", value);
//! }
//! }
//! }
//!
//! // This function wants to log its parameter out prior to doing work with it.
//! fn do_work<T: Show+'static>(value: &T) {
//! log(value);
//! // ...do some other work
//! }
//!
//! fn main() {
//! let my_string = "Hello World".to_string();
//! do_work(&my_string);
//!
//! let my_i8: i8 = 100;
//! do_work(&my_i8);
//! }
//! ```
#![stable]
use mem::{transmute, transmute_copy};
use option::{Option, Some, None};
use raw::TraitObject;
use intrinsics::TypeId;
/// A type with no inhabitants
#[deprecated = "this type is being removed, define a type locally if \
necessary"]
pub enum Void { }
///////////////////////////////////////////////////////////////////////////////
// Any trait
///////////////////////////////////////////////////////////////////////////////
/// The `Any` trait is implemented by all `'static` types, and can be used for
/// dynamic typing
///
/// Every type with no non-`'static` references implements `Any`, so `Any` can
/// be used as a trait object to emulate the effects dynamic typing.
#[stable]
pub trait Any: AnyPrivate {}
/// An inner trait to ensure that only this module can call `get_type_id()`.
pub trait AnyPrivate {
/// Get the `TypeId` of `self`
fn get_type_id(&self) -> TypeId;
}
impl<T: 'static> AnyPrivate for T {
fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
}
impl<T: 'static + AnyPrivate> Any for T {}
///////////////////////////////////////////////////////////////////////////////
// Extension methods for Any trait objects.
// Implemented as three extension traits so that the methods can be generic.
///////////////////////////////////////////////////////////////////////////////
/// Extension methods for a referenced `Any` trait object
#[unstable = "this trait will not be necessary once DST lands, it will be a \
part of `impl Any`"]
pub trait AnyRefExt<'a> {
/// Returns true if the boxed type is the same as `T`
#[stable]
fn is<T: 'static>(self) -> bool;
/// Returns some reference to the boxed value if it is of type `T`, or
/// `None` if it isn't.
#[unstable = "naming conventions around acquiring references may change"]
fn downcast_ref<T: 'static>(self) -> Option<&'a T>;
/// Returns some reference to the boxed value if it is of type `T`, or
/// `None` if it isn't.
#[deprecated = "this function has been renamed to `downcast_ref`"]
fn as_ref<T: 'static>(self) -> Option<&'a T> {
self.downcast_ref::<T>()
}
}
#[stable]
impl<'a> AnyRefExt<'a> for &'a Any+'a {
#[inline]
#[stable]
fn is<T: 'static>(self) -> bool {
// Get TypeId of the type this function is instantiated with
let t = TypeId::of::<T>();
// Get TypeId of the type in the trait object
let boxed = self.get_type_id();
// Compare both TypeIds on equality
t == boxed
}
#[inline]
#[unstable = "naming conventions around acquiring references may change"]
fn downcast_ref<T: 'static>(self) -> Option<&'a T> {
if self.is::<T>() {
unsafe {
// Get the raw representation of the trait object
let to: TraitObject = transmute_copy(&self);
// Extract the data pointer
Some(transmute(to.data))
}
} else {
None
}
}
}
/// Extension methods for a mutable referenced `Any` trait object
#[unstable = "this trait will not be necessary once DST lands, it will be a \
part of `impl Any`"]
pub trait AnyMutRefExt<'a> {
/// Returns some mutable reference to the boxed value if it is of type `T`, or
/// `None` if it isn't.
#[unstable = "naming conventions around acquiring references may change"]
fn downcast_mut<T: 'static>(self) -> Option<&'a mut T>;
/// Returns some mutable reference to the boxed value if it is of type `T`, or
/// `None` if it isn't.
#[deprecated = "this function has been renamed to `downcast_mut`"]
fn as_mut<T: 'static>(self) -> Option<&'a mut T> {
self.downcast_mut::<T>()
}
}
#[stable]
impl<'a> AnyMutRefExt<'a> for &'a mut Any+'a {
#[inline]
#[unstable = "naming conventions around acquiring references may change"]
fn downcast_mut<T: 'static>(self) -> Option<&'a mut T> {
if self.is::<T>() {
unsafe {
// Get the raw representation of the trait object
let to: TraitObject = transmute_copy(&self);
// Extract the data pointer
Some(transmute(to.data))
}
} else {
None
}
}
}<|fim▁end|> | |
<|file_name|>gpioset.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of libgpiod.
#
# Copyright (C) 2017-2018 Bartosz Golaszewski <[email protected]>
#
'''Simplified reimplementation of the gpioset tool in Python.'''
import gpiod
import sys
if __name__ == '__main__':
if len(sys.argv) < 3:
raise TypeError('usage: gpioset.py <gpiochip> <offset1>=<value1> ...')
with gpiod.Chip(sys.argv[1]) as chip:
offsets = []<|fim▁hole|> for arg in sys.argv[2:]:
arg = arg.split('=')
offsets.append(int(arg[0]))
values.append(int(arg[1]))
lines = chip.get_lines(offsets)
lines.request(consumer=sys.argv[0], type=gpiod.LINE_REQ_DIR_OUT)
lines.set_values(values)
input()<|fim▁end|> | values = [] |
<|file_name|>demoserver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Run this server and then in Vim you can open the channel:
# :let handle = ch_open('localhost:8765')
#
# Then Vim can send requests to the server:
# :let response = ch_sendexpr(handle, 'hello!')
#
# And you can control Vim by typing a JSON message here, e.g.:
# ["ex","echo 'hi there'"]
#
# There is no prompt, just type a line and press Enter.
# To exit cleanly type "quit<Enter>".
#
# See ":help channel-demo" in Vim.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import threading
try:
# Python 3
import socketserver
except ImportError:
# Python 2
import SocketServer as socketserver
thesocket = None
class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
print("=== socket opened ===")
global thesocket
thesocket = self.request
while True:
try:
data = self.request.recv(4096).decode('utf-8')
except socket.error:
print("=== socket error ===")
break
except IOError:
print("=== socket closed ===")
break
if data == '':
print("=== socket closed ===")
break
print("received: {}".format(data))
try:
decoded = json.loads(data)
except ValueError:
print("json decoding failed")
decoded = [-1, '']
# Send a response if the sequence number is positive.
# Negative numbers are used for "eval" responses.
if decoded[0] >= 0:
if decoded[1] == 'hello!':
response = "got it"
else:
response = "what?"
encoded = json.dumps([decoded[0], response])
print("sending {}".format(encoded))
self.request.sendall(encoded.encode('utf-8'))
thesocket = None
class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
pass
if __name__ == "__main__":
HOST, PORT = "localhost", 8765
server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler)
ip, port = server.server_address
# Start a thread with the server -- that thread will then start one
# more thread for each request
server_thread = threading.Thread(target=server.serve_forever)
# Exit the server thread when the main thread terminates
server_thread.daemon = True
server_thread.start()
print("Server loop running in thread: ", server_thread.name)
print("Listening on port {}".format(PORT))
while True:
typed = sys.stdin.readline()
if "quit" in typed:
print("Goodbye!")
break
if thesocket is None:<|fim▁hole|> else:
print("sending {}".format(typed))
thesocket.sendall(typed.encode('utf-8'))
server.shutdown()
server.server_close()<|fim▁end|> | print("No socket yet") |
<|file_name|>flexbox_sub_layout.rs<|end_file_name|><|fim▁begin|>/*!
A very simple application that show how to use a flexbox layout.
Requires the following features: `cargo run --example flexbox --features "flexbox"`
*/
extern crate native_windows_gui as nwg;
use nwg::NativeUi;
#[derive(Default)]
pub struct FlexBoxApp {
window: nwg::Window,
layout: nwg::FlexboxLayout,
button1: nwg::Button,
layout2: nwg::FlexboxLayout,
button2: nwg::Button,
button3: nwg::Button,
}
impl FlexBoxApp {
fn exit(&self) {
nwg::stop_thread_dispatch();
}
}
//
// ALL of this stuff is handled by native-windows-derive
//
mod flexbox_app_ui {
use native_windows_gui as nwg;
use super::*;
use std::rc::Rc;
use std::cell::RefCell;
use std::ops::Deref;
pub struct FlexBoxAppUi {
inner: Rc<FlexBoxApp>,
default_handler: RefCell<Option<nwg::EventHandler>>
}
impl nwg::NativeUi<FlexBoxAppUi> for FlexBoxApp {
fn build_ui(mut data: FlexBoxApp) -> Result<FlexBoxAppUi, nwg::NwgError> {
use nwg::Event as E;
// Controls
nwg::Window::builder()
.size((500, 500))
.position((300, 300))
.title("Flexbox example")
.build(&mut data.window)?;
nwg::Button::builder()
.text("Btn 1")
.parent(&data.window)
.focus(true)
.build(&mut data.button1)?;
nwg::Button::builder()
.text("Btn 2")
.parent(&data.window)
.focus(true)
.build(&mut data.button2)?;
nwg::Button::builder()
.text("Btn 3")
.parent(&data.window)
.focus(true)
.build(&mut data.button3)?;
// Wrap-up
let ui =FlexBoxAppUi {
inner: Rc::new(data),
default_handler: Default::default(),
};
// Events
let evt_ui = Rc::downgrade(&ui.inner);
let handle_events = move |evt, _evt_data, handle| {
if let Some(evt_ui) = evt_ui.upgrade() {
match evt {
E::OnWindowClose =>
if &handle == &evt_ui.window {
FlexBoxApp::exit(&evt_ui);
},
_ => {}
}
}
};
*ui.default_handler.borrow_mut() = Some(nwg::full_bind_event_handler(&ui.window.handle, handle_events));
// Layout
use nwg::stretch::{geometry::Size, style::{Dimension as D, FlexDirection}};
nwg::FlexboxLayout::builder()
.parent(&ui.window)
.flex_direction(FlexDirection::Column)
.child(&ui.button2)
.child_size(Size { width: D::Auto, height: D::Points(200.0) })
.child(&ui.button3)
.child_flex_grow(2.0)
.child_size(Size { width: D::Auto, height: D::Auto })
.build_partial(&ui.layout2)?;
nwg::FlexboxLayout::builder()
.parent(&ui.window)
.flex_direction(FlexDirection::Row)
.child(&ui.button1)
.child_flex_grow(2.0)
.child_size(Size { width: D::Auto, height: D::Auto })
.child_layout(&ui.layout2)
.child_size(Size { width: D::Points(300.0), height: D::Auto })
.build(&ui.layout)?;
<|fim▁hole|>
impl Drop for FlexBoxAppUi {
/// To make sure that everything is freed without issues, the default handler must be unbound.
fn drop(&mut self) {
let handler = self.default_handler.borrow();
if handler.is_some() {
nwg::unbind_event_handler(handler.as_ref().unwrap());
}
}
}
impl Deref for FlexBoxAppUi {
type Target = FlexBoxApp;
fn deref(&self) -> &FlexBoxApp {
&self.inner
}
}
}
fn main() {
nwg::init().expect("Failed to init Native Windows GUI");
nwg::Font::set_global_family("Segoe UI").expect("Failed to set default font");
let _ui = FlexBoxApp::build_ui(Default::default()).expect("Failed to build UI");
nwg::dispatch_thread_events();
}<|fim▁end|> |
return Ok(ui);
}
} |
<|file_name|>empPath.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998 Ulf Larsson
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import string
import empDb
import empSector
import math
move_directions = "ujnbgy"
move_reverse_directions ="bgyujn"
def norm_coords( coords, world_size ) :
""" normalize coordinates according to world size"""
x , y = coords
size_x, size_y = world_size
return ( ( x + size_x / 2 ) % size_x - size_x / 2,
( y + size_y / 2 ) % size_y - size_y / 2 )
def neighbours( coords ) :
""" neighbours ordered as directions """
world = empDb.megaDB['version']['worldsize']
x , y = coords
return [ norm_coords( ( x + 1, y - 1) , world ) ,
norm_coords( ( x + 2, y ) , world ) ,
norm_coords( ( x + 1, y + 1) , world ) ,
norm_coords( ( x - 1, y + 1) , world ) ,
norm_coords( ( x - 2, y ) , world ) ,
norm_coords( ( x - 1, y - 1) , world ) ]
def coords_to_str( coords ) :
x , y = coords
return `x` + ',' + `y`
## MobCost is used in the bestpath algorithm.
## Bestpath for navigating, marching and
## exploring needs their own version of
## this class
class MobCost:
""" Mobility cost using the move cmd """
def __init__( self ) :
pass
def cost( self, coords ) :
""" cost for moving into sector """
result = 2.0 * empSector.infinite_mob_cost
sect = empDb.megaDB['SECTOR'].get( coords , {} )
if sect and sect.get( 'owner' ) == empDb.CN_OWNED :
result = empSector.mob_cost( sect )
return result
class ExplMobCost:
""" Mobility cost using the expl cmd """
def __init__( self ) :
pass
def cost( self, coords ) :
""" cost for moving into sector """
result = 2.0 * empSector.infinite_mob_cost
sect = empDb.megaDB['SECTOR'].get( coords, {} )
if sect and ( sect.get( 'owner' ) == empDb.CN_OWNED
or empSector.is_explorable_into( sect ) ) :
result = empSector.mob_cost( sect )
return result
## Path is used in bestpath calculation to keep track of
## start point, end point , path string and path cost.
## These are public members right now but should be
## private.
class Path :
""" Empire path between sectors in a hex map """
def __init__( self, sect, mob_cost ) :
self.start = sect
self.end = sect
self.directions = ""
self.cost = mob_cost
def append( self, tail, dir ) :
""" concatinate two paths """
result = Path( self.start, self.cost + tail.cost )
result.directions = self.directions + dir + tail.directions
result.end = tail.end
return result
def post_extend( self, sect , mob_cost , dir ) :
""" add a step at the end of the path """
result = Path( self.start, self.cost + mob_cost )
result.directions = self.directions + dir
result.end = sect
return result
def pre_extend( self, sect , mob_cost , dir ) :
""" add a step at the beginning of the path """
result = Path( sect, self.cost + mob_cost )
result.directions = dir + self.directions
result.end = self.end;
return result
## Paths -- bestpath generator between sets of sectors.
##
##
## Paths has the following data members
## __mob : mobility cost object
## __visited : dictonary of sector we have calculated a path to
## __heads : list of paths starting at a source sector
## __tails : list of paths endinging at a destination sector
## __complete : list of paths starting at a source sector
## and ends at a destination sector.
##
## __heads, __tails and __complete are sorted wrt the path cost
##
## Paths has two main parts. One is to build up paths
## and the second part deals with removing a source or
## destination sector.
##
## Building up paths is done by taking the best head ( or tail) path
## and create new paths to the neighbours of the path's end point.
## If the neigbouring sector is *not* in __visited we add the new
## path, otherwise we try to create a __complete path. This ends
## when the total cost of the best head and tail path is higher
## then the best complete path.
##
## Removing source or destination sector is done by looping through
## __visited sectors and remove those origin from the removed sector.
## Same for the lists of paths.
##
##
class Paths :
""" Paths between two sets of sectors """
def __init__( self, from_sect, to_sect, mcost ):
self.__mob = mcost
self.__visited = {}
self.__starting_at = {}
self.__ending_at = {}
self.__heads = []
self.__tails = []
self.__complete = []
for sect in from_sect:
path = Path( sect, 0.0 )
self.__visited[ path.start ] = ( path , 1 )
self.__starting_at[ path.start ] = [ path ]
self.__insert_path( self.__heads , path )
for sect in to_sect :
path = Path( sect, self.__mob.cost( sect ) )
self.__visited[ path.end ] = ( path , 0 )
self.__ending_at[ path.end ] = [ path ]
self.__insert_path( self.__tails , path )
self.__make_paths()
def empty( self ) :
""" no path exits """
return ( len( self.__complete ) == 0
or self.__complete[ 0 ].cost >= empSector.infinite_mob_cost )
def best( self ) :
""" the best path ( lowest cost ) between any two sectors """
return self.__complete[ 0 ]
def __found_best_path( self ) :
""" have we found the best path """
done_search = not self.__heads or not self.__tails
if not done_search :
best_so_far = empSector.infinite_mob_cost
if self.__complete :
best_so_far = self.__complete[ 0 ].cost
best_possible = self.__heads[ 0 ].cost + self.__tails[ 0 ].cost
done_search = best_possible > best_so_far
return done_search
def __insert_path( self, path_list, path ) :
""" insert path in a sorted list """
index = 0
for elem in path_list :
if path.cost <= elem.cost :
break
else :
index = index + 1;
path_list.insert( index, path )
def __make_paths( self ):
""" expand tail and head paths """
expand_heads = not 0
while not self.__found_best_path():
if expand_heads:
self.__expand_heads()
else :
self.__expand_tails()
expand_heads = not expand_heads
def __expand_heads( self ) :
""" expand best head path """
path = self.__heads[ 0 ];
# print "expand head path " + path_str( path )
del self.__heads[ 0 ]
i = 0
for sect in neighbours( path.end ) :
dir = move_directions[ i ]
if not self.__visited.has_key( sect ) :
new_path = path.post_extend( sect ,
self.__mob.cost( sect ),
dir )
self.__insert_path( self.__heads, new_path )
self.__visited[ sect ] = ( new_path, 1 )
self.__starting_at[ path.start ].append( new_path )
else :
tail, is_head_path = self.__visited[ sect ]
if not is_head_path :
self.__insert_path( self.__complete,
path.append( tail, dir ) )
i = i + 1
def __expand_tails( self ) :
""" expand best tail path """
path = self.__tails[ 0 ]
# print "expand tail path " + path_str( path )
del self.__tails[ 0 ]
i = 0
for sect in neighbours( path.start ) :
dir = move_reverse_directions[ i ]
if not self.__visited.has_key( sect ) :
new_path = path.pre_extend( sect,
self.__mob.cost( sect ),
dir )
self.__insert_path( self.__tails, new_path )
self.__visited[ sect ] = ( new_path , 0 )
self.__ending_at[ path.end ].append( new_path )
else :
head, is_head_path = self.__visited[ sect ]
if is_head_path :
self.__insert_path( self.__complete,
head.append( path, dir ) )
i = i + 1
## code below deals with removing sectors
def remove_from( self, coords ) :
""" remove a sector from the set of source sectors """
removed = []
for path in self.__starting_at[ coords ] :
del self.__visited[ path.end ]
removed.append( path.end )
del self.__starting_at[ coords ]
self.__heads = self.__not_starting_at( self.__heads,
coords )
self.__complete = self.__not_starting_at( self.__complete,
coords )
self.__activate_neighbours_of( removed )
self.__make_paths()
def remove_to( self, coords ) :
""" remove a sector from the set of destination sectors """
removed = []
for path in self.__ending_at[ coords ] :
del self.__visited[ path.start ]
removed.append( path.start )
del self.__ending_at[ coords ]
self.__tails = self.__not_ending_at( self.__tails,
coords )
self.__complete = self.__not_ending_at( self.__complete,
coords )
self.__activate_neighbours_of( removed )
self.__make_paths()
def __not_starting_at( self,
path_list,
coords ) :
""" filter out path not starting at coords """
result = []
for path in path_list :
if path.start != coords :
result.append( path )
return result
def __not_ending_at( self,
path_list,
coords ) :
""" filter out path not starting at coords """
result = []
for path in path_list :
if path.end != coords :
result.append( path )
return result
def __activate_neighbours_of( self, removed_list ) :
""" enable neighbouring paths to expand into unvisited sectors """
for removed in removed_list :
## print "activate " + removed.str() + " neighbours"
for sect in neighbours( removed ) :
if self.__visited.has_key( sect) :
self.__activate_path_end( sect )
def __activate_path_end( self, sect ) :
""" insert path to head_paths or tail_paths """
path , is_head_path = self.__visited[ sect ];
if is_head_path :
if path not in self.__heads :
# print "activate head path " + path_str( path )
self.__insert_path( self.__heads, path )
else :
if path not in self.__tails :
# print "activate tail path " + path_str( path ) <|fim▁hole|>
## only used in debug printing
def path_str( path ) :
""" make a string out of a path """
return ( coords_to_str( path.start ) + ' ' + path.directions
+ ' ' + coords_to_str( path.end )
+ ' (' + `path.cost` + ')' )
## MultiMove use two dictonaries to keep track of mobility
## and amount of commodities in source and destination sectors.
## Paths is used to calculate the best path. For each of these
## paths we check wether we shall remove a source sector or
## a destination sector in the Paths object depending on how
## much we can move.
def best_path( src, dst, mob_cost = MobCost() ) :
result = None
paths = Paths( [ src ], [ dst ], mob_cost )
if not paths.empty() :
result = paths.best()
return result
class MoveGenerator :
""" generator of moves """
def __init__( self,
commodity,
src_secs,
dst_secs,
mcost = MobCost() ) :
self.__from_map = src_secs
self.__to_map = dst_secs
self.__move = None
self.__commodity = commodity
## print len( src_secs ) , " source sectors",
## print len( dst_secs ) , " destination sectors",
self.__paths = Paths( self.__from_map.keys(),
self.__to_map.keys(),
mcost )
## print "use ", len( self.__from_map ) , " source sectors",
## print len( self.__to_map ) , " destination sectors",
self.next()
def empty( self ) :
""" no more move commands """
return not self.__move
def next( self ) :
""" proceede to next move command """
self.__move = None
while not ( self.__paths.empty() or self.__move ) :
path = self.__paths.best()
## print "best path = " + path_str( path )
amount, mob , weight = self.__from_map[ path.start ]
if weight * path.cost < mob :
## print amount, mob, weight
move_amount = math.floor( mob / ( weight * path.cost ) )
if move_amount > amount : move_amount = amount
to_amount = self.__to_map[ path.end ]
if move_amount > to_amount : move_amount = to_amount
amount = amount - move_amount;
to_amount = to_amount - move_amount;
mob = math.floor( mob - weight * path.cost * move_amount )
self.__move = ( self.__commodity,
path,
move_amount )
if to_amount > 0 :
self.__to_map[ path.end ] = to_amount
else :
self.__paths.remove_to( path.end )
if amount > 0 and mob > 0 :
self.__from_map[ path.start ] = ( amount ,
mob ,
weight)
else :
self.__paths.remove_from( path.start )
else :
self.__paths.remove_from( path.start )
def move( self ) :
""" current move command """
return self.__move
class MultiMove :
""" generator of move commands """
def __init__( self,
commodity,
from_secs,
from_amount,
mob_limit,
to_secs,
to_amount ) :
## print len( from_secs ) , " source sectors",
## print len( to_secs ) , " destination sectors",
if from_amount < 0 : from_amount = 0
if mob_limit < 0 : mob_limit = 0
if to_amount < 0 : to_amount = 0
src = self.__create_src_map( commodity,
from_secs,
from_amount,
mob_limit )
dst = self.__create_dst_map( commodity,
to_secs,
to_amount )
for coords in dst.keys() :
if src.has_key( coords ) :
del src[ coords ]
self.__mover = MoveGenerator( commodity,
src,
dst,
MobCost() )
def empty( self ) :
""" no more move commands """
return self.__mover.empty()
def next( self ) :
""" proceede to next move command """
self.__mover.next()
def move_cmd_str( self ) :
""" construct a move command string """
result = ""
if not self.__mover.empty() :
commodity, path, amount = self.__mover.move();
result = ( 'move ' + commodity + ' '
+ coords_to_str( path.start ) + ' ' + `amount`
+ ' ' + coords_to_str( path.end ) )
return result
def __create_src_map( self, commodity, from_secs, from_amount, mob_limit ):
""" create source sectors dictionary """
result = {}
for sect in from_secs.values() :
coords = empSector.to_coord( sect )
if empSector.is_movable_from( sect, commodity ) :
mob = empSector.value( sect, 'mob' ) - mob_limit;
amount = empSector.value( sect, commodity ) - from_amount
if mob > 0 and amount > 0 :
weight = empSector.move_weight( sect, commodity )
result[ coords ] = ( amount , mob , weight)
## print "src += " + coords.str() + " " + `amount` + " ",
## print `mob` + " " + `weight`
return result
def __create_dst_map( self, commodity, to_secs, to_amount ):
""" create destination sectors dictionary """
result = {}
for sect in to_secs.values() :
coords = empSector.to_coord( sect )
if empSector.is_movable_into( sect, commodity ) :
amount = to_amount - empSector.value( sect, commodity )
if amount > 0 :
result[ coords ] = amount
## print "dst += " + coords.str() + " " + `amount`
return result
class MultiExplore :
""" generator of explore commands """
def __init__( self,
commodity,
from_secs,
from_amount,
mob_limit,
to_secs ) :
if from_amount < 0 : from_amount = 0
if mob_limit < 0 : mob_limit = 0
src = self.__create_src_map( commodity,
from_secs,
from_amount,
mob_limit )
dst = self.__create_dst_map( to_secs )
self.__explore = MoveGenerator( commodity,
src,
dst,
ExplMobCost() )
def empty( self ) :
""" no more explore commands """
return self.__explore.empty()
def next( self ) :
""" proceede to next explore command """
self.__explore.next()
def explore_cmd_str( self ) :
""" construct a expl command string """
result = ""
if not self.__explore.empty() :
commodity, path, amount = self.__explore.move();
result = ( 'expl ' + commodity + ' '
+ coords_to_str( path.start ) + ' ' + `amount`
+ ' ' + path.directions + 'h' )
return result
def __create_src_map( self, commodity, from_secs, from_amount, mob_limit ):
""" init source sectors dictionary """
result = {};
for sect in from_secs.values() :
coords = empSector.to_coord( sect )
if empSector.is_movable_from( sect, commodity ) :
mob = empSector.value( sect, 'mob' ) - mob_limit;
amount = empSector.value( sect, commodity ) - from_amount
if mob > 0 and amount > 0 :
weight = 1.0
result[ coords ] = ( amount ,
mob ,
weight)
## print "src += " + coords.str() + " " + `amount` + " ",
## print `mob` + " " + `weight`
return result;
def __create_dst_map( self, to_secs ):
""" init destination sectors dictionary """
result = {}
for sect in to_secs.values() :
if empSector.is_explorable_into( sect ) :
coords = empSector.to_coord( sect )
result[ coords ] = 1
return result<|fim▁end|> | self.__insert_path( self.__tails, path ) |
<|file_name|>create-cube-mesh.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import * as babylon from "@babylonjs/core"
export const createCubeMesh = (scene: babylon.Scene): babylon.Mesh => {
const material = new babylon.StandardMaterial("cube-material", scene)
material.emissiveColor = new babylon.Color3(0.1, 0.6, 0.9)
const mesh = babylon.Mesh.CreateBox("cube-mesh", 1, scene)
mesh.material = material
return mesh
}<|fim▁end|> | |
<|file_name|>bigip_partition.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: bigip_partition
short_description: Manage BIG-IP partitions.
description:
- Manage BIG-IP partitions.
version_added: "2.5"
options:
description:
description:
- The description to attach to the Partition.
route_domain:
description:
- The default Route Domain to assign to the Partition. If no route domain
is specified, then the default route domain for the system (typically
zero) will be used only when creating a new partition.
state:
description:
- Whether the partition should exist or not.
default: present
choices:
- present
- absent
notes:
- Requires the f5-sdk Python package on the host. This is as easy as pip
install f5-sdk.
- Requires BIG-IP software version >= 12
requirements:
- f5-sdk >= 2.2.3
extends_documentation_fragment: f5
author:
- Tim Rupp (@caphrim007)
'''
EXAMPLES = '''
- name: Create partition "foo" using the default route domain
bigip_partition:
name: "foo"
password: "secret"
server: "lb.mydomain.com"
user: "admin"
delegate_to: localhost
- name: Create partition "bar" using a custom route domain
bigip_partition:
name: "bar"
route_domain: 3
password: "secret"
server: "lb.mydomain.com"
user: "admin"
delegate_to: localhost
- name: Change route domain of partition "foo"
bigip_partition:
name: "foo"
route_domain: 8
password: "secret"
server: "lb.mydomain.com"
user: "admin"
delegate_to: localhost
- name: Set a description for partition "foo"
bigip_partition:
name: "foo"
description: "Tenant CompanyA"
password: "secret"
server: "lb.mydomain.com"
user: "admin"
delegate_to: localhost
- name: Delete the "foo" partition
bigip_partition:
name: "foo"
password: "secret"
server: "lb.mydomain.com"
user: "admin"
state: "absent"
delegate_to: localhost
'''
RETURN = '''
route_domain:
description: Name of the route domain associated with the partition.
returned: changed and success
type: int
sample: 0
description:
description: The description of the partition.
returned: changed and success
type: string
sample: "Example partition"
'''
from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import AnsibleF5Parameters
from ansible.module_utils.f5_utils import F5ModuleError
from ansible.module_utils.f5_utils import iteritems
from ansible.module_utils.f5_utils import defaultdict
try:
from ansible.module_utils.f5_utils import HAS_F5SDK
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError:
HAS_F5SDK = False
class Parameters(AnsibleF5Parameters):
api_map = {
'defaultRouteDomain': 'route_domain',
}
api_attributes = [
'description', 'defaultRouteDomain'
]
returnables = [
'description', 'route_domain'
]
updatables = [
'description', 'route_domain'
]
def __init__(self, params=None):
self._values = defaultdict(lambda: None)
self._values['__warnings'] = []
if params:
self.update(params=params)
def update(self, params=None):
if params:
for k, v in iteritems(params):
if self.api_map is not None and k in self.api_map:
map_key = self.api_map[k]
else:
map_key = k
# Handle weird API parameters like `dns.proxy.__iter__` by
# using a map provided by the module developer
class_attr = getattr(type(self), map_key, None)
if isinstance(class_attr, property):
# There is a mapped value for the api_map key
if class_attr.fset is None:
# If the mapped value does not have
# an associated setter
self._values[map_key] = v
else:
# The mapped value has a setter
setattr(self, map_key, v)
else:
# If the mapped value is not a @property
self._values[map_key] = v
def to_return(self):
result = {}
try:
for returnable in self.returnables:
result[returnable] = getattr(self, returnable)
result = self._filter_params(result)
return result
except Exception:
return result
def api_params(self):
result = {}
for api_attribute in self.api_attributes:
if self.api_map is not None and api_attribute in self.api_map:
result[api_attribute] = getattr(self, self.api_map[api_attribute])
else:
result[api_attribute] = getattr(self, api_attribute)
result = self._filter_params(result)
return result
@property
def partition(self):
# Cannot create a partition in a partition, so nullify this
return None
@property
def route_domain(self):
if self._values['route_domain'] is None:
return None
return int(self._values['route_domain'])
class Difference(object):
def __init__(self, want, have=None):
self.want = want
self.have = have
def compare(self, param):
try:
result = getattr(self, param)
return result
except AttributeError:
result = self.__default(param)
return result
def __default(self, param):
attr1 = getattr(self.want, param)
try:
attr2 = getattr(self.have, param)
if attr1 != attr2:
return attr1
except AttributeError:
return attr1
class ModuleManager(object):
def __init__(self, client):
self.client = client
self.have = None
self.want = Parameters(self.client.module.params)
self.changes = Parameters()
def _set_changed_options(self):
changed = {}
for key in Parameters.returnables:
if getattr(self.want, key) is not None:
changed[key] = getattr(self.want, key)
if changed:
self.changes = Parameters(changed)
def _update_changed_options(self):
diff = Difference(self.want, self.have)
updatables = Parameters.updatables
changed = dict()
for k in updatables:
change = diff.compare(k)
if change is None:
continue
else:
changed[k] = change
if changed:
self.changes = Parameters(changed)
return True<|fim▁hole|> return False
def exec_module(self):
changed = False
result = dict()
state = self.want.state
try:
if state == "present":
changed = self.present()
elif state == "absent":
changed = self.absent()
except iControlUnexpectedHTTPError as e:
raise F5ModuleError(str(e))
changes = self.changes.to_return()
result.update(**changes)
result.update(dict(changed=changed))
return result
def present(self):
if self.exists():
return self.update()
else:
return self.create()
def create(self):
if self.client.check_mode:
return True
self.create_on_device()
if not self.exists():
raise F5ModuleError("Failed to create the partition.")
return True
def should_update(self):
result = self._update_changed_options()
if result:
return True
return False
def update(self):
self.have = self.read_current_from_device()
if not self.should_update():
return False
if self.client.check_mode:
return True
self.update_on_device()
return True
def absent(self):
if self.exists():
return self.remove()
return False
def remove(self):
if self.client.check_mode:
return True
self.remove_from_device()
if self.exists():
raise F5ModuleError("Failed to delete the partition.")
return True
def read_current_from_device(self):
resource = self.client.api.tm.auth.partitions.partition.load(
name=self.want.name
)
result = resource.attrs
return Parameters(result)
def exists(self):
result = self.client.api.tm.auth.partitions.partition.exists(
name=self.want.name
)
return result
def update_on_device(self):
params = self.want.api_params()
result = self.client.api.tm.auth.partitions.partition.load(
name=self.want.name
)
result.modify(**params)
def create_on_device(self):
params = self.want.api_params()
self.client.api.tm.auth.partitions.partition.create(
name=self.want.name,
**params
)
def remove_from_device(self):
result = self.client.api.tm.auth.partitions.partition.load(
name=self.want.name
)
if result:
result.delete()
class ArgumentSpec(object):
def __init__(self):
self.supports_check_mode = True
self.argument_spec = dict(
name=dict(required=True),
description=dict(),
route_domain=dict(type='int'),
)
self.f5_product_name = 'bigip'
def main():
try:
spec = ArgumentSpec()
client = AnsibleF5Client(
argument_spec=spec.argument_spec,
supports_check_mode=spec.supports_check_mode,
f5_product_name=spec.f5_product_name
)
if not HAS_F5SDK:
raise F5ModuleError("The python f5-sdk module is required")
mm = ModuleManager(client)
results = mm.exec_module()
client.module.exit_json(**results)
except F5ModuleError as e:
client.module.fail_json(msg=str(e))
if __name__ == '__main__':
main()<|fim▁end|> | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import (login as _login, logout as _logout,
authenticate)
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from django.forms.models import model_to_dict
from django.http import (HttpResponse, HttpResponseForbidden,
HttpResponseBadRequest)
from django.views.decorators.cache import cache_page
from django.shortcuts import redirect, render
from django.utils.html import format_html
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django_otp.decorators import otp_required
from openid.extensions.ax import FetchRequest, FetchResponse
from openid.extensions.sreg import SRegRequest, SRegResponse
from openid.server.server import (Server, ProtocolError, EncodingError,
CheckIDRequest, ENCODE_URL,
ENCODE_KVFORM, ENCODE_HTML_FORM)
from passlib.hash import ldap_md5_crypt
from urlparse import urljoin
from okupy import OkupyError
from okupy.accounts.forms import (LoginForm, OpenIDLoginForm, SSLCertLoginForm,
OTPForm, SignupForm, SiteAuthForm,
StrongAuthForm, ProfileSettingsForm,
ContactSettingsForm, EmailSettingsForm,
GentooAccountSettingsForm,
PasswordSettingsForm)
from okupy.accounts.models import LDAPUser, OpenID_Attributes, Queue
from okupy.accounts.openid_store import DjangoDBOpenIDStore
from okupy.common.ldap_helpers import (get_bound_ldapuser,
set_secondary_password,
remove_secondary_password)
from okupy.common.decorators import strong_auth_required, anonymous_required
from okupy.common.log import log_extra_data
from okupy.crypto.ciphers import sessionrefcipher
from okupy.crypto.models import RevokedToken
from okupy.otp import init_otp
from okupy.otp.sotp.models import SOTPDevice
from okupy.otp.totp.models import TOTPDevice
# the following two are for exceptions
import openid.yadis.discover
import openid.fetchers
import django_otp
import hashlib
import io
import ldap
import logging
import qrcode
logger = logging.getLogger('okupy')
logger_mail = logging.getLogger('mail_okupy')
@cache_page(60 * 20)
def lists(request, acc_list):
devlist = LDAPUser.objects.all()
if acc_list == 'devlist':
devlist = devlist.filter(is_developer=True)
elif acc_list == 'former-devlist':
devlist = devlist.filter(is_retired=True)
elif acc_list == 'foundation-members':
devlist = devlist.filter(is_foundation=True)
return render(request, '%s.html' % acc_list, {'devlist': devlist})
@otp_required
def index(request):
ldb_user = LDAPUser.objects.filter(username=request.user.username)
return render(request, 'index.html', {
'ldb_user': ldb_user,
})
def login(request):
""" The login page """
user = None
oreq = request.session.get('openid_request', None)
# this can be POST or GET, and can be null or empty
next = request.REQUEST.get('next') or reverse(index)
is_otp = False
login_form = None
strong_auth_req = 'strong_auth_requested' in request.session
if oreq:
login_form_class = OpenIDLoginForm
elif ('strong_auth_requested' in request.session
and request.user.is_authenticated()):
login_form_class = StrongAuthForm
else:
login_form_class = LoginForm
try:
if request.method != 'POST':
pass
elif 'cancel' in request.POST:
# note: this wipes request.session
_logout(request)
if oreq is not None:
oresp = oreq.answer(False)
return render_openid_response(request, oresp)
elif 'otp_token' in request.POST:
# if user's not authenticated, go back to square one
if not request.user.is_authenticated():
raise OkupyError('OTP verification timed out')
is_otp = True
otp_form = OTPForm(request.POST)
if otp_form.is_valid():
token = otp_form.cleaned_data['otp_token']
else:
raise OkupyError('OTP verification failed')
# prevent replay attacks and race conditions
if not RevokedToken.add(token, request.user):
raise OkupyError('OTP verification failed')
dev = django_otp.match_token(request.user, token)
if not dev:
raise OkupyError('OTP verification failed')
django_otp.login(request, dev)
else:
login_form = login_form_class(request.POST)
if login_form.is_valid():
if login_form_class != StrongAuthForm:
username = login_form.cleaned_data['username']
else:
username = request.user.username
password = login_form.cleaned_data['password']
else:
raise OkupyError('Login failed')
"""
Perform authentication, if it retrieves a user object then
it was successful. If it retrieves None then it failed to login
"""
try:
user = authenticate(
request=request,
username=username,
password=password)
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError(
"Can't contact the LDAP server or the database")
if not user:
raise OkupyError('Login failed')
if oreq:
request.session['auto_logout'] = (
login_form.cleaned_data['auto_logout'])
except OkupyError as error:
messages.error(request, str(error))
if user and user.is_active:
_login(request, user)
# prepare devices, and see if OTP is enabled
init_otp(request)
set_secondary_password(request=request, password=password)
if request.user.is_authenticated():
if (strong_auth_req
and not 'secondary_password' in request.session):
if request.method != 'POST':
messages.info(request, 'You need to type in your password'
+ ' again to perform this action')
else:
if request.user.is_verified():
return redirect(next)
login_form = OTPForm()
is_otp = True
if login_form is None:
login_form = login_form_class()
if is_otp or strong_auth_req:
ssl_auth_form = None
ssl_auth_uri = None
ssh_auth_command = None
else:
encrypted_id = sessionrefcipher.encrypt(request.session)
# TODO: it fails when:
# 1. site is accessed via IP (auth.127.0.0.1),
# 2. HTTP used on non-standard port (https://...:8000).
ssl_auth_form = SSLCertLoginForm({
'session': encrypted_id,
'next': request.build_absolute_uri(next),
'login_uri': request.build_absolute_uri(request.get_full_path()),
})
ssl_auth_host = 'auth.' + request.get_host()
ssl_auth_path = reverse(ssl_auth)
ssl_auth_uri = urljoin('https://' + ssl_auth_host, ssl_auth_path)
if settings.SSH_BIND[1] == 22:
ssh_port_opt = ''
else:
ssh_port_opt = '-p %d ' % settings.SSH_BIND[1]
ssh_auth_command = 'ssh %sauth+%s@%s' % (
ssh_port_opt,
encrypted_id,
request.get_host().split(':')[0])
return render(request, 'login.html', {
'login_form': login_form,
'openid_request': oreq,
'next': next,
'ssl_auth_uri': ssl_auth_uri,
'ssl_auth_form': ssl_auth_form,
'ssh_auth_command': ssh_auth_command,
'is_otp': is_otp,
})
@csrf_exempt
@require_POST
def ssl_auth(request):
""" SSL certificate authentication. """
ssl_auth_form = SSLCertLoginForm(request.POST)
if not ssl_auth_form.is_valid():
return HttpResponseBadRequest('400 Bad Request')
session = ssl_auth_form.cleaned_data['session']
next_uri = ssl_auth_form.cleaned_data['login_uri']
user = authenticate(request=request)
if user and user.is_active:
_login(request, user)
init_otp(request)
if request.user.is_verified(): # OTP disabled
next_uri = ssl_auth_form.cleaned_data['next']
else:
messages.error(request, 'Certificate authentication failed')
# so, django will always start a new session for us. we need to copy
# the data to the original session and preferably flush the new one.
session.update(request.session)
# always logout automatically from SSL-based auth
# it's easy enough to log back in anyway
if 'openid_request' in session:
session['auto_logout'] = True
session.save()
request.session.flush()
return redirect(next_uri)
def logout(request):
""" The logout page """
try:
remove_secondary_password(request)
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
finally:
_logout(request)
return redirect(login)
@anonymous_required
def signup(request):
""" The signup page """
signup_form = None
if request.method == "POST":
signup_form = SignupForm(request.POST)
if signup_form.is_valid():
try:
try:
LDAPUser.objects.get(
username=signup_form.cleaned_data['username'])
except LDAPUser.DoesNotExist:
pass
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError("Can't contact LDAP server")
else:
raise OkupyError('Username already exists')
try:
LDAPUser.objects.get(
email__contains=signup_form.cleaned_data['email'])
except LDAPUser.DoesNotExist:
pass
else:
raise OkupyError('Email already exists')
queued_user = Queue(
username=signup_form.cleaned_data['username'],
first_name=signup_form.cleaned_data['first_name'],
last_name=signup_form.cleaned_data['last_name'],
email=signup_form.cleaned_data['email'],
password=signup_form.cleaned_data['password_origin'],
)
try:
queued_user.save()
except IntegrityError:
raise OkupyError('Account is already pending activation')
except Exception as error:
logger.critical(error, extra=log_extra_data(request))<|fim▁hole|> 'To confirm your email address, please click the \
following link:\n%s' % queued_user.encrypted_id,
'%s' % settings.SERVER_EMAIL,
[signup_form.cleaned_data['email']]
)
messages.info(
request, "You will shortly receive an activation mail")
return redirect(login)
except OkupyError as error:
messages.error(request, str(error))
else:
signup_form = SignupForm()
return render(request, 'signup.html', {
'signup_form': signup_form,
})
@anonymous_required
def activate(request, token):
"""
The page that users get to activate their accounts
It is in the form /activate/$TOKEN
"""
try:
try:
queued = Queue.objects.get(encrypted_id=token)
except (Queue.DoesNotExist, OverflowError, TypeError, ValueError):
raise OkupyError('Invalid URL')
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError("Can't contact the database")
# get max uidNumber
try:
uidnumber = LDAPUser.objects.latest('uid').uid + 1
except LDAPUser.DoesNotExist:
uidnumber = 1
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError("Can't contact LDAP server")
# add account to ldap
new_user = LDAPUser(
object_class=settings.AUTH_LDAP_USER_OBJECTCLASS,
last_name=queued.last_name,
full_name='%s %s' % (queued.first_name, queued.last_name),
password=[ldap_md5_crypt.encrypt(queued.password)],
first_name=queued.first_name,
email=[queued.email],
username=queued.username,
uid=uidnumber,
gid=100,
gecos='%s %s' % (queued.first_name, queued.last_name),
home_directory='/home/%s' % queued.username,
ACL=['user.group'],
)
new_user.save()
# remove queued account from DB
queued.delete()
messages.success(
request, "Your account has been activated successfully")
except OkupyError as error:
messages.error(request, str(error))
return redirect(login)
# Settings
@strong_auth_required
@otp_required
def profile_settings(request):
""" Primary account settings, """
with get_bound_ldapuser(request) as user_info:
profile_settings = None
if request.method == "POST":
profile_settings = ProfileSettingsForm(request.POST)
if profile_settings.is_valid():
try:
#birthday = profile_settings.cleaned_data['birthday']
first_name = profile_settings.cleaned_data['first_name']
last_name = profile_settings.cleaned_data['last_name']
if user_info.first_name != first_name:
user_info.first_name = first_name
if user_info.last_name != last_name:
user_info.last_name = last_name
user_info.full_name = '%s %s' % (first_name, last_name)
user_info.gecos = '%s %s' % (first_name, last_name)
"""
if user_info.birthday != birthday:
user_info.birthday = birthday
"""
try:
user_info.save()
except IntegrityError:
pass
except ldap.TYPE_OR_VALUE_EXISTS:
pass
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError("Can't contact LDAP server")
else:
profile_settings = ProfileSettingsForm()
return render(request, 'settings-profile.html', {
'profile_settings': profile_settings,
'user_info': user_info,
})
@strong_auth_required
@otp_required
def password_settings(request):
""" Password settings """
with get_bound_ldapuser(request) as user_info:
password_settings = None
if request.method == "POST":
password_settings = PasswordSettingsForm(request.POST)
if password_settings.is_valid():
try:
new_password = password_settings.cleaned_data[
'new_password']
new_password_verify = password_settings.cleaned_data[
'new_password_verify']
old_password = password_settings.cleaned_data[
'old_password']
if old_password and (new_password == new_password_verify):
for hash in list(user_info.password):
print hash
try:
if ldap_md5_crypt.verify(old_password, hash):
user_info.password.append(
ldap_md5_crypt.encrypt(
new_password_verify))
user_info.password.remove(hash)
break
except ValueError:
# ignore unknown hashes
pass
try:
user_info.save()
except IntegrityError:
pass
except ldap.TYPE_OR_VALUE_EXISTS:
pass
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError("Can't contact LDAP server")
else:
password_settings = PasswordSettingsForm()
return render(request, 'settings-password.html', {
'password_settings': password_settings,
'user_info': user_info,
})
@strong_auth_required
@otp_required
def email_settings(request):
""" Email Settings """
with get_bound_ldapuser(request) as user_info:
email_settings = None
if request.method == "POST":
email_settings = EmailSettingsForm(request.POST)
if email_settings.is_valid():
try:
email = email_settings.cleaned_data['email']
gravatar_mail = email_settings.cleaned_data['gravatar']
if request.POST.get('delete'):
user_info.email.remove(email)
else:
user_info.email.append(email)
if gravatar_mail:
gravatar_hash = hashlib.md5(gravatar_mail).hexdigest()
user_info.gravatar = gravatar_hash
try:
user_info.save()
except IntegrityError:
pass
except ldap.TYPE_OR_VALUE_EXISTS:
pass
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError("Can't contact LDAP server")
else:
email_settings = EmailSettingsForm()
return render(request, 'settings-email.html', {
'email_settings': email_settings,
'user_info': user_info,
})
@strong_auth_required
@otp_required
def contact_settings(request):
""" Contact details """
with get_bound_ldapuser(request) as user_info:
contact_settings = None
if request.method == "POST":
contact_settings = ContactSettingsForm(request.POST)
if contact_settings.is_valid():
try:
gpg_fingerprint = contact_settings.cleaned_data[
'gpg_fingerprint']
im = contact_settings.cleaned_data['im']
latitude = contact_settings.cleaned_data['latitude']
location = contact_settings.cleaned_data['location']
longitude = contact_settings.cleaned_data['longitude']
phone = contact_settings.cleaned_data['phone']
website = contact_settings.cleaned_data['website']
if location and user_info.location != location:
user_info.location = location
if user_info.phone != phone:
user_info.phone = phone
if request.POST.get('delete_web'):
user_info.website.remove(website)
elif website and (not website in user_info.website):
user_info.website.append(website)
if request.POST.get('delete_im'):
user_info.im.remove(im)
elif im and (not im in user_info.im):
user_info.im.append(im)
if user_info.longitude != longitude:
user_info.longitude = longitude
if user_info.latitude != latitude:
user_info.latitude = latitude
if request.POST.get('delete_gpg'):
user_info.gpg_fingerprint.remove(gpg_fingerprint)
elif gpg_fingerprint and \
(not gpg_fingerprint in user_info.gpg_fingerprint):
user_info.gpg_fingerprint.append(gpg_fingerprint)
try:
user_info.save()
except IntegrityError:
pass
except ldap.TYPE_OR_VALUE_EXISTS:
pass
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError("Can't contact LDAP server")
else:
contact_settings = ContactSettingsForm()
return render(request, 'settings-contact.html', {
'contact_settings': contact_settings,
'user_info': user_info,
})
@strong_auth_required
@otp_required
def gentoo_dev_settings(request):
""" Gentoo related information """
with get_bound_ldapuser(request) as user_info:
gentoo_account_settings = None
if request.method == "POST":
gentoo_account_settings = GentooAccountSettingsForm(request.POST)
if gentoo_account_settings.is_valid():
try:
devbug = gentoo_account_settings.cleaned_data[
'developer_bug']
gentoo_join_date = gentoo_account_settings.cleaned_data[
'gentoo_join_date']
gentoo_mentor = gentoo_account_settings.cleaned_data[
'mentor']
gentoo_retire_date = gentoo_account_settings.cleaned_data[
'gentoo_retire_date']
gentoo_mentor = gentoo_account_settings.cleaned_data[
'mentor']
planet_feed = gentoo_account_settings.cleaned_data[
'planet_feed']
universe_feed = gentoo_account_settings.cleaned_data[
'universe_feed']
if request.POST.get('delete_devbug'):
user_info.devbug.remove(devbug)
elif devbug and (not devbug in user_info.developer_bug):
user_info.developer_bug.append(devbug)
if request.POST.get('delete_gjd'):
user_info.gentoo_join_date.remove(gentoo_join_date)
elif gentoo_join_date and (not gentoo_join_date in user_info.gentoo_join_date):
user_info.gentoo_join_date.append(gentoo_join_date)
if request.POST.get('delete_mentor'):
user_info.mentor.remove(gentoo_mentor)
elif gentoo_mentor and \
(not gentoo_mentor in user_info.mentor):
user_info.mentor.append(gentoo_mentor)
if user_info.gentoo_retire_date:
if request.POST.get('delete_grd'):
user_info.gentoo_retire_date.remove(gentoo_retire_date)
elif gentoo_retire_date and (not gentoo_retire_date in user_info.gentoo_retire_date):
user_info.gentoo_retire_date.append(gentoo_retire_date)
if user_info.planet_feed != planet_feed:
user_info.planet_feed = planet_feed
if user_info.universe_feed != universe_feed:
user_info.universe_feed = universe_feed
try:
user_info.save()
except IntegrityError:
pass
except ldap.TYPE_OR_VALUE_EXISTS:
pass
except Exception as error:
logger.critical(error, extra=log_extra_data(request))
logger_mail.exception(error)
raise OkupyError("Can't contact LDAP server")
else:
gentoo_account_settings = GentooAccountSettingsForm()
return render(request, 'settings-gentoo.html', {
'gentoo_account_settings': gentoo_account_settings,
'user_info': user_info,
})
@strong_auth_required
@otp_required
def otp_setup(request):
dev = TOTPDevice.objects.get(user=request.user)
secret = None
conf_form = None
skeys = None
if request.method == 'POST':
if 'disable' in request.POST:
with get_bound_ldapuser(request) as user:
dev.disable(user)
elif 'confirm' in request.POST and 'otp_secret' in request.session:
secret = request.session['otp_secret']
conf_form = OTPForm(request.POST)
try:
if not conf_form.is_valid():
raise OkupyError()
token = conf_form.cleaned_data['otp_token']
# prevent reusing the same token to login
if not RevokedToken.add(token, request.user):
raise OkupyError()
if not dev.verify_token(token, secret):
raise OkupyError()
except OkupyError:
messages.error(request, 'Token verification failed.')
conf_form = OTPForm()
else:
with get_bound_ldapuser(request) as user:
dev.enable(user, secret)
secret = None
conf_form = None
sdev = SOTPDevice.objects.get(user=request.user)
skeys = sdev.gen_keys(user)
messages.info(request, 'The new secret has been set.')
elif 'enable' in request.POST:
secret = dev.gen_secret()
request.session['otp_secret'] = secret
conf_form = OTPForm()
elif 'recovery' in request.POST:
sdev = SOTPDevice.objects.get(user=request.user)
with get_bound_ldapuser(request) as user:
skeys = sdev.gen_keys(user)
messages.info(request, 'Your old recovery keys have been revoked.')
elif 'cancel' in request.POST:
messages.info(request, 'Secret change aborted. Previous settings'
'are in effect.')
if secret:
# into groups of four characters
secret = ' '.join([secret[i:i + 4]
for i in range(0, len(secret), 4)])
if skeys:
# xxx xx xxx
def group_key(s):
return ' '.join([s[0:3], s[3:5], s[5:8]])
skeys = list([group_key(k) for k in skeys])
return render(request, 'otp-setup.html', {
'otp_enabled': dev.is_enabled(),
'secret': secret,
'conf_form': conf_form,
'skeys': skeys,
})
def otp_qrcode(request):
dev = TOTPDevice()
secret = request.session.get('otp_secret')
if not secret:
return HttpResponseForbidden()
qr = qrcode.make(dev.get_uri(secret), box_size=5)
f = io.BytesIO()
qr.save(f, 'PNG')
return HttpResponse(f.getvalue(), content_type='image/png')
# OpenID-specific
def endpoint_url(request):
return request.build_absolute_uri(reverse(openid_endpoint))
def get_openid_server(request):
store = DjangoDBOpenIDStore()
return Server(store, endpoint_url(request))
def render_openid_response(request, oresp, srv=None):
if srv is None:
srv = get_openid_server(request)
try:
eresp = srv.encodeResponse(oresp)
except EncodingError as e:
# TODO: do we want some different heading for it?
return render(request, 'openid_endpoint.html', {
'error': str(e),
}, status=500)
dresp = HttpResponse(eresp.body, status=eresp.code)
for h, v in eresp.headers.items():
dresp[h] = v
return dresp
@csrf_exempt
def openid_endpoint(request):
if request.method == 'POST':
req = request.POST
else:
req = request.GET
srv = get_openid_server(request)
try:
oreq = srv.decodeRequest(req)
except ProtocolError as e:
if e.whichEncoding() == ENCODE_URL:
return redirect(e.encodeToURL())
elif e.whichEncoding() == ENCODE_HTML_FORM:
return HttpResponse(e.toHTML())
elif e.whichEncoding() == ENCODE_KVFORM:
return HttpResponse(e.encodeToKVForm(), status=400)
else:
return render(request, 'openid_endpoint.html', {
'error': str(e)
}, status=400)
if oreq is None:
return render(request, 'openid_endpoint.html')
if isinstance(oreq, CheckIDRequest):
# immediate requests not supported yet, so immediately
# reject them.
if oreq.immediate:
oresp = oreq.answer(False)
else:
request.session['openid_request'] = oreq
return redirect(openid_auth_site)
else:
oresp = srv.handleRequest(oreq)
return render_openid_response(request, oresp, srv)
def user_page(request, username):
return render(request, 'user-page.html', {
'endpoint_uri': endpoint_url(request),
})
openid_ax_attribute_mapping = {
# http://web.archive.org/web/20110714025426/http://www.axschema.org/types/
'http://axschema.org/namePerson/friendly': 'nickname',
'http://axschema.org/contact/email': 'email',
'http://axschema.org/namePerson': 'fullname',
'http://axschema.org/birthDate': 'dob',
'http://axschema.org/person/gender': 'gender',
'http://axschema.org/contact/postalCode/home': 'postcode',
'http://axschema.org/contact/country/home': 'country',
'http://axschema.org/pref/language': 'language',
'http://axschema.org/pref/timezone': 'timezone',
# TODO: provide further attributes
}
@otp_required
def openid_auth_site(request):
try:
oreq = request.session['openid_request']
except KeyError:
return render(request, 'openid-auth-site.html', {
'error': 'No OpenID request associated. The request may have \
expired.',
}, status=400)
sreg = SRegRequest.fromOpenIDRequest(oreq)
ax = FetchRequest.fromOpenIDRequest(oreq)
sreg_fields = set(sreg.allRequestedFields())
if ax:
for uri in ax.requested_attributes:
k = openid_ax_attribute_mapping.get(uri)
if k:
sreg_fields.add(k)
ldap_user = LDAPUser.objects.get(username=request.user.username)
if sreg_fields:
sreg_data = {
'nickname': ldap_user.username,
'email': ldap_user.email,
'fullname': ldap_user.full_name,
'dob': ldap_user.birthday,
}
for k in list(sreg_data):
if not sreg_data[k]:
del sreg_data[k]
else:
sreg_data = {}
sreg_fields = sreg_data.keys()
# Read preferences from the db.
try:
saved_pref = OpenID_Attributes.objects.get(
uid=ldap_user.uid,
trust_root=oreq.trust_root,
)
except OpenID_Attributes.DoesNotExist:
saved_pref = None
auto_auth = False
else:
auto_auth = saved_pref.always_auth
if auto_auth or request.POST:
if auto_auth:
# TODO: can we do this nicer?
form_inp = model_to_dict(saved_pref)
else:
form_inp = request.POST
form = SiteAuthForm(form_inp, instance=saved_pref)
# can it be invalid somehow?
assert(form.is_valid())
attrs = form.save(commit=False)
# nullify fields that were not requested
for fn in form.cleaned_data:
if fn in ('always_auth',):
pass
elif hasattr(attrs, fn) and fn not in sreg_fields:
setattr(attrs, fn, None)
if auto_auth or 'accept' in request.POST:
# prepare sreg response
for fn, send in form.cleaned_data.items():
if fn not in sreg_data:
pass
elif not send:
del sreg_data[fn]
elif isinstance(sreg_data[fn], list):
form_key = 'which_%s' % fn
val = form.cleaned_data[form_key]
if val not in sreg_data[fn]:
raise NotImplementedError(
'Changing choices not implemented yet')
sreg_data[fn] = val
if not auto_auth:
setattr(attrs, form_key, val)
if not auto_auth:
# save prefs in the db
# (if auto_auth, then nothing changed)
attrs.uid = ldap_user.uid
attrs.trust_root = oreq.trust_root
attrs.save()
oresp = oreq.answer(True, identity=request.build_absolute_uri(
reverse(user_page, args=(request.user.username,))))
sreg_resp = SRegResponse.extractResponse(sreg, sreg_data)
oresp.addExtension(sreg_resp)
if ax:
ax_resp = FetchResponse(ax)
for uri in ax.requested_attributes:
k = openid_ax_attribute_mapping.get(uri)
if k and k in sreg_data:
ax_resp.addValue(uri, sreg_data[k])
oresp.addExtension(ax_resp)
elif 'reject' in request.POST:
oresp = oreq.answer(False)
else:
return render(request, 'openid-auth-site.html', {
'error': 'Invalid request submitted.',
}, status=400)
if request.session.get('auto_logout', False):
# _logout clears request.session
_logout(request)
else:
del request.session['openid_request']
return render_openid_response(request, oresp)
form = SiteAuthForm(instance=saved_pref)
sreg_form = {}
# Fill in lists for choices
for f in sreg_fields:
if f not in sreg_data:
pass
elif isinstance(sreg_data[f], list):
form.fields['which_%s' % f].widget.choices = [
(x, x) for x in sreg_data[f]
]
sreg_form[f] = form['which_%s' % f]
else:
sreg_form[f] = format_html("<input type='text'"
+ " readonly='readonly'"
+ " value='{0}' />",
sreg_data[f])
try:
# TODO: cache it
if oreq.returnToVerified():
tr_valid = 'Return-To valid and trusted'
else:
tr_valid = 'Return-To untrusted'
except openid.yadis.discover.DiscoveryFailure:
tr_valid = 'Unable to verify trust (Yadis unsupported)'
except openid.fetchers.HTTPFetchingError:
tr_valid = 'Unable to verify trust (HTTP error)'
return render(request, 'openid-auth-site.html', {
'openid_request': oreq,
'return_to_valid': tr_valid,
'form': form,
'sreg': sreg_fields,
'sreg_form': sreg_form,
'policy_url': sreg.policy_url,
})<|fim▁end|> | logger_mail.exception(error)
raise OkupyError("Can't contact the database")
send_mail(
'%sAccount Activation' % settings.EMAIL_SUBJECT_PREFIX, |
<|file_name|>debug.go<|end_file_name|><|fim▁begin|>package main
import (
"bytes"
"io"
"log"
"os"
)
// bindata_read reads the given file from disk.
// It panics if anything went wrong.
func bindata_read(path, name string) []byte {
fd, err := os.Open(path)
if err != nil {
log.Fatalf("Read %s: %v", name, err)
}
defer fd.Close()
var buf bytes.Buffer
_, err = io.Copy(&buf, fd)
if err != nil {
log.Fatalf("Read %s: %v", name, err)
}
return buf.Bytes()
}
// in_b_test_asset reads file data from disk.
// It panics if something went wrong in the process.
func in_b_test_asset() []byte {
return bindata_read(
"/a/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/b/test.asset",
"in/b/test.asset",
)
}
// in_test_asset reads file data from disk.
// It panics if something went wrong in the process.
func in_test_asset() []byte {
return bindata_read(
"/a/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/test.asset",
"in/test.asset",
)
}
// in_a_test_asset reads file data from disk.
// It panics if something went wrong in the process.
func in_a_test_asset() []byte {
return bindata_read(<|fim▁hole|> )
}
// in_c_test_asset reads file data from disk.
// It panics if something went wrong in the process.
func in_c_test_asset() []byte {
return bindata_read(
"/a/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/c/test.asset",
"in/c/test.asset",
)
}
// Asset loads and returns the asset for the given name.
// This returns nil of the asset could not be found.
func Asset(name string) []byte {
if f, ok := _bindata[name]; ok {
return f()
}
return nil
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() []byte{
"in/b/test.asset": in_b_test_asset,
"in/test.asset": in_test_asset,
"in/a/test.asset": in_a_test_asset,
"in/c/test.asset": in_c_test_asset,
}<|fim▁end|> | "/a/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/a/test.asset",
"in/a/test.asset", |
<|file_name|>PersistentBuffer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2018 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import os.path
from twisted.enterprise import adbapi
from calvin.runtime.south.async import async
from calvin.utilities.calvinlogger import get_logger
from calvin.runtime.south.calvinsys import base_calvinsys_object
_log = get_logger(__name__)
class PersistentBuffer(base_calvinsys_object.BaseCalvinsysObject):
"""
Asynchronous (using twisted adbapi) SQLite-based implementation of persistant queue
Based on the following (from sqlite.org):
1) If no ROWID is specified on the insert [...] then an appropriate ROWID is created automatically.
2) The usual algorithm is to give the newly created row a ROWID that is one larger than the largest
ROWID in the table prior to the insert.
3) If the table is initially empty, then a ROWID of 1 is used.
4) If the largest ROWID is equal to the largest possible integer (9223372036854775807) then the
database engine starts picking positive candidate ROWIDs at random until it finds one
that is not previously used.
5) The normal ROWID selection [...] will generate monotonically increasing unique ROWIDs as long
as you never use the maximum ROWID value and you never delete the entry in the table with the largest ROWID.
Since we are implementing a FIFO queue, 1) should ensure there is a row id, 2) & 5) that the ordering is correct
and 3) that the rowid is reset whenever the queue is emptied, so 4) should never happen.
"""
init_schema = {
"type": "object",
"properties": {
"buffer_id": {
"description": "Buffer identifier, should be unique - will be used as part of filename",
"type": "string",
"pattern": "^[a-zA-Z0-9]+"
},
"reporting": {
"description": "Log some statistics on buffer at given interval (in seconds)",
"type": "number"
}
},
"required": ["buffer_id"],
"description": "Initialize buffer"
}
can_write_schema = {
"description": "Returns True if buffer ready for write, otherwise False",
"type": "boolean"
}
write_schema = {
"description": "Push data to buffer; always a list of json serializable items",
"type": "array"
}
can_read_schema = {
"description": "Returns True if data can be read, otherwise False",
"type": "boolean"
}
read_schema = {
"description": "Pop data from buffer, always a list",
"type": "array"
}
def init(self, buffer_id, reporting=None, *args, **kwargs):
self.db_name = buffer_id
self.db_path = os.path.join(os.path.abspath(os.path.curdir), self.db_name + ".sq3")
self.db = adbapi.ConnectionPool('sqlite3', self.db_path, check_same_thread=False)
self._pushed_values = 0
self._popped_values = 0
self._latest_timestamp = 0
self._value = None
self._changed = None
self._statlogging = None
def ready(length):
def log_stats():
_log.info("{} : pushed {}, popped {} (latest timestamp: {}) ".format(self.db_name, self._pushed_values, self._popped_values, self._latest_timestamp))
self._statlogging.reset()
self._changed = True # Something has changed, need to check if readable
# install timer to report on pushing/popping
if reporting:
self._statlogging= async.DelayedCall(reporting, log_stats)
self.scheduler_wakeup()
def create(db):
# Create simple queue table. Using TEXT unless there is a reason not to.
db.execute("CREATE TABLE IF NOT EXISTS queue (value BLOB)")
def error(e):
_log.error("Error initializing queue {}: {}".format(self.db_name, e))
q = self.db.runInteraction(create)
q.addCallback(ready)
q.addErrback(error)
def can_write(self):
# Can always write after init, meaning changed is no longer None
return self._changed is not None
def write(self, value):
def error(e):
_log.warning("Error during write: {}".format(e))
done() # Call done to wake scheduler, not sure this is a good idea
def done(unused=None):
self._changed = True # Let can_read know there may be something new to read
self.scheduler_wakeup()
self._pushed_values += len(value)
try:
value = json.dumps(value) # Convert to string for sqlite
except TypeError:
_log.error("Value is not json serializable")
else:
q = self.db.runOperation("INSERT INTO queue (value) VALUES (?)", (value, ))
q.addCallback(done)
q.addErrback(error)
def can_read(self):
def error(e):
_log.warning("Error during read: {}".format(e))
done()
def done(value=None):
if value:
self._changed = True # alert can_read that the database has changed
self._value = value
self.scheduler_wakeup()
def pop(db):
limit = 2 # <- Not empirically/theoretically tested
db.execute("SELECT value FROM queue ORDER BY rowid LIMIT (?)", (limit,))
value = db.fetchall() # a list of (value, ) tuples, or None
if value:
# pop values (i.e. delete rows with len(value) lowest row ids)
db.execute("DELETE FROM queue WHERE rowid in (SELECT rowid FROM queue ORDER BY rowid LIMIT (?))",
(len(value),))
return value
if self._value :
# There is a value to read
return True
elif self._changed :
# Something has changed, try to pop a value
self._changed = False
q = self.db.runInteraction(pop)
q.addCallback(done)<|fim▁hole|>
def read(self):
value = []
while self._value:
# get an item from list of replies
dbtuple = self._value.pop(0)
# the item is a tuple, get the first value
dbvalue = dbtuple[0]
# convert value from string and return it
try:
value.extend(json.loads(dbvalue))
except ValueError:
_log.error("No value decoded - possibly corrupt file")
self._popped_values += len(value)
return value
def close(self):
if self._statlogging:
self._statlogging.cancel()
def done(response):
# A count response; [(cnt,)]
if response[0][0] == 0:
try:
os.remove(self.db_path)
except:
# Failed for some reason
_log.warning("Could not remove db file {}".format(self._dbpath))
q = self.db.runQuery("SELECT COUNT(*) from queue")
q.addCallback(done)
self.db.close()<|fim▁end|> | q.addErrback(error)
# Nothing to do
return False |
<|file_name|>test_submitter_app.py<|end_file_name|><|fim▁begin|># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import mock
import time
import json
from nose.tools import eq_, ok_, assert_raises
from socorro.submitter.submitter_app import (
SubmitterApp,
SubmitterFileSystemWalkerSource,
)
from configman.dotdict import DotDict
from socorro.external.crashstorage_base import Redactor
from socorro.unittest.testbase import TestCase
<|fim▁hole|>def sequencer(*args):
list_of_args = list(args)
def foo(*fargs, **fkwargs):
try:
return list_of_args.pop()
except IndexError:
return None
return foo
def generator_for_sequence(*args):
list_of_args = list(args)
def foo(*fargs, **fkwargs):
try:
yield list_of_args.pop()
except IndexError:
return
return foo
class TestSubmitterFileSystemWalkerSource(TestCase):
def get_standard_config(self):
config = DotDict()
config.search_root = None
config.dump_suffix = '.dump'
config.dump_field = "upload_file_minidump"
config.redactor_class = Redactor
config.forbidden_keys = Redactor.required_config.forbidden_keys.default
config.logger = mock.MagicMock()
return config
def test_setup(self):
config = self.get_standard_config()
sub_walker = SubmitterFileSystemWalkerSource(config)
eq_(sub_walker.config, config)
eq_(sub_walker.config.logger, config.logger)
def test_get_raw_crash(self):
config = self.get_standard_config()
sub_walker = SubmitterFileSystemWalkerSource(config)
raw = ('{"name":"Gabi", ''"submitted_timestamp":"%d"}' % time.time())
fake_raw_crash = DotDict(json.loads(raw))
mocked_get_raw_crash = mock.Mock(return_value=fake_raw_crash)
sub_walker.get_raw_crash = mocked_get_raw_crash
path_tuple = ['6611a662-e70f-4ba5-a397-69a3a2121129.dump',
'6611a662-e70f-4ba5-a397-69a3a2121129.flash1.dump',
'6611a662-e70f-4ba5-a397-69a3a2121129.flash2.dump',
]
raw_crash = sub_walker.get_raw_crash(path_tuple)
ok_(isinstance(raw_crash, DotDict))
eq_(raw_crash['name'], 'Gabi')
def test_get_raw_dumps_as_files(self):
config = self.get_standard_config()
sub_walker = SubmitterFileSystemWalkerSource(config)
dump_pathnames = (
'6611a662-e70f-4ba5-a397-69a3a2121129',
(
'raw_crash_file',
'/some/path/6611a662-e70f-4ba5-a397-69a3a2121129.dump',
'/some/path/6611a662-e70f-4ba5-a397-69a3a2121129.flash1.dump',
'/some/path/6611a662-e70f-4ba5-a397-69a3a2121129.flash2.dump',
),
)
raw_dumps_files = sub_walker.get_raw_dumps_as_files(dump_pathnames)
dump_names = {
'upload_file_minidump': '/some/path/6611a662-e70f-4ba5-a397-69a3a2121129.dump',
'flash1': '/some/path/6611a662-e70f-4ba5-a397-69a3a2121129.flash1.dump',
'flash2': '/some/path/6611a662-e70f-4ba5-a397-69a3a2121129.flash2.dump'
}
ok_(isinstance(raw_dumps_files, dict))
eq_(raw_dumps_files, dump_names)
def test_new_crashes(self):
sequence = [
(
'./',
'6611a662-e70f-4ba5-a397-69a3a2121129.json',
'./6611a662-e70f-4ba5-a397-69a3a2121129.json',
),
(
'./',
'6611a662-e70f-4ba5-a397-69a3a2121129.upload.dump',
'./6611a662-e70f-4ba5-a397-69a3a2121129.upload.dump',
),
(
'./',
'7611a662-e70f-4ba5-a397-69a3a2121129.json',
'./7611a662-e70f-4ba5-a397-69a3a2121129.json',
),
(
'./',
'7611a662-e70f-4ba5-a397-69a3a2121129.other.dump',
'./7611a662-e70f-4ba5-a397-69a3a2121129.other.dump',
),
(
'./',
'7611a662-e70f-4ba5-a397-69a3a2121129.other.txt',
'./7611a662-e70f-4ba5-a397-69a3a2121129.other.txt',
),
(
'./',
'8611a662-e70f-4ba5-a397-69a3a2121129.json',
'./8611a662-e70f-4ba5-a397-69a3a2121129.json',
)
]
def findFileGenerator_mock_method(root, method):
for x in sequence:
if method(x):
yield x
def listdir_mock_method(a_path):
for x in sequence:
yield x[1]
config = self.get_standard_config()
expected = [
(
((
'6611a662-e70f-4ba5-a397-69a3a2121129',
[
'./6611a662-e70f-4ba5-a397-69a3a2121129.json',
'./6611a662-e70f-4ba5-a397-69a3a2121129.upload.dump'
],
), ),
{}
),
(
((
'7611a662-e70f-4ba5-a397-69a3a2121129',
[
'./7611a662-e70f-4ba5-a397-69a3a2121129.json',
'./7611a662-e70f-4ba5-a397-69a3a2121129.other.dump'
],
), ),
{}
),
(
((
'8611a662-e70f-4ba5-a397-69a3a2121129',
[
'./8611a662-e70f-4ba5-a397-69a3a2121129.json'
]
), ),
{}
),
]
find_patch_path = 'socorro.submitter.submitter_app.findFileGenerator'
with mock.patch(
find_patch_path,
new_callable=lambda: findFileGenerator_mock_method
):
listdir_patch_path = 'socorro.submitter.submitter_app.listdir'
with mock.patch(
listdir_patch_path,
new_callable=lambda: listdir_mock_method
):
sub_walker = SubmitterFileSystemWalkerSource(config)
result = [x for x in sub_walker.new_crashes()]
eq_(result, expected)
class TestSubmitterApp(TestCase):
def get_standard_config(self):
config = DotDict()
config.source = DotDict()
mocked_source_crashstorage = mock.Mock()
mocked_source_crashstorage.id = 'mocked_source_crashstorage'
config.source.crashstorage_class = mock.Mock(
return_value=mocked_source_crashstorage
)
config.destination = DotDict()
mocked_destination_crashstorage = mock.Mock()
mocked_destination_crashstorage.id = 'mocked_destination_crashstorage'
config.destination.crashstorage_class = mock.Mock(
return_value=mocked_destination_crashstorage
)
config.producer_consumer = DotDict()
mocked_producer_consumer = mock.Mock()
mocked_producer_consumer.id = 'mocked_producer_consumer'
config.producer_consumer.producer_consumer_class = mock.Mock(
return_value=mocked_producer_consumer
)
config.producer_consumer.number_of_threads = float(1)
config.new_crash_source = DotDict()
config.new_crash_source.new_crash_source_class = None
config.submitter = DotDict()
config.submitter.delay = 0
config.submitter.dry_run = False
config.number_of_submissions = "all"
config.logger = mock.MagicMock()
return config
def get_new_crash_source_config(self):
config = DotDict()
config.source = DotDict()
mocked_source_crashstorage = mock.Mock()
mocked_source_crashstorage.id = 'mocked_source_crashstorage'
config.source.crashstorage_class = mock.Mock(
return_value=mocked_source_crashstorage
)
config.destination = DotDict()
mocked_destination_crashstorage = mock.Mock()
mocked_destination_crashstorage.id = 'mocked_destination_crashstorage'
config.destination.crashstorage_class = mock.Mock(
return_value=mocked_destination_crashstorage
)
config.producer_consumer = DotDict()
mocked_producer_consumer = mock.Mock()
mocked_producer_consumer.id = 'mocked_producer_consumer'
config.producer_consumer.producer_consumer_class = mock.Mock(
return_value=mocked_producer_consumer
)
config.producer_consumer.number_of_threads = float(1)
config.new_crash_source = DotDict()
mocked_new_crash_source = mock.Mock()
mocked_new_crash_source.id = 'mocked_new_crash_source'
config.new_crash_source.new_crash_source_class = mock.Mock(
return_value=mocked_new_crash_source
)
config.submitter = DotDict()
config.submitter.delay = 0
config.submitter.dry_run = False
config.number_of_submissions = "all"
config.logger = mock.MagicMock()
return config
def test_setup(self):
config = self.get_standard_config()
sub = SubmitterApp(config)
eq_(sub.config, config)
eq_(sub.config.logger, config.logger)
def test_transform(self):
config = self.get_standard_config()
sub = SubmitterApp(config)
sub._setup_source_and_destination()
crash_id = '86b58ff2-9708-487d-bfc4-9dac32121214'
fake_raw_crash = DotDict()
mocked_get_raw_crash = mock.Mock(return_value=fake_raw_crash)
sub.source.get_raw_crash = mocked_get_raw_crash
fake_dump = {'upload_file_minidump': 'fake dump'}
mocked_get_raw_dumps_as_files = mock.Mock(return_value=fake_dump)
sub.source.get_raw_dumps_as_files = mocked_get_raw_dumps_as_files
sub.destination.save_raw_crash = mock.Mock()
sub.transform(crash_id)
sub.source.get_raw_crash.assert_called_with(crash_id)
sub.source.get_raw_dumps_as_files.assert_called_with(crash_id)
sub.destination.save_raw_crash_with_file_dumps.assert_called_with(
fake_raw_crash,
fake_dump,
crash_id
)
def test_source_iterator(self):
# Test with number of submissions equal to all
# It raises StopIterations after all the elements were called
config = self.get_standard_config()
config.number_of_submissions = "all"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
sub.source.new_crashes = lambda: iter([1, 2, 3])
itera = sub.source_iterator()
eq_(itera.next(), ((1,), {}))
eq_(itera.next(), ((2,), {}))
eq_(itera.next(), ((3,), {}))
assert_raises(StopIteration, itera.next)
# Test with number of submissions equal to forever
# It never raises StopIterations
config = self.get_standard_config()
config.number_of_submissions = "forever"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
itera = sub.source_iterator()
sub.source.new_crashes = lambda: iter([1, 2, 3])
eq_(itera.next(), ((1,), {}))
eq_(itera.next(), ((2,), {}))
eq_(itera.next(), ((3,), {}))
eq_(itera.next(), ((1,), {}))
eq_(itera.next(), ((2,), {}))
eq_(itera.next(), ((3,), {}))
# Test with number of submissions equal to an integer > number of items
# It raises StopIterations after some number of elements were called
config = self.get_standard_config()
config.number_of_submissions = "5"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
itera = sub.source_iterator()
sub.source.new_crashes = lambda: iter([1, 2, 3])
eq_(itera.next(), ((1,), {}))
eq_(itera.next(), ((2,), {}))
eq_(itera.next(), ((3,), {}))
eq_(itera.next(), ((1,), {}))
eq_(itera.next(), ((2,), {}))
assert_raises(StopIteration, itera.next)
# Test with number of submissions equal to an integer < number of items
# It raises StopIterations after some number of elements were called
config = self.get_standard_config()
config.number_of_submissions = "1"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
itera = sub.source_iterator()
sub.source.new_crashes = lambda: iter([1, 2, 3])
eq_(itera.next(), ((1,), {}))
assert_raises(StopIteration, itera.next)
def test_new_crash_source_iterator(self):
# Test with number of submissions equal to all
# It raises StopIterations after all the elements were called
config = self.get_new_crash_source_config()
config.number_of_submissions = "all"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
config.new_crash_source.new_crash_source_class.return_value \
.new_crashes = lambda: iter([1, 2, 3])
itera = sub.source_iterator()
eq_(itera.next(), ((1,), {}))
eq_(itera.next(), ((2,), {}))
eq_(itera.next(), ((3,), {}))
assert_raises(StopIteration, itera.next)
# Test with number of submissions equal to forever
# It never raises StopIterations
config = self.get_new_crash_source_config()
config.number_of_submissions = "forever"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
itera = sub.source_iterator()
# setup a fake iter using two form of the data to ensure it deals
# with both forms correctly.
config.new_crash_source.new_crash_source_class.return_value \
.new_crashes = lambda: iter([1, ((2, ), {}), 3])
eq_(itera.next(), ((1,), {}))
eq_(itera.next(), ((2,), {}))
eq_(itera.next(), ((3,), {}))
eq_(itera.next(), ((1,), {}))
eq_(itera.next(), ((2,), {}))
eq_(itera.next(), ((3,), {}))
# Test with number of submissions equal to an integer > number of items
# It raises StopIterations after some number of elements were called
config = self.get_new_crash_source_config()
config.number_of_submissions = "5"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
itera = sub.source_iterator()
def _iter():
return iter([((1, ), {'finished_func': (1,)}), 2, 3])
config.new_crash_source.new_crash_source_class.return_value.new_crashes = _iter
eq_(itera.next(), ((1,), {'finished_func': (1,)}))
eq_(itera.next(), ((2,), {}))
eq_(itera.next(), ((3,), {}))
eq_(itera.next(), ((1,), {'finished_func': (1,)}))
eq_(itera.next(), ((2,), {}))
assert_raises(StopIteration, itera.next)
# Test with number of submissions equal to an integer < number of items
# It raises StopIterations after some number of elements were called
config = self.get_new_crash_source_config()
config.number_of_submissions = "1"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
itera = sub.source_iterator()
config.new_crash_source.new_crash_source_class.return_value \
.new_crashes = lambda: iter([1, 2, 3])
eq_(itera.next(), ((1,), {}))
assert_raises(StopIteration, itera.next)
# Test with number of submissions equal to an integer < number of items
# AND the new_crashes iter returning an args, kwargs form rather than
# than a crash_id
# It raises StopIterations after some number of elements were called
config = self.get_new_crash_source_config()
config.number_of_submissions = "2"
sub = SubmitterApp(config)
sub._setup_source_and_destination()
sub._setup_task_manager()
itera = sub.source_iterator()
config.new_crash_source.new_crash_source_class.return_value \
.new_crashes = lambda: iter(
[
(((1, ['./1.json', './1.dump', './1.other.dump']), ), {}),
(((2, ['./2.json', './1.dump']), ), {})
]
)
eq_(
itera.next(),
(((1, ['./1.json', './1.dump', './1.other.dump']), ), {})
)
eq_(
itera.next(),
(((2, ['./2.json', './1.dump']), ), {})
)
assert_raises(StopIteration, itera.next)<|fim▁end|> | |
<|file_name|>cancel.ts<|end_file_name|><|fim▁begin|>/**
* @docs https://docs.mollie.com/reference/v2/refunds-api/cancel-refund
*/
import createMollieClient from '@mollie/api-client';
const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });
(async () => {
try {<|fim▁hole|> console.log(status);
} catch (error) {
console.warn(error);
}
})();<|fim▁end|> | const status: boolean = await mollieClient.paymentRefunds.cancel('re_4qqhO89gsT', { paymentId: 'tr_WDqYK6vllg' });
|
<|file_name|>readme.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate linxal;
extern crate ndarray;
use linxal::types::{c32, LinxalMatrix};<|fim▁hole|>use linxal::solve_linear::SolveLinear;
use ndarray::{arr1, arr2};
fn f1() {
let m = arr2(&[[1.0f32, 2.0],
[-2.0, 1.0]]);
let r = m.eigenvalues();
assert!(r.is_ok());
let r = r.unwrap();
let true_evs = arr1(&[c32::new(1.0, 2.0), c32::new(1.0, -2.0)]);
assert_eq_within_tol!(true_evs, r, 0.01);
let b = arr1(&[-1.0, 1.0]);
let x = m.solve_linear(&b).unwrap();
let true_x = arr1(&[-0.6, -0.2]);
assert_eq_within_tol!(x, true_x, 0.0001);
}
fn f2() {
let m = arr2(&[[1.0f32, 2.0],
[-2.0, 1.0]]);
let r = Eigen::compute(&m, false, false);
assert!(r.is_ok());
let r = r.unwrap();
let true_evs = arr1(&[c32::new(1.0, 2.0), c32::new(1.0, -2.0)]);
assert_eq_within_tol!(true_evs, r.values, 0.01);
let b = arr1(&[-1.0, 1.0]);
let x = SolveLinear::compute(&m, &b).unwrap();
let true_x = arr1(&[-0.6, -0.2]);
assert_eq_within_tol!(x, true_x, 0.0001);
}
fn main() {
f1();
f2();
}<|fim▁end|> | use linxal::eigenvalues::Eigen; |
<|file_name|>readsensors.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Questo file legge il file di configurazione,
# trova e modifica il parametro eseguendo il rispettivo "write*.py"
# Serve per la parte di gestione html in python
import cgi
import cgitb
# Abilita gli errori al server web/http
cgitb.enable()
# Le mie librerie Json, Html, flt (Thermo(Redis))
import mjl, mhl, flt
import redis,os # Questa volta servira` anche os ?
# Parametri generali
TestoPagina="Configurazione sensori di temperatura"
ConfigFile="../conf/thermo.json"
WriteFile="/cgi-bin/writesensors.py"
# Redis "key"
RedisKey = "sensore:temperatura"
# 1 wire
Dir1w = "/sys/bus/w1/devices/"
# Apro il database Redis con l'istruzione della mia libreria
MyDB = flt.OpenDBFile(ConfigFile)
# Cerco i sensori
List1wire = os.listdir(Dir1w)
List1wire.remove("w1_bus_master1")
# Genero le chiavi se non esistono
for i in List1wire:
if not MyDB.exists(RedisKey+":"+i):
MyDB.set(RedisKey+":"+i,"Sensore"+i)
# Elimino quelle che non esistono piu`
for i in MyDB.keys(RedisKey+":*"):
Esiste=""
for j in List1wire:
if flt.Decode(i) == RedisKey+":"+j:
Esiste="True"
if not Esiste:
MyDB.delete(i)
# Start web page - Uso l'intestazione "web" della mia libreria
print (mhl.MyHtml())
print (mhl.MyHtmlHead())
<|fim▁hole|>print ("<h1>","<center>",TestoPagina,"</center>","</h1>")
#print ("<hr/>","<br/>")
# Eventuale help/annotazione
print ("""
Questo cerca le sonde di temperatura, genera automaticamente le chiavi redis, eliminando eventuali sonde che non sono piu` collegate.
<br/>
L'inserimento e` possibile per la sola descrizione, che servira` al riconoscimento del sensore, nel caso ve ne fosse piu` di uno collegato.
<br/>
<br/>
<i>Inserire una descrizione di riconoscimento, la piu` breve possibile.</i>
<br/>
<br/>
<b>Ricorda di riconfigurare il PID ed eliminare/archiviare "temperature.csv" fer forzare la riscrittura dell'intestazione.</b>
<hr/>
<br/>
""")
# Inizio del form
print (mhl.MyActionForm(WriteFile,"POST"))
print ("<table>")
# Questa volta ho tante chiavi ..
for i in List1wire:
# La prima voce non e` modificabile ed e` la chiave Redis (solo visualizzazione)
print ("<tr>")
print ("<td>")
print ("Key: ")
print ("</td>")
print ("<td>")
print (mhl.MyTextForm("key",i,"40","required","readonly"))
print ("</td>")
print ("</tr>")
print ("<tr>")
print ("<td>")
print ("Descrizione sensore: ")
print ("</td>")
print ("<td>")
print (mhl.MyTextForm(RedisKey+":"+i,flt.Decode(MyDB.get(RedisKey+":"+i)),"40","required",""))
print ("</td>")
print ("</tr>")
print ("<tr>")
print ("<td>")
print ("")
print ("</td>")
print ("<td>")
print ("<hr/>")
print ("</td>")
print ("</tr>")
print ("<tr>")
print ("<td colspan=\"2\">")
print ("<hr/>")
print ("</td>")
print ("</tr>")
print ("<tr>")
print ("<td>")
print ("</td>")
print ("<td colspan=\"2\">")
print (mhl.MyButtonForm("submit","Submit"))
print ("</td>")
print ("</tr>")
print ("</table>")
# End form
print (mhl.MyEndForm())
# End web page
print (mhl.MyHtmlBottom())<|fim▁end|> | # Scrivo il Titolo/Testo della pagina |
<|file_name|>natsort.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals<|fim▁hole|>
from sqlalchemy import DDL, text
SQL_FUNCTION_NATSORT = '''
CREATE FUNCTION indico.natsort(value TEXT)
RETURNS bytea
AS $$
SELECT string_agg(
convert_to(coalesce(r[2], length(length(r[1])::text) || length(r[1])::text || r[1]), 'SQL_ASCII'),
' '
)
FROM regexp_matches(value, '0*([0-9]+)|([^0-9]+)', 'g') r;
$$
LANGUAGE SQL IMMUTABLE STRICT;
'''
def _should_create_function(ddl, target, connection, **kw):
sql = """
SELECT COUNT(*)
FROM information_schema.routines
WHERE routine_schema = 'indico' AND routine_name = 'natsort'
"""
count = connection.execute(text(sql)).scalar()
return not count
def create_natsort_function(conn):
DDL(SQL_FUNCTION_NATSORT).execute_if(callable_=_should_create_function).execute(conn)<|fim▁end|> | |
<|file_name|>audio_item.py<|end_file_name|><|fim▁begin|>__author__ = 'bromix'
from .base_item import BaseItem
class AudioItem(BaseItem):
def __init__(self, name, uri, image=u'', fanart=u''):
BaseItem.__init__(self, name, uri, image, fanart)
self._duration = None
self._track_number = None
self._year = None
self._genre = None
self._album = None
self._artist = None
self._title = name
self._rating = None
def set_rating(self, rating):
self._rating = float(rating)
def get_rating(self):
return self._rating
def set_title(self, title):
self._title = unicode(title)
def get_title(self):
return self._title
def set_artist_name(self, artist_name):
self._artist = unicode(artist_name)
def get_artist_name(self):
return self._artist
def set_album_name(self, album_name):
self._album = unicode(album_name)
def get_album_name(self):
return self._album
def set_genre(self, genre):
self._genre = unicode(genre)
def get_genre(self):
return self._genre
def set_year(self, year):
self._year = int(year)
def set_year_from_datetime(self, date_time):
self.set_year(date_time.year)
def get_year(self):
return self._year
def set_track_number(self, track_number):
self._track_number = int(track_number)
def get_track_number(self):
return self._track_number
def set_duration_from_milli_seconds(self, milli_seconds):
self.set_duration_from_seconds(int(milli_seconds) / 1000)
def set_duration_from_seconds(self, seconds):
self._duration = int(seconds)
def set_duration_from_minutes(self, minutes):
self.set_duration_from_seconds(int(minutes) * 60)
<|fim▁hole|><|fim▁end|> | def get_duration(self):
return self._duration |
<|file_name|>0063_populate_uuid_values.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-09-05 09:13
from __future__ import unicode_literals
import uuid
from django.core.exceptions import FieldDoesNotExist
from django.db import migrations
def set_uuid_field(apps, schema_editor):
"""
Set a random uuid value to all existing rows in all models containing an 'uuid' attribute in database.
"""
base = apps.get_app_config('base')<|fim▁hole|> for pk in ids:
try:
model_class.objects.filter(pk=pk).update(uuid=uuid.uuid4())
except FieldDoesNotExist:
break
class Migration(migrations.Migration):
dependencies = [
('base', '0062_add_uuid_field'),
]
operations = [
migrations.RunPython(set_uuid_field, elidable=True, reverse_code=migrations.RunPython.noop),
]<|fim▁end|> | for model_class in base.get_models():
ids = model_class.objects.values_list('id', flat=True)
if ids: |
<|file_name|>Status.test.js<|end_file_name|><|fim▁begin|>import React from 'react';
import Status from 'components/Status';
import renderer from 'react-test-renderer';
describe('Status component', () => {
function getComponent(piecesLeftCount) {
return renderer.create(
<Status piecesLeftCount={piecesLeftCount} />
);
}
it('should show pieces left', () => {
expect(getComponent(9).toJSON()).toMatchSnapshot();
});<|fim▁hole|> expect(getComponent(0).toJSON()).toMatchSnapshot();
});
});<|fim▁end|> |
it('should show "Done" when no pieces left', () => { |
<|file_name|>touch_buttons.cpp<|end_file_name|><|fim▁begin|>/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_TOUCH_BUTTONS
#include "touch_buttons.h"
#include "../scaled_tft.h"
#include HAL_PATH(../../HAL, tft/xpt2046.h)
XPT2046 touchIO;
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
#include "../tft_io/touch_calibration.h"
#endif
#include "../buttons.h" // For EN_C bit mask
#include "../marlinui.h" // For ui.refresh
#include "../tft_io/tft_io.h"
#define DOGM_AREA_LEFT TFT_PIXEL_OFFSET_X
#define DOGM_AREA_TOP TFT_PIXEL_OFFSET_Y
#define DOGM_AREA_WIDTH (GRAPHICAL_TFT_UPSCALE) * (LCD_PIXEL_WIDTH)
#define DOGM_AREA_HEIGHT (GRAPHICAL_TFT_UPSCALE) * (LCD_PIXEL_HEIGHT)
#define BUTTON_AREA_TOP BUTTON_Y_LO
#define BUTTON_AREA_BOT BUTTON_Y_HI
TouchButtons touch;
void TouchButtons::init() { touchIO.Init(); }
uint8_t TouchButtons::read_buttons() {
#ifdef HAS_WIRED_LCD
int16_t x, y;
const bool is_touched = (TERN(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration.orientation, TOUCH_ORIENTATION) == TOUCH_PORTRAIT ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y));
if (!is_touched) return 0;
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
const calibrationState state = touch_calibration.get_calibration_state();
if (state >= CALIBRATION_TOP_LEFT && state <= CALIBRATION_BOTTOM_RIGHT) {
if (touch_calibration.handleTouch(x, y)) ui.refresh();
return 0;
}
x = int16_t((int32_t(x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x;
y = int16_t((int32_t(y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y;
#else
x = uint16_t((uint32_t(x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X;
y = uint16_t((uint32_t(y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y;
#endif
// Touch within the button area simulates an encoder button
if (y > BUTTON_AREA_TOP && y < BUTTON_AREA_BOT)
return WITHIN(x, BUTTOND_X_LO, BUTTOND_X_HI) ? EN_D
: WITHIN(x, BUTTONA_X_LO, BUTTONA_X_HI) ? EN_A
: WITHIN(x, BUTTONB_X_LO, BUTTONB_X_HI) ? EN_B
: WITHIN(x, BUTTONC_X_LO, BUTTONC_X_HI) ? EN_C
: 0;
if ( !WITHIN(x, DOGM_AREA_LEFT, DOGM_AREA_LEFT + DOGM_AREA_WIDTH)
|| !WITHIN(y, DOGM_AREA_TOP, DOGM_AREA_TOP + DOGM_AREA_HEIGHT)
) return 0;
// Column and row above BUTTON_AREA_TOP
int8_t col = (x - (DOGM_AREA_LEFT)) * (LCD_WIDTH) / (DOGM_AREA_WIDTH),
row = (y - (DOGM_AREA_TOP)) * (LCD_HEIGHT) / (DOGM_AREA_HEIGHT);
<|fim▁hole|> MarlinUI::screen_click(row, col, x, y);
#endif
return 0;
}
#endif // HAS_TOUCH_BUTTONS<|fim▁end|> | // Send the touch to the UI (which will simulate the encoder wheel) |
<|file_name|>device-id-server.js<|end_file_name|><|fim▁begin|>Meteor.methods({<|fim▁hole|> 'deviceId/isClaimed': function(deviceId) {
check(deviceId, String);
return isClaimed(deviceId)
},
'deviceId/gen': function() {
return gen();
},
'deviceId/store': function(deviceId) {
check(deviceId, String);
return store(deviceId);
},
});
var isClaimed = function(deviceId) {
return !!DeviceIds.findOne({deviceId: deviceId})
}
var gen = function() {
var deviceId = Random.id();
if(isClaimed(deviceId))
return gen();
store(deviceId);
return deviceId;
}
var store = function(deviceId) {
if(isClaimed(deviceId))
throw new Meteor.Error('device-already-exists', "That deviceId already exists.")
return !!DeviceIds.insert({deviceId: deviceId})
}
_.extend(DeviceId, {
isClaimed: isClaimed
})<|fim▁end|> | |
<|file_name|>tab_jsp.java<|end_file_name|><|fim▁begin|>/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.53
* Generated at: 2015-06-08 03:36:45 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.prefs;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class tab_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ff_005fview;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005fview_005fcontent;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ff_005fverbatim;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fform_0026_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005ftool_005fbar;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005ff_005fview = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005fview_005fcontent = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ff_005fverbatim = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fform_0026_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005ff_005fview.release();
_005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle.release();
_005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody.release();
_005fjspx_005ftagPool_005fsakai_005fview_005fcontent.release();
_005fjspx_005ftagPool_005ff_005fverbatim.release();
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.release();
_005fjspx_005ftagPool_005fh_005fform_0026_005fid.release();
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar.release();
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.release();
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered.release();
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.release();
_005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody.release();
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.release();
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.release();
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.release();
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody.release();
_005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout.release();
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.release();
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
if (_jspx_meth_f_005fview_005f0(_jspx_page_context))
return;
out.write('\n');
out.write('\n');
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_f_005fview_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// f:view
com.sun.faces.taglib.jsf_core.ViewTag _jspx_th_f_005fview_005f0 = (com.sun.faces.taglib.jsf_core.ViewTag) _005fjspx_005ftagPool_005ff_005fview.get(com.sun.faces.taglib.jsf_core.ViewTag.class);
_jspx_th_f_005fview_005f0.setPageContext(_jspx_page_context);
_jspx_th_f_005fview_005f0.setParent(null);
int _jspx_eval_f_005fview_005f0 = _jspx_th_f_005fview_005f0.doStartTag();
if (_jspx_eval_f_005fview_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fview_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fview_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fview_005f0.doInitBody();
}
do {
out.write('\n');
if (_jspx_meth_sakai_005fview_005fcontainer_005f0(_jspx_th_f_005fview_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write('\n');
int evalDoAfterBody = _jspx_th_f_005fview_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fview_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fview_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fview.reuse(_jspx_th_f_005fview_005f0);
return true;
}
_005fjspx_005ftagPool_005ff_005fview.reuse(_jspx_th_f_005fview_005f0);
return false;
}
private boolean _jspx_meth_sakai_005fview_005fcontainer_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fview_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// sakai:view_container
org.sakaiproject.jsf.tag.ViewTag _jspx_th_sakai_005fview_005fcontainer_005f0 = (org.sakaiproject.jsf.tag.ViewTag) _005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle.get(org.sakaiproject.jsf.tag.ViewTag.class);
_jspx_th_sakai_005fview_005fcontainer_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005fview_005fcontainer_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fview_005f0);
// /prefs/tab.jsp(10,0) name = title type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005fview_005fcontainer_005f0.setTitle("#{msgs.prefs_title}");
int _jspx_eval_sakai_005fview_005fcontainer_005f0 = _jspx_th_sakai_005fview_005fcontainer_005f0.doStartTag();
if (_jspx_eval_sakai_005fview_005fcontainer_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write('\n');
if (_jspx_meth_sakai_005fstylesheet_005f0(_jspx_th_sakai_005fview_005fcontainer_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_sakai_005fview_005fcontent_005f0(_jspx_th_sakai_005fview_005fcontainer_005f0, _jspx_page_context))
return true;
out.write('\n');
}
if (_jspx_th_sakai_005fview_005fcontainer_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle.reuse(_jspx_th_sakai_005fview_005fcontainer_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle.reuse(_jspx_th_sakai_005fview_005fcontainer_005f0);
return false;
}
private boolean _jspx_meth_sakai_005fstylesheet_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005fview_005fcontainer_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:stylesheet
org.sakaiproject.jsf.tag.StylesheetTag _jspx_th_sakai_005fstylesheet_005f0 = (org.sakaiproject.jsf.tag.StylesheetTag) _005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody.get(org.sakaiproject.jsf.tag.StylesheetTag.class);
_jspx_th_sakai_005fstylesheet_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005fstylesheet_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005fview_005fcontainer_005f0);
// /prefs/tab.jsp(11,0) name = path type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005fstylesheet_005f0.setPath("/css/prefs.css");
int _jspx_eval_sakai_005fstylesheet_005f0 = _jspx_th_sakai_005fstylesheet_005f0.doStartTag();
if (_jspx_th_sakai_005fstylesheet_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody.reuse(_jspx_th_sakai_005fstylesheet_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody.reuse(_jspx_th_sakai_005fstylesheet_005f0);
return false;
}
private boolean _jspx_meth_sakai_005fview_005fcontent_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005fview_005fcontainer_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// sakai:view_content
org.sakaiproject.jsf.tag.ViewContentTag _jspx_th_sakai_005fview_005fcontent_005f0 = (org.sakaiproject.jsf.tag.ViewContentTag) _005fjspx_005ftagPool_005fsakai_005fview_005fcontent.get(org.sakaiproject.jsf.tag.ViewContentTag.class);
_jspx_th_sakai_005fview_005fcontent_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005fview_005fcontent_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005fview_005fcontainer_005f0);
int _jspx_eval_sakai_005fview_005fcontent_005f0 = _jspx_th_sakai_005fview_005fcontent_005f0.doStartTag();
if (_jspx_eval_sakai_005fview_005fcontent_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write('\n');
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f0(_jspx_th_sakai_005fview_005fcontent_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005fform_005f0(_jspx_th_sakai_005fview_005fcontent_005f0, _jspx_page_context))
return true;
out.write('\n');
}
if (_jspx_th_sakai_005fview_005fcontent_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005fview_005fcontent.reuse(_jspx_th_sakai_005fview_005fcontent_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005fview_005fcontent.reuse(_jspx_th_sakai_005fview_005fcontent_005f0);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005fview_005fcontent_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f0 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f0.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005fview_005fcontent_005f0);
int _jspx_eval_f_005fverbatim_005f0 = _jspx_th_f_005fverbatim_005f0.doStartTag();
if (_jspx_eval_f_005fverbatim_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f0.doInitBody();
}
do {
out.write("\n");
out.write(" <script type=\"text/javascript\" src=\"/library/js/jquery/jquery-1.9.1.min.js\">//</script>\n");
out.write(" <script type=\"text/javascript\" src=\"/library/js/fluid/1.4/MyInfusion.js\">//</script>\n");
out.write(" <script type=\"text/javascript\" src=\"/sakai-user-tool-prefs/js/prefs.js\">//</script>\n");
out.write("<script type=\"text/javascript\">\n");
out.write("<!--\n");
out.write("function checkReloadTop() {\n");
out.write(" check = jQuery('input[id$=reloadTop]').val();\n");
out.write(" if (check == 'true' ) parent.location.reload();\n");
out.write("}\n");
out.write("\n");
out.write("jQuery(document).ready(function () {\n");
out.write(" setTimeout('checkReloadTop();', 1500);\n");
out.write(" setupMultipleSelect();\n");
out.write(" setupPrefsGen();\n");
out.write("});\n");
out.write("//-->\n");
out.write("</script>\n");
if (_jspx_meth_t_005foutputText_005f0(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write('\n');
if (_jspx_meth_t_005foutputText_005f1(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_t_005foutputText_005f2(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_t_005foutputText_005f3(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_t_005foutputText_005f4(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write('\n');
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f0);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f0);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f0 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f0.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(32,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f0.setStyle("display:none");
// /prefs/tab.jsp(32,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f0.setStyleClass("checkboxSelectMessage");
// /prefs/tab.jsp(32,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f0.setValue("#{msgs.prefs_checkbox_select_message}");
int _jspx_eval_t_005foutputText_005f0 = _jspx_th_t_005foutputText_005f0.doStartTag();
if (_jspx_th_t_005foutputText_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f0);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f0);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f1 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f1.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(34,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f1.setStyle("display:none");
// /prefs/tab.jsp(34,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f1.setStyleClass("movePanelMessage");
// /prefs/tab.jsp(34,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f1.setValue("Move selected sites to top of {0}");
int _jspx_eval_t_005foutputText_005f1 = _jspx_th_t_005foutputText_005f1.doStartTag();
if (_jspx_th_t_005foutputText_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f1);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f1);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f2 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f2.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(35,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f2.setStyle("display:none");
// /prefs/tab.jsp(35,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f2.setStyleClass("checkboxFromMessFav");
// /prefs/tab.jsp(35,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f2.setValue("#{msgs.prefs_fav_sites_short}");
int _jspx_eval_t_005foutputText_005f2 = _jspx_th_t_005foutputText_005f2.doStartTag();
if (_jspx_th_t_005foutputText_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f2);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f2);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f3 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f3.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(36,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f3.setStyle("display:none");
// /prefs/tab.jsp(36,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f3.setStyleClass("checkboxFromMessAct");
// /prefs/tab.jsp(36,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f3.setValue("#{msgs.prefs_active_sites_short}");
int _jspx_eval_t_005foutputText_005f3 = _jspx_th_t_005foutputText_005f3.doStartTag();
if (_jspx_th_t_005foutputText_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f3);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f3);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f4 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f4.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(37,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f4.setStyle("display:none");
// /prefs/tab.jsp(37,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f4.setStyleClass("checkboxFromMessArc");
// /prefs/tab.jsp(37,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f4.setValue("#{msgs.prefs_archive_sites_short}");
int _jspx_eval_t_005foutputText_005f4 = _jspx_th_t_005foutputText_005f4.doStartTag();
if (_jspx_th_t_005foutputText_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f4);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f4);
return false;
}
private boolean _jspx_meth_h_005fform_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005fview_005fcontent_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// h:form
com.sun.faces.taglib.html_basic.FormTag _jspx_th_h_005fform_005f0 = (com.sun.faces.taglib.html_basic.FormTag) _005fjspx_005ftagPool_005fh_005fform_0026_005fid.get(com.sun.faces.taglib.html_basic.FormTag.class);
_jspx_th_h_005fform_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fform_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005fview_005fcontent_005f0);
// /prefs/tab.jsp(40,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fform_005f0.setId("prefs_form");
int _jspx_eval_h_005fform_005f0 = _jspx_th_h_005fform_005f0.doStartTag();
if (_jspx_eval_h_005fform_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write("\t\t\t\t");
if (_jspx_meth_sakai_005ftool_005fbar_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write("\t\t\t\t<h3>\n");
out.write("\t\t\t\t\t");
if (_jspx_meth_h_005foutputText_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\t\t\t\t\t");
if (_jspx_meth_h_005fpanelGroup_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\t\t\t\t</h3>\n");
out.write(" <div class=\"act\">\n");
out.write(" ");
if (_jspx_meth_h_005fcommandButton_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_h_005fcommandButton_005f1(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" </div>\t\t\t\t\n");
out.write("\t\t\t\t\n");
out.write(" ");
if (_jspx_meth_sakai_005fmessages_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f1(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f2(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_t_005fdataList_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f7(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f8(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_t_005fdataList_005f1(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f13(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f14(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_t_005fdataList_005f2(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f19(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f20(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write('\n');
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f21(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_h_005foutputText_005f19(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_h_005fselectOneRadio_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f22(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\t \t");
if (_jspx_meth_h_005fcommandButton_005f2(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\t\t ");
if (_jspx_meth_h_005fcommandButton_005f3(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005finputHidden_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005finputHidden_005f1(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005finputHidden_005f2(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005finputHidden_005f3(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f23(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
}
if (_jspx_th_h_005fform_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fform_0026_005fid.reuse(_jspx_th_h_005fform_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fform_0026_005fid.reuse(_jspx_th_h_005fform_005f0);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar
org.sakaiproject.jsf.tag.ToolBarTag _jspx_th_sakai_005ftool_005fbar_005f0 = (org.sakaiproject.jsf.tag.ToolBarTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar.get(org.sakaiproject.jsf.tag.ToolBarTag.class);
_jspx_th_sakai_005ftool_005fbar_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_sakai_005ftool_005fbar_005f0 = _jspx_th_sakai_005ftool_005fbar_005f0.doStartTag();
if (_jspx_eval_sakai_005ftool_005fbar_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write("\t\t\t ");
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f0(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f1(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f2(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f3(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f4(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f5(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f6(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f7(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f8(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f9(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f10(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f11(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f12(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f13(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f14(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f15(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f16(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f17(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f18(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f19(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f20(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f21(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f22(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f23(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f24(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t \t");
}
if (_jspx_th_sakai_005ftool_005fbar_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar.reuse(_jspx_th_sakai_005ftool_005fbar_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar.reuse(_jspx_th_sakai_005ftool_005fbar_005f0);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f0 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(43,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(43,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(43,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setRendered("#{UserPrefsTool.noti_selection == 1}");
// /prefs/tab.jsp(43,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f0 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f0.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f0);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f1 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(44,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(44,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setRendered("#{UserPrefsTool.tab_selection == 1}");
// /prefs/tab.jsp(44,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f1 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f1.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f1);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f1);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f2 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(45,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(45,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(45,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setRendered("#{UserPrefsTool.timezone_selection == 1}");
// /prefs/tab.jsp(45,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f2 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f2.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f2);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f2);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f3 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(46,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(46,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(46,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setRendered("#{UserPrefsTool.language_selection == 1}");
// /prefs/tab.jsp(46,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f3 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f3.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f3);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f3);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f4 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(47,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(47,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(47,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setRendered("#{UserPrefsTool.privacy_selection == 1}");
// /prefs/tab.jsp(47,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f4 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f4.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f4);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f4);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f5 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(49,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(49,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(49,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setRendered("#{UserPrefsTool.noti_selection == 2}");
// /prefs/tab.jsp(49,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f5 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f5.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f5);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f5);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f6 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(50,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(50,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setRendered("#{UserPrefsTool.tab_selection == 2}");
// /prefs/tab.jsp(50,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f6 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f6.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f6);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f6);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f7 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(51,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(51,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(51,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setRendered("#{UserPrefsTool.timezone_selection == 2}");
// /prefs/tab.jsp(51,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f7 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f7.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f7);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f7);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f8 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(52,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(52,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(52,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setRendered("#{UserPrefsTool.language_selection == 2}");
// /prefs/tab.jsp(52,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f8 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f8.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f8);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f8);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f9 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(53,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(53,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(53,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setRendered("#{UserPrefsTool.privacy_selection == 2}");
// /prefs/tab.jsp(53,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f9 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f9.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f9);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f9);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f10 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(55,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(55,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(55,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setRendered("#{UserPrefsTool.noti_selection == 3}");
// /prefs/tab.jsp(55,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f10 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f10.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f10);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f10);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f11(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f11 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(56,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(56,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setRendered("#{UserPrefsTool.tab_selection == 3}");
// /prefs/tab.jsp(56,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f11 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f11.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f11);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f11);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f12(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f12 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(57,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(57,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(57,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setRendered("#{UserPrefsTool.timezone_selection == 3}");
// /prefs/tab.jsp(57,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f12 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f12.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f12);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f12);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f13(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f13 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(58,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(58,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(58,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setRendered("#{UserPrefsTool.language_selection == 3}");
// /prefs/tab.jsp(58,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f13 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f13.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f13);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f13);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f14(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f14 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(59,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(59,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(59,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setRendered("#{UserPrefsTool.privacy_selection == 3}");
// /prefs/tab.jsp(59,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f14 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f14.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f14);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f14);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f15(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f15 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(61,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(61,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(61,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setRendered("#{UserPrefsTool.noti_selection == 4}");
// /prefs/tab.jsp(61,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f15 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f15.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f15);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f15);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f16(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f16 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(62,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(62,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setRendered("#{UserPrefsTool.tab_selection == 4}");
// /prefs/tab.jsp(62,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f16 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f16.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f16);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f16);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f17(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f17 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(63,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(63,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(63,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setRendered("#{UserPrefsTool.timezone_selection == 4}");
// /prefs/tab.jsp(63,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f17 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f17.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f17);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f17);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f18(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f18 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(64,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(64,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(64,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setRendered("#{UserPrefsTool.language_selection == 4}");
// /prefs/tab.jsp(64,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f18 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f18.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f18);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f18);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f19(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f19 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(65,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(65,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(65,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setRendered("#{UserPrefsTool.privacy_selection == 4}");
// /prefs/tab.jsp(65,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f19 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f19.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f19);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f19);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f20(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f20 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(67,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(67,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(67,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setRendered("#{UserPrefsTool.noti_selection == 5}");
// /prefs/tab.jsp(67,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f20 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f20.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f20);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f20);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f21(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f21 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(68,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(68,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setRendered("#{UserPrefsTool.tab_selection == 5}");
// /prefs/tab.jsp(68,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f21 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f21.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f21);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f21);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f22(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f22 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(69,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(69,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(69,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setRendered("#{UserPrefsTool.timezone_selection == 5}");
// /prefs/tab.jsp(69,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f22 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f22.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f22);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f22);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f23(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f23 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(70,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(70,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(70,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setRendered("#{UserPrefsTool.language_selection == 5}");
// /prefs/tab.jsp(70,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f23 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f23.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f23);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f23);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f24(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f24 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(71,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(71,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(71,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setRendered("#{UserPrefsTool.privacy_selection == 5}");
// /prefs/tab.jsp(71,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f24 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f24.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f24);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f24);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f0 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(76,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f0.setValue("#{msgs.prefs_tab_title}");
int _jspx_eval_h_005foutputText_005f0 = _jspx_th_h_005foutputText_005f0.doStartTag();
if (_jspx_th_h_005foutputText_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f0);
return false;
}
private boolean _jspx_meth_h_005fpanelGroup_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// h:panelGroup
com.sun.faces.taglib.html_basic.PanelGroupTag _jspx_th_h_005fpanelGroup_005f0 = (com.sun.faces.taglib.html_basic.PanelGroupTag) _005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered.get(com.sun.faces.taglib.html_basic.PanelGroupTag.class);
_jspx_th_h_005fpanelGroup_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fpanelGroup_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(77,5) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fpanelGroup_005f0.setRendered("#{UserPrefsTool.tabUpdated}");
// /prefs/tab.jsp(77,5) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fpanelGroup_005f0.setStyle("margin:0 3em;font-weight:normal");
int _jspx_eval_h_005fpanelGroup_005f0 = _jspx_th_h_005fpanelGroup_005f0.doStartTag();
if (_jspx_eval_h_005fpanelGroup_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write("\t\t\t\t\t\t");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "prefUpdatedMsg.jsp", out, false);
out.write("\t\n");
out.write("\t\t\t\t\t");
}
if (_jspx_th_h_005fpanelGroup_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered.reuse(_jspx_th_h_005fpanelGroup_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered.reuse(_jspx_th_h_005fpanelGroup_005f0);
return false;
}
private boolean _jspx_meth_h_005fcommandButton_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag _jspx_th_h_005fcommandButton_005f0 = (com.sun.faces.taglib.html_basic.CommandButtonTag) _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.get(com.sun.faces.taglib.html_basic.CommandButtonTag.class);
_jspx_th_h_005fcommandButton_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fcommandButton_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(82,12) name = accesskey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setAccesskey("s");
// /prefs/tab.jsp(82,12) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setId("prefAllSub");
// /prefs/tab.jsp(82,12) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setStyleClass("active formButton");
// /prefs/tab.jsp(82,12) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setValue("#{msgs.update_pref}");
// /prefs/tab.jsp(82,12) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setAction("#{UserPrefsTool.processActionSaveOrder}");
int _jspx_eval_h_005fcommandButton_005f0 = _jspx_th_h_005fcommandButton_005f0.doStartTag();
if (_jspx_th_h_005fcommandButton_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f0);
return false;
}
private boolean _jspx_meth_h_005fcommandButton_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag _jspx_th_h_005fcommandButton_005f1 = (com.sun.faces.taglib.html_basic.CommandButtonTag) _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.get(com.sun.faces.taglib.html_basic.CommandButtonTag.class);
_jspx_th_h_005fcommandButton_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005fcommandButton_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(83,12) name = accesskey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setAccesskey("x");
// /prefs/tab.jsp(83,12) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setId("cancel");
// /prefs/tab.jsp(83,12) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setValue("#{msgs.cancel_pref}");
// /prefs/tab.jsp(83,12) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setAction("#{UserPrefsTool.processActionCancel}");
// /prefs/tab.jsp(83,12) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setStyleClass("formButton");
int _jspx_eval_h_005fcommandButton_005f1 = _jspx_th_h_005fcommandButton_005f1.doStartTag();
if (_jspx_th_h_005fcommandButton_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f1);
return false;
}
private boolean _jspx_meth_sakai_005fmessages_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:messages
org.sakaiproject.jsf.tag.MessagesTag _jspx_th_sakai_005fmessages_005f0 = (org.sakaiproject.jsf.tag.MessagesTag) _005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody.get(org.sakaiproject.jsf.tag.MessagesTag.class);
_jspx_th_sakai_005fmessages_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005fmessages_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(86,26) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005fmessages_005f0.setRendered("#{!empty facesContext.maximumSeverity}");
int _jspx_eval_sakai_005fmessages_005f0 = _jspx_th_sakai_005fmessages_005f0.doStartTag();
if (_jspx_th_sakai_005fmessages_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody.reuse(_jspx_th_sakai_005fmessages_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody.reuse(_jspx_th_sakai_005fmessages_005f0);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f1 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f1.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f1 = _jspx_th_f_005fverbatim_005f1.doStartTag();
if (_jspx_eval_f_005fverbatim_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f1.doInitBody();
}
do {
out.write("\n");
out.write("<div class=\"layoutReorderer-container fl-container-flex\" id=\"layoutReorderer\" style=\"margin:.5em 0\">\n");
out.write(" <p>\n");
out.write(" ");
if (_jspx_meth_h_005foutputText_005f1(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" </p>\n");
out.write(" <p>\n");
out.write(" ");
if (_jspx_meth_h_005foutputText_005f2(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" </p>\n");
out.write(" <p>\n");
out.write(" ");
if (_jspx_meth_h_005foutputText_005f3(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" <p>\n");
out.write(" ");
if (_jspx_meth_h_005foutputText_005f4(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" </p>\n");
out.write("\n");
out.write(" <div id=\"movePanel\">\n");
out.write(" <h4 class=\"skip\">");
if (_jspx_meth_h_005foutputText_005f5(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</h4>\n");
out.write(" <div id=\"movePanelTop\" style=\"display:none\"><a href=\"#\" accesskey=\"6\" title=\"");
if (_jspx_meth_h_005foutputText_005f6(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write('"');
out.write('>');
if (_jspx_meth_h_005fgraphicImage_005f0(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
if (_jspx_meth_h_005foutputText_005f7(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</a></div>\n");
out.write(" <div id=\"movePanelTopDummy\" class=\"dummy\">");
if (_jspx_meth_h_005fgraphicImage_005f1(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</div>\n");
out.write(" <div id=\"movePanelLeftRight\">\n");
out.write(" <a href=\"#\" id=\"movePanelLeft\" style=\"display:none\" accesskey=\"7\" title=\"");
if (_jspx_meth_h_005foutputText_005f8(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write('"');
out.write('>');
if (_jspx_meth_h_005fgraphicImage_005f2(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
if (_jspx_meth_h_005foutputText_005f9(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</a>\n");
out.write(" <span id=\"movePanelLeftDummy\">");
if (_jspx_meth_h_005fgraphicImage_005f3(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</span> \n");
out.write(" \n");
out.write(" <a href=\"#\" id=\"movePanelRight\" style=\"display:none\" accesskey=\"8\" title=\"");
if (_jspx_meth_h_005foutputText_005f10(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write('"');
out.write('>');
if (_jspx_meth_h_005fgraphicImage_005f4(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
if (_jspx_meth_h_005foutputText_005f11(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</a>\n");
out.write(" <span id=\"movePanelRightDummy\"class=\"dummy\">");
if (_jspx_meth_h_005fgraphicImage_005f5(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</span> \n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div id=\"movePanelBottom\" style=\"display:none\"><a href=\"#\" accesskey=\"9\" title=\"");
if (_jspx_meth_h_005foutputText_005f12(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write('"');
out.write('>');
if (_jspx_meth_h_005fgraphicImage_005f6(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
if (_jspx_meth_h_005foutputText_005f13(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</a></div>\n");
out.write(" <div id=\"movePanelBottomDummy\"class=\"dummy\">");
if (_jspx_meth_h_005fgraphicImage_005f7(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</div>\n");
out.write(" </div> \n");
out.write("<div class=\"columnSetup3 fluid-vertical-order\">\n");
out.write("<!-- invalid drag n drop message template -->\n");
out.write("<p class=\"flc-reorderer-dropWarning layoutReorderer-dropWarning\">\n");
if (_jspx_meth_h_005foutputText_005f14(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write("</p>\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f1);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f1);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f1 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(90,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f1.setValue("#{msgs.prefs_mouse_instructions}");
// /prefs/tab.jsp(90,8) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f1.setEscape("false");
int _jspx_eval_h_005foutputText_005f1 = _jspx_th_h_005foutputText_005f1.doStartTag();
if (_jspx_th_h_005foutputText_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f1);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f2 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(93,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f2.setValue("#{msgs.prefs_keyboard_instructions}");
// /prefs/tab.jsp(93,8) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f2.setEscape("false");
int _jspx_eval_h_005foutputText_005f2 = _jspx_th_h_005foutputText_005f2.doStartTag();
if (_jspx_th_h_005foutputText_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f2);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f3 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f3.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(96,8) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f3.setStyleClass("skip");
// /prefs/tab.jsp(96,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f3.setValue("#{msgs.prefs_multitples_instructions_scru}");
// /prefs/tab.jsp(96,8) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f3.setEscape("false");
int _jspx_eval_h_005foutputText_005f3 = _jspx_th_h_005foutputText_005f3.doStartTag();
if (_jspx_th_h_005foutputText_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f3);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f3);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f4 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f4.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(98,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f4.setValue("#{msgs.prefs_multitples_instructions}");
// /prefs/tab.jsp(98,8) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f4.setEscape("false");
int _jspx_eval_h_005foutputText_005f4 = _jspx_th_h_005foutputText_005f4.doStartTag();
if (_jspx_th_h_005foutputText_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f4);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f4);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f5 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f5.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(102,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f5.setValue("#{msgs.prefs_multitples_instructions_panel_title}");
// /prefs/tab.jsp(102,25) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f5.setEscape("false");
int _jspx_eval_h_005foutputText_005f5 = _jspx_th_h_005foutputText_005f5.doStartTag();
if (_jspx_th_h_005foutputText_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f5);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f5);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f6 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f6.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(103,85) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f6.setValue("#{msgs.tabs_move_top}");
int _jspx_eval_h_005foutputText_005f6 = _jspx_th_h_005foutputText_005f6.doStartTag();
if (_jspx_th_h_005foutputText_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f6);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f6);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f0 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(103,132) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f0.setValue("prefs/to-top.png");
// /prefs/tab.jsp(103,132) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f0.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f0 = _jspx_th_h_005fgraphicImage_005f0.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f0);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f7 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f7.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(103,182) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f7.setStyleClass("skip");
// /prefs/tab.jsp(103,182) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f7.setValue("#{msgs.tabs_move_top}");
int _jspx_eval_h_005foutputText_005f7 = _jspx_th_h_005foutputText_005f7.doStartTag();
if (_jspx_th_h_005foutputText_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f7);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f7);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f1 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(104,50) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f1.setValue("prefs/to-top-dis.png");
// /prefs/tab.jsp(104,50) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f1.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f1 = _jspx_th_h_005fgraphicImage_005f1.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f1);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f8 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f8.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(106,86) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f8.setValue("#{msgs.tabs_move_left}");
int _jspx_eval_h_005foutputText_005f8 = _jspx_th_h_005foutputText_005f8.doStartTag();
if (_jspx_th_h_005foutputText_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f8);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f8);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f2 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(106,134) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f2.setValue("prefs/to-left.png");
// /prefs/tab.jsp(106,134) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f2.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f2 = _jspx_th_h_005fgraphicImage_005f2.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f2);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f9 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f9.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(106,185) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f9.setStyleClass("skip");
// /prefs/tab.jsp(106,185) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f9.setValue("#{msgs.tabs_move_left}");
int _jspx_eval_h_005foutputText_005f9 = _jspx_th_h_005foutputText_005f9.doStartTag();
if (_jspx_th_h_005foutputText_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f9);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f9);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f3 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f3.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(107,42) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f3.setValue("prefs/to-left-dis.png");
// /prefs/tab.jsp(107,42) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f3.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f3 = _jspx_th_h_005fgraphicImage_005f3.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f3);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f3);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f10 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f10.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(109,87) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f10.setValue("#{msgs.tabs_move_right}");
int _jspx_eval_h_005foutputText_005f10 = _jspx_th_h_005foutputText_005f10.doStartTag();
if (_jspx_th_h_005foutputText_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f10);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f10);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f4 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f4.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(109,136) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f4.setValue("prefs/to-right.png");
// /prefs/tab.jsp(109,136) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f4.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f4 = _jspx_th_h_005fgraphicImage_005f4.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f4);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f4);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f11(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f11 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f11.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f11.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(109,188) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f11.setStyleClass("skip");
// /prefs/tab.jsp(109,188) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f11.setValue("#{msgs.tabs_move_right}");
int _jspx_eval_h_005foutputText_005f11 = _jspx_th_h_005foutputText_005f11.doStartTag();
if (_jspx_th_h_005foutputText_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f11);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f11);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f5 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f5.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(110,56) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f5.setValue("prefs/to-right-dis.png");
// /prefs/tab.jsp(110,56) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f5.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f5 = _jspx_th_h_005fgraphicImage_005f5.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f5);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f5);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f12(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f12 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f12.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f12.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(113,88) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f12.setValue("#{msgs.tabs_move_bottom}");
int _jspx_eval_h_005foutputText_005f12 = _jspx_th_h_005foutputText_005f12.doStartTag();
if (_jspx_th_h_005foutputText_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f12);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f12);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f6 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f6.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(113,138) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f6.setValue("prefs/to-bottom.png");
// /prefs/tab.jsp(113,138) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f6.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f6 = _jspx_th_h_005fgraphicImage_005f6.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f6);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f6);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f13(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f13 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f13.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f13.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(113,191) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f13.setStyleClass("skip");
// /prefs/tab.jsp(113,191) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f13.setValue("#{msgs.tabs_move_bottom}");
int _jspx_eval_h_005foutputText_005f13 = _jspx_th_h_005foutputText_005f13.doStartTag();
if (_jspx_th_h_005foutputText_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f13);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f13);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f7 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f7.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(114,52) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f7.setValue("prefs/to-bottom-dis.png");
// /prefs/tab.jsp(114,52) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f7.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f7 = _jspx_th_h_005fgraphicImage_005f7.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f7);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f7);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f14(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f14 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f14.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f14.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(119,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f14.setValue("#{msgs.prefs_element_locked}");
int _jspx_eval_h_005foutputText_005f14 = _jspx_th_h_005foutputText_005f14.doStartTag();
if (_jspx_th_h_005foutputText_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f14);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f14);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f2 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f2.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f2 = _jspx_th_f_005fverbatim_005f2.doStartTag();
if (_jspx_eval_f_005fverbatim_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f2.doInitBody();
}
do {
out.write("\n");
out.write("\t\t\t<!-- Column #1 -->\n");
out.write(" <div class=\"flc-reorderer-column col1\" id=\"reorderCol1\">\n");
out.write(" <div class=\"colTitle layoutReorderer-locked\"><h4>");
if (_jspx_meth_h_005foutputText_005f15(_jspx_th_f_005fverbatim_005f2, _jspx_page_context))
return true;
out.write("</h4></div>\n");
out.write("\n");
out.write("<div class=\"flc-reorderer-module layoutReorderer-module layoutReorderer-locked\">\n");
out.write("<div class=\"demoSelector-layoutReorderer layoutReorderer-module-dragbar\">");
if (_jspx_meth_h_005foutputText_005f16(_jspx_th_f_005fverbatim_005f2, _jspx_page_context))
return true;
out.write("</div></div>\n");
out.write("\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f2);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f2);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f15(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f15 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f15.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f15.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f2);
// /prefs/tab.jsp(125,77) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f15.setValue("#{msgs.prefs_fav_sites}");
int _jspx_eval_h_005foutputText_005f15 = _jspx_th_h_005foutputText_005f15.doStartTag();
if (_jspx_th_h_005foutputText_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f15);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f15);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f16(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f16 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f16.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f16.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f2);
// /prefs/tab.jsp(128,73) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f16.setValue("#{msgs.prefs_my_workspace}");
int _jspx_eval_h_005foutputText_005f16 = _jspx_th_h_005foutputText_005f16.doStartTag();
if (_jspx_th_h_005foutputText_005f16.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f16);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f16);
return false;
}
private boolean _jspx_meth_t_005fdataList_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:dataList
org.apache.myfaces.custom.datalist.HtmlDataListTag _jspx_th_t_005fdataList_005f0 = (org.apache.myfaces.custom.datalist.HtmlDataListTag) _005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.get(org.apache.myfaces.custom.datalist.HtmlDataListTag.class);
_jspx_th_t_005fdataList_005f0.setPageContext(_jspx_page_context);
_jspx_th_t_005fdataList_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(131,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setId("dt1");
// /prefs/tab.jsp(131,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setValue("#{UserPrefsTool.prefTabItems}");
// /prefs/tab.jsp(131,2) name = var type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setVar("item");
// /prefs/tab.jsp(131,2) name = layout type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setLayout("simple");
// /prefs/tab.jsp(131,2) name = rowIndexVar type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setRowIndexVar("counter");
// /prefs/tab.jsp(131,2) name = itemStyleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setItemStyleClass("dataListStyle");
int _jspx_eval_t_005fdataList_005f0 = _jspx_th_t_005fdataList_005f0.doStartTag();
if (_jspx_eval_t_005fdataList_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_t_005fdataList_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_t_005fdataList_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_t_005fdataList_005f0.doInitBody();
}
do {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f3(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f5(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f4(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f6(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f5(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_h_005foutputFormat_005f0(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f6(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_t_005fdataList_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_t_005fdataList_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_t_005fdataList_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f0);
return true;
}
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f0);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f3 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f3.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
int _jspx_eval_f_005fverbatim_005f3 = _jspx_th_f_005fverbatim_005f3.doStartTag();
if (_jspx_eval_f_005fverbatim_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f3.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"flc-reorderer-module layoutReorderer-module last-login\"\n");
out.write("\t\t\tid=\"");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f3);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f3);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f5 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f5.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
// /prefs/tab.jsp(138,18) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f5.setValue("#{item.value}");
int _jspx_eval_t_005foutputText_005f5 = _jspx_th_t_005foutputText_005f5.doStartTag();
if (_jspx_th_t_005foutputText_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f5);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f5);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f4 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f4.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
int _jspx_eval_f_005fverbatim_005f4 = _jspx_th_f_005fverbatim_005f4.doStartTag();
if (_jspx_eval_f_005fverbatim_005f4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f4.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f4.doInitBody();
}
do {
out.write("\">\n");
out.write(" <div class=\"demoSelector-layoutReorderer layoutReorderer-module-dragbar\">\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f4.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f4);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f4);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f6 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f6.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
// /prefs/tab.jsp(142,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f6.setValue("#{item.label}");
// /prefs/tab.jsp(142,16) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f6.setStyleClass("siteLabel");
// /prefs/tab.jsp(142,16) name = title type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f6.setTitle("#{item.description}");
int _jspx_eval_t_005foutputText_005f6 = _jspx_th_t_005foutputText_005f6.doStartTag();
if (_jspx_th_t_005foutputText_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f6);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f6);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f5 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f5.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
int _jspx_eval_f_005fverbatim_005f5 = _jspx_th_f_005fverbatim_005f5.doStartTag();
if (_jspx_eval_f_005fverbatim_005f5 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f5.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f5.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"checkBoxContainer\">\n");
out.write(" <input type=\"checkbox\" class=\"selectSiteCheck\" title=\"\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f5.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f5);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f5);
return false;
}
private boolean _jspx_meth_h_005foutputFormat_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputFormat
com.sun.faces.taglib.html_basic.OutputFormatTag _jspx_th_h_005foutputFormat_005f0 = (com.sun.faces.taglib.html_basic.OutputFormatTag) _005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.get(com.sun.faces.taglib.html_basic.OutputFormatTag.class);
_jspx_th_h_005foutputFormat_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputFormat_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
// /prefs/tab.jsp(147,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputFormat_005f0.setValue("#{msgs.prefs_checkbox_select_message}");
int _jspx_eval_h_005foutputFormat_005f0 = _jspx_th_h_005foutputFormat_005f0.doStartTag();
if (_jspx_eval_h_005foutputFormat_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f0(_jspx_th_h_005foutputFormat_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f1(_jspx_th_h_005foutputFormat_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
}
if (_jspx_th_h_005foutputFormat_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f0);
return false;
}
private boolean _jspx_meth_f_005fparam_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f0 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f0.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f0);
// /prefs/tab.jsp(148,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f0.setValue("#{item.label}");
int _jspx_eval_f_005fparam_005f0 = _jspx_th_f_005fparam_005f0.doStartTag();
if (_jspx_th_f_005fparam_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f0);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f0);
return false;
}
private boolean _jspx_meth_f_005fparam_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f1 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f1.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f0);
// /prefs/tab.jsp(149,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f1.setValue("#{msgs.prefs_fav_sites_short}");
int _jspx_eval_f_005fparam_005f1 = _jspx_th_f_005fparam_005f1.doStartTag();
if (_jspx_th_f_005fparam_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f1);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f1);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f6 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f6.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
int _jspx_eval_f_005fverbatim_005f6 = _jspx_th_f_005fverbatim_005f6.doStartTag();
if (_jspx_eval_f_005fverbatim_005f6 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f6.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f6.doInitBody();
}
do {
out.write("\"/></div></div></div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f6.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f6);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f6);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f7 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f7.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f7 = _jspx_th_f_005fverbatim_005f7.doStartTag();
if (_jspx_eval_f_005fverbatim_005f7 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f7 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f7.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f7.doInitBody();
}
do {
out.write("</div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f7.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f7 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f7);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f7);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f8 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f8.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f8 = _jspx_th_f_005fverbatim_005f8.doStartTag();
if (_jspx_eval_f_005fverbatim_005f8 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f8 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f8.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f8.doInitBody();
}
do {
out.write("\n");
out.write("\t\t\t<!-- Column #2 -->\n");
out.write(" <div class=\"flc-reorderer-column col2\" id=\"reorderCol2\">\n");
out.write(" <div class=\"colTitle layoutReorderer-locked\"><h4>");
if (_jspx_meth_h_005foutputText_005f17(_jspx_th_f_005fverbatim_005f8, _jspx_page_context))
return true;
out.write("</h4></div>\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f8.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f8 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f8);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f8);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f17(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f8, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f17 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f17.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f17.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f8);
// /prefs/tab.jsp(160,77) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f17.setValue("#{msgs.prefs_active_sites}");
int _jspx_eval_h_005foutputText_005f17 = _jspx_th_h_005foutputText_005f17.doStartTag();
if (_jspx_th_h_005foutputText_005f17.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f17);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f17);
return false;
}
private boolean _jspx_meth_t_005fdataList_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:dataList
org.apache.myfaces.custom.datalist.HtmlDataListTag _jspx_th_t_005fdataList_005f1 = (org.apache.myfaces.custom.datalist.HtmlDataListTag) _005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.get(org.apache.myfaces.custom.datalist.HtmlDataListTag.class);
_jspx_th_t_005fdataList_005f1.setPageContext(_jspx_page_context);
_jspx_th_t_005fdataList_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(162,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setId("dt2");
// /prefs/tab.jsp(162,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setValue("#{UserPrefsTool.prefDrawerItems}");
// /prefs/tab.jsp(162,2) name = var type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setVar("item");
// /prefs/tab.jsp(162,2) name = layout type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setLayout("simple");
// /prefs/tab.jsp(162,2) name = rowIndexVar type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setRowIndexVar("counter");
// /prefs/tab.jsp(162,2) name = itemStyleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setItemStyleClass("dataListStyle");
int _jspx_eval_t_005fdataList_005f1 = _jspx_th_t_005fdataList_005f1.doStartTag();
if (_jspx_eval_t_005fdataList_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_t_005fdataList_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_t_005fdataList_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_t_005fdataList_005f1.doInitBody();
}
do {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f9(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f7(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f10(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f8(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f11(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_h_005foutputFormat_005f1(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f12(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
int evalDoAfterBody = _jspx_th_t_005fdataList_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_t_005fdataList_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_t_005fdataList_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f1);
return true;
}
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f1);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f9 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f9.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
int _jspx_eval_f_005fverbatim_005f9 = _jspx_th_f_005fverbatim_005f9.doStartTag();
if (_jspx_eval_f_005fverbatim_005f9 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f9 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f9.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f9.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"flc-reorderer-module layoutReorderer-module last-login\"\n");
out.write("\t\t\tid=\"");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f9.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f9 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f9);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f9);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f7 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f7.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
// /prefs/tab.jsp(169,18) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f7.setValue("#{item.value}");
int _jspx_eval_t_005foutputText_005f7 = _jspx_th_t_005foutputText_005f7.doStartTag();
if (_jspx_th_t_005foutputText_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f7);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f7);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f10 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f10.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
int _jspx_eval_f_005fverbatim_005f10 = _jspx_th_f_005fverbatim_005f10.doStartTag();
if (_jspx_eval_f_005fverbatim_005f10 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f10 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f10.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f10.doInitBody();
}
do {
out.write("\">\n");
out.write(" <div class=\"demoSelector-layoutReorderer layoutReorderer-module-dragbar\">\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f10.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f10 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f10);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f10);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f8 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f8.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
// /prefs/tab.jsp(173,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f8.setValue("#{item.label}");
// /prefs/tab.jsp(173,16) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f8.setStyleClass("siteLabel");
// /prefs/tab.jsp(173,16) name = title type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f8.setTitle("#{item.description}");
int _jspx_eval_t_005foutputText_005f8 = _jspx_th_t_005foutputText_005f8.doStartTag();
if (_jspx_th_t_005foutputText_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f8);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f8);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f11(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f11 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f11.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f11.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
int _jspx_eval_f_005fverbatim_005f11 = _jspx_th_f_005fverbatim_005f11.doStartTag();
if (_jspx_eval_f_005fverbatim_005f11 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f11 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f11.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f11.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"checkBoxContainer\">\n");
out.write(" <input type=\"checkbox\" class=\"selectSiteCheck\" title=\"\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f11.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f11 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f11);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f11);
return false;
}
private boolean _jspx_meth_h_005foutputFormat_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputFormat
com.sun.faces.taglib.html_basic.OutputFormatTag _jspx_th_h_005foutputFormat_005f1 = (com.sun.faces.taglib.html_basic.OutputFormatTag) _005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.get(com.sun.faces.taglib.html_basic.OutputFormatTag.class);
_jspx_th_h_005foutputFormat_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputFormat_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
// /prefs/tab.jsp(178,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputFormat_005f1.setValue("#{msgs.prefs_checkbox_select_message}");
int _jspx_eval_h_005foutputFormat_005f1 = _jspx_th_h_005foutputFormat_005f1.doStartTag();
if (_jspx_eval_h_005foutputFormat_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f2(_jspx_th_h_005foutputFormat_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f3(_jspx_th_h_005foutputFormat_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
}
if (_jspx_th_h_005foutputFormat_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f1);
return false;
}
private boolean _jspx_meth_f_005fparam_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f2 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f2.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f1);
// /prefs/tab.jsp(179,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f2.setValue("#{item.label}");
int _jspx_eval_f_005fparam_005f2 = _jspx_th_f_005fparam_005f2.doStartTag();
if (_jspx_th_f_005fparam_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f2);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f2);
return false;
}
private boolean _jspx_meth_f_005fparam_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f3 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f3.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f1);
// /prefs/tab.jsp(180,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f3.setValue("#{msgs.prefs_active_sites_short}");
int _jspx_eval_f_005fparam_005f3 = _jspx_th_f_005fparam_005f3.doStartTag();
if (_jspx_th_f_005fparam_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f3);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f3);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f12(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f12 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f12.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f12.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
int _jspx_eval_f_005fverbatim_005f12 = _jspx_th_f_005fverbatim_005f12.doStartTag();<|fim▁hole|> _jspx_th_f_005fverbatim_005f12.doInitBody();
}
do {
out.write("\"/></div></div></div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f12.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f12);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f12);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f13(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f13 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f13.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f13.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f13 = _jspx_th_f_005fverbatim_005f13.doStartTag();
if (_jspx_eval_f_005fverbatim_005f13 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f13 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f13.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f13.doInitBody();
}
do {
out.write("</div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f13.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f13 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f13);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f13);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f14(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f14 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f14.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f14.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f14 = _jspx_th_f_005fverbatim_005f14.doStartTag();
if (_jspx_eval_f_005fverbatim_005f14 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f14 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f14.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f14.doInitBody();
}
do {
out.write("\n");
out.write("\t\t\t<!-- Column #3 -->\n");
out.write(" <div class=\"flc-reorderer-column fl-container-flex25 fl-force-left col3\" id=\"reorderCol3\">\n");
out.write(" <div class=\"colTitle layoutReorderer-locked\"><h4>");
if (_jspx_meth_h_005foutputText_005f18(_jspx_th_f_005fverbatim_005f14, _jspx_page_context))
return true;
out.write("</h4></div>\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f14.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f14 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f14);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f14);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f18(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f14, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f18 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f18.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f18.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f14);
// /prefs/tab.jsp(189,77) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f18.setValue("#{msgs.prefs_archive_sites}");
int _jspx_eval_h_005foutputText_005f18 = _jspx_th_h_005foutputText_005f18.doStartTag();
if (_jspx_th_h_005foutputText_005f18.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f18);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f18);
return false;
}
private boolean _jspx_meth_t_005fdataList_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:dataList
org.apache.myfaces.custom.datalist.HtmlDataListTag _jspx_th_t_005fdataList_005f2 = (org.apache.myfaces.custom.datalist.HtmlDataListTag) _005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.get(org.apache.myfaces.custom.datalist.HtmlDataListTag.class);
_jspx_th_t_005fdataList_005f2.setPageContext(_jspx_page_context);
_jspx_th_t_005fdataList_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(191,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setId("dt3");
// /prefs/tab.jsp(191,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setValue("#{UserPrefsTool.prefHiddenItems}");
// /prefs/tab.jsp(191,2) name = var type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setVar("item");
// /prefs/tab.jsp(191,2) name = layout type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setLayout("simple");
// /prefs/tab.jsp(191,2) name = rowIndexVar type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setRowIndexVar("counter");
// /prefs/tab.jsp(191,2) name = itemStyleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setItemStyleClass("dataListStyle");
int _jspx_eval_t_005fdataList_005f2 = _jspx_th_t_005fdataList_005f2.doStartTag();
if (_jspx_eval_t_005fdataList_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_t_005fdataList_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_t_005fdataList_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_t_005fdataList_005f2.doInitBody();
}
do {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f15(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f9(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f16(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f10(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f17(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_h_005foutputFormat_005f2(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f18(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_t_005fdataList_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_t_005fdataList_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_t_005fdataList_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f2);
return true;
}
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f2);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f15(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f15 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f15.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f15.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
int _jspx_eval_f_005fverbatim_005f15 = _jspx_th_f_005fverbatim_005f15.doStartTag();
if (_jspx_eval_f_005fverbatim_005f15 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f15 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f15.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f15.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"flc-reorderer-module layoutReorderer-module last-login\"\n");
out.write("\t\t\tid=\"");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f15.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f15 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f15);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f15);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f9 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f9.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
// /prefs/tab.jsp(198,18) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f9.setValue("#{item.value}");
int _jspx_eval_t_005foutputText_005f9 = _jspx_th_t_005foutputText_005f9.doStartTag();
if (_jspx_th_t_005foutputText_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f9);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f9);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f16(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f16 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f16.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f16.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
int _jspx_eval_f_005fverbatim_005f16 = _jspx_th_f_005fverbatim_005f16.doStartTag();
if (_jspx_eval_f_005fverbatim_005f16 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f16 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f16.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f16.doInitBody();
}
do {
out.write("\">\n");
out.write(" <div class=\"demoSelector-layoutReorderer layoutReorderer-module-dragbar\">\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f16.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f16 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f16.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f16);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f16);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f10 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f10.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
// /prefs/tab.jsp(202,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f10.setValue("#{item.label}");
// /prefs/tab.jsp(202,16) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f10.setStyleClass("siteLabel");
// /prefs/tab.jsp(202,16) name = title type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f10.setTitle("#{item.description}");
int _jspx_eval_t_005foutputText_005f10 = _jspx_th_t_005foutputText_005f10.doStartTag();
if (_jspx_th_t_005foutputText_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f10);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f10);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f17(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f17 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f17.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f17.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
int _jspx_eval_f_005fverbatim_005f17 = _jspx_th_f_005fverbatim_005f17.doStartTag();
if (_jspx_eval_f_005fverbatim_005f17 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f17 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f17.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f17.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"checkBoxContainer\">\n");
out.write(" <input type=\"checkbox\" class=\"selectSiteCheck\" title=\"\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f17.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f17 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f17.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f17);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f17);
return false;
}
private boolean _jspx_meth_h_005foutputFormat_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputFormat
com.sun.faces.taglib.html_basic.OutputFormatTag _jspx_th_h_005foutputFormat_005f2 = (com.sun.faces.taglib.html_basic.OutputFormatTag) _005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.get(com.sun.faces.taglib.html_basic.OutputFormatTag.class);
_jspx_th_h_005foutputFormat_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputFormat_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
// /prefs/tab.jsp(207,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputFormat_005f2.setValue("#{msgs.prefs_checkbox_select_message}");
int _jspx_eval_h_005foutputFormat_005f2 = _jspx_th_h_005foutputFormat_005f2.doStartTag();
if (_jspx_eval_h_005foutputFormat_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f4(_jspx_th_h_005foutputFormat_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f5(_jspx_th_h_005foutputFormat_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
}
if (_jspx_th_h_005foutputFormat_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f2);
return false;
}
private boolean _jspx_meth_f_005fparam_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f4 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f4.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f2);
// /prefs/tab.jsp(208,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f4.setValue("#{item.label}");
int _jspx_eval_f_005fparam_005f4 = _jspx_th_f_005fparam_005f4.doStartTag();
if (_jspx_th_f_005fparam_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f4);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f4);
return false;
}
private boolean _jspx_meth_f_005fparam_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f5 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f5.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f2);
// /prefs/tab.jsp(209,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f5.setValue("#{msgs.prefs_archive_sites_short}");
int _jspx_eval_f_005fparam_005f5 = _jspx_th_f_005fparam_005f5.doStartTag();
if (_jspx_th_f_005fparam_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f5);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f5);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f18(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f18 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f18.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f18.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
int _jspx_eval_f_005fverbatim_005f18 = _jspx_th_f_005fverbatim_005f18.doStartTag();
if (_jspx_eval_f_005fverbatim_005f18 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f18 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f18.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f18.doInitBody();
}
do {
out.write("\"/></div></div></div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f18.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f18 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f18.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f18);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f18);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f19(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f19 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f19.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f19.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f19 = _jspx_th_f_005fverbatim_005f19.doStartTag();
if (_jspx_eval_f_005fverbatim_005f19 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f19 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f19.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f19.doInitBody();
}
do {
out.write("</div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f19.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f19 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f19.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f19);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f19);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f20(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f20 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f20.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f20.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f20 = _jspx_th_f_005fverbatim_005f20.doStartTag();
if (_jspx_eval_f_005fverbatim_005f20 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f20 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f20.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f20.doInitBody();
}
do {
out.write("</div></div>\n");
out.write("<div style=\"float:none;clear:both;margin:2em 0\">\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f20.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f20 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f20.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f20);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f20);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f21(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f21 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f21.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f21.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f21 = _jspx_th_f_005fverbatim_005f21.doStartTag();
if (_jspx_eval_f_005fverbatim_005f21 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f21 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f21.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f21.doInitBody();
}
do {
out.write("\n");
out.write("<div id=\"top-text\">\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f21.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f21 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f21.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f21);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f21);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f19(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f19 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f19.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f19.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(223,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f19.setValue("#{msgs.tabDisplay_prompt}");
// /prefs/tab.jsp(223,0) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f19.setRendered("#{UserPrefsTool.prefShowTabLabelOption==true}");
int _jspx_eval_h_005foutputText_005f19 = _jspx_th_h_005foutputText_005f19.doStartTag();
if (_jspx_th_h_005foutputText_005f19.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody.reuse(_jspx_th_h_005foutputText_005f19);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody.reuse(_jspx_th_h_005foutputText_005f19);
return false;
}
private boolean _jspx_meth_h_005fselectOneRadio_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:selectOneRadio
com.sun.faces.taglib.html_basic.SelectOneRadioTag _jspx_th_h_005fselectOneRadio_005f0 = (com.sun.faces.taglib.html_basic.SelectOneRadioTag) _005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout.get(com.sun.faces.taglib.html_basic.SelectOneRadioTag.class);
_jspx_th_h_005fselectOneRadio_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fselectOneRadio_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(224,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fselectOneRadio_005f0.setValue("#{UserPrefsTool.selectedTabLabel}");
// /prefs/tab.jsp(224,0) name = layout type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fselectOneRadio_005f0.setLayout("pageDirection");
// /prefs/tab.jsp(224,0) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fselectOneRadio_005f0.setRendered("#{UserPrefsTool.prefShowTabLabelOption==true}");
int _jspx_eval_h_005fselectOneRadio_005f0 = _jspx_th_h_005fselectOneRadio_005f0.doStartTag();
if (_jspx_eval_h_005fselectOneRadio_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fselectItem_005f0(_jspx_th_h_005fselectOneRadio_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fselectItem_005f1(_jspx_th_h_005fselectOneRadio_005f0, _jspx_page_context))
return true;
out.write('\n');
}
if (_jspx_th_h_005fselectOneRadio_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout.reuse(_jspx_th_h_005fselectOneRadio_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout.reuse(_jspx_th_h_005fselectOneRadio_005f0);
return false;
}
private boolean _jspx_meth_f_005fselectItem_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fselectOneRadio_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:selectItem
com.sun.faces.taglib.jsf_core.SelectItemTag _jspx_th_f_005fselectItem_005f0 = (com.sun.faces.taglib.jsf_core.SelectItemTag) _005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.get(com.sun.faces.taglib.jsf_core.SelectItemTag.class);
_jspx_th_f_005fselectItem_005f0.setPageContext(_jspx_page_context);
_jspx_th_f_005fselectItem_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fselectOneRadio_005f0);
// /prefs/tab.jsp(225,24) name = itemValue type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fselectItem_005f0.setItemValue("1");
// /prefs/tab.jsp(225,24) name = itemLabel type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fselectItem_005f0.setItemLabel("#{msgs.tabDisplay_coursecode}");
int _jspx_eval_f_005fselectItem_005f0 = _jspx_th_f_005fselectItem_005f0.doStartTag();
if (_jspx_th_f_005fselectItem_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.reuse(_jspx_th_f_005fselectItem_005f0);
return true;
}
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.reuse(_jspx_th_f_005fselectItem_005f0);
return false;
}
private boolean _jspx_meth_f_005fselectItem_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fselectOneRadio_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:selectItem
com.sun.faces.taglib.jsf_core.SelectItemTag _jspx_th_f_005fselectItem_005f1 = (com.sun.faces.taglib.jsf_core.SelectItemTag) _005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.get(com.sun.faces.taglib.jsf_core.SelectItemTag.class);
_jspx_th_f_005fselectItem_005f1.setPageContext(_jspx_page_context);
_jspx_th_f_005fselectItem_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fselectOneRadio_005f0);
// /prefs/tab.jsp(226,24) name = itemValue type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fselectItem_005f1.setItemValue("2");
// /prefs/tab.jsp(226,24) name = itemLabel type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fselectItem_005f1.setItemLabel("#{msgs.tabDisplay_coursename}");
int _jspx_eval_f_005fselectItem_005f1 = _jspx_th_f_005fselectItem_005f1.doStartTag();
if (_jspx_th_f_005fselectItem_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.reuse(_jspx_th_f_005fselectItem_005f1);
return true;
}
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.reuse(_jspx_th_f_005fselectItem_005f1);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f22(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f22 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f22.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f22.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f22 = _jspx_th_f_005fverbatim_005f22.doStartTag();
if (_jspx_eval_f_005fverbatim_005f22 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f22 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f22.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f22.doInitBody();
}
do {
out.write("\n");
out.write("</div>\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f22.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f22 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f22.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f22);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f22);
return false;
}
private boolean _jspx_meth_h_005fcommandButton_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag _jspx_th_h_005fcommandButton_005f2 = (com.sun.faces.taglib.html_basic.CommandButtonTag) _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.get(com.sun.faces.taglib.html_basic.CommandButtonTag.class);
_jspx_th_h_005fcommandButton_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005fcommandButton_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(233,3) name = accesskey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setAccesskey("s");
// /prefs/tab.jsp(233,3) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setId("prefAllSub");
// /prefs/tab.jsp(233,3) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setStyleClass("active formButton");
// /prefs/tab.jsp(233,3) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setValue("#{msgs.update_pref}");
// /prefs/tab.jsp(233,3) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setAction("#{UserPrefsTool.processActionSaveOrder}");
int _jspx_eval_h_005fcommandButton_005f2 = _jspx_th_h_005fcommandButton_005f2.doStartTag();
if (_jspx_th_h_005fcommandButton_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f2);
return false;
}
private boolean _jspx_meth_h_005fcommandButton_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag _jspx_th_h_005fcommandButton_005f3 = (com.sun.faces.taglib.html_basic.CommandButtonTag) _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.get(com.sun.faces.taglib.html_basic.CommandButtonTag.class);
_jspx_th_h_005fcommandButton_005f3.setPageContext(_jspx_page_context);
_jspx_th_h_005fcommandButton_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(234,3) name = accesskey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setAccesskey("x");
// /prefs/tab.jsp(234,3) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setId("cancel");
// /prefs/tab.jsp(234,3) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setValue("#{msgs.cancel_pref}");
// /prefs/tab.jsp(234,3) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setAction("#{UserPrefsTool.processActionCancel}");
// /prefs/tab.jsp(234,3) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setStyleClass("formButton");
int _jspx_eval_h_005fcommandButton_005f3 = _jspx_th_h_005fcommandButton_005f3.doStartTag();
if (_jspx_th_h_005fcommandButton_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f3);
return true;
}
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f3);
return false;
}
private boolean _jspx_meth_h_005finputHidden_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:inputHidden
com.sun.faces.taglib.html_basic.InputHiddenTag _jspx_th_h_005finputHidden_005f0 = (com.sun.faces.taglib.html_basic.InputHiddenTag) _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.get(com.sun.faces.taglib.html_basic.InputHiddenTag.class);
_jspx_th_h_005finputHidden_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005finputHidden_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(235,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f0.setId("prefTabString");
// /prefs/tab.jsp(235,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f0.setValue("#{UserPrefsTool.prefTabString}");
int _jspx_eval_h_005finputHidden_005f0 = _jspx_th_h_005finputHidden_005f0.doStartTag();
if (_jspx_th_h_005finputHidden_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f0);
return false;
}
private boolean _jspx_meth_h_005finputHidden_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:inputHidden
com.sun.faces.taglib.html_basic.InputHiddenTag _jspx_th_h_005finputHidden_005f1 = (com.sun.faces.taglib.html_basic.InputHiddenTag) _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.get(com.sun.faces.taglib.html_basic.InputHiddenTag.class);
_jspx_th_h_005finputHidden_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005finputHidden_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(236,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f1.setId("prefDrawerString");
// /prefs/tab.jsp(236,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f1.setValue("#{UserPrefsTool.prefDrawerString}");
int _jspx_eval_h_005finputHidden_005f1 = _jspx_th_h_005finputHidden_005f1.doStartTag();
if (_jspx_th_h_005finputHidden_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f1);
return false;
}
private boolean _jspx_meth_h_005finputHidden_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:inputHidden
com.sun.faces.taglib.html_basic.InputHiddenTag _jspx_th_h_005finputHidden_005f2 = (com.sun.faces.taglib.html_basic.InputHiddenTag) _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.get(com.sun.faces.taglib.html_basic.InputHiddenTag.class);
_jspx_th_h_005finputHidden_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005finputHidden_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(237,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f2.setId("prefHiddenString");
// /prefs/tab.jsp(237,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f2.setValue("#{UserPrefsTool.prefHiddenString}");
int _jspx_eval_h_005finputHidden_005f2 = _jspx_th_h_005finputHidden_005f2.doStartTag();
if (_jspx_th_h_005finputHidden_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f2);
return false;
}
private boolean _jspx_meth_h_005finputHidden_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:inputHidden
com.sun.faces.taglib.html_basic.InputHiddenTag _jspx_th_h_005finputHidden_005f3 = (com.sun.faces.taglib.html_basic.InputHiddenTag) _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.get(com.sun.faces.taglib.html_basic.InputHiddenTag.class);
_jspx_th_h_005finputHidden_005f3.setPageContext(_jspx_page_context);
_jspx_th_h_005finputHidden_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(238,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f3.setId("reloadTop");
// /prefs/tab.jsp(238,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f3.setValue("#{UserPrefsTool.reloadTop}");
int _jspx_eval_h_005finputHidden_005f3 = _jspx_th_h_005finputHidden_005f3.doStartTag();
if (_jspx_th_h_005finputHidden_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f3);
return true;
}
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f3);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f23(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f23 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f23.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f23.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f23 = _jspx_th_f_005fverbatim_005f23.doStartTag();
if (_jspx_eval_f_005fverbatim_005f23 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f23 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f23.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f23.doInitBody();
}
do {
out.write("\n");
out.write("<p>\n");
if (_jspx_meth_h_005foutputText_005f20(_jspx_th_f_005fverbatim_005f23, _jspx_page_context))
return true;
out.write("\n");
out.write("</p>\n");
out.write("</div>\n");
out.write("<script type=\"text/javascript\">\n");
out.write(" initlayoutReorderer();\n");
out.write("</script>\n");
out.write("\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f23.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f23 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f23.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f23);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f23);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f20(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f23, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f20 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f20.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f20.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f23);
// /prefs/tab.jsp(241,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f20.setValue("#{msgs.prefs_auto_refresh}");
int _jspx_eval_h_005foutputText_005f20 = _jspx_th_h_005foutputText_005f20.doStartTag();
if (_jspx_th_h_005foutputText_005f20.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f20);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f20);
return false;
}
}<|fim▁end|> | if (_jspx_eval_f_005fverbatim_005f12 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f12.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out); |
<|file_name|>base_class.py<|end_file_name|><|fim▁begin|>'''
Defines the base class of an electric potential grid.
'''
import numpy as np
import matplotlib as mpl
import matplotlib.pylab as plt
from numba import jit
# Global dimensions (used for plots)
sqc_x = (2., 'cm') # unit length for SquareCable
sqc_u = (10., 'V') # unit potential for SquareCable
edm_x = (10., 'mm') # unit length for Edm
edm_u = (2., 'kV') # unit potential for Edm
# Plot parameters
font = {'family' : 'normal',
'weight' : 'normal'}
mpl.rc('font', **font)
mpl.rcParams['lines.linewidth'] = 5.
# Functions compiled just-in-time
@jit
def gen_sc_grid(b, t, u):
'''
Generates SquareCable grid.
'''
grid = np.full((b,b), u)
fix = np.ones((b,b))
grid = np.pad(grid, ((t-b)/2,), 'constant', constant_values=(0,))
fix = np.pad(fix, ((t-b)/2,), 'constant', constant_values=(0,))
grid = np.pad(grid, 1, 'constant', constant_values=(0,))
fix = np.pad(fix, 1, 'constant', constant_values=(1,))
return grid, fix
@jit
def gen_edm_grid(tube_dist, scale=1):
'''
Generates Edm grid.
'''
small_plate = np.full(2,1, dtype='float64')
big_plate = np.full(20,4, dtype='float64')
gap = np.zeros(1, dtype='float64')
row_one = np.concatenate((small_plate, gap, big_plate, gap, small_plate))
row_two = np.zeros(row_one.size)
row_three = -row_one
grid = np.vstack((row_one, row_two, row_three))
grid = np.pad(grid, tube_dist, 'constant', constant_values=(0,))
fix = np.where(grid==0, 0, 1)
if scale != 1:
scale = np.ones((scale, scale))
grid = np.kron(grid, scale)
fix = np.kron(fix, scale)
grid = np.pad(grid, 1, 'constant', constant_values=(0,))
fix = np.pad(fix, 1, 'constant', constant_values=(1,))
return grid, fix
@jit
def update(grid, fix, scale, w=-1):
'''
Updates SquareCable or Edm grid.
Relaxation parameter w (0 < w < 2) affects the speed of convergence.
- w = 'j': solves with Jacobi method
- w = -1: solves with estimated optimal w
'''
if w=='j' or w=='J':<|fim▁hole|> grid[index[0]+1, index[1]] +
grid[index[0], index[1]-1] +
grid[index[0], index[1]+1] )
return new_grid
if w==-1:
coef = float(grid.shape[1])/grid.shape[0]
const = 2.0 if coef==1. else 5.5
w = 2./(1+const/(coef*scale))
for index, fixed in np.ndenumerate(fix):
if fixed: continue
grid[index] = ((1-w) * grid[index] + 0.25 * w *
( grid[index[0]-1, index[1]] +
grid[index[0]+1, index[1]] +
grid[index[0], index[1]-1] +
grid[index[0], index[1]+1] ))
return grid
# Base class
class PotentialGrid(object):
def update_grid(self, w=-1):
'''
Updates grid once.
'''
self.grid = update(self.grid, self.fix, self.scale, w)
def converge_grid(self, w=-1, accuracy=0.05):
'''
Updates grid until convergence.
'''
temporal_spread = 1.
spatial_spread = 0.
updates = 0
while temporal_spread > accuracy*spatial_spread:
horizontal_spread = np.absolute(np.diff(self.grid, axis=-1)).max()
vertical_spread = np.absolute(np.diff(self.grid, axis=0)).max()
spatial_spread = max(horizontal_spread, vertical_spread)
old_grid = np.copy(self.grid)
self.update_grid(w)
temporal_spread = np.linalg.norm( (self.grid - old_grid) )
updates += 1
if updates%1000==0:
print '\nspatial spread = ', spatial_spread
print 'temporal spread = ', temporal_spread
print 'updates = ', updates
return temporal_spread, spatial_spread, updates
def plot_grid(self, title=None):
'''
Plots grid's potential field. Parameter title sets the title of the
plot.
'''
if self.grid.shape[0] == self.grid.shape[1]:
colour, shrink, aspect = 'YlOrRd', 1, (1, 10)
else:
colour, shrink, aspect = 'RdYlBu', 0.5, (1.2, 8)
grid = self.dim['u'][0]*self.grid
xedge = (grid.shape[1]-2.)*self.dim['x'][0]/self.scale/2.
yedge = (grid.shape[0]-2.)*self.dim['x'][0]/self.scale/2.
fig = plt.figure()
ax = fig.add_subplot(111)
if title=='intro':
ax.set_title(r'EDM experiment plate assembly', fontsize=45)
elif title=='results':
ax.set_title(r'Electric Potential Field', fontsize=45)
axx = ax.imshow(grid, extent= [-xedge, xedge, -yedge, yedge],
aspect=aspect[0], interpolation='None',
cmap=plt.cm.get_cmap(colour))
ax.set_xlabel(r'$system\ size\ ({0})$'.format(self.dim['x'][1]),
fontsize=45)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.tick_params(axis='both', labelsize=40)
cbar = fig.colorbar(axx, shrink=shrink, aspect=aspect[1])
cbar.ax.tick_params(labelsize=40)
cbar.set_label(r'$Potential\ \phi\ ({0})$'.format(self.dim['u'][1]),
size=50)
def analyse_scale(self, w=-1, datapoints=20, accuracy=0.05, plot=True):
'''
Plots number of updates against scale for given relaxation parameter w,
number of datapoints and accuracy of convergence. If plot=False,
returns computed updates and scales.
Plots also maximum spatial spread of potential against scale.
'''
scales = np.linspace(10, 10*datapoints, datapoints)
mesh, updates = [], []
for s in scales:
print s
self.set_scale(s, silent=True)
data = self.converge_grid(w, accuracy)
updates.append(data[2])
mesh.append(data[1]*self.dim['u'][0])
if not plot: return scales, updates
if w=='j':
xaxis = scales*scales
lab= r'$scale^2\ \left(\frac{1}{(%g%s)^2}\right)$'% (
self.dim['x'][0], self.dim['x'][1])
else:
xaxis = scales
lab= r'$scale\ \left(\frac{1}{%g%s}\right)$'% (self.dim['x'][0],
self.dim['x'][1])
slope = updates[-1]/xaxis[-1]
fit = slope*xaxis
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title(r'Number of updates against Scale', fontsize=45)
ax.plot(xaxis, updates, label=r'Numerical data')
ax.plot(xaxis, fit, label=r'Linear fit ($slope=%.2f$)'% (slope))
ax.set_xlabel(lab, fontsize=35)
ax.set_ylabel(r'$temporal\ updates$', fontsize=35)
ax.tick_params(axis='both', labelsize=25)
ax.legend(loc='upper left', prop={'size':40})
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title(r'Spatial spread against Scale', fontsize=45)
ax.plot(scales, mesh)
ax.set_xlabel(r'$scale\ \left(\frac{1}{%g%s}\right)$'%
(self.dim['x'][0], self.dim['x'][1]), fontsize=40)
ax.set_ylabel(r'$spatial\ spread\ (%s)$'% (self.dim['u'][1]),
fontsize=40)
ax.tick_params(axis='both', labelsize=25)
def analyse_spread(self, w=-1, datapoints=10):
'''
Plots spatial spread of potential against accuracy of convergence for
given relaxation parameter w and number of datapoints.
'''
fig = plt.figure()
ax = fig.add_subplot(111)
#ax.set_title(r'Spatial spread against Accuracy of convergence',
# fontsize=75)
ax.set_xlabel(r'$fraction\ of\ spatial\ spread$', fontsize=40)
ax.invert_xaxis()
ax.set_ylabel(r'$spatial\ spread\ (%s)$'% (self.dim['u'][1]),
fontsize=40)
ax.tick_params(axis='both', labelsize=30)
accuracies = np.logspace(-1,-10,datapoints)
for scale in np.linspace(10,10*datapoints,datapoints):
self.set_scale(scale, silent=True)
spreads = []
for acc in accuracies:
t,s,u = self.converge_grid(w, acc)
spreads.append(s*self.dim['u'][0])
ax.plot(accuracies, spreads, label='Scale={0}'.format(scale))
return accuracies, spreads
def analyse_omega(self, guess, scales=-1, datapoints=20,
accuracy=0.05, plot=True):
'''
Plots number of updates against relaxation parameter for given initial
guess, system scales, number of datapoints and accuracy of convergence.
If plot=False, returns computed updates and relaxation parameters.
'''
if plot:
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title(r'Optimal omega search at different scales',
fontsize=55)
ax.set_xlabel('$relaxation\ parameter\ \omega$', fontsize=37)
ax.set_ylabel('$temporal\ updates$', fontsize=37)
ax.tick_params(axis='both', labelsize=30)
ws = np.pad(np.array([guess]), datapoints/2, 'linear_ramp',
end_values=(guess-0.05, 1.99))
if scales==-1: scales = [self.scale]
for scale in scales:
updates = []
for w in ws:
self.set_scale(scale, silent=True)
data = self.converge_grid(w, accuracy)
updates.append(data[-1])
if plot: ax.plot(ws, updates, label=r'Scale ${0}$'.format(scale))
else: return ws, updates
if plot: ax.legend(loc='upper center', prop={'size':40})
def plot_omega_vs_scale(self, const=2., datapoints=20):
'''
Plots relaxation parameter against scale along with approximate fit for
given number of datapoints.
The fitting is approximated by the user with the constant const which
appears in the formula: 2(1+const/(coef*scale)), where coef is the
ratio of x and y dimensions of the system.
'''
coef = float(self.grid.shape[1]-2)/(self.grid.shape[0]-2)
scales = np.linspace(10, 50, datapoints)
fit = 2./(1+const/(coef*scales))
ws = []
for scale in scales:
self.set_scale(scale, silent=True)
guess = 2./(1+const/(coef*self.scale))
w, update = self.analyse_omega(guess, plot=False)
w = w[update.index(min(update))]
ws.append(w)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title(r'Relaxation parameter against scale', fontsize=55)
ax.set_xlabel(r'$scale\ \left(\frac{1}{%g%s}\right)$'%
(self.dim['x'][0], self.dim['x'][1]), fontsize=37)
ax.set_ylabel('$relaxation\ parameter\ \omega$', fontsize=37)
ax.tick_params(axis='both', labelsize=30)
ax.plot(scales, ws, label=r'Numerical data')
ax.plot(scales, fit, label=r'Approximate fit ($C=%.1f$)'% (const))
ax.legend(loc='upper left', prop={'size':40})
return scales, ws<|fim▁end|> | new_grid=np.copy(grid)
for index, fixed in np.ndenumerate(fix):
if fixed: continue
new_grid[index] = 0.25*( grid[index[0]-1, index[1]] + |
<|file_name|>0050_auto_20181005_1425.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-05 14:25
from __future__ import unicode_literals
<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [("elections", "0049_move_status")]
operations = [
migrations.RemoveField(model_name="election", name="rejection_reason"),
migrations.RemoveField(model_name="election", name="suggested_status"),
migrations.RemoveField(model_name="election", name="suggestion_reason"),
]<|fim▁end|> | from django.db import migrations
|
<|file_name|>global.d.ts<|end_file_name|><|fim▁begin|>/// <reference types="segment-analytics" />
import React from "react"
import Relay from "react-relay"
import sharify from "sharify"<|fim▁hole|> interface Window {
/**
* This requires the Segment JS client to be exposed as `window.analytics`.
*/
analytics: SegmentAnalytics.AnalyticsJS
}
}
declare module "express" {
interface ArtsyResponseLocals {
sharify: sharify.ResponseLocal
/**
* A short-hand convenience accessor for `sharify.data`.
*/
sd: sharify.ResponseLocalData
/**
* A Relay network layer configured for Artsy’s GraphQL service (metaphysics).
*/
networkLayer: Relay.DefaultNetworkLayer
}
interface Response {
/**
* An interface for `response.locals` that can be extended with route specific locals.
*/
locals: ArtsyResponseLocals
}
}<|fim▁end|> |
declare global { |
<|file_name|>walletdb.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Bagcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "walletdb.h"
#include "base58.h"
#include "protocol.h"
#include "serialize.h"
#include "sync.h"
#include "util.h"
#include "utiltime.h"
#include "wallet.h"
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/thread.hpp>
using namespace boost;
using namespace std;
static uint64_t nAccountingEntryNumber = 0;
//
// CWalletDB
//
bool CWalletDB::WriteName(const string& strAddress, const string& strName)
{
nWalletDBUpdated++;
return Write(make_pair(string("name"), strAddress), strName);
}
bool CWalletDB::EraseName(const string& strAddress)
{
// This should only be used for sending addresses, never for receiving addresses,
// receiving addresses must always have an address book entry if they're not change return.
nWalletDBUpdated++;
return Erase(make_pair(string("name"), strAddress));
}
bool CWalletDB::WritePurpose(const string& strAddress, const string& strPurpose)
{
nWalletDBUpdated++;
return Write(make_pair(string("purpose"), strAddress), strPurpose);
}
bool CWalletDB::ErasePurpose(const string& strPurpose)
{
nWalletDBUpdated++;
return Erase(make_pair(string("purpose"), strPurpose));
}
bool CWalletDB::WriteTx(uint256 hash, const CWalletTx& wtx)
{
nWalletDBUpdated++;
return Write(std::make_pair(std::string("tx"), hash), wtx);
}
bool CWalletDB::EraseTx(uint256 hash)
{
nWalletDBUpdated++;
return Erase(std::make_pair(std::string("tx"), hash));
}
bool CWalletDB::WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata& keyMeta)
{
nWalletDBUpdated++;
if (!Write(std::make_pair(std::string("keymeta"), vchPubKey),
keyMeta, false))
return false;
// hash pubkey/privkey to accelerate wallet load
std::vector<unsigned char> vchKey;
vchKey.reserve(vchPubKey.size() + vchPrivKey.size());
vchKey.insert(vchKey.end(), vchPubKey.begin(), vchPubKey.end());
vchKey.insert(vchKey.end(), vchPrivKey.begin(), vchPrivKey.end());
return Write(std::make_pair(std::string("key"), vchPubKey), std::make_pair(vchPrivKey, Hash(vchKey.begin(), vchKey.end())), false);
}
bool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey,
const std::vector<unsigned char>& vchCryptedSecret,
const CKeyMetadata &keyMeta)
{
const bool fEraseUnencryptedKey = true;
nWalletDBUpdated++;
if (!Write(std::make_pair(std::string("keymeta"), vchPubKey),
keyMeta))
return false;
if (!Write(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false))
return false;
if (fEraseUnencryptedKey)
{
Erase(std::make_pair(std::string("key"), vchPubKey));
Erase(std::make_pair(std::string("wkey"), vchPubKey));
}
return true;
}
bool CWalletDB::WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)
{
nWalletDBUpdated++;
return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true);
}
bool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript)
{
nWalletDBUpdated++;
return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false);
}
bool CWalletDB::WriteWatchOnly(const CScript &dest)
{
nWalletDBUpdated++;
return Write(std::make_pair(std::string("watchs"), dest), '1');
}
bool CWalletDB::EraseWatchOnly(const CScript &dest)
{
nWalletDBUpdated++;
return Erase(std::make_pair(std::string("watchs"), dest));
}
bool CWalletDB::WriteBestBlock(const CBlockLocator& locator)
{
nWalletDBUpdated++;
return Write(std::string("bestblock"), locator);
}
bool CWalletDB::ReadBestBlock(CBlockLocator& locator)
{
return Read(std::string("bestblock"), locator);
}
bool CWalletDB::WriteOrderPosNext(int64_t nOrderPosNext)
{
nWalletDBUpdated++;
return Write(std::string("orderposnext"), nOrderPosNext);
}
bool CWalletDB::WriteDefaultKey(const CPubKey& vchPubKey)
{
nWalletDBUpdated++;
return Write(std::string("defaultkey"), vchPubKey);
}
bool CWalletDB::ReadPool(int64_t nPool, CKeyPool& keypool)
{
return Read(std::make_pair(std::string("pool"), nPool), keypool);
}
bool CWalletDB::WritePool(int64_t nPool, const CKeyPool& keypool)
{
nWalletDBUpdated++;
return Write(std::make_pair(std::string("pool"), nPool), keypool);
}
bool CWalletDB::ErasePool(int64_t nPool)
{
nWalletDBUpdated++;
return Erase(std::make_pair(std::string("pool"), nPool));
}
bool CWalletDB::WriteMinVersion(int nVersion)
{
return Write(std::string("minversion"), nVersion);
}
bool CWalletDB::ReadAccount(const string& strAccount, CAccount& account)
{
account.SetNull();
return Read(make_pair(string("acc"), strAccount), account);
}
bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account)
{
return Write(make_pair(string("acc"), strAccount), account);
}
bool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry)
{
return Write(std::make_pair(std::string("acentry"), std::make_pair(acentry.strAccount, nAccEntryNum)), acentry);
}
bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry)
{
return WriteAccountingEntry(++nAccountingEntryNumber, acentry);
}
CAmount CWalletDB::GetAccountCreditDebit(const string& strAccount)
{
list<CAccountingEntry> entries;
ListAccountCreditDebit(strAccount, entries);
CAmount nCreditDebit = 0;
BOOST_FOREACH (const CAccountingEntry& entry, entries)
nCreditDebit += entry.nCreditDebit;
return nCreditDebit;
}
void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& entries)
{
bool fAllAccounts = (strAccount == "*");
Dbc* pcursor = GetCursor();
if (!pcursor)
throw runtime_error("CWalletDB::ListAccountCreditDebit() : cannot create DB cursor");
unsigned int fFlags = DB_SET_RANGE;
while (true)
{
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
if (fFlags == DB_SET_RANGE)
ssKey << std::make_pair(std::string("acentry"), std::make_pair((fAllAccounts ? string("") : strAccount), uint64_t(0)));
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
fFlags = DB_NEXT;
if (ret == DB_NOTFOUND)
break;
else if (ret != 0)
{
pcursor->close();
throw runtime_error("CWalletDB::ListAccountCreditDebit() : error scanning DB");
}
// Unserialize
string strType;
ssKey >> strType;
if (strType != "acentry")
break;
CAccountingEntry acentry;
ssKey >> acentry.strAccount;
if (!fAllAccounts && acentry.strAccount != strAccount)
break;
ssValue >> acentry;
ssKey >> acentry.nEntryNo;
entries.push_back(acentry);
}
pcursor->close();
}
DBErrors CWalletDB::ReorderTransactions(CWallet* pwallet)
{
LOCK(pwallet->cs_wallet);
// Old wallets didn't have any defined order for transactions
// Probably a bad idea to change the output of this
// First: get all CWalletTx and CAccountingEntry into a sorted-by-time multimap.
typedef pair<CWalletTx*, CAccountingEntry*> TxPair;
typedef multimap<int64_t, TxPair > TxItems;
TxItems txByTime;
for (map<uint256, CWalletTx>::iterator it = pwallet->mapWallet.begin(); it != pwallet->mapWallet.end(); ++it)
{
CWalletTx* wtx = &((*it).second);
txByTime.insert(make_pair(wtx->nTimeReceived, TxPair(wtx, (CAccountingEntry*)0)));
}
list<CAccountingEntry> acentries;
ListAccountCreditDebit("", acentries);
BOOST_FOREACH(CAccountingEntry& entry, acentries)
{
txByTime.insert(make_pair(entry.nTime, TxPair((CWalletTx*)0, &entry)));
}
int64_t& nOrderPosNext = pwallet->nOrderPosNext;
nOrderPosNext = 0;
std::vector<int64_t> nOrderPosOffsets;
for (TxItems::iterator it = txByTime.begin(); it != txByTime.end(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
CAccountingEntry *const pacentry = (*it).second.second;
int64_t& nOrderPos = (pwtx != 0) ? pwtx->nOrderPos : pacentry->nOrderPos;
if (nOrderPos == -1)
{
nOrderPos = nOrderPosNext++;
nOrderPosOffsets.push_back(nOrderPos);
<|fim▁hole|> {
if (!WriteTx(pwtx->GetHash(), *pwtx))
return DB_LOAD_FAIL;
}
else
if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry))
return DB_LOAD_FAIL;
}
else
{
int64_t nOrderPosOff = 0;
BOOST_FOREACH(const int64_t& nOffsetStart, nOrderPosOffsets)
{
if (nOrderPos >= nOffsetStart)
++nOrderPosOff;
}
nOrderPos += nOrderPosOff;
nOrderPosNext = std::max(nOrderPosNext, nOrderPos + 1);
if (!nOrderPosOff)
continue;
// Since we're changing the order, write it back
if (pwtx)
{
if (!WriteTx(pwtx->GetHash(), *pwtx))
return DB_LOAD_FAIL;
}
else
if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry))
return DB_LOAD_FAIL;
}
}
WriteOrderPosNext(nOrderPosNext);
return DB_LOAD_OK;
}
class CWalletScanState {
public:
unsigned int nKeys;
unsigned int nCKeys;
unsigned int nKeyMeta;
bool fIsEncrypted;
bool fAnyUnordered;
int nFileVersion;
vector<uint256> vWalletUpgrade;
CWalletScanState() {
nKeys = nCKeys = nKeyMeta = 0;
fIsEncrypted = false;
fAnyUnordered = false;
nFileVersion = 0;
}
};
bool
ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
CWalletScanState &wss, string& strType, string& strErr)
{
try {
// Unserialize
// Taking advantage of the fact that pair serialization
// is just the two items serialized one after the other
ssKey >> strType;
if (strType == "name")
{
string strAddress;
ssKey >> strAddress;
ssValue >> pwallet->mapAddressBook[CBitcoinAddress(strAddress).Get()].name;
}
else if (strType == "purpose")
{
string strAddress;
ssKey >> strAddress;
ssValue >> pwallet->mapAddressBook[CBitcoinAddress(strAddress).Get()].purpose;
}
else if (strType == "tx")
{
uint256 hash;
ssKey >> hash;
CWalletTx wtx;
ssValue >> wtx;
CValidationState state;
if (!(CheckTransaction(wtx, state) && (wtx.GetHash() == hash) && state.IsValid()))
return false;
// Undo serialize changes in 31600
if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703)
{
if (!ssValue.empty())
{
char fTmp;
char fUnused;
ssValue >> fTmp >> fUnused >> wtx.strFromAccount;
strErr = strprintf("LoadWallet() upgrading tx ver=%d %d '%s' %s",
wtx.fTimeReceivedIsTxTime, fTmp, wtx.strFromAccount, hash.ToString());
wtx.fTimeReceivedIsTxTime = fTmp;
}
else
{
strErr = strprintf("LoadWallet() repairing tx ver=%d %s", wtx.fTimeReceivedIsTxTime, hash.ToString());
wtx.fTimeReceivedIsTxTime = 0;
}
wss.vWalletUpgrade.push_back(hash);
}
if (wtx.nOrderPos == -1)
wss.fAnyUnordered = true;
pwallet->AddToWallet(wtx, true);
}
else if (strType == "acentry")
{
string strAccount;
ssKey >> strAccount;
uint64_t nNumber;
ssKey >> nNumber;
if (nNumber > nAccountingEntryNumber)
nAccountingEntryNumber = nNumber;
if (!wss.fAnyUnordered)
{
CAccountingEntry acentry;
ssValue >> acentry;
if (acentry.nOrderPos == -1)
wss.fAnyUnordered = true;
}
}
else if (strType == "watchs")
{
CScript script;
ssKey >> script;
char fYes;
ssValue >> fYes;
if (fYes == '1')
pwallet->LoadWatchOnly(script);
// Watch-only addresses have no birthday information for now,
// so set the wallet birthday to the beginning of time.
pwallet->nTimeFirstKey = 1;
}
else if (strType == "key" || strType == "wkey")
{
CPubKey vchPubKey;
ssKey >> vchPubKey;
if (!vchPubKey.IsValid())
{
strErr = "Error reading wallet database: CPubKey corrupt";
return false;
}
CKey key;
CPrivKey pkey;
uint256 hash = 0;
if (strType == "key")
{
wss.nKeys++;
ssValue >> pkey;
} else {
CWalletKey wkey;
ssValue >> wkey;
pkey = wkey.vchPrivKey;
}
// Old wallets store keys as "key" [pubkey] => [privkey]
// ... which was slow for wallets with lots of keys, because the public key is re-derived from the private key
// using EC operations as a checksum.
// Newer wallets store keys as "key"[pubkey] => [privkey][hash(pubkey,privkey)], which is much faster while
// remaining backwards-compatible.
try
{
ssValue >> hash;
}
catch(...){}
bool fSkipCheck = false;
if (hash != 0)
{
// hash pubkey/privkey to accelerate wallet load
std::vector<unsigned char> vchKey;
vchKey.reserve(vchPubKey.size() + pkey.size());
vchKey.insert(vchKey.end(), vchPubKey.begin(), vchPubKey.end());
vchKey.insert(vchKey.end(), pkey.begin(), pkey.end());
if (Hash(vchKey.begin(), vchKey.end()) != hash)
{
strErr = "Error reading wallet database: CPubKey/CPrivKey corrupt";
return false;
}
fSkipCheck = true;
}
if (!key.Load(pkey, vchPubKey, fSkipCheck))
{
strErr = "Error reading wallet database: CPrivKey corrupt";
return false;
}
if (!pwallet->LoadKey(key, vchPubKey))
{
strErr = "Error reading wallet database: LoadKey failed";
return false;
}
}
else if (strType == "mkey")
{
unsigned int nID;
ssKey >> nID;
CMasterKey kMasterKey;
ssValue >> kMasterKey;
if(pwallet->mapMasterKeys.count(nID) != 0)
{
strErr = strprintf("Error reading wallet database: duplicate CMasterKey id %u", nID);
return false;
}
pwallet->mapMasterKeys[nID] = kMasterKey;
if (pwallet->nMasterKeyMaxID < nID)
pwallet->nMasterKeyMaxID = nID;
}
else if (strType == "ckey")
{
vector<unsigned char> vchPubKey;
ssKey >> vchPubKey;
vector<unsigned char> vchPrivKey;
ssValue >> vchPrivKey;
wss.nCKeys++;
if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey))
{
strErr = "Error reading wallet database: LoadCryptedKey failed";
return false;
}
wss.fIsEncrypted = true;
}
else if (strType == "keymeta")
{
CPubKey vchPubKey;
ssKey >> vchPubKey;
CKeyMetadata keyMeta;
ssValue >> keyMeta;
wss.nKeyMeta++;
pwallet->LoadKeyMetadata(vchPubKey, keyMeta);
// find earliest key creation time, as wallet birthday
if (!pwallet->nTimeFirstKey ||
(keyMeta.nCreateTime < pwallet->nTimeFirstKey))
pwallet->nTimeFirstKey = keyMeta.nCreateTime;
}
else if (strType == "defaultkey")
{
ssValue >> pwallet->vchDefaultKey;
}
else if (strType == "pool")
{
int64_t nIndex;
ssKey >> nIndex;
CKeyPool keypool;
ssValue >> keypool;
pwallet->setKeyPool.insert(nIndex);
// If no metadata exists yet, create a default with the pool key's
// creation time. Note that this may be overwritten by actually
// stored metadata for that key later, which is fine.
CKeyID keyid = keypool.vchPubKey.GetID();
if (pwallet->mapKeyMetadata.count(keyid) == 0)
pwallet->mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime);
}
else if (strType == "version")
{
ssValue >> wss.nFileVersion;
if (wss.nFileVersion == 10300)
wss.nFileVersion = 300;
}
else if (strType == "cscript")
{
uint160 hash;
ssKey >> hash;
CScript script;
ssValue >> script;
if (!pwallet->LoadCScript(script))
{
strErr = "Error reading wallet database: LoadCScript failed";
return false;
}
}
else if (strType == "orderposnext")
{
ssValue >> pwallet->nOrderPosNext;
}
else if (strType == "destdata")
{
std::string strAddress, strKey, strValue;
ssKey >> strAddress;
ssKey >> strKey;
ssValue >> strValue;
if (!pwallet->LoadDestData(CBitcoinAddress(strAddress).Get(), strKey, strValue))
{
strErr = "Error reading wallet database: LoadDestData failed";
return false;
}
}
} catch (...)
{
return false;
}
return true;
}
static bool IsKeyType(string strType)
{
return (strType== "key" || strType == "wkey" ||
strType == "mkey" || strType == "ckey");
}
DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
{
pwallet->vchDefaultKey = CPubKey();
CWalletScanState wss;
bool fNoncriticalErrors = false;
DBErrors result = DB_LOAD_OK;
try {
LOCK(pwallet->cs_wallet);
int nMinVersion = 0;
if (Read((string)"minversion", nMinVersion))
{
if (nMinVersion > CLIENT_VERSION)
return DB_TOO_NEW;
pwallet->LoadMinVersion(nMinVersion);
}
// Get cursor
Dbc* pcursor = GetCursor();
if (!pcursor)
{
LogPrintf("Error getting wallet database cursor\n");
return DB_CORRUPT;
}
while (true)
{
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
int ret = ReadAtCursor(pcursor, ssKey, ssValue);
if (ret == DB_NOTFOUND)
break;
else if (ret != 0)
{
LogPrintf("Error reading next record from wallet database\n");
return DB_CORRUPT;
}
// Try to be tolerant of single corrupt records:
string strType, strErr;
if (!ReadKeyValue(pwallet, ssKey, ssValue, wss, strType, strErr))
{
// losing keys is considered a catastrophic error, anything else
// we assume the user can live with:
if (IsKeyType(strType))
result = DB_CORRUPT;
else
{
// Leave other errors alone, if we try to fix them we might make things worse.
fNoncriticalErrors = true; // ... but do warn the user there is something wrong.
if (strType == "tx")
// Rescan if there is a bad transaction record:
SoftSetBoolArg("-rescan", true);
}
}
if (!strErr.empty())
LogPrintf("%s\n", strErr);
}
pcursor->close();
}
catch (boost::thread_interrupted) {
throw;
}
catch (...) {
result = DB_CORRUPT;
}
if (fNoncriticalErrors && result == DB_LOAD_OK)
result = DB_NONCRITICAL_ERROR;
// Any wallet corruption at all: skip any rewriting or
// upgrading, we don't want to make it worse.
if (result != DB_LOAD_OK)
return result;
LogPrintf("nFileVersion = %d\n", wss.nFileVersion);
LogPrintf("Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total\n",
wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys);
// nTimeFirstKey is only reliable if all keys have metadata
if ((wss.nKeys + wss.nCKeys) != wss.nKeyMeta)
pwallet->nTimeFirstKey = 1; // 0 would be considered 'no value'
BOOST_FOREACH(uint256 hash, wss.vWalletUpgrade)
WriteTx(hash, pwallet->mapWallet[hash]);
// Rewrite encrypted wallets of versions 0.4.0 and 0.5.0rc:
if (wss.fIsEncrypted && (wss.nFileVersion == 40000 || wss.nFileVersion == 50000))
return DB_NEED_REWRITE;
if (wss.nFileVersion < CLIENT_VERSION) // Update
WriteVersion(CLIENT_VERSION);
if (wss.fAnyUnordered)
result = ReorderTransactions(pwallet);
return result;
}
DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector<uint256>& vTxHash, vector<CWalletTx>& vWtx)
{
pwallet->vchDefaultKey = CPubKey();
bool fNoncriticalErrors = false;
DBErrors result = DB_LOAD_OK;
try {
LOCK(pwallet->cs_wallet);
int nMinVersion = 0;
if (Read((string)"minversion", nMinVersion))
{
if (nMinVersion > CLIENT_VERSION)
return DB_TOO_NEW;
pwallet->LoadMinVersion(nMinVersion);
}
// Get cursor
Dbc* pcursor = GetCursor();
if (!pcursor)
{
LogPrintf("Error getting wallet database cursor\n");
return DB_CORRUPT;
}
while (true)
{
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
int ret = ReadAtCursor(pcursor, ssKey, ssValue);
if (ret == DB_NOTFOUND)
break;
else if (ret != 0)
{
LogPrintf("Error reading next record from wallet database\n");
return DB_CORRUPT;
}
string strType;
ssKey >> strType;
if (strType == "tx") {
uint256 hash;
ssKey >> hash;
CWalletTx wtx;
ssValue >> wtx;
vTxHash.push_back(hash);
vWtx.push_back(wtx);
}
}
pcursor->close();
}
catch (boost::thread_interrupted) {
throw;
}
catch (...) {
result = DB_CORRUPT;
}
if (fNoncriticalErrors && result == DB_LOAD_OK)
result = DB_NONCRITICAL_ERROR;
return result;
}
DBErrors CWalletDB::ZapWalletTx(CWallet* pwallet, vector<CWalletTx>& vWtx)
{
// build list of wallet TXs
vector<uint256> vTxHash;
DBErrors err = FindWalletTx(pwallet, vTxHash, vWtx);
if (err != DB_LOAD_OK)
return err;
// erase each wallet TX
BOOST_FOREACH (uint256& hash, vTxHash) {
if (!EraseTx(hash))
return DB_CORRUPT;
}
return DB_LOAD_OK;
}
void ThreadFlushWalletDB(const string& strFile)
{
// Make this thread recognisable as the wallet flushing thread
RenameThread("bagcoin-wallet");
static bool fOneThread;
if (fOneThread)
return;
fOneThread = true;
if (!GetBoolArg("-flushwallet", true))
return;
unsigned int nLastSeen = nWalletDBUpdated;
unsigned int nLastFlushed = nWalletDBUpdated;
int64_t nLastWalletUpdate = GetTime();
while (true)
{
MilliSleep(500);
if (nLastSeen != nWalletDBUpdated)
{
nLastSeen = nWalletDBUpdated;
nLastWalletUpdate = GetTime();
}
if (nLastFlushed != nWalletDBUpdated && GetTime() - nLastWalletUpdate >= 2)
{
TRY_LOCK(bitdb.cs_db,lockDb);
if (lockDb)
{
// Don't do this if any databases are in use
int nRefCount = 0;
map<string, int>::iterator mi = bitdb.mapFileUseCount.begin();
while (mi != bitdb.mapFileUseCount.end())
{
nRefCount += (*mi).second;
mi++;
}
if (nRefCount == 0)
{
boost::this_thread::interruption_point();
map<string, int>::iterator mi = bitdb.mapFileUseCount.find(strFile);
if (mi != bitdb.mapFileUseCount.end())
{
LogPrint("db", "Flushing wallet.dat\n");
nLastFlushed = nWalletDBUpdated;
int64_t nStart = GetTimeMillis();
// Flush wallet.dat so it's self contained
bitdb.CloseDb(strFile);
bitdb.CheckpointLSN(strFile);
bitdb.mapFileUseCount.erase(mi++);
LogPrint("db", "Flushed wallet.dat %dms\n", GetTimeMillis() - nStart);
}
}
}
}
}
}
bool BackupWallet(const CWallet& wallet, const string& strDest)
{
if (!wallet.fFileBacked)
return false;
while (true)
{
{
LOCK(bitdb.cs_db);
if (!bitdb.mapFileUseCount.count(wallet.strWalletFile) || bitdb.mapFileUseCount[wallet.strWalletFile] == 0)
{
// Flush log data to the dat file
bitdb.CloseDb(wallet.strWalletFile);
bitdb.CheckpointLSN(wallet.strWalletFile);
bitdb.mapFileUseCount.erase(wallet.strWalletFile);
// Copy wallet.dat
filesystem::path pathSrc = GetDataDir() / wallet.strWalletFile;
filesystem::path pathDest(strDest);
if (filesystem::is_directory(pathDest))
pathDest /= wallet.strWalletFile;
try {
#if BOOST_VERSION >= 104000
filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists);
#else
filesystem::copy_file(pathSrc, pathDest);
#endif
LogPrintf("copied wallet.dat to %s\n", pathDest.string());
return true;
} catch(const filesystem::filesystem_error &e) {
LogPrintf("error copying wallet.dat to %s - %s\n", pathDest.string(), e.what());
return false;
}
}
}
MilliSleep(100);
}
return false;
}
//
// Try to (very carefully!) recover wallet.dat if there is a problem.
//
bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
{
// Recovery procedure:
// move wallet.dat to wallet.timestamp.bak
// Call Salvage with fAggressive=true to
// get as much data as possible.
// Rewrite salvaged data to wallet.dat
// Set -rescan so any missing transactions will be
// found.
int64_t now = GetTime();
std::string newFilename = strprintf("wallet.%d.bak", now);
int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL,
newFilename.c_str(), DB_AUTO_COMMIT);
if (result == 0)
LogPrintf("Renamed %s to %s\n", filename, newFilename);
else
{
LogPrintf("Failed to rename %s to %s\n", filename, newFilename);
return false;
}
std::vector<CDBEnv::KeyValPair> salvagedData;
bool allOK = dbenv.Salvage(newFilename, true, salvagedData);
if (salvagedData.empty())
{
LogPrintf("Salvage(aggressive) found no records in %s.\n", newFilename);
return false;
}
LogPrintf("Salvage(aggressive) found %u records\n", salvagedData.size());
bool fSuccess = allOK;
boost::scoped_ptr<Db> pdbCopy(new Db(&dbenv.dbenv, 0));
int ret = pdbCopy->open(NULL, // Txn pointer
filename.c_str(), // Filename
"main", // Logical db name
DB_BTREE, // Database type
DB_CREATE, // Flags
0);
if (ret > 0)
{
LogPrintf("Cannot create database file %s\n", filename);
return false;
}
CWallet dummyWallet;
CWalletScanState wss;
DbTxn* ptxn = dbenv.TxnBegin();
BOOST_FOREACH(CDBEnv::KeyValPair& row, salvagedData)
{
if (fOnlyKeys)
{
CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION);
CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION);
string strType, strErr;
bool fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
wss, strType, strErr);
if (!IsKeyType(strType))
continue;
if (!fReadOK)
{
LogPrintf("WARNING: CWalletDB::Recover skipping %s: %s\n", strType, strErr);
continue;
}
}
Dbt datKey(&row.first[0], row.first.size());
Dbt datValue(&row.second[0], row.second.size());
int ret2 = pdbCopy->put(ptxn, &datKey, &datValue, DB_NOOVERWRITE);
if (ret2 > 0)
fSuccess = false;
}
ptxn->commit(0);
pdbCopy->close(0);
return fSuccess;
}
bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename)
{
return CWalletDB::Recover(dbenv, filename, false);
}
bool CWalletDB::WriteDestData(const std::string &address, const std::string &key, const std::string &value)
{
nWalletDBUpdated++;
return Write(std::make_pair(std::string("destdata"), std::make_pair(address, key)), value);
}
bool CWalletDB::EraseDestData(const std::string &address, const std::string &key)
{
nWalletDBUpdated++;
return Erase(std::make_pair(std::string("destdata"), std::make_pair(address, key)));
}<|fim▁end|> | if (pwtx) |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from . import _wrap_numbers, Symbol, Number, Matrix
def symbols(s):
""" mimics sympy.symbols """
tup = tuple(map(Symbol, s.replace(',', ' ').split()))
if len(tup) == 1:
return tup[0]
else:
return tup
def symarray(prefix, shape):
import numpy as np
arr = np.empty(shape, dtype=object)
for index in np.ndindex(shape):
arr[index] = Symbol('%s_%s' % (
prefix, '_'.join(map(str, index))))
return arr
def lambdify(args, exprs):
"""
lambdify mimics sympy.lambdify
"""
try:
nargs = len(args)
except TypeError:
args = (args,)
nargs = 1
try:
nexprs = len(exprs)
except TypeError:
exprs = (exprs,)
nexprs = 1
@_wrap_numbers
def f(*inp):
if len(inp) != nargs:
raise TypeError("Incorrect number of arguments")
try:
len(inp)
except TypeError:
inp = (inp,)
subsd = dict(zip(args, inp))
return [expr.subs(subsd).evalf() for expr in exprs][
0 if nexprs == 1 else slice(None)]
return f
class Lambdify(object):
"""
Lambdify mimics symengine.Lambdify
"""
def __init__(self, syms, exprs):
self.syms = syms
self.exprs = exprs
def __call__(self, inp, out=None):
inp = tuple(map(Number.make, inp))
subsd = dict(zip(self.syms, inp))
def _eval(expr_iter):
return [expr.subs(subsd).evalf() for expr in expr_iter]
exprs = self.exprs
if out is not None:
try:
out.flat = _eval(exprs.flatten())
except AttributeError:
out.flat = _eval(exprs)
elif isinstance(exprs, Matrix):
import numpy as np
nr, nc = exprs.nrows, exprs.ncols<|fim▁hole|> out = np.empty((nr, nc))
for ri in range(nr):
for ci in range(nc):
out[ri, ci] = exprs._get_element(
ri*nc + ci).subs(subsd).evalf()
return out
# return Matrix(nr, nc, _eval(exprs._get_element(i) for
# i in range(nr*nc)))
elif hasattr(exprs, 'reshape'):
# NumPy like container:
container = exprs.__class__(exprs.shape, dtype=float, order='C')
container.flat = _eval(exprs.flatten())
return container
else:
return _eval(exprs)<|fim▁end|> | |
<|file_name|>aligned_parse_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""aligned_parse_reader.py: read parsed and aligned files"""
__author__ = "Fabien Cromieres"
__license__ = "undecided"
__version__ = "1.0"
__email__ = "[email protected]"
__status__ = "Development"<|fim▁hole|>
import logging
import io
import exceptions
log = logging.getLogger("aparse")
log.setLevel(logging.INFO)
def read_one_parse_info_from_file_object(f):
id_line = f.readline()
if len(id_line) == 0:
raise exceptions.EOFError()
sharp, id_part, score_part = id_line.split()
assert sharp == "#"
id_tag, id_ = id_part.split("=")
assert id_tag == "ID"
score_tag, score = score_part.split("=")
assert score_tag == "SCORE"
score = float(score)
sentence = []
while True:
line = f.readline().strip()
if len(line) == 0:
return id_, sentence
splitted_line = line.split("\t")
num_pos = int(splitted_line[0])
dpnd = int(splitted_line[1])
word = splitted_line[2]
assert num_pos == len(sentence)
sentence.append(word)
def read_one_align_info_from_file_object(f):
id_line = f.readline()
if len(id_line) == 0:
raise exceptions.EOFError()
id_line = id_line.strip()
sharp, id_, score = id_line.split()
assert sharp == "#"
score = float(score)
align_line = f.readline().strip()
alignment = []
for link in align_line.split():
left, right = link.split("-")
left = [int(x) for x in left.split(",")]
right = [int(x) for x in right.split(",")]
alignment.append((left, right))
return id_, score, alignment
def load_aligned_corpus(src_fn, tgt_fn, align_fn, skip_empty_align=True, invert_alignment_links=False):
src = io.open(src_fn, 'rt', encoding="utf8")
tgt = io.open(tgt_fn, 'rt', encoding="utf8")
align_f = io.open(align_fn, 'rt', encoding="utf8")
num_sentence = 0
while True:
try:
id_src, sentence_src = read_one_parse_info_from_file_object(src)
id_tgt, sentence_tgt = read_one_parse_info_from_file_object(tgt)
id_align, score_align, alignment = read_one_align_info_from_file_object(
align_f)
except exceptions.EOFError:
return
if skip_empty_align and len(alignment) == 0:
log.warn("skipping empty alignment %i %s" % (num_sentence, id_align))
continue
assert id_src == id_tgt, "%s != %s @%i" % (id_src, id_tgt, num_sentence)
assert id_src == id_align, "%s != %s @%i" % (id_src, id_align, num_sentence)
if invert_alignment_links:
inverted_alignment = [(right, left) for (left, right) in alignment]
alignment = inverted_alignment
yield sentence_src, sentence_tgt, alignment
num_sentence += 1<|fim▁end|> |
from __future__ import absolute_import, division, print_function, unicode_literals |
<|file_name|>TestIndexDeletion.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2002-2011 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.index.impl.lucene;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.index.Index;
import org.neo4j.helpers.collection.MapUtil;
import org.neo4j.index.Neo4jTestCase;
import org.neo4j.kernel.AbstractGraphDatabase;
import org.neo4j.kernel.EmbeddedGraphDatabase;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.neo4j.index.Neo4jTestCase.assertContains;
import static org.neo4j.index.impl.lucene.Contains.contains;
import static org.neo4j.index.impl.lucene.HasThrownException.hasThrownException;
public class TestIndexDeletion
{
private static final String INDEX_NAME = "index";
private static GraphDatabaseService graphDb;
private Index<Node> index;
private Transaction tx;
private String key;
private Node node;
private String value;
private List<WorkThread> workers;
@BeforeClass
public static void setUpStuff()
{
String storeDir = "target/var/freshindex";
Neo4jTestCase.deleteFileOrDirectory( new File( storeDir ) );
graphDb = new EmbeddedGraphDatabase( storeDir, MapUtil.stringMap( "index", "lucene" ) );
}
@AfterClass
public static void tearDownStuff()
{
graphDb.shutdown();
}
@After
public void commitTx()
{
finishTx( true );
for ( WorkThread worker : workers )
{
worker.rollback();
worker.die();
}
}
public void rollbackTx()
{
finishTx( false );
}
public void finishTx( boolean success )
{
if ( tx != null )
{
if ( success )
{
tx.success();
}
tx.finish();
tx = null;
}
}
@Before
public void createInitialData()
{
beginTx();
index = graphDb.index().forNodes( INDEX_NAME );
index.delete();
restartTx();
index = graphDb.index().forNodes( INDEX_NAME );
key = "key";
value = "my own value";
node = graphDb.createNode();
index.add( node, key, value );
workers = new ArrayList<WorkThread>();
}
public void beginTx()
{
if ( tx == null )
{
tx = graphDb.beginTx();
}
}
void restartTx()
{
finishTx( true );
beginTx();
}
@Test
public void shouldBeAbleToDeleteAndRecreateIndex()
{
restartTx();
assertContains( index.query( key, "own" ) );
index.delete();
restartTx();
Index<Node> recreatedIndex = graphDb.index().forNodes( INDEX_NAME, LuceneIndexProvider.FULLTEXT_CONFIG );
assertNull( recreatedIndex.get( key, value ).getSingle() );
recreatedIndex.add( node, key, value );
restartTx();
assertContains( recreatedIndex.query( key, "own" ), node );
recreatedIndex.delete();
}
@Test
public void shouldNotBeDeletedWhenDeletionRolledBack()
{
restartTx();
index.delete();
rollbackTx();
index.get( key, value );
}
@Test( expected = IllegalStateException.class )
public void shouldThrowIllegalStateForActionsAfterDeletedOnIndex()
{
restartTx();
index.delete();
restartTx();
index.query( key, "own" );
}
@Test( expected = IllegalStateException.class )
public void shouldThrowIllegalStateForActionsAfterDeletedOnIndex2()
{
restartTx();
index.delete();
restartTx();
index.add( node, key, value );
}
@Test( expected = IllegalStateException.class )
public void shouldThrowIllegalStateForActionsAfterDeletedOnIndex3()
{
restartTx();
index.delete();
index.query( key, "own" );
}
@Test( expected = IllegalStateException.class )
public void shouldThrowIllegalStateForActionsAfterDeletedOnIndex4()
{
restartTx();
index.delete();
Index<Node> newIndex = graphDb.index().forNodes( INDEX_NAME );
newIndex.query( key, "own" );
}
@Test
public void deleteInOneTxShouldNotAffectTheOther() throws InterruptedException
{
index.delete();
WorkThread firstTx = createWorker();
firstTx.createNodeAndIndexBy( key, "another value" );
firstTx.commit();
}
@Test
public void deleteAndCommitShouldBePublishedToOtherTransaction2() throws InterruptedException
{
WorkThread firstTx = createWorker();
WorkThread secondTx = createWorker();
firstTx.beginTransaction();
secondTx.beginTransaction();
firstTx.createNodeAndIndexBy( key, "some value" );
secondTx.createNodeAndIndexBy( key, "some other value" );
firstTx.deleteIndex();
firstTx.commit();
secondTx.queryIndex( key, "some other value" );
assertThat( secondTx, hasThrownException() );
secondTx.rollback();
// Since $Before will start a tx, add a value and keep tx open and workers will
// delete the index so this test will fail in @After if we don't rollback this tx
rollbackTx();
}
@Test
public void indexDeletesShouldNotByVisibleUntilCommit()
{
commitTx();
WorkThread firstTx = createWorker();
WorkThread secondTx = createWorker();
firstTx.beginTransaction();<|fim▁hole|>
firstTx.rollback();
}
@Test
public void indexDeleteShouldDeleteDirectory()
{
String otherIndexName = "other-index";
File pathToLuceneIndex = new File( ((AbstractGraphDatabase)graphDb).getStoreDir() + "/index/lucene/node/" + INDEX_NAME );
File pathToOtherLuceneIndex = new File( ((AbstractGraphDatabase)graphDb).getStoreDir() + "/index/lucene/node/" + otherIndexName );
Index<Node> otherIndex = graphDb.index().forNodes( otherIndexName );
Node node = graphDb.createNode();
otherIndex.add( node, "someKey", "someValue" );
assertFalse( pathToLuceneIndex.exists() );
assertFalse( pathToOtherLuceneIndex.exists() );
restartTx();
// Here "index" and "other-index" indexes should exist
assertTrue( pathToLuceneIndex.exists() );
assertTrue( pathToOtherLuceneIndex.exists() );
index.delete();
assertTrue( pathToLuceneIndex.exists() );
assertTrue( pathToOtherLuceneIndex.exists() );
restartTx();
// Here only "other-index" should exist
assertFalse( pathToLuceneIndex.exists() );
assertTrue( pathToOtherLuceneIndex.exists() );
}
private WorkThread createWorker()
{
WorkThread workThread = new WorkThread( index, graphDb );
workers.add( workThread );
return workThread;
}
}<|fim▁end|> | firstTx.removeFromIndex( key, value );
assertThat( secondTx.queryIndex( key, value ), contains( node ) ); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* webdriverio
* https://github.com/Camme/webdriverio
*
* A WebDriver module for nodejs. Either use the super easy help commands or use the base
* Webdriver wire protocol commands. Its totally inspired by jellyfishs webdriver, but the
* goal is to make all the webdriver protocol items available, as near the original as possible.
*
* Copyright (c) 2013 Camilo Tapia <[email protected]>
* Licensed under the MIT license.
*
* Contributors:
* Dan Jenkins <[email protected]><|fim▁hole|> * Christian Bromann <[email protected]>
* Vincent Voyer <[email protected]>
*/
import WebdriverIO from './lib/webdriverio'
import Multibrowser from './lib/multibrowser'
import ErrorHandler from './lib/utils/ErrorHandler'
import getImplementedCommands from './lib/helpers/getImplementedCommands'
import pkg from './package.json'
const IMPLEMENTED_COMMANDS = getImplementedCommands()
const VERSION = pkg.version
let remote = function (options = {}, modifier) {
/**
* initialise monad
*/
let wdio = WebdriverIO(options, modifier)
/**
* build prototype: commands
*/
for (let commandName of Object.keys(IMPLEMENTED_COMMANDS)) {
wdio.lift(commandName, IMPLEMENTED_COMMANDS[commandName])
}
let prototype = wdio()
prototype.defer.resolve()
return prototype
}
let multiremote = function (options) {
let multibrowser = new Multibrowser()
for (let browserName of Object.keys(options)) {
multibrowser.addInstance(
browserName,
remote(options[browserName], multibrowser.getInstanceModifier())
)
}
return remote(options, multibrowser.getModifier())
}
export { remote, multiremote, VERSION, ErrorHandler }<|fim▁end|> | |
<|file_name|>dom-portal-host.d.ts<|end_file_name|><|fim▁begin|>import { ComponentFactoryResolver, ComponentRef } from '@angular/core';
import { BasePortalHost, ComponentPortal, TemplatePortal } from './portal';
/**
* A PortalHost for attaching portals to an arbitrary DOM element outside of the Angular
* application context.
*
* This is the only part of the portal core that directly touches the DOM.
*/
export declare class DomPortalHost extends BasePortalHost {
private _hostDomElement;
private _componentFactoryResolver;
constructor(_hostDomElement: Element, _componentFactoryResolver: ComponentFactoryResolver);
/** Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver. */
attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;<|fim▁hole|><|fim▁end|> | attachTemplatePortal(portal: TemplatePortal): Map<string, any>;
dispose(): void;
} |
<|file_name|>CreateUserInputInterface.java<|end_file_name|><|fim▁begin|>/*
* (c) Copyright 2021 Micro Focus
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.cloudslang.content.active_directory.entities;
import java.util.List;
public interface CreateUserInputInterface {
String getHost();
String getDistinguishedName();
String getUserCommonName();
String getUserPassword();
String getSAMAccountName();
String getUsername();
String getPassword();
String getProtocol();
Boolean getTrustAllRoots();
String getTrustKeystore();
String getTrustPassword();
Boolean getEscapeChars();
String getTimeout();
String getProxyHost();
int getProxyPort();
String getProxyUsername();
String getProxyPassword();
String getX509HostnameVerifier();
String getTlsVersion();
List<String> getAllowedCiphers();<|fim▁hole|>
}<|fim▁end|> | |
<|file_name|>pose-predictor.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var THREE = require('./three-math.js');
var PredictionMode = {
NONE: 'none',
INTERPOLATE: 'interpolate',
PREDICT: 'predict'
}
// How much to interpolate between the current orientation estimate and the
// previous estimate position. This is helpful for devices with low
// deviceorientation firing frequency (eg. on iOS8 and below, it is 20 Hz). The
// larger this value (in [0, 1]), the smoother but more delayed the head
// tracking is.
var INTERPOLATION_SMOOTHING_FACTOR = 0.01;
// Angular threshold, if the angular speed (in deg/s) is less than this, do no
// prediction. Without it, the screen flickers quite a bit.
var PREDICTION_THRESHOLD_DEG_PER_S = 0.01;
//var PREDICTION_THRESHOLD_DEG_PER_S = 0;
// How far into the future to predict.
window.WEBVR_PREDICTION_TIME_MS = 80;
// Whether to predict or what.
window.WEBVR_PREDICTION_MODE = PredictionMode.PREDICT;
function PosePredictor() {
this.lastQ = new THREE.Quaternion();
this.lastTimestamp = null;
this.outQ = new THREE.Quaternion();
this.deltaQ = new THREE.Quaternion();
}
PosePredictor.prototype.getPrediction = function(currentQ, rotationRate, timestamp) {
// If there's no previous quaternion, output the current one and save for
// later.
if (!this.lastTimestamp) {
this.lastQ.copy(currentQ);
this.lastTimestamp = timestamp;
return currentQ;
}
// DEBUG ONLY: Try with a fixed 60 Hz update speed.
//var elapsedMs = 1000/60;
var elapsedMs = timestamp - this.lastTimestamp;
switch (WEBVR_PREDICTION_MODE) {
case PredictionMode.INTERPOLATE:
this.outQ.copy(currentQ);
this.outQ.slerp(this.lastQ, INTERPOLATION_SMOOTHING_FACTOR);
// Save the current quaternion for later.
this.lastQ.copy(currentQ);<|fim▁hole|> if (rotationRate) {
axisAngle = this.getAxisAngularSpeedFromRotationRate_(rotationRate);
} else {
axisAngle = this.getAxisAngularSpeedFromGyroDelta_(currentQ, elapsedMs);
}
// If there is no predicted axis/angle, don't do prediction.
if (!axisAngle) {
this.outQ.copy(currentQ);
this.lastQ.copy(currentQ);
break;
}
var angularSpeedDegS = axisAngle.speed;
var axis = axisAngle.axis;
var predictAngleDeg = (WEBVR_PREDICTION_TIME_MS / 1000) * angularSpeedDegS;
// If we're rotating slowly, don't do prediction.
if (angularSpeedDegS < PREDICTION_THRESHOLD_DEG_PER_S) {
this.outQ.copy(currentQ);
this.lastQ.copy(currentQ);
break;
}
// Calculate the prediction delta to apply to the original angle.
this.deltaQ.setFromAxisAngle(axis, THREE.Math.degToRad(predictAngleDeg));
// DEBUG ONLY: As a sanity check, use the same axis and angle as before,
// which should cause no prediction to happen.
//this.deltaQ.setFromAxisAngle(axis, angle);
this.outQ.copy(this.lastQ);
this.outQ.multiply(this.deltaQ);
// Use the predicted quaternion as the new last one.
//this.lastQ.copy(this.outQ);
this.lastQ.copy(currentQ);
break;
case PredictionMode.NONE:
default:
this.outQ.copy(currentQ);
}
this.lastTimestamp = timestamp;
return this.outQ;
};
PosePredictor.prototype.setScreenOrientation = function(screenOrientation) {
this.screenOrientation = screenOrientation;
};
PosePredictor.prototype.getAxis_ = function(quat) {
// x = qx / sqrt(1-qw*qw)
// y = qy / sqrt(1-qw*qw)
// z = qz / sqrt(1-qw*qw)
var d = Math.sqrt(1 - quat.w * quat.w);
return new THREE.Vector3(quat.x / d, quat.y / d, quat.z / d);
};
PosePredictor.prototype.getAngle_ = function(quat) {
// angle = 2 * acos(qw)
// If w is greater than 1 (THREE.js, how can this be?), arccos is not defined.
if (quat.w > 1) {
return 0;
}
var angle = 2 * Math.acos(quat.w);
// Normalize the angle to be in [-π, π].
if (angle > Math.PI) {
angle -= 2 * Math.PI;
}
return angle;
};
PosePredictor.prototype.getAxisAngularSpeedFromRotationRate_ = function(rotationRate) {
if (!rotationRate) {
return null;
}
var screenRotationRate;
if (/iPad|iPhone|iPod/.test(navigator.platform)) {
// iOS: angular speed in deg/s.
var screenRotationRate = this.getScreenAdjustedRotationRateIOS_(rotationRate);
} else {
// Android: angular speed in rad/s, so need to convert.
rotationRate.alpha = THREE.Math.radToDeg(rotationRate.alpha);
rotationRate.beta = THREE.Math.radToDeg(rotationRate.beta);
rotationRate.gamma = THREE.Math.radToDeg(rotationRate.gamma);
var screenRotationRate = this.getScreenAdjustedRotationRate_(rotationRate);
}
var vec = new THREE.Vector3(
screenRotationRate.beta, screenRotationRate.alpha, screenRotationRate.gamma);
/*
var vec;
if (/iPad|iPhone|iPod/.test(navigator.platform)) {
vec = new THREE.Vector3(rotationRate.gamma, rotationRate.alpha, rotationRate.beta);
} else {
vec = new THREE.Vector3(rotationRate.beta, rotationRate.alpha, rotationRate.gamma);
}
// Take into account the screen orientation too!
vec.applyQuaternion(this.screenTransform);
*/
// Angular speed in deg/s.
var angularSpeedDegS = vec.length();
var axis = vec.normalize();
return {
speed: angularSpeedDegS,
axis: axis
}
};
PosePredictor.prototype.getScreenAdjustedRotationRate_ = function(rotationRate) {
var screenRotationRate = {
alpha: -rotationRate.alpha,
beta: rotationRate.beta,
gamma: rotationRate.gamma
};
switch (this.screenOrientation) {
case 90:
screenRotationRate.beta = - rotationRate.gamma;
screenRotationRate.gamma = rotationRate.beta;
break;
case 180:
screenRotationRate.beta = - rotationRate.beta;
screenRotationRate.gamma = - rotationRate.gamma;
break;
case 270:
case -90:
screenRotationRate.beta = rotationRate.gamma;
screenRotationRate.gamma = - rotationRate.beta;
break;
default: // SCREEN_ROTATION_0
screenRotationRate.beta = rotationRate.beta;
screenRotationRate.gamma = rotationRate.gamma;
break;
}
return screenRotationRate;
};
PosePredictor.prototype.getScreenAdjustedRotationRateIOS_ = function(rotationRate) {
var screenRotationRate = {
alpha: rotationRate.alpha,
beta: rotationRate.beta,
gamma: rotationRate.gamma
};
// Values empirically derived.
switch (this.screenOrientation) {
case 90:
screenRotationRate.beta = -rotationRate.beta;
screenRotationRate.gamma = rotationRate.gamma;
break;
case 180:
// You can't even do this on iOS.
break;
case 270:
case -90:
screenRotationRate.alpha = -rotationRate.alpha;
screenRotationRate.beta = rotationRate.beta;
screenRotationRate.gamma = rotationRate.gamma;
break;
default: // SCREEN_ROTATION_0
screenRotationRate.alpha = rotationRate.beta;
screenRotationRate.beta = rotationRate.alpha;
screenRotationRate.gamma = rotationRate.gamma;
break;
}
return screenRotationRate;
};
PosePredictor.prototype.getAxisAngularSpeedFromGyroDelta_ = function(currentQ, elapsedMs) {
// Sometimes we use the same sensor timestamp, in which case prediction
// won't work.
if (elapsedMs == 0) {
return null;
}
// Q_delta = Q_last^-1 * Q_curr
this.deltaQ.copy(this.lastQ);
this.deltaQ.inverse();
this.deltaQ.multiply(currentQ);
// Convert from delta quaternion to axis-angle.
var axis = this.getAxis_(this.deltaQ);
var angleRad = this.getAngle_(this.deltaQ);
// It took `elapsed` ms to travel the angle amount over the axis. Now,
// we make a new quaternion based how far in the future we want to
// calculate.
var angularSpeedRadMs = angleRad / elapsedMs;
var angularSpeedDegS = THREE.Math.radToDeg(angularSpeedRadMs) * 1000;
// If no rotation rate is provided, do no prediction.
return {
speed: angularSpeedDegS,
axis: axis
};
};
module.exports = PosePredictor;<|fim▁end|> | break;
case PredictionMode.PREDICT:
var axisAngle; |
<|file_name|>noUndefined.js<|end_file_name|><|fim▁begin|>/*
* /MathJax/extensions/TeX/noUndefined.js
<|fim▁hole|> * Part of the MathJax library.
* See http://www.mathjax.org for details.
*
* Licensed under the Apache License, Version 2.0;
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Extension["TeX/noUndefined"]={version:"1.1",config:MathJax.Hub.CombineConfig("TeX.noUndefined",{attributes:{mathcolor:"red"}})};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.Extension["TeX/noUndefined"].config;var a=MathJax.ElementJax.mml;MathJax.InputJax.TeX.Parse.Augment({csUndefined:function(c){this.Push(a.mtext(c).With(b.attributes))}});MathJax.Hub.Startup.signal.Post("TeX noUndefined Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/noUndefined.js");<|fim▁end|> | *
* Copyright (c) 2010 Design Science, Inc.
*
|
<|file_name|>005_cleaner.py<|end_file_name|><|fim▁begin|># 005_cleaner.py
#####################################################################
##################################
# Import des modules et ajout du path de travail pour import relatif
import sys
sys.path.insert(0 , 'C:/Users/WILLROS/Perso/Shade/scripts/LocalWC-Shade-App/apis/')
from voca import AddLog , StringFormatter , OutFileCreate , OdditiesFinder
##################################
# Init des paths et noms de fichiers
missionName = '005'
AddLog('title' , '{} : Début du nettoyage du fichier'.format(missionName))
work_dir = 'C:/Users/WILLROS/Perso/Shade/scripts/LocalWC-Shade-App/apis/raw/{}_raw/'.format(missionName)
# Nom du fichier source
raw_file = 'src'
##################################
# retreiving raw string
raw_string_with_tabs = open(work_dir + raw_file , 'r').read()
# replacing tabs with carriage return
raw_string_with_cr = raw_string_with_tabs.replace( '\t', '\n' )
# turning the string into a list
raw_list = raw_string_with_cr.splitlines()
# going through oddities finder
AddLog('subtitle' , 'Début de la fonction OdditiesFinder')
list_without_oddities = OdditiesFinder( raw_list )
# going through string formatter
ref_list = []
AddLog('subtitle' , 'Début de la fonction StringFormatter')
<|fim▁hole|>
##################################
# Enregistrement des fichiers sortie
AddLog('subtitle' , 'Début de la fonction OutFileCreate')
OutFileCreate('C:/Users/WILLROS/Perso/Shade/scripts/LocalWC-Shade-App/apis/out/','{}_src'.format(missionName),ref_list,'prenoms masculins italiens')<|fim▁end|> | for line in list_without_oddities:
ref_list.append( StringFormatter( line ) )
|
<|file_name|>grunt.js<|end_file_name|><|fim▁begin|>/*jshint node:true */
module.exports = function( grunt ) {
"use strict";
var entryFiles = grunt.file.expandFiles( "entries/*.xml" );
grunt.loadNpmTasks( "grunt-clean" );
grunt.loadNpmTasks( "grunt-wordpress" );
grunt.loadNpmTasks( "grunt-jquery-content" );
grunt.loadNpmTasks( "grunt-check-modules" );
grunt.initConfig({
clean: {
folder: "dist"
},
lint: {
grunt: "grunt.js"
},
xmllint: {
all: [].concat( entryFiles, "categories.xml", "entries2html.xsl" )
},
xmltidy: {
all: [].concat( entryFiles, "categories.xml" )
},
"build-pages": {
all: grunt.file.expandFiles( "pages/**" )
},
"build-xml-entries": {
all: entryFiles
},<|fim▁hole|> dir: "dist/wordpress"
}, grunt.file.readJSON( "config.json" ) ),
watch: {
scripts: {
files: 'entries/*.xml',
tasks: ['wordpress-deploy'],
options: {
interrupt: true
}
}
}
});
grunt.registerTask( "default", "build-wordpress" );
grunt.registerTask( "build", "build-pages build-xml-entries build-xml-categories build-xml-full build-resources" );
grunt.registerTask( "build-wordpress", "check-modules clean lint xmllint build" );
grunt.registerTask( "tidy", "xmllint xmltidy" );
};<|fim▁end|> | "build-resources": {
all: grunt.file.expandFiles( "resources/**" )
},
wordpress: grunt.utils._.extend({ |
<|file_name|>ControlPrinter.cpp<|end_file_name|><|fim▁begin|>//
// ControlPrinter.cpp
// Tonic
//
// Created by Morgan Packard on 4/28/13.
// Copyright (c) 2013 Nick Donaldson. All rights reserved.
//
#include "ControlPrinter.h"
namespace Tonic { namespace Tonic_{
ControlPrinter_::ControlPrinter_()
:message("%f\n"), hasPrinted(false){
}
void ControlPrinter_::setMessage(string messageArg){
message = messageArg + "\n";
}
} // Namespace Tonic_<|fim▁hole|>
} // Namespace Tonic<|fim▁end|> | |
<|file_name|>mocha-ci-reporter.js<|end_file_name|><|fim▁begin|>const JsonReporter = require('./mocha-custom-json-reporter');
const mocha = require('mocha');
const MochaDotsReporter = require('./mocha-dots-reporter');
const MochaJUnitReporter = require('mocha-junit-reporter');
const {Base} = mocha.reporters;
/**
* @param {*} runner
* @param {*} options<|fim▁hole|> Base.call(this, runner, options);
this._mochaDotsReporter = new MochaDotsReporter(runner);
this._jsonReporter = new JsonReporter(runner);
this._mochaJunitReporter = new MochaJUnitReporter(runner, options);
// TODO(#28387) clean up this typing.
return /** @type {*} */ (this);
}
ciReporter.prototype.__proto__ = Base.prototype;
module.exports = ciReporter;<|fim▁end|> | * @return {MochaDotsReporter}
*/
function ciReporter(runner, options) { |
<|file_name|>sysinfo.py<|end_file_name|><|fim▁begin|>import os
from multiprocessing import cpu_count
_cpu_count = cpu_count()
if hasattr(os, 'getloadavg'):
def load_fair():
return 'load', os.getloadavg()[0] / _cpu_count
else:
from winperfmon import PerformanceCounter
from threading import Thread
from collections import deque
from time import sleep
class SystemLoadThread(Thread):
def __init__(self):
super(SystemLoadThread, self).__init__()
self.daemon = True
self.samples = deque(maxlen=10)
self.load = 0.5
self.counter = PerformanceCounter(r'\System\Processor Queue Length', r'\Processor(_Total)\% Processor Time')
<|fim▁hole|> self.samples.append(pql)
if pt >= 100:
self.load = max(sum(self.samples) / len(self.samples) / _cpu_count, pt / 100.)
else:
self.load = pt / 100.
sleep(1)
_load_thread = SystemLoadThread()
_load_thread.start()
def load_fair():
return 'load', _load_thread.load
def cpu_count():
return 'cpu-count', _cpu_count
report_callbacks = [load_fair, cpu_count]<|fim▁end|> | def run(self):
while True:
pql, pt = self.counter.query() |
<|file_name|>sparc64_unknown_linux_gnu.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use spec::{LinkerFlavor, Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::linux_base::opts();
base.cpu = "v9".to_string();
base.max_atomic_width = Some(64);
Ok(Target {
llvm_target: "sparc64-unknown-linux-gnu".to_string(),
target_endian: "big".to_string(),
target_pointer_width: "64".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "E-m:e-i64:64-n32:64-S128".to_string(),
arch: "sparc64".to_string(),
target_os: "linux".to_string(),
target_env: "gnu".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>manage-account.component.ts<|end_file_name|><|fim▁begin|>/**
* Created by yezm on 12/08/2016.
*/
import {Component, OnDestroy, OnInit} from "@angular/core";
import {AuthService} from "../../shared/auth.service";
import {FormControl, FormGroup, Validators, FormBuilder} from "@angular/forms";
import {Router} from "@angular/router";
import {Subscription} from "rxjs";
import {Uuid} from "../shared/uuid.service";<|fim▁hole|> templateUrl: 'manage-account.component.html'
})
export class ManageAccountComponent implements OnDestroy, OnInit{
ngOnInit(): any {
this.loginForm = this.formBuilder.group({
username: ['', [Validators.required, ValidationService.emailValidator]],
password: ['', Validators.required]
});
}
private sub: Subscription;
constructor(public auth: AuthService, private router: Router, private formBuilder: FormBuilder, public uuid: Uuid) {
}
loginForm: FormGroup;
errorMessage: string;
get message() {
return 'You are logged ' + (this.auth.user.isLoggedIn ? 'in as: ' + this.auth.user.name : 'out');
}
login(username: string, password: string) {
if (username == null || password == null) {
this.errorMessage = 'Username or password are not valid.';
return;
}
this.sub = this.auth.login(username, password)
.subscribe(data => {
var result = data.json();
this.auth.user.hasPassword = true;
this.auth.user.email = result.email;
this.auth.user.isLoggedIn = true;
this.auth.user.name = result.name;
}, err => {
this.errorMessage = err;
});
}
createPassword() {
this.router.navigate(['/user-center/create-password']);
}
changePassword() {
this.router.navigate(['/user-center/change-password']);
}
forgotPassword() {
this.router.navigate(['/user-center/forgot-password']);
}
ngOnDestroy(): void {
if(this.sub){
this.sub.unsubscribe();
}
}
}<|fim▁end|> | import {ValidationService} from "../../shared/validation.service";
@Component({
selector: 'manage-account', |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
from __future__ import absolute_import
from django.conf.urls import url, include
from .views import MonitoringView
urlpatterns = [<|fim▁hole|> url(r'^plugins/', include('app.modules.monitoring_nodes.plugins.urls', namespace="plugins")),
url(r'^nodes/', include('app.modules.monitoring_nodes.nodes.urls', namespace="nodes")),
url(r'^groups/', include('app.modules.monitoring_nodes.groups.urls', namespace="groups")),
url(r'^graphs/', include('app.modules.monitoring_nodes.graphs.urls', namespace="graphs")),
url(r'^configs/', include('app.modules.monitoring_nodes.configs.urls', namespace="configs")),
]<|fim▁end|> | url(r'^$', MonitoringView.as_view(), name="index"),
url(r'^info/', include('app.modules.monitoring_nodes.info.urls', namespace='info')), |
<|file_name|>foundation.dropdown.js<|end_file_name|><|fim▁begin|>/*jslint unparam: true, browser: true, indent: 2 */
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.dropdown = {
name : 'dropdown',
version : '4.3.2',
settings : {
activeClass: 'open',
is_hover: false,
opened: function(){},
closed: function(){}
},
init : function (scope, method, options) {
this.scope = scope || this.scope;
Foundation.inherit(this, 'throttle scrollLeft data_options');
if (typeof method === 'object') {
$.extend(true, this.settings, method);
}
if (typeof method !== 'string') {
if (!this.settings.init) {
this.events();
}
return this.settings.init;
} else {
return this[method].call(this, options);
}
},
events : function () {
var self = this;
$(this.scope)
.on('click.fndtn.dropdown', '[data-dropdown]', function (e) {
var settings = $.extend({}, self.settings, self.data_options($(this)));
e.preventDefault();
if (!settings.is_hover) self.toggle($(this));
})
.on('mouseenter', '[data-dropdown]', function (e) {
var settings = $.extend({}, self.settings, self.data_options($(this)));
if (settings.is_hover) self.toggle($(this));
})
.on('mouseleave', '[data-dropdown-content]', function (e) {
var target = $('[data-dropdown="' + $(this).attr('id') + '"]'),
settings = $.extend({}, self.settings, self.data_options(target));
if (settings.is_hover) self.close.call(self, $(this));
})
.on('opened.fndtn.dropdown', '[data-dropdown-content]', this.settings.opened)
.on('closed.fndtn.dropdown', '[data-dropdown-content]', this.settings.closed);
$(document).on('click.fndtn.dropdown touchstart.fndtn.dropdown', function (e) {
var parent = $(e.target).closest('[data-dropdown-content]');
if ($(e.target).data('dropdown') || $(e.target).parent().data('dropdown')) {
return;
}
if (!($(e.target).data('revealId')) &&
(parent.length > 0 && ($(e.target).is('[data-dropdown-content]') ||
$.contains(parent.first()[0], e.target)))) {
e.stopPropagation();<|fim▁hole|> return;
}
self.close.call(self, $('[data-dropdown-content]'));
});
$(window).on('resize.fndtn.dropdown', self.throttle(function () {
self.resize.call(self);
}, 50)).trigger('resize');
this.settings.init = true;
},
close: function (dropdown) {
var self = this;
dropdown.each(function () {
if ($(this).hasClass(self.settings.activeClass)) {
$(this)
.css(Foundation.rtl ? 'right':'left', '-99999px')
.removeClass(self.settings.activeClass)
.prev('[data-dropdown]')
.removeClass(self.settings.activeClass);
$(this).trigger('closed');
}
});
},
open: function (dropdown, target) {
this
.css(dropdown
.addClass(this.settings.activeClass), target);
dropdown.prev('[data-dropdown]').addClass(this.settings.activeClass);
dropdown.trigger('opened');
},
toggle : function (target) {
var dropdown = $('#' + target.data('dropdown'));
if (dropdown.length === 0) {
// No dropdown found, not continuing
return;
}
this.close.call(this, $('[data-dropdown-content]').not(dropdown));
if (dropdown.hasClass(this.settings.activeClass)) {
this.close.call(this, dropdown);
} else {
this.close.call(this, $('[data-dropdown-content]'))
this.open.call(this, dropdown, target);
}
},
resize : function () {
var dropdown = $('[data-dropdown-content].open'),
target = $("[data-dropdown='" + dropdown.attr('id') + "']");
if (dropdown.length && target.length) {
this.css(dropdown, target);
}
},
css : function (dropdown, target) {
var offset_parent = dropdown.offsetParent();
// if (offset_parent.length > 0 && /body/i.test(dropdown.offsetParent()[0].nodeName)) {
var position = target.offset();
position.top -= offset_parent.offset().top;
position.left -= offset_parent.offset().left;
// } else {
// var position = target.position();
// }
if (this.small()) {
dropdown.css({
position : 'absolute',
width: '95%',
'max-width': 'none',
top: position.top + this.outerHeight(target)
});
dropdown.css(Foundation.rtl ? 'right':'left', '2.5%');
} else {
if (!Foundation.rtl && $(window).width() > this.outerWidth(dropdown) + target.offset().left && !this.data_options(target).align_right) {
var left = position.left;
if (dropdown.hasClass('right')) {
dropdown.removeClass('right');
}
} else {
if (!dropdown.hasClass('right')) {
dropdown.addClass('right');
}
var left = position.left - (this.outerWidth(dropdown) - this.outerWidth(target));
}
dropdown.attr('style', '').css({
position : 'absolute',
top: position.top + this.outerHeight(target),
left: left
});
}
return dropdown;
},
small : function () {
return $(window).width() < 768 || $('html').hasClass('lt-ie9');
},
off: function () {
$(this.scope).off('.fndtn.dropdown');
$('html, body').off('.fndtn.dropdown');
$(window).off('.fndtn.dropdown');
$('[data-dropdown-content]').off('.fndtn.dropdown');
this.settings.init = false;
},
reflow : function () {}
};
}(Foundation.zj, this, this.document));<|fim▁end|> | |
<|file_name|>0434-Number of Segments in a String.py<|end_file_name|><|fim▁begin|>class Solution:
def countSegments(self, s: 'str') -> 'int':<|fim▁hole|><|fim▁end|> | return len(s.split()) |
<|file_name|>atari_dqn.py<|end_file_name|><|fim▁begin|>import argparse
import datetime
import pathlib
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from mushroom_rl.algorithms.value import AveragedDQN, CategoricalDQN, DQN,\
DoubleDQN, MaxminDQN, DuelingDQN, NoisyDQN, Rainbow
from mushroom_rl.approximators.parametric import TorchApproximator
from mushroom_rl.core import Core, Logger
from mushroom_rl.environments import *
from mushroom_rl.policy import EpsGreedy
from mushroom_rl.utils.dataset import compute_metrics
from mushroom_rl.utils.parameters import LinearParameter, Parameter
from mushroom_rl.utils.replay_memory import PrioritizedReplayMemory
"""
This script runs Atari experiments with DQN, and some of its variants, as
presented in:
"Human-Level Control Through Deep Reinforcement Learning". Mnih V. et al.. 2015.
"""
class Network(nn.Module):
n_features = 512
def __init__(self, input_shape, output_shape, **kwargs):
super().__init__()
n_input = input_shape[0]
n_output = output_shape[0]
self._h1 = nn.Conv2d(n_input, 32, kernel_size=8, stride=4)
self._h2 = nn.Conv2d(32, 64, kernel_size=4, stride=2)
self._h3 = nn.Conv2d(64, 64, kernel_size=3, stride=1)
self._h4 = nn.Linear(3136, self.n_features)
self._h5 = nn.Linear(self.n_features, n_output)
nn.init.xavier_uniform_(self._h1.weight,
gain=nn.init.calculate_gain('relu'))
nn.init.xavier_uniform_(self._h2.weight,
gain=nn.init.calculate_gain('relu'))
nn.init.xavier_uniform_(self._h3.weight,
gain=nn.init.calculate_gain('relu'))
nn.init.xavier_uniform_(self._h4.weight,
gain=nn.init.calculate_gain('relu'))
nn.init.xavier_uniform_(self._h5.weight,
gain=nn.init.calculate_gain('linear'))
def forward(self, state, action=None):
h = F.relu(self._h1(state.float() / 255.))
h = F.relu(self._h2(h))
h = F.relu(self._h3(h))
h = F.relu(self._h4(h.view(-1, 3136)))
q = self._h5(h)
if action is None:
return q
else:
q_acted = torch.squeeze(q.gather(1, action.long()))
return q_acted
class FeatureNetwork(nn.Module):
def __init__(self, input_shape, output_shape, **kwargs):
super().__init__()
n_input = input_shape[0]
self._h1 = nn.Conv2d(n_input, 32, kernel_size=8, stride=4)
self._h2 = nn.Conv2d(32, 64, kernel_size=4, stride=2)
self._h3 = nn.Conv2d(64, 64, kernel_size=3, stride=1)
self._h4 = nn.Linear(3136, Network.n_features)
nn.init.xavier_uniform_(self._h1.weight,
gain=nn.init.calculate_gain('relu'))
nn.init.xavier_uniform_(self._h2.weight,
gain=nn.init.calculate_gain('relu'))
nn.init.xavier_uniform_(self._h3.weight,
gain=nn.init.calculate_gain('relu'))
nn.init.xavier_uniform_(self._h4.weight,
gain=nn.init.calculate_gain('relu'))
def forward(self, state, action=None):
h = F.relu(self._h1(state.float() / 255.))
h = F.relu(self._h2(h))
h = F.relu(self._h3(h))
h = F.relu(self._h4(h.view(-1, 3136)))
return h
def print_epoch(epoch, logger):
logger.info('################################################################')
logger.info('Epoch: %d' % epoch)
logger.info('----------------------------------------------------------------')
def get_stats(dataset, logger):
score = compute_metrics(dataset)
logger.info(('min_reward: %f, max_reward: %f, mean_reward: %f,'
' games_completed: %d' % score))
return score
def experiment():
np.random.seed()
# Argument parser
parser = argparse.ArgumentParser()
arg_game = parser.add_argument_group('Game')
arg_game.add_argument("--name",
type=str,
default='BreakoutDeterministic-v4',
help='Gym ID of the Atari game.')
arg_game.add_argument("--screen-width", type=int, default=84,
help='Width of the game screen.')
arg_game.add_argument("--screen-height", type=int, default=84,
help='Height of the game screen.')
arg_mem = parser.add_argument_group('Replay Memory')
arg_mem.add_argument("--initial-replay-size", type=int, default=50000,
help='Initial size of the replay memory.')
arg_mem.add_argument("--max-replay-size", type=int, default=500000,
help='Max size of the replay memory.')
arg_mem.add_argument("--prioritized", action='store_true',
help='Whether to use prioritized memory or not.')
arg_net = parser.add_argument_group('Deep Q-Network')
arg_net.add_argument("--optimizer",
choices=['adadelta',
'adam',
'rmsprop',
'rmspropcentered'],
default='adam',
help='Name of the optimizer to use.')
arg_net.add_argument("--learning-rate", type=float, default=.0001,
help='Learning rate value of the optimizer.')
arg_net.add_argument("--decay", type=float, default=.95,
help='Discount factor for the history coming from the'
'gradient momentum in rmspropcentered and'
'rmsprop')
arg_net.add_argument("--epsilon", type=float, default=1e-8,
help='Epsilon term used in rmspropcentered and'
'rmsprop')
arg_alg = parser.add_argument_group('Algorithm')
arg_alg.add_argument("--algorithm", choices=['dqn', 'ddqn', 'adqn', 'mmdqn',
'cdqn', 'dueldqn', 'ndqn', 'rainbow'],
default='dqn',
help='Name of the algorithm. dqn is for standard'
'DQN, ddqn is for Double DQN and adqn is for'
'Averaged DQN.')
arg_alg.add_argument("--n-approximators", type=int, default=1,
help="Number of approximators used in the ensemble for"
"AveragedDQN or MaxminDQN.")
arg_alg.add_argument("--batch-size", type=int, default=32,
help='Batch size for each fit of the network.')
arg_alg.add_argument("--history-length", type=int, default=4,
help='Number of frames composing a state.')
arg_alg.add_argument("--target-update-frequency", type=int, default=10000,
help='Number of collected samples before each update'
'of the target network.')
arg_alg.add_argument("--evaluation-frequency", type=int, default=250000,
help='Number of collected samples before each'
'evaluation. An epoch ends after this number of'
'steps')
arg_alg.add_argument("--train-frequency", type=int, default=4,
help='Number of collected samples before each fit of'
'the neural network.')<|fim▁hole|> 'rate stops decreasing.')
arg_alg.add_argument("--initial-exploration-rate", type=float, default=1.,
help='Initial value of the exploration rate.')
arg_alg.add_argument("--final-exploration-rate", type=float, default=.1,
help='Final value of the exploration rate. When it'
'reaches this values, it stays constant.')
arg_alg.add_argument("--test-exploration-rate", type=float, default=.05,
help='Exploration rate used during evaluation.')
arg_alg.add_argument("--test-samples", type=int, default=125000,
help='Number of collected samples for each'
'evaluation.')
arg_alg.add_argument("--max-no-op-actions", type=int, default=30,
help='Maximum number of no-op actions performed at the'
'beginning of the episodes.')
arg_alg.add_argument("--alpha-coeff", type=float, default=.6,
help='Prioritization exponent for prioritized experience replay.')
arg_alg.add_argument("--n-atoms", type=int, default=51,
help='Number of atoms for Categorical DQN.')
arg_alg.add_argument("--v-min", type=int, default=-10,
help='Minimum action-value for Categorical DQN.')
arg_alg.add_argument("--v-max", type=int, default=10,
help='Maximum action-value for Categorical DQN.')
arg_alg.add_argument("--n-steps-return", type=int, default=3,
help='Number of steps for n-step return for Rainbow.')
arg_alg.add_argument("--sigma-coeff", type=float, default=.5,
help='Sigma0 coefficient for noise initialization in'
'NoisyDQN and Rainbow.')
arg_utils = parser.add_argument_group('Utils')
arg_utils.add_argument('--use-cuda', action='store_true',
help='Flag specifying whether to use the GPU.')
arg_utils.add_argument('--save', action='store_true',
help='Flag specifying whether to save the model.')
arg_utils.add_argument('--load-path', type=str,
help='Path of the model to be loaded.')
arg_utils.add_argument('--render', action='store_true',
help='Flag specifying whether to render the game.')
arg_utils.add_argument('--quiet', action='store_true',
help='Flag specifying whether to hide the progress'
'bar.')
arg_utils.add_argument('--debug', action='store_true',
help='Flag specifying whether the script has to be'
'run in debug mode.')
args = parser.parse_args()
scores = list()
optimizer = dict()
if args.optimizer == 'adam':
optimizer['class'] = optim.Adam
optimizer['params'] = dict(lr=args.learning_rate,
eps=args.epsilon)
elif args.optimizer == 'adadelta':
optimizer['class'] = optim.Adadelta
optimizer['params'] = dict(lr=args.learning_rate,
eps=args.epsilon)
elif args.optimizer == 'rmsprop':
optimizer['class'] = optim.RMSprop
optimizer['params'] = dict(lr=args.learning_rate,
alpha=args.decay,
eps=args.epsilon)
elif args.optimizer == 'rmspropcentered':
optimizer['class'] = optim.RMSprop
optimizer['params'] = dict(lr=args.learning_rate,
alpha=args.decay,
eps=args.epsilon,
centered=True)
else:
raise ValueError
# Summary folder
folder_name = './logs/atari_' + args.algorithm + '_' + args.name +\
'_' + datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
pathlib.Path(folder_name).mkdir(parents=True)
# Settings
if args.debug:
initial_replay_size = 50
max_replay_size = 500
train_frequency = 5
target_update_frequency = 10
test_samples = 20
evaluation_frequency = 50
max_steps = 1000
else:
initial_replay_size = args.initial_replay_size
max_replay_size = args.max_replay_size
train_frequency = args.train_frequency
target_update_frequency = args.target_update_frequency
test_samples = args.test_samples
evaluation_frequency = args.evaluation_frequency
max_steps = args.max_steps
# MDP
mdp = Atari(args.name, args.screen_width, args.screen_height,
ends_at_life=True, history_length=args.history_length,
max_no_op_actions=args.max_no_op_actions)
if args.load_path:
logger = Logger(DQN.__name__, results_dir=None)
logger.strong_line()
logger.info('Experiment Algorithm: ' + DQN.__name__)
# Agent
agent = DQN.load(args.load_path)
epsilon_test = Parameter(value=args.test_exploration_rate)
agent.policy.set_epsilon(epsilon_test)
# Algorithm
core_test = Core(agent, mdp)
# Evaluate model
dataset = core_test.evaluate(n_steps=args.test_samples,
render=args.render,
quiet=args.quiet)
get_stats(dataset, logger)
else:
# Policy
epsilon = LinearParameter(value=args.initial_exploration_rate,
threshold_value=args.final_exploration_rate,
n=args.final_exploration_frame)
epsilon_test = Parameter(value=args.test_exploration_rate)
epsilon_random = Parameter(value=1)
pi = EpsGreedy(epsilon=epsilon_random)
# Approximator
approximator_params = dict(
network=Network if args.algorithm not in ['dueldqn', 'cdqn', 'ndqn', 'rainbow'] else FeatureNetwork,
input_shape=mdp.info.observation_space.shape,
output_shape=(mdp.info.action_space.n,),
n_actions=mdp.info.action_space.n,
n_features=Network.n_features,
optimizer=optimizer,
use_cuda=args.use_cuda
)
if args.algorithm not in ['cdqn', 'rainbow']:
approximator_params['loss'] = F.smooth_l1_loss
approximator = TorchApproximator
if args.prioritized:
replay_memory = PrioritizedReplayMemory(
initial_replay_size, max_replay_size, alpha=args.alpha_coeff,
beta=LinearParameter(.4, threshold_value=1,
n=max_steps // train_frequency)
)
else:
replay_memory = None
# Agent
algorithm_params = dict(
batch_size=args.batch_size,
target_update_frequency=target_update_frequency // train_frequency,
replay_memory=replay_memory,
initial_replay_size=initial_replay_size,
max_replay_size=max_replay_size
)
if args.algorithm == 'dqn':
alg = DQN
agent = alg(mdp.info, pi, approximator,
approximator_params=approximator_params,
**algorithm_params)
elif args.algorithm == 'ddqn':
alg = DoubleDQN
agent = alg(mdp.info, pi, approximator,
approximator_params=approximator_params,
**algorithm_params)
elif args.algorithm == 'adqn':
alg = AveragedDQN
agent = alg(mdp.info, pi, approximator,
approximator_params=approximator_params,
n_approximators=args.n_approximators,
**algorithm_params)
elif args.algorithm == 'mmdqn':
alg = MaxminDQN
agent = alg(mdp.info, pi, approximator,
approximator_params=approximator_params,
n_approximators=args.n_approximators,
**algorithm_params)
elif args.algorithm == 'dueldqn':
alg = DuelingDQN
agent = alg(mdp.info, pi, approximator_params=approximator_params,
**algorithm_params)
elif args.algorithm == 'cdqn':
alg = CategoricalDQN
agent = alg(mdp.info, pi, approximator_params=approximator_params,
n_atoms=args.n_atoms, v_min=args.v_min,
v_max=args.v_max, **algorithm_params)
elif args.algorithm == 'ndqn':
alg = NoisyDQN
agent = alg(mdp.info, pi, approximator_params=approximator_params,
sigma_coeff=args.sigma_coeff, **algorithm_params)
elif args.algorithm == 'rainbow':
alg = Rainbow
beta = LinearParameter(.4, threshold_value=1, n=max_steps // train_frequency)
agent = alg(mdp.info, pi, approximator_params=approximator_params,
n_atoms=args.n_atoms, v_min=args.v_min,
v_max=args.v_max, n_steps_return=args.n_steps_return,
alpha_coeff=args.alpha_coeff, beta=beta,
sigma_coeff=args.sigma_coeff, **algorithm_params)
logger = Logger(alg.__name__, results_dir=None)
logger.strong_line()
logger.info('Experiment Algorithm: ' + alg.__name__)
# Algorithm
core = Core(agent, mdp)
# RUN
# Fill replay memory with random dataset
print_epoch(0, logger)
core.learn(n_steps=initial_replay_size,
n_steps_per_fit=initial_replay_size, quiet=args.quiet)
if args.save:
agent.save(folder_name + '/agent_0.msh')
# Evaluate initial policy
pi.set_epsilon(epsilon_test)
mdp.set_episode_end(False)
dataset = core.evaluate(n_steps=test_samples, render=args.render,
quiet=args.quiet)
scores.append(get_stats(dataset, logger))
np.save(folder_name + '/scores.npy', scores)
for n_epoch in range(1, max_steps // evaluation_frequency + 1):
print_epoch(n_epoch, logger)
logger.info('- Learning:')
# learning step
pi.set_epsilon(epsilon)
mdp.set_episode_end(True)
core.learn(n_steps=evaluation_frequency,
n_steps_per_fit=train_frequency, quiet=args.quiet)
if args.save:
agent.save(folder_name + '/agent_' + str(n_epoch) + '.msh')
logger.info('- Evaluation:')
# evaluation step
pi.set_epsilon(epsilon_test)
mdp.set_episode_end(False)
dataset = core.evaluate(n_steps=test_samples, render=args.render,
quiet=args.quiet)
scores.append(get_stats(dataset, logger))
np.save(folder_name + '/scores.npy', scores)
return scores
if __name__ == '__main__':
experiment()<|fim▁end|> | arg_alg.add_argument("--max-steps", type=int, default=50000000,
help='Total number of collected samples.')
arg_alg.add_argument("--final-exploration-frame", type=int, default=1000000,
help='Number of collected samples until the exploration' |
<|file_name|>headers.py<|end_file_name|><|fim▁begin|>import collections
import itertools
from marnadi.utils import cached_property, CachedDescriptor
class Header(collections.Mapping):
__slots__ = 'value', 'params'
def __init__(self, *value, **params):
assert len(value) == 1
self.value = value[0]
self.params = params
def __hash__(self):
return hash(self.value)
def __eq__(self, other):
return self.value == other
def __ne__(self, other):
return self.value != other
def __str__(self):
return self.stringify()
def __bytes__(self):
value = self.stringify()
if isinstance(value, bytes): # python 2.x
return value
return value.encode(encoding='latin1')
def __getitem__(self, item):
return self.params[item]
def __iter__(self):
return iter(self.params)
def __len__(self):
return len(self.params)
def __bool__(self):
return True
def __nonzero__(self):
return self.__bool__()
def stringify(self):
if not self.params:
return str(self.value)
return '{value}; {params}'.format(
value=self.value,
params='; '.join(
'%s=%s' % (attr_name, attr_value)
for attr_name, attr_value in self.params.items()
),
)
class HeadersMixin(collections.Mapping):
if hasattr(collections.Mapping, '__slots__'):
__slots__ = '__weakref__',
def __getitem__(self, header):
return self._headers[header.title()]
def __len__(self):
return len(self._headers)
def __iter__(self):
return iter(self._headers)
__hash__ = object.__hash__
__eq__ = object.__eq__
__ne__ = object.__ne__
@cached_property
def _headers(self):
raise ValueError("This property must be set before using")
def items(self, stringify=False):
for header, values in self._headers.items():
for value in values:
yield header, str(value) if stringify else value
def values(self, stringify=False):
for values in self._headers.values():
for value in values:
yield str(value) if stringify else value
class ResponseHeaders(HeadersMixin, collections.MutableMapping):
__slots__ = ()
def __init__(self, default_headers):
self._headers = default_headers
def __delitem__(self, header):
del self._headers[header.title()]
def __setitem__(self, header, value):
self._headers[header.title()] = [value]
def append(self, header_item):
header, value = header_item
self._headers[header.title()].append(value)
def extend(self, headers):
for header in headers:
self.append(header)<|fim▁hole|> def setdefault(self, header, default=None):
return self._headers.setdefault(header.title(), [default])
def clear(self, *headers):
if headers:
for header in headers:
try:
del self[header]
except KeyError:
pass
else:
self._headers.clear()
class Headers(CachedDescriptor, HeadersMixin):
__slots__ = ()
def __init__(self, *default_headers, **kw_default_headers):
super(Headers, self).__init__()
self._headers = collections.defaultdict(list)
for header, value in itertools.chain(
default_headers,
kw_default_headers.items(),
):
self._headers[header.title()].append(value)
def get_value(self, instance):
return ResponseHeaders(default_headers=self._headers.copy())<|fim▁end|> | |
<|file_name|>solution.py<|end_file_name|><|fim▁begin|>class Solution(object):
def findPaths(self, m, n, N, i, j):
"""
:type m: int
:type n: int
:type N: int
:type i: int
:type j: int
:rtype: int
"""<|fim▁hole|> for i in xrange(N):
next = collections.defaultdict(int)
for (x, y), cnt in cur.iteritems():
for dx, dy in [[-1, 0], [0, 1], [1, 0], [0, -1]]:
nx = x + dx
ny = y + dy
if nx < 0 or ny < 0 or nx >= m or ny >= n:
paths += cnt
paths %= MOD
else:
next[(nx, ny)] += cnt
next[(nx, ny)] %= MOD
cur = next
return paths
# 94 / 94 test cases passed.
# Status: Accepted
# Runtime: 232 ms
# beats 75.36 %<|fim▁end|> | MOD = 1000000007
paths = 0
cur = {(i, j): 1} |
<|file_name|>container_linux.go<|end_file_name|><|fim▁begin|>// +build linux
package libcontainer
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"reflect"
"strings"
"sync"
"syscall"
"github.com/Sirupsen/logrus"
"github.com/golang/protobuf/proto"
"github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/criurpc"
"github.com/opencontainers/runc/libcontainer/utils"
"github.com/vishvananda/netlink/nl"
)
const stdioFdCount = 3
type linuxContainer struct {
id string
root string
config *configs.Config
cgroupManager cgroups.Manager
initPath string
initArgs []string
initProcess parentProcess
criuPath string
m sync.Mutex
criuVersion int
}
// State represents a running container's state
type State struct {
BaseState
// Platform specific fields below here
// Path to all the cgroups setup for a container. Key is cgroup subsystem name
// with the value as the path.
CgroupPaths map[string]string `json:"cgroup_paths"`
// NamespacePaths are filepaths to the container's namespaces. Key is the namespace type
// with the value as the path.
NamespacePaths map[configs.NamespaceType]string `json:"namespace_paths"`
// Container's standard descriptors (std{in,out,err}), needed for checkpoint and restore
ExternalDescriptors []string `json:"external_descriptors,omitempty"`
}
// A libcontainer container object.
//
// Each container is thread-safe within the same process. Since a container can
// be destroyed by a separate process, any function may return that the container
// was not found.
type Container interface {
BaseContainer
// Methods below here are platform specific
// Checkpoint checkpoints the running container's state to disk using the criu(8) utility.
//
// errors:
// Systemerror - System error.
Checkpoint(criuOpts *CriuOpts) error
// Restore restores the checkpointed container to a running state using the criu(8) utiity.
//
// errors:
// Systemerror - System error.
Restore(process *Process, criuOpts *CriuOpts) error
// If the Container state is RUNNING or PAUSING, sets the Container state to PAUSING and pauses
// the execution of any user processes. Asynchronously, when the container finished being paused the
// state is changed to PAUSED.
// If the Container state is PAUSED, do nothing.
//
// errors:
// ContainerDestroyed - Container no longer exists,
// Systemerror - System error.
Pause() error
// If the Container state is PAUSED, resumes the execution of any user processes in the
// Container before setting the Container state to RUNNING.
// If the Container state is RUNNING, do nothing.
//
// errors:
// ContainerDestroyed - Container no longer exists,
// Systemerror - System error.
Resume() error
// NotifyOOM returns a read-only channel signaling when the container receives an OOM notification.
//
// errors:
// Systemerror - System error.
NotifyOOM() (<-chan struct{}, error)
}
// ID returns the container's unique ID
func (c *linuxContainer) ID() string {
return c.id
}
// Config returns the container's configuration
func (c *linuxContainer) Config() configs.Config {
return *c.config
}
func (c *linuxContainer) Status() (Status, error) {
c.m.Lock()
defer c.m.Unlock()
return c.currentStatus()
}
func (c *linuxContainer) State() (*State, error) {
c.m.Lock()
defer c.m.Unlock()
return c.currentState()
}
func (c *linuxContainer) Processes() ([]int, error) {
pids, err := c.cgroupManager.GetPids()
if err != nil {
return nil, newSystemError(err)
}
return pids, nil
}
func (c *linuxContainer) Stats() (*Stats, error) {
var (
err error
stats = &Stats{}
)
if stats.CgroupStats, err = c.cgroupManager.GetStats(); err != nil {
return stats, newSystemError(err)
}
for _, iface := range c.config.Networks {
switch iface.Type {
case "veth":
istats, err := getNetworkInterfaceStats(iface.HostInterfaceName)
if err != nil {
return stats, newSystemError(err)
}
stats.Interfaces = append(stats.Interfaces, istats)
}
}
return stats, nil
}
func (c *linuxContainer) Set(config configs.Config) error {
c.m.Lock()
defer c.m.Unlock()
c.config = &config
return c.cgroupManager.Set(c.config)
}
func (c *linuxContainer) Start(process *Process) error {
c.m.Lock()
defer c.m.Unlock()
status, err := c.currentStatus()
if err != nil {
return err
}
doInit := status == Destroyed
parent, err := c.newParentProcess(process, doInit)
if err != nil {
return newSystemError(err)
}
if err := parent.start(); err != nil {
// terminate the process to ensure that it properly is reaped.
if err := parent.terminate(); err != nil {
logrus.Warn(err)
}
return newSystemError(err)
}
if doInit {
c.updateState(parent)
}
if c.config.Hooks != nil {
s := configs.HookState{
Version: c.config.Version,
ID: c.id,
Pid: parent.pid(),
Root: c.config.Rootfs,
}
for _, hook := range c.config.Hooks.Poststart {
if err := hook.Run(s); err != nil {
if err := parent.terminate(); err != nil {
logrus.Warn(err)
}
return newSystemError(err)
}
}
}
return nil
}
func (c *linuxContainer) Signal(s os.Signal) error {
if err := c.initProcess.signal(s); err != nil {
return newSystemError(err)
}
return nil
}
func (c *linuxContainer) newParentProcess(p *Process, doInit bool) (parentProcess, error) {
parentPipe, childPipe, err := newPipe()
if err != nil {
return nil, newSystemError(err)
}
cmd, err := c.commandTemplate(p, childPipe)
if err != nil {
return nil, newSystemError(err)
}
if !doInit {
return c.newSetnsProcess(p, cmd, parentPipe, childPipe)
}
return c.newInitProcess(p, cmd, parentPipe, childPipe)
}
func (c *linuxContainer) commandTemplate(p *Process, childPipe *os.File) (*exec.Cmd, error) {
cmd := &exec.Cmd{
Path: c.initPath,
Args: c.initArgs,
}
cmd.Stdin = p.Stdin
cmd.Stdout = p.Stdout
cmd.Stderr = p.Stderr
cmd.Dir = c.config.Rootfs
if cmd.SysProcAttr == nil {
cmd.SysProcAttr = &syscall.SysProcAttr{}
}
cmd.ExtraFiles = append(p.ExtraFiles, childPipe)
cmd.Env = append(cmd.Env, fmt.Sprintf("_LIBCONTAINER_INITPIPE=%d", stdioFdCount+len(cmd.ExtraFiles)-1))
// NOTE: when running a container with no PID namespace and the parent process spawning the container is
// PID1 the pdeathsig is being delivered to the container's init process by the kernel for some reason
// even with the parent still running.
if c.config.ParentDeathSignal > 0 {
cmd.SysProcAttr.Pdeathsig = syscall.Signal(c.config.ParentDeathSignal)
}
return cmd, nil
}
func (c *linuxContainer) newInitProcess(p *Process, cmd *exec.Cmd, parentPipe, childPipe *os.File) (*initProcess, error) {
t := "_LIBCONTAINER_INITTYPE=standard"
cloneFlags := c.config.Namespaces.CloneFlags()
if cloneFlags&syscall.CLONE_NEWUSER != 0 {
if err := c.addUidGidMappings(cmd.SysProcAttr); err != nil {
// user mappings are not supported
return nil, err
}
enableSetgroups(cmd.SysProcAttr)
// Default to root user when user namespaces are enabled.
if cmd.SysProcAttr.Credential == nil {
cmd.SysProcAttr.Credential = &syscall.Credential{}
}
}
cmd.Env = append(cmd.Env, t)
cmd.SysProcAttr.Cloneflags = cloneFlags
return &initProcess{
cmd: cmd,
childPipe: childPipe,
parentPipe: parentPipe,
manager: c.cgroupManager,
config: c.newInitConfig(p),
container: c,
process: p,
}, nil
}
func (c *linuxContainer) newSetnsProcess(p *Process, cmd *exec.Cmd, parentPipe, childPipe *os.File) (*setnsProcess, error) {
cmd.Env = append(cmd.Env, "_LIBCONTAINER_INITTYPE=setns")
// for setns process, we dont have to set cloneflags as the process namespaces
// will only be set via setns syscall
data, err := c.bootstrapData(0, c.initProcess.pid(), p.consolePath)
if err != nil {
return nil, err
}
// TODO: set on container for process management
return &setnsProcess{
cmd: cmd,
cgroupPaths: c.cgroupManager.GetPaths(),
childPipe: childPipe,
parentPipe: parentPipe,
config: c.newInitConfig(p),
process: p,
bootstrapData: data,
}, nil
}
func (c *linuxContainer) newInitConfig(process *Process) *initConfig {
return &initConfig{
Config: c.config,
Args: process.Args,
Env: process.Env,
User: process.User,
Cwd: process.Cwd,
Console: process.consolePath,
Capabilities: process.Capabilities,
PassedFilesCount: len(process.ExtraFiles),
}
}
func newPipe() (parent *os.File, child *os.File, err error) {
fds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_STREAM|syscall.SOCK_CLOEXEC, 0)
if err != nil {
return nil, nil, err
}
return os.NewFile(uintptr(fds[1]), "parent"), os.NewFile(uintptr(fds[0]), "child"), nil
}
func (c *linuxContainer) Destroy() error {
c.m.Lock()
defer c.m.Unlock()
status, err := c.currentStatus()
if err != nil {
return err
}
if status != Destroyed {
return newGenericError(fmt.Errorf("container is not destroyed"), ContainerNotStopped)
}
if !c.config.Namespaces.Contains(configs.NEWPID) {
if err := killCgroupProcesses(c.cgroupManager); err != nil {
logrus.Warn(err)
}
}
err = c.cgroupManager.Destroy()
if rerr := os.RemoveAll(c.root); err == nil {
err = rerr
}
c.initProcess = nil
if c.config.Hooks != nil {
s := configs.HookState{
Version: c.config.Version,
ID: c.id,
Root: c.config.Rootfs,
}
for _, hook := range c.config.Hooks.Poststop {
if err := hook.Run(s); err != nil {
return err
}
}
}
return err
}
func (c *linuxContainer) Pause() error {
c.m.Lock()
defer c.m.Unlock()
return c.cgroupManager.Freeze(configs.Frozen)
}
func (c *linuxContainer) Resume() error {
c.m.Lock()
defer c.m.Unlock()
return c.cgroupManager.Freeze(configs.Thawed)
}
func (c *linuxContainer) NotifyOOM() (<-chan struct{}, error) {
return notifyOnOOM(c.cgroupManager.GetPaths())
}
// XXX debug support, remove when debugging done.
func addArgsFromEnv(evar string, args *[]string) {
if e := os.Getenv(evar); e != "" {
for _, f := range strings.Fields(e) {
*args = append(*args, f)
}
}
fmt.Printf(">>> criu %v\n", *args)
}
// check Criu version greater than or equal to min_version
func (c *linuxContainer) checkCriuVersion(min_version string) error {
var x, y, z, versionReq int
_, err := fmt.Sscanf(min_version, "%d.%d.%d\n", &x, &y, &z) // 1.5.2
if err != nil {
_, err = fmt.Sscanf(min_version, "Version: %d.%d\n", &x, &y) // 1.6
}
versionReq = x*10000 + y*100 + z
out, err := exec.Command(c.criuPath, "-V").Output()
if err != nil {
return fmt.Errorf("Unable to execute CRIU command: %s", c.criuPath)
}
x = 0
y = 0
z = 0
if ep := strings.Index(string(out), "-"); ep >= 0 {
// criu Git version format
var version string
if sp := strings.Index(string(out), "GitID"); sp > 0 {
version = string(out)[sp:ep]
} else {
return fmt.Errorf("Unable to parse the CRIU version: %s", c.criuPath)
}
n, err := fmt.Sscanf(string(version), "GitID: v%d.%d.%d", &x, &y, &z) // 1.5.2
if err != nil {
n, err = fmt.Sscanf(string(version), "GitID: v%d.%d", &x, &y) // 1.6
y++
} else {
z++
}
if n < 2 || err != nil {
return fmt.Errorf("Unable to parse the CRIU version: %s %d %s", version, n, err)
}
} else {
// criu release version format
n, err := fmt.Sscanf(string(out), "Version: %d.%d.%d\n", &x, &y, &z) // 1.5.2
if err != nil {
n, err = fmt.Sscanf(string(out), "Version: %d.%d\n", &x, &y) // 1.6
}
if n < 2 || err != nil {
return fmt.Errorf("Unable to parse the CRIU version: %s %d %s", out, n, err)
}
}
c.criuVersion = x*10000 + y*100 + z
if c.criuVersion < versionReq {
return fmt.Errorf("CRIU version must be %s or higher", min_version)
}
return nil
}
const descriptorsFilename = "descriptors.json"
func (c *linuxContainer) addCriuDumpMount(req *criurpc.CriuReq, m *configs.Mount) {
mountDest := m.Destination
if strings.HasPrefix(mountDest, c.config.Rootfs) {
mountDest = mountDest[len(c.config.Rootfs):]
}
extMnt := &criurpc.ExtMountMap{
Key: proto.String(mountDest),
Val: proto.String(mountDest),
}
req.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)
}
func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
c.m.Lock()
defer c.m.Unlock()
if err := c.checkCriuVersion("1.5.2"); err != nil {
return err
}
if criuOpts.ImagesDirectory == "" {
criuOpts.ImagesDirectory = filepath.Join(c.root, "criu.image")
}
// Since a container can be C/R'ed multiple times,
// the checkpoint directory may already exist.
if err := os.Mkdir(criuOpts.ImagesDirectory, 0755); err != nil && !os.IsExist(err) {
return err
}
if criuOpts.WorkDirectory == "" {
criuOpts.WorkDirectory = filepath.Join(c.root, "criu.work")
}
if err := os.Mkdir(criuOpts.WorkDirectory, 0755); err != nil && !os.IsExist(err) {
return err
}
workDir, err := os.Open(criuOpts.WorkDirectory)
if err != nil {
return err
}
defer workDir.Close()
imageDir, err := os.Open(criuOpts.ImagesDirectory)
if err != nil {
return err
}
defer imageDir.Close()
rpcOpts := criurpc.CriuOpts{
ImagesDirFd: proto.Int32(int32(imageDir.Fd())),
WorkDirFd: proto.Int32(int32(workDir.Fd())),
LogLevel: proto.Int32(4),
LogFile: proto.String("dump.log"),
Root: proto.String(c.config.Rootfs),
ManageCgroups: proto.Bool(true),
NotifyScripts: proto.Bool(true),
Pid: proto.Int32(int32(c.initProcess.pid())),
ShellJob: proto.Bool(criuOpts.ShellJob),
LeaveRunning: proto.Bool(criuOpts.LeaveRunning),
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
FileLocks: proto.Bool(criuOpts.FileLocks),
}
// append optional criu opts, e.g., page-server and port
if criuOpts.PageServer.Address != "" && criuOpts.PageServer.Port != 0 {
rpcOpts.Ps = &criurpc.CriuPageServerInfo{
Address: proto.String(criuOpts.PageServer.Address),
Port: proto.Int32(criuOpts.PageServer.Port),
}
}
// append optional manage cgroups mode
if criuOpts.ManageCgroupsMode != 0 {
if err := c.checkCriuVersion("1.7"); err != nil {
return err
}
rpcOpts.ManageCgroupsMode = proto.Uint32(uint32(criuOpts.ManageCgroupsMode))
}
t := criurpc.CriuReqType_DUMP
req := &criurpc.CriuReq{
Type: &t,
Opts: &rpcOpts,
}
for _, m := range c.config.Mounts {
switch m.Device {
case "bind":
c.addCriuDumpMount(req, m)
break
case "cgroup":
binds, err := getCgroupMounts(m)
if err != nil {
return err
}
for _, b := range binds {
c.addCriuDumpMount(req, b)
}
break
}
}
// Write the FD info to a file in the image directory
fdsJSON, err := json.Marshal(c.initProcess.externalDescriptors())
if err != nil {
return err
}
err = ioutil.WriteFile(filepath.Join(criuOpts.ImagesDirectory, descriptorsFilename), fdsJSON, 0655)
if err != nil {
return err
}
err = c.criuSwrk(nil, req, criuOpts, false)
if err != nil {
return err
}
return nil
}
func (c *linuxContainer) addCriuRestoreMount(req *criurpc.CriuReq, m *configs.Mount) {
mountDest := m.Destination
if strings.HasPrefix(mountDest, c.config.Rootfs) {
mountDest = mountDest[len(c.config.Rootfs):]
}
extMnt := &criurpc.ExtMountMap{
Key: proto.String(mountDest),
Val: proto.String(m.Source),
}
req.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)
}
func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {
c.m.Lock()
defer c.m.Unlock()
if err := c.checkCriuVersion("1.5.2"); err != nil {
return err
}
if criuOpts.WorkDirectory == "" {
criuOpts.WorkDirectory = filepath.Join(c.root, "criu.work")
}
// Since a container can be C/R'ed multiple times,
// the work directory may already exist.
if err := os.Mkdir(criuOpts.WorkDirectory, 0655); err != nil && !os.IsExist(err) {
return err
}
workDir, err := os.Open(criuOpts.WorkDirectory)
if err != nil {
return err
}
defer workDir.Close()
if criuOpts.ImagesDirectory == "" {
criuOpts.ImagesDirectory = filepath.Join(c.root, "criu.image")
}
imageDir, err := os.Open(criuOpts.ImagesDirectory)
if err != nil {
return err
}
defer imageDir.Close()
// CRIU has a few requirements for a root directory:
// * it must be a mount point
// * its parent must not be overmounted
// c.config.Rootfs is bind-mounted to a temporary directory
// to satisfy these requirements.
root := filepath.Join(c.root, "criu-root")
if err := os.Mkdir(root, 0755); err != nil {
return err
}
defer os.Remove(root)
root, err = filepath.EvalSymlinks(root)
if err != nil {
return err
}
err = syscall.Mount(c.config.Rootfs, root, "", syscall.MS_BIND|syscall.MS_REC, "")
if err != nil {
return err
}
defer syscall.Unmount(root, syscall.MNT_DETACH)
t := criurpc.CriuReqType_RESTORE
req := &criurpc.CriuReq{
Type: &t,
Opts: &criurpc.CriuOpts{
ImagesDirFd: proto.Int32(int32(imageDir.Fd())),
WorkDirFd: proto.Int32(int32(workDir.Fd())),
EvasiveDevices: proto.Bool(true),
LogLevel: proto.Int32(4),
LogFile: proto.String("restore.log"),
RstSibling: proto.Bool(true),
Root: proto.String(root),
ManageCgroups: proto.Bool(true),
NotifyScripts: proto.Bool(true),
ShellJob: proto.Bool(criuOpts.ShellJob),
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
FileLocks: proto.Bool(criuOpts.FileLocks),
},
}
for _, m := range c.config.Mounts {
switch m.Device {
case "bind":
c.addCriuRestoreMount(req, m)
break
case "cgroup":
binds, err := getCgroupMounts(m)
if err != nil {
return err
}
for _, b := range binds {
c.addCriuRestoreMount(req, b)
}
break
}
}
for _, iface := range c.config.Networks {
switch iface.Type {
case "veth":
veth := new(criurpc.CriuVethPair)
veth.IfOut = proto.String(iface.HostInterfaceName)
veth.IfIn = proto.String(iface.Name)
req.Opts.Veths = append(req.Opts.Veths, veth)
break
case "loopback":
break
}
}
for _, i := range criuOpts.VethPairs {
veth := new(criurpc.CriuVethPair)
veth.IfOut = proto.String(i.HostInterfaceName)
veth.IfIn = proto.String(i.ContainerInterfaceName)
req.Opts.Veths = append(req.Opts.Veths, veth)
}
// append optional manage cgroups mode
if criuOpts.ManageCgroupsMode != 0 {
if err := c.checkCriuVersion("1.7"); err != nil {
return err
}
req.Opts.ManageCgroupsMode = proto.Uint32(uint32(criuOpts.ManageCgroupsMode))
}
var (
fds []string
fdJSON []byte
)
if fdJSON, err = ioutil.ReadFile(filepath.Join(criuOpts.ImagesDirectory, descriptorsFilename)); err != nil {
return err
}
if err = json.Unmarshal(fdJSON, &fds); err != nil {
return err
}
for i := range fds {
if s := fds[i]; strings.Contains(s, "pipe:") {
inheritFd := new(criurpc.InheritFd)
inheritFd.Key = proto.String(s)
inheritFd.Fd = proto.Int32(int32(i))
req.Opts.InheritFd = append(req.Opts.InheritFd, inheritFd)
}
}
err = c.criuSwrk(process, req, criuOpts, true)
if err != nil {
return err
}
return nil
}
func (c *linuxContainer) criuApplyCgroups(pid int, req *criurpc.CriuReq) error {
if err := c.cgroupManager.Apply(pid); err != nil {
return err
}
path := fmt.Sprintf("/proc/%d/cgroup", pid)
cgroupsPaths, err := cgroups.ParseCgroupFile(path)
if err != nil {
return err
}
for c, p := range cgroupsPaths {
cgroupRoot := &criurpc.CgroupRoot{
Ctrl: proto.String(c),
Path: proto.String(p),
}
req.Opts.CgRoot = append(req.Opts.CgRoot, cgroupRoot)
}
return nil
}
func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts *CriuOpts, applyCgroups bool) error {
fds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_SEQPACKET|syscall.SOCK_CLOEXEC, 0)
if err != nil {
return err
}
logPath := filepath.Join(opts.WorkDirectory, req.GetOpts().GetLogFile())
criuClient := os.NewFile(uintptr(fds[0]), "criu-transport-client")
criuServer := os.NewFile(uintptr(fds[1]), "criu-transport-server")
defer criuClient.Close()
defer criuServer.Close()
args := []string{"swrk", "3"}
logrus.Debugf("Using CRIU %d at: %s", c.criuVersion, c.criuPath)
logrus.Debugf("Using CRIU with following args: %s", args)
cmd := exec.Command(c.criuPath, args...)
if process != nil {
cmd.Stdin = process.Stdin
cmd.Stdout = process.Stdout
cmd.Stderr = process.Stderr
}
cmd.ExtraFiles = append(cmd.ExtraFiles, criuServer)
if err := cmd.Start(); err != nil {
return err
}
criuServer.Close()
defer func() {
criuClient.Close()
_, err := cmd.Process.Wait()
if err != nil {
return
}
}()
if applyCgroups {
err := c.criuApplyCgroups(cmd.Process.Pid, req)
if err != nil {
return err
}
}
var extFds []string
if process != nil {
extFds, err = getPipeFds(cmd.Process.Pid)
if err != nil {
return err
}
}
logrus.Debugf("Using CRIU in %s mode", req.GetType().String())
val := reflect.ValueOf(req.GetOpts())
v := reflect.Indirect(val)
for i := 0; i < v.NumField(); i++ {
st := v.Type()
name := st.Field(i).Name
if strings.HasPrefix(name, "XXX_") {
continue
}
value := val.MethodByName("Get" + name).Call([]reflect.Value{})
logrus.Debugf("CRIU option %s with value %v", name, value[0])
}
data, err := proto.Marshal(req)
if err != nil {
return err
}
_, err = criuClient.Write(data)
if err != nil {
return err
}
buf := make([]byte, 10*4096)
for true {
n, err := criuClient.Read(buf)
if err != nil {
return err
}
if n == 0 {
return fmt.Errorf("unexpected EOF")
}
if n == len(buf) {
return fmt.Errorf("buffer is too small")
}
resp := new(criurpc.CriuResp)
err = proto.Unmarshal(buf[:n], resp)
if err != nil {
return err
}
if !resp.GetSuccess() {
typeString := req.GetType().String()
return fmt.Errorf("criu failed: type %s errno %d\nlog file: %s", typeString, resp.GetCrErrno(), logPath)
}
t := resp.GetType()
switch {
case t == criurpc.CriuReqType_NOTIFY:
if err := c.criuNotifications(resp, process, opts, extFds); err != nil {
return err
}
t = criurpc.CriuReqType_NOTIFY
req = &criurpc.CriuReq{
Type: &t,
NotifySuccess: proto.Bool(true),
}
data, err = proto.Marshal(req)
if err != nil {
return err
}
n, err = criuClient.Write(data)
if err != nil {
return err
}
continue
case t == criurpc.CriuReqType_RESTORE:
case t == criurpc.CriuReqType_DUMP:
break
default:
return fmt.Errorf("unable to parse the response %s", resp.String())
}
break
}
// cmd.Wait() waits cmd.goroutines which are used for proxying file descriptors.
// Here we want to wait only the CRIU process.
st, err := cmd.Process.Wait()
if err != nil {
return err
}
if !st.Success() {
return fmt.Errorf("criu failed: %s\nlog file: %s", st.String(), logPath)
}
return nil
}
// block any external network activity
func lockNetwork(config *configs.Config) error {
for _, config := range config.Networks {
strategy, err := getStrategy(config.Type)
if err != nil {
return err
}
if err := strategy.detach(config); err != nil {
return err
}
}
return nil
}
func unlockNetwork(config *configs.Config) error {
for _, config := range config.Networks {
strategy, err := getStrategy(config.Type)
if err != nil {
return err
}
if err = strategy.attach(config); err != nil {
return err
}
}
return nil
}
func (c *linuxContainer) criuNotifications(resp *criurpc.CriuResp, process *Process, opts *CriuOpts, fds []string) error {
notify := resp.GetNotify()
if notify == nil {
return fmt.Errorf("invalid response: %s", resp.String())
}
switch {
case notify.GetScript() == "post-dump":
if !opts.LeaveRunning {
f, err := os.Create(filepath.Join(c.root, "checkpoint"))
if err != nil {
return err
}
f.Close()
}
break
case notify.GetScript() == "network-unlock":
if err := unlockNetwork(c.config); err != nil {
return err
}
break
case notify.GetScript() == "network-lock":
if err := lockNetwork(c.config); err != nil {
return err
}
break
case notify.GetScript() == "post-restore":
pid := notify.GetPid()<|fim▁hole|> return err
}
// TODO: crosbymichael restore previous process information by saving the init process information in
// the container's state file or separate process state files.
if err := c.updateState(r); err != nil {
return err
}
process.ops = r
break
}
return nil
}
func (c *linuxContainer) updateState(process parentProcess) error {
c.initProcess = process
state, err := c.currentState()
if err != nil {
return err
}
f, err := os.Create(filepath.Join(c.root, stateFilename))
if err != nil {
return err
}
defer f.Close()
os.Remove(filepath.Join(c.root, "checkpoint"))
return utils.WriteJSON(f, state)
}
func (c *linuxContainer) currentStatus() (Status, error) {
if _, err := os.Stat(filepath.Join(c.root, "checkpoint")); err == nil {
return Checkpointed, nil
}
if c.initProcess == nil {
return Destroyed, nil
}
// return Running if the init process is alive
if err := syscall.Kill(c.initProcess.pid(), 0); err != nil {
if err == syscall.ESRCH {
return Destroyed, nil
}
return 0, newSystemError(err)
}
if c.config.Cgroups != nil && c.config.Cgroups.Resources != nil && c.config.Cgroups.Resources.Freezer == configs.Frozen {
return Paused, nil
}
return Running, nil
}
func (c *linuxContainer) currentState() (*State, error) {
status, err := c.currentStatus()
if err != nil {
return nil, err
}
if status == Destroyed {
return nil, newGenericError(fmt.Errorf("container destroyed"), ContainerNotExists)
}
startTime, err := c.initProcess.startTime()
if err != nil {
return nil, newSystemError(err)
}
state := &State{
BaseState: BaseState{
ID: c.ID(),
Config: *c.config,
InitProcessPid: c.initProcess.pid(),
InitProcessStartTime: startTime,
},
CgroupPaths: c.cgroupManager.GetPaths(),
NamespacePaths: make(map[configs.NamespaceType]string),
ExternalDescriptors: c.initProcess.externalDescriptors(),
}
for _, ns := range c.config.Namespaces {
state.NamespacePaths[ns.Type] = ns.GetPath(c.initProcess.pid())
}
for _, nsType := range configs.NamespaceTypes() {
if _, ok := state.NamespacePaths[nsType]; !ok {
ns := configs.Namespace{Type: nsType}
state.NamespacePaths[ns.Type] = ns.GetPath(c.initProcess.pid())
}
}
return state, nil
}
// bootstrapData encodes the necessary data in netlink binary format as a io.Reader.
// Consumer can write the data to a bootstrap program such as one that uses
// nsenter package to bootstrap the container's init process correctly, i.e. with
// correct namespaces, uid/gid mapping etc.
func (c *linuxContainer) bootstrapData(cloneFlags uintptr, pid int, consolePath string) (io.Reader, error) {
// create the netlink message
r := nl.NewNetlinkRequest(int(InitMsg), 0)
// write pid
r.AddData(&Int32msg{
Type: PidAttr,
Value: uint32(pid),
})
// write console path
if consolePath != "" {
r.AddData(&Bytemsg{
Type: ConsolePathAttr,
Value: []byte(consolePath),
})
}
return bytes.NewReader(r.Serialize()), nil
}<|fim▁end|> | r, err := newRestoredProcess(int(pid), fds)
if err != nil { |
<|file_name|>twitter.py<|end_file_name|><|fim▁begin|>from twython import Twython
from config import APP_KEY, APP_SECRET
def obtain_auth_url():
"""Used to app to tweet to my account
NOT CALLED ANYWHERE"""
twitter = Twython(APP_KEY, APP_SECRET)<|fim▁hole|> print "\n\n\nGo to the following URL to authorize app:"
print auth['auth_url']
oauth_verifier = raw_input("\nEnter the pin: ")
twitter = Twython(APP_KEY, APP_SECRET, oauth_token, oauth_token_secret)
authorized = twitter.get_authorized_tokens(oauth_verifier)
#write confirmed tokens to disk
with open("config.py", "a") as config_file:
config_file.write("\n'OAUTH_TOKEN': '" + authorized['oauth_token']
+ "'\n'OAUTH_TOKEN_SECRET': '" + authorized['oauth_token_secret'] + "'")
obtain_auth_url()<|fim▁end|> | auth = twitter.get_authentication_tokens()
oauth_token = auth['oauth_token']
oauth_token_secret = auth['oauth_token_secret'] |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import * as debug from 'debug';
import Resolver from '../../resolver';
import { IRemoteUser } from '../../../../models/user';
import acceptFollow from './follow';
import { IAccept, IFollow } from '../../type';
const log = debug('misskey:activitypub');
export default async (actor: IRemoteUser, activity: IAccept): Promise<void> => {
const uri = activity.id || activity;
log(`Accept: ${uri}`);
const resolver = new Resolver();
let object;<|fim▁hole|> try {
object = await resolver.resolve(activity.object);
} catch (e) {
log(`Resolution failed: ${e}`);
throw e;
}
switch (object.type) {
case 'Follow':
acceptFollow(actor, object as IFollow);
break;
default:
console.warn(`Unknown accept type: ${object.type}`);
break;
}
};<|fim▁end|> | |
<|file_name|>test_commonutils.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function, absolute_import
import numpy
import pandas
from numpy.random.mtrand import RandomState
from sklearn.metrics.pairwise import pairwise_distances
from hep_ml import commonutils
from hep_ml.commonutils import weighted_quantile, build_normalizer, \
compute_cut_for_efficiency, generate_sample, compute_knn_indices_of_signal, \
compute_knn_indices_of_same_class
def test_splitting(n_rows=10, n_columns=8):
column_names = ['col' + str(i) for i in range(n_columns)]
signal_df = pandas.DataFrame(numpy.ones([n_rows, n_columns]), columns=column_names)
bg_df = pandas.DataFrame(numpy.zeros([n_rows, n_columns]), columns=column_names)
common_X = pandas.concat([signal_df, bg_df], ignore_index=True)
common_y = numpy.concatenate([numpy.ones(len(signal_df)), numpy.zeros(len(bg_df))])
trainX, testX, trainY, testY = commonutils.train_test_split(common_X, common_y)
for (index, row), label in zip(trainX.iterrows(), trainY):
assert numpy.all(row == label), 'wrong data partition'
for (index, row), label in zip(testX.iterrows(), testY):
assert numpy.all(row == label), 'wrong data partition'
assert (trainX.columns == column_names).all(), 'new column names!'
assert (testX.columns == column_names).all(), 'new column names!'
assert len(trainX) + len(testX) == len(common_X), 'new size is strange'
def check_weighted_percentile(size=100, q_size=20):
random = RandomState()
array = random.permutation(size)
quantiles = random.uniform(size=q_size)
q_permutation = random.permutation(q_size)
result1 = weighted_quantile(array, quantiles)[q_permutation]
result2 = weighted_quantile(array, quantiles[q_permutation])
result3 = weighted_quantile(array[random.permutation(size)], quantiles[q_permutation])
assert numpy.all(result1 == result2) and numpy.all(result1 == result3), 'breaks on permutations'
# checks that order is kept
quantiles = numpy.linspace(0, 1, size * 3)
x = weighted_quantile(array, quantiles, sample_weight=random.exponential(size=size))
assert numpy.all(x == numpy.sort(x)), "doesn't preserve order"
array = numpy.array([0, 1, 2, 5])
# comparing with simple percentiles
for x in random.uniform(size=10):
assert numpy.abs(numpy.percentile(array, x * 100) - weighted_quantile(array, x, old_style=True)) < 1e-7, \
"doesn't coincide with numpy.percentile"
def test_weighted_percentile():
check_weighted_percentile(RandomState().randint(4, 40), RandomState().randint(4, 40))
check_weighted_percentile(100, 20)
check_weighted_percentile(20, 100)
def test_build_normalizer(checks=10):
predictions = numpy.array(RandomState().normal(size=2000))
result = build_normalizer(predictions)(predictions)
assert numpy.all(result[numpy.argsort(predictions)] == sorted(result))
assert numpy.all(result >= 0) and numpy.all(result <= 1)
percentiles = [100 * (i + 1.) / (checks + 1.) for i in range(checks)]
assert numpy.all(abs(numpy.percentile(result, percentiles) - numpy.array(percentiles) / 100.) < 0.01)
# testing with weights
predictions = numpy.exp(predictions / 2)
weighted_normalizer = build_normalizer(predictions, sample_weight=predictions)
result = weighted_normalizer(predictions)
assert numpy.all(result[numpy.argsort(predictions)] == sorted(result))
assert numpy.all(result >= 0) and numpy.all(result <= 1 + 1e-7)
predictions = numpy.sort(predictions)
result = weighted_normalizer(predictions)
result2 = numpy.cumsum(predictions) / numpy.sum(predictions)
assert numpy.all(numpy.abs(result - result2) < 0.005)
def test_compute_cut():
random = RandomState()
predictions = random.permutation(100)
labels = numpy.ones(100)
for eff in [0.1, 0.5, 0.75, 0.99]:
cut = compute_cut_for_efficiency(eff, labels, predictions)
assert numpy.sum(predictions > cut) / len(predictions) == eff, 'the cut was set wrongly'<|fim▁hole|> for eff in random.uniform(size=100):
cut = compute_cut_for_efficiency(eff, labels, predictions, sample_weight=weights)
lower = numpy.sum(weights[predictions > cut + 1]) / numpy.sum(weights)
upper = numpy.sum(weights[predictions > cut - 1]) / numpy.sum(weights)
assert lower < eff < upper, 'the cut was set wrongly'
def test_compute_knn_indices(n_events=100):
X, y = generate_sample(n_events, 10, distance=.5)
is_signal = y > 0.5
signal_indices = numpy.where(is_signal)[0]
uniform_columns = X.columns[:1]
knn_indices = compute_knn_indices_of_signal(X[uniform_columns], is_signal, 10)
distances = pairwise_distances(X[uniform_columns])
for i, neighbours in enumerate(knn_indices):
assert numpy.all(is_signal[neighbours]), "returned indices are not signal"
not_neighbours = [x for x in signal_indices if not x in neighbours]
min_dist = numpy.min(distances[i, not_neighbours])
max_dist = numpy.max(distances[i, neighbours])
assert min_dist >= max_dist, "distances are set wrongly!"
knn_all_indices = compute_knn_indices_of_same_class(X[uniform_columns], is_signal, 10)
for i, neighbours in enumerate(knn_all_indices):
assert numpy.all(is_signal[neighbours] == is_signal[i]), "returned indices are not signal/bg"<|fim▁end|> |
weights = numpy.array(random.exponential(size=100)) |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># (c) 2012, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import os
import pwd
import sys
import ConfigParser
def get_config(p, section, key, env_var, default):
if env_var is not None:
value = os.environ.get(env_var, None)
if value is not None:
return value
if p is not None:
try:
return p.get(section, key)
except:
return default
return default
def load_config_file():
p = ConfigParser.ConfigParser()
path1 = os.path.expanduser(os.environ.get('ANSIBLE_CONFIG', "~/.ansible.cfg"))
path2 = os.getcwd() + "/ansible.cfg"
path3 = "/etc/ansible/ansible.cfg"
if os.path.exists(path1):
p.read(path1)
elif os.path.exists(path2):
p.read(path2)
elif os.path.exists(path3):
p.read(path3)
else:
return None
return p
<|fim▁hole|> path = os.path.expanduser(path)
return path
p = load_config_file()
active_user = pwd.getpwuid(os.geteuid())[0]
# Needed so the RPM can call setup.py and have modules land in the
# correct location. See #1277 for discussion
if getattr(sys, "real_prefix", None):
DIST_MODULE_PATH = os.path.join(sys.prefix, 'share/ansible/')
else:
DIST_MODULE_PATH = '/usr/share/ansible/'
# sections in config file
DEFAULTS='defaults'
# configurable things
DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'hostfile', 'ANSIBLE_HOSTS', '/etc/ansible/hosts'))
DEFAULT_MODULE_PATH = shell_expand_path(get_config(p, DEFAULTS, 'library', 'ANSIBLE_LIBRARY', DIST_MODULE_PATH))
DEFAULT_REMOTE_TMP = shell_expand_path(get_config(p, DEFAULTS, 'remote_tmp', 'ANSIBLE_REMOTE_TEMP', '$HOME/.ansible/tmp'))
DEFAULT_MODULE_NAME = get_config(p, DEFAULTS, 'module_name', None, 'command')
DEFAULT_PATTERN = get_config(p, DEFAULTS, 'pattern', None, '*')
DEFAULT_FORKS = get_config(p, DEFAULTS, 'forks', 'ANSIBLE_FORKS', 5)
DEFAULT_MODULE_ARGS = get_config(p, DEFAULTS, 'module_args', 'ANSIBLE_MODULE_ARGS', '')
DEFAULT_MODULE_LANG = get_config(p, DEFAULTS, 'module_lang', 'ANSIBLE_MODULE_LANG', 'C')
DEFAULT_TIMEOUT = get_config(p, DEFAULTS, 'timeout', 'ANSIBLE_TIMEOUT', 10)
DEFAULT_POLL_INTERVAL = get_config(p, DEFAULTS, 'poll_interval', 'ANSIBLE_POLL_INTERVAL', 15)
DEFAULT_REMOTE_USER = get_config(p, DEFAULTS, 'remote_user', 'ANSIBLE_REMOTE_USER', active_user)
DEFAULT_ASK_PASS = get_config(p, DEFAULTS, 'ask_pass', 'ANSIBLE_ASK_PASS', False)
DEFAULT_PRIVATE_KEY_FILE = shell_expand_path(get_config(p, DEFAULTS, 'private_key_file', 'ANSIBLE_PRIVATE_KEY_FILE', None))
DEFAULT_SUDO_USER = get_config(p, DEFAULTS, 'sudo_user', 'ANSIBLE_SUDO_USER', 'root')
DEFAULT_ASK_SUDO_PASS = get_config(p, DEFAULTS, 'ask_sudo_pass', 'ANSIBLE_ASK_SUDO_PASS', False)
DEFAULT_REMOTE_PORT = int(get_config(p, DEFAULTS, 'remote_port', 'ANSIBLE_REMOTE_PORT', 22))
DEFAULT_TRANSPORT = get_config(p, DEFAULTS, 'transport', 'ANSIBLE_TRANSPORT', 'paramiko')
DEFAULT_SCP_IF_SSH = get_config(p, 'ssh_connection', 'scp_if_ssh', 'ANSIBLE_SCP_IF_SSH', False)
DEFAULT_MANAGED_STR = get_config(p, DEFAULTS, 'ansible_managed', None, 'Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}')
DEFAULT_SYSLOG_FACILITY = get_config(p, DEFAULTS, 'syslog_facility', 'ANSIBLE_SYSLOG_FACILITY', 'LOG_USER')
DEFAULT_KEEP_REMOTE_FILES = get_config(p, DEFAULTS, 'keep_remote_files', 'ANSIBLE_KEEP_REMOTE_FILES', '0')
DEFAULT_SUDO_EXE = get_config(p, DEFAULTS, 'sudo_exe', 'ANSIBLE_SUDO_EXE', 'sudo')
DEFAULT_SUDO_FLAGS = get_config(p, DEFAULTS, 'sudo_flags', 'ANSIBLE_SUDO_FLAGS', '-H')
DEFAULT_HASH_BEHAVIOUR = get_config(p, DEFAULTS, 'hash_behaviour', 'ANSIBLE_HASH_BEHAVIOUR', 'replace')
DEFAULT_JINJA2_EXTENSIONS = get_config(p, DEFAULTS, 'jinja2_extensions', 'ANSIBLE_JINJA2_EXTENSIONS', None)
DEFAULT_EXECUTABLE = get_config(p, DEFAULTS, 'executable', 'ANSIBLE_EXECUTABLE', '/bin/sh')
DEFAULT_ACTION_PLUGIN_PATH = shell_expand_path(get_config(p, DEFAULTS, 'action_plugins', 'ANSIBLE_ACTION_PLUGINS', '/usr/share/ansible_plugins/action_plugins'))
DEFAULT_CALLBACK_PLUGIN_PATH = shell_expand_path(get_config(p, DEFAULTS, 'callback_plugins', 'ANSIBLE_CALLBACK_PLUGINS', '/usr/share/ansible_plugins/callback_plugins'))
DEFAULT_CONNECTION_PLUGIN_PATH = shell_expand_path(get_config(p, DEFAULTS, 'connection_plugins', 'ANSIBLE_CONNECTION_PLUGINS', '/usr/share/ansible_plugins/connection_plugins'))
DEFAULT_LOOKUP_PLUGIN_PATH = shell_expand_path(get_config(p, DEFAULTS, 'lookup_plugins', 'ANSIBLE_LOOKUP_PLUGINS', '/usr/share/ansible_plugins/lookup_plugins'))
DEFAULT_VARS_PLUGIN_PATH = shell_expand_path(get_config(p, DEFAULTS, 'vars_plugins', 'ANSIBLE_VARS_PLUGINS', '/usr/share/ansible_plugins/vars_plugins'))
DEFAULT_FILTER_PLUGIN_PATH = shell_expand_path(get_config(p, DEFAULTS, 'filter_plugins', 'ANSIBLE_FILTER_PLUGINS', '/usr/share/ansible_plugins/filter_plugins'))
# non-configurable things
DEFAULT_SUDO_PASS = None
DEFAULT_REMOTE_PASS = None
DEFAULT_SUBSET = None
ANSIBLE_SSH_ARGS = get_config(p, 'ssh_connection', 'ssh_args', 'ANSIBLE_SSH_ARGS', None)
ZEROMQ_PORT = int(get_config(p, 'fireball', 'zeromq_port', 'ANSIBLE_ZEROMQ_PORT', 5099))<|fim▁end|> | def shell_expand_path(path):
''' shell_expand_path is needed as os.path.expanduser does not work
when path is None, which is the default for ANSIBLE_PRIVATE_KEY_FILE '''
if path: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .boolalg import (ITE, And, Equivalent, Implies, Nand, Nor, Not, Or,
POSform, SOPform, Xor, bool_map, false, simplify_logic,
to_cnf, to_dnf, to_nnf, true)
from .inference import satisfiable
__all__ = ('ITE', 'And', 'Equivalent', 'Implies', 'Nand', 'Nor', 'Not', 'Or',
'POSform', 'SOPform', 'Xor', 'bool_map', 'false', 'simplify_logic',
'to_cnf', 'to_dnf', 'to_nnf', 'true', 'satisfiable')<|fim▁end|> | """
Package for handling logical expressions.
"""
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
setup(name='awstools',
version='0.1',
description='Simple API for AWS IoT',
url='https://github.com/h314to/awstools',
author='Filipe Agapito',
author_email='[email protected]',
license='MIT',<|fim▁hole|> install_requires=[
'awscli',
'sh',
],
test_suite='nose.collector',
tests_require=['nose'],
zip_safe=False)<|fim▁end|> | packages=['awstools'], |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
from django.http import HttpResponse,JsonResponse
from django.views import generic
from django.views.generic.edit import FormView, CreateView
from django.core.urlresolvers import reverse_lazy
from django.core.mail import send_mail
from hacks.models import Hackathon, CodeMania, SendRSVP, RSVPConfirmation
from hacks.forms import HackathonForm
from .forms import HackathonForm, CodeManiaForm
import json
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseForbidden
# Create your views here.
class HackathonView(generic.View):
def get(self, request):
form = HackathonForm
template_name = 'index.html'
return render(request, template_name)
# def post(self, request):
# try:
# # f = HackathonForm(request.POST)
# # f.save()
# name = request.POST.get('name', None)
# email = request.POST.get('email',None )
# phone_number = request.POST.get('phone_number', None)
# github = request.POST.get('github', None)
# linkedin = request.POST.get('linkedin', None)
# hardware_required= request.POST.get('hardware_required', None)
# mac_address= request.POST.get('mac_address', None)
# size = request.POST.get('size', None)
# Hackathon.objects.create(name = name, email=email, phone_number=phone_number, github=github, linkedin=linkedin, hardware_required = hardware_required, mac_address=mac_address, size=size)
# plaintext = get_template('registration_email.txt')
# htmly = get_template('registration_email.html')
# d = Context({ 'name': request.POST.get('name', None) })
# subject, from_email, to = 'JSS Hackathon 2015', 'Hackathon 2015<[email protected]>', request.POST.get('email', )
# text_content = plaintext.render(d)
# html_content = htmly.render(d)
# msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
# msg.attach_alternative(html_content, "text/html")
# msg.send()
# # send_mail('Hackathon-2015', 'Here is the message.', 'Microsoft Mobile Innovation Lab <[email protected]>', ['[email protected]'], fail_silently=False)
# return HttpResponse(json.dumps({"event":1}), content_type="application/json")
# except Exception as e:
# return HttpResponse(json.dumps(e), content_type="application/json")
class CodeManiaView(generic.View):
def get(self, request):
form = CodeManiaForm
template_name = 'codemania.html'
return render(request, template_name, {'form':form})
# def post(self, request):
# try:
# name = request.POST.get('name', None)
# email = request.POST.get('email',None )
# phone_number = request.POST.get('phone_number', None)
# year = request.POST.get('year', None)
# course= request.POST.get('course', None)
# branch= request.POST.get('branch', None)
# CodeMania.objects.create(name = name, email=email, phone_number=phone_number, year=year, course=course, branch = branch)
# plaintext = get_template('codemania_registration_email.txt')
# htmly = get_template('codemania_registration_email.html')
# d = Context({ 'name': name})
# subject, from_email, to = 'CodeMania-2015', 'Hackathon 2015 <[email protected]>', email
# text_content = plaintext.render(d)
# html_content = htmly.render(d)
# msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
# msg.attach_alternative(html_content, "text/html")
# msg.send()
# # send_mail('Hackathon-2015', 'Here is the message.', 'Microsoft Mobile Innovation Lab <[email protected]>', ['[email protected]'], fail_silently=False)
# return HttpResponse(json.dumps({"event":1}), content_type="application/json")
# except Exception as e:
# return HttpResponse(json.dumps(e), content_type="application/json")
def handler404(request):
response = render_to_response('404.html', {},
context_instance=RequestContext(request))
response.status_code = 404
return response
def handler500(request):
response = render_to_response('500.html', {},
context_instance=RequestContext(request))
response.status_code = 500
return response
def problems(request):
return render_to_response('problems.html')
from django.contrib.auth.decorators import login_required
<|fim▁hole|> def as_view(cls, **initkwargs):
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
return login_required(view)
class sendRSVP(LoginRequiredMixin, generic.View):
def get(self, request):
template_name = 'send_rsvp.html'
return render(request, template_name, )
def post(self, request):
import uuid
emails = request.POST.get('emails', None)
emails = emails.replace('\r','')
emails = emails.split('\n')
plaintext = get_template('rsvp_confirmation_mail.txt')
htmly = get_template('rsvp_confirmation_mail.html')
for email in emails:
if email is not None or email is not "":
uid = uuid.uuid4()
SendRSVP.objects.create(email = email, uid = uid)
d = Context({ 'uid': uid})
subject, from_email, to = 'Confirmation: Hackathon-2015 ', 'Hackathon 2015 <[email protected]>', email
text_content = plaintext.render(d)
html_content = htmly.render(d)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.send()
return HttpResponse(json.dumps({"Event":"Email Sent to selected list of participants"}), content_type="application/json")
class RSVP(generic.View):
def get(self, request, uid = None):
template_name = 'rsvp_view.html'
uid = str(request.get_full_path()).split('/')[-1]
if RSVPConfirmation.objects.filter(sent_rsvp__uid = uid):
return render(request, 'already_confirmed.html', )
else:
return render(request, template_name, {'uid': uid})
def post(self, request, uid):
uid = str(request.get_full_path()).split('/')[-1]
if RSVPConfirmation.objects.filter(sent_rsvp__uid = uid).count() == 1:
return HttpResponseForbidden()
else:
college = request.POST.get('college', '')
status = request.POST.get('status', False)
rsvp_obj = SendRSVP.objects.filter(uid = str(uid))[0]
RSVPConfirmation.objects.create(status = status, college = college, sent_rsvp = rsvp_obj)
return HttpResponse(json.dumps({"event":1}), content_type="application/json")<|fim▁end|> | class LoginRequiredMixin(object):
@classmethod |
<|file_name|>test_template_use.py<|end_file_name|><|fim▁begin|>from . import *<|fim▁hole|> def test_resized_img_src(self):
@self.app.route('/resized_img_src')
def use():
return render_template_string('''
<img src="{{ resized_img_src('cc.png') }}" />
'''.strip())
res = self.client.get('/resized_img_src')
self.assert200(res)
self.assertIn('src="/imgsizer/cc.png?', res.data)
def test_url_for(self):
@self.app.route('/url_for')
def use():
return render_template_string('''
<img src="{{ url_for('images', filename='cc.png') }}" />
'''.strip())
res = self.client.get('/url_for')
self.assert200(res)
self.assertIn('src="/imgsizer/cc.png?', res.data)<|fim▁end|> |
class TestTemplateUse(TestCase):
|
<|file_name|>fix_encoding.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Collection of functions and classes to fix various encoding problems on
multiple platforms with python.
"""
import codecs
import locale
import os
import sys
# Prevents initializing multiple times.
_SYS_ARGV_PROCESSED = False
def complain(message):
"""If any exception occurs in this file, we'll probably try to print it
on stderr, which makes for frustrating debugging if stderr is directed
to our wrapper. So be paranoid about catching errors and reporting them
to sys.__stderr__, so that the user has a higher chance to see them.
"""
print >> sys.__stderr__, (
isinstance(message, str) and message or repr(message))
def fix_default_encoding():
"""Forces utf8 solidly on all platforms.
By default python execution environment is lazy and defaults to ascii
encoding.
http://uucode.com/blog/2007/03/23/shut-up-you-dummy-7-bit-python/
"""
if sys.getdefaultencoding() == 'utf-8':
return False
# Regenerate setdefaultencoding.
reload(sys)
# Module 'sys' has no 'setdefaultencoding' member
# pylint: disable=E1101
sys.setdefaultencoding('utf-8')
for attr in dir(locale):
if attr[0:3] != 'LC_':
continue
aref = getattr(locale, attr)
try:
locale.setlocale(aref, '')
except locale.Error:
continue
try:
lang = locale.getlocale(aref)[0]
except (TypeError, ValueError):
continue
if lang:
try:
locale.setlocale(aref, (lang, 'UTF-8'))
except locale.Error:
os.environ[attr] = lang + '.UTF-8'
try:
locale.setlocale(locale.LC_ALL, '')
except locale.Error:
pass
return True
###############################
# Windows specific
def fix_win_sys_argv(encoding):
"""Converts sys.argv to 'encoding' encoded string.
utf-8 is recommended.
Works around <http://bugs.python.org/issue2128>.
"""
global _SYS_ARGV_PROCESSED
if _SYS_ARGV_PROCESSED:
return False
# These types are available on linux but not Mac.
# pylint: disable=E0611,F0401
from ctypes import byref, c_int, POINTER, windll, WINFUNCTYPE
from ctypes.wintypes import LPCWSTR, LPWSTR
# <http://msdn.microsoft.com/en-us/library/ms683156.aspx>
GetCommandLineW = WINFUNCTYPE(LPWSTR)(('GetCommandLineW', windll.kernel32))
# <http://msdn.microsoft.com/en-us/library/bb776391.aspx>
CommandLineToArgvW = WINFUNCTYPE(POINTER(LPWSTR), LPCWSTR, POINTER(c_int))(
('CommandLineToArgvW', windll.shell32))
argc = c_int(0)
argv_unicode = CommandLineToArgvW(GetCommandLineW(), byref(argc))
argv = [
argv_unicode[i].encode(encoding, 'replace')
for i in xrange(0, argc.value)]
if not hasattr(sys, 'frozen'):
# If this is an executable produced by py2exe or bbfreeze, then it
# will have been invoked directly. Otherwise, unicode_argv[0] is the
# Python interpreter, so skip that.
argv = argv[1:]
# Also skip option arguments to the Python interpreter.
while len(argv) > 0:
arg = argv[0]
if not arg.startswith(u'-') or arg == u'-':
break
argv = argv[1:]
if arg == u'-m':
# sys.argv[0] should really be the absolute path of the
# module source, but never mind.
break
if arg == u'-c':
argv[0] = u'-c'
break
sys.argv = argv
_SYS_ARGV_PROCESSED = True
return True
def fix_win_codec():
"""Works around <http://bugs.python.org/issue6058>."""
# <http://msdn.microsoft.com/en-us/library/dd317756.aspx>
try:
codecs.lookup('cp65001')
return False
except LookupError:
codecs.register(
lambda name: name == 'cp65001' and codecs.lookup('utf-8') or None)
return True
class WinUnicodeOutputBase(object):
"""Base class to adapt sys.stdout or sys.stderr to behave correctly on
Windows.
Setting encoding to utf-8 is recommended.
"""
def __init__(self, fileno, name, encoding):
# Corresponding file handle.
self._fileno = fileno
self.encoding = encoding
self.name = name
self.closed = False
self.softspace = False
self.mode = 'w'
@staticmethod
def isatty():
return False
def close(self):
# Don't really close the handle, that would only cause problems.
self.closed = True
def fileno(self):
return self._fileno
def flush(self):
raise NotImplementedError()
def write(self, text):
raise NotImplementedError()
def writelines(self, lines):
try:
for line in lines:
self.write(line)
except Exception, e:
complain('%s.writelines: %r' % (self.name, e))
raise
class WinUnicodeConsoleOutput(WinUnicodeOutputBase):
"""Output adapter to a Windows Console.
Understands how to use the win32 console API.
"""
def __init__(self, console_handle, fileno, stream_name, encoding):
super(WinUnicodeConsoleOutput, self).__init__(
fileno, '<Unicode console %s>' % stream_name, encoding)
# Handle to use for WriteConsoleW
self._console_handle = console_handle
# Loads the necessary function.
# These types are available on linux but not Mac.
# pylint: disable=E0611,F0401
from ctypes import byref, GetLastError, POINTER, windll, WINFUNCTYPE
from ctypes.wintypes import BOOL, DWORD, HANDLE, LPWSTR
from ctypes.wintypes import LPVOID # pylint: disable=E0611
self._DWORD = DWORD
self._byref = byref
# <http://msdn.microsoft.com/en-us/library/ms687401.aspx>
self._WriteConsoleW = WINFUNCTYPE(
BOOL, HANDLE, LPWSTR, DWORD, POINTER(DWORD), LPVOID)(
('WriteConsoleW', windll.kernel32))
self._GetLastError = GetLastError
def flush(self):
# No need to flush the console since it's immediate.
pass
def write(self, text):
try:
if not isinstance(text, unicode):
# Convert to unicode.
text = str(text).decode(self.encoding, 'replace')
remaining = len(text)
while remaining > 0:
n = self._DWORD(0)
# There is a shorter-than-documented limitation on the length of the
# string passed to WriteConsoleW. See
# <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1232>.
retval = self._WriteConsoleW(
self._console_handle, text,
min(remaining, 10000),
self._byref(n), None)
if retval == 0 or n.value == 0:
raise IOError(
'WriteConsoleW returned %r, n.value = %r, last error = %r' % (
retval, n.value, self._GetLastError()))
remaining -= n.value
if not remaining:
break
text = text[n.value:]
except Exception, e:
complain('%s.write: %r' % (self.name, e))
raise
class WinUnicodeOutput(WinUnicodeOutputBase):
"""Output adaptor to a file output on Windows.
If the standard FileWrite function is used, it will be encoded in the current
code page. WriteConsoleW() permits writing any character.
"""
def __init__(self, stream, fileno, encoding):
super(WinUnicodeOutput, self).__init__(
fileno, '<Unicode redirected %s>' % stream.name, encoding)
# Output stream
self._stream = stream
# Flush right now.
self.flush()
def flush(self):
try:
self._stream.flush()
except Exception, e:
complain('%s.flush: %r from %r' % (self.name, e, self._stream))
raise
def write(self, text):
try:
if isinstance(text, unicode):
# Replace characters that cannot be printed instead of failing.
text = text.encode(self.encoding, 'replace')
self._stream.write(text)
except Exception, e:
complain('%s.write: %r' % (self.name, e))
raise
def win_handle_is_a_console(handle):
"""Returns True if a Windows file handle is a handle to a console."""
# These types are available on linux but not Mac.
# pylint: disable=E0611,F0401
from ctypes import byref, POINTER, windll, WINFUNCTYPE
from ctypes.wintypes import BOOL, DWORD, HANDLE
FILE_TYPE_CHAR = 0x0002
FILE_TYPE_REMOTE = 0x8000
INVALID_HANDLE_VALUE = DWORD(-1).value
# <http://msdn.microsoft.com/en-us/library/ms683167.aspx>
GetConsoleMode = WINFUNCTYPE(BOOL, HANDLE, POINTER(DWORD))(
('GetConsoleMode', windll.kernel32))
# <http://msdn.microsoft.com/en-us/library/aa364960.aspx>
GetFileType = WINFUNCTYPE(DWORD, DWORD)(('GetFileType', windll.kernel32))
# GetStdHandle returns INVALID_HANDLE_VALUE, NULL, or a valid handle.
if handle == INVALID_HANDLE_VALUE or handle is None:
return False
return (
(GetFileType(handle) & ~FILE_TYPE_REMOTE) == FILE_TYPE_CHAR and
GetConsoleMode(handle, byref(DWORD())))
def win_get_unicode_stream(stream, excepted_fileno, output_handle, encoding):
"""Returns a unicode-compatible stream.
This function will return a direct-Console writing object only if:
- the file number is the expected console file number
- the handle the expected file handle
- the 'real' handle is in fact a handle to a console.
"""
old_fileno = getattr(stream, 'fileno', lambda: None)()
if old_fileno == excepted_fileno:
# These types are available on linux but not Mac.
# pylint: disable=E0611,F0401
from ctypes import windll, WINFUNCTYPE
from ctypes.wintypes import DWORD, HANDLE
# <http://msdn.microsoft.com/en-us/library/ms683231.aspx><|fim▁hole|> # It's a console.
return WinUnicodeConsoleOutput(
real_output_handle, old_fileno, stream.name, encoding)
# It's something else. Create an auto-encoding stream.
return WinUnicodeOutput(stream, old_fileno, encoding)
def fix_win_console(encoding):
"""Makes Unicode console output work independently of the current code page.
This also fixes <http://bugs.python.org/issue1602>.
Credit to Michael Kaplan
<http://blogs.msdn.com/b/michkap/archive/2010/04/07/9989346.aspx> and
TZOmegaTZIOY
<http://stackoverflow.com/questions/878972/windows-cmd-encoding-change-causes-python-crash/1432462#1432462>.
"""
if (isinstance(sys.stdout, WinUnicodeOutputBase) or
isinstance(sys.stderr, WinUnicodeOutputBase)):
return False
try:
# SetConsoleCP and SetConsoleOutputCP could be used to change the code page
# but it's not really useful since the code here is using WriteConsoleW().
# Also, changing the code page is 'permanent' to the console and needs to be
# reverted manually.
# In practice one needs to set the console font to a TTF font to be able to
# see all the characters but it failed for me in practice. In any case, it
# won't throw any exception when printing, which is the important part.
# -11 and -12 are defined in stdio.h
sys.stdout = win_get_unicode_stream(sys.stdout, 1, -11, encoding)
sys.stderr = win_get_unicode_stream(sys.stderr, 2, -12, encoding)
# TODO(maruel): Do sys.stdin with ReadConsoleW(). Albeit the limitation is
# "It doesn't appear to be possible to read Unicode characters in UTF-8
# mode" and this appears to be a limitation of cmd.exe.
except Exception, e:
complain('exception %r while fixing up sys.stdout and sys.stderr' % e)
return True
def fix_encoding():
"""Fixes various encoding problems on all platforms.
Should be called at the very beginning of the process.
"""
ret = True
if sys.platform == 'win32':
ret &= fix_win_codec()
ret &= fix_default_encoding()
if sys.platform == 'win32':
encoding = sys.getdefaultencoding()
ret &= fix_win_sys_argv(encoding)
ret &= fix_win_console(encoding)
return ret<|fim▁end|> | GetStdHandle = WINFUNCTYPE(HANDLE, DWORD)(('GetStdHandle', windll.kernel32))
real_output_handle = GetStdHandle(DWORD(output_handle))
if win_handle_is_a_console(real_output_handle): |
<|file_name|>constant_condition.rs<|end_file_name|><|fim▁begin|>use eew::EEW;
use condition::Condition;
pub const TRUE_CONDITION: ConstantCondition = ConstantCondition(true);
pub const FALSE_CONDITION: ConstantCondition = ConstantCondition(false);
pub struct ConstantCondition(pub bool);
impl Condition for ConstantCondition {
fn is_satisfied(&self, _: &EEW, _: Option<&EEW>) -> bool
{
return self.0;
}<|fim▁hole|><|fim▁end|> | } |
<|file_name|>timer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.<|fim▁hole|>
_log = get_logger(__name__)
class TimerEvent(async.DelayedCall):
def __init__(self, actor_id, delay, trigger_loop, repeats=False):
super(TimerEvent, self).__init__(delay, callback=self.trigger)
self._actor_id = actor_id
self._triggered = False
self.trigger_loop = trigger_loop
self.repeats = repeats
_log.debug("Set calvinsys timer %f %s on %s" % (delay, "repeat" if self.repeats else "", self._actor_id))
@property
def triggered(self):
return self._triggered
def ack(self):
self._triggered = False
def trigger(self):
_log.debug("Trigger calvinsys timer on %s" % (self._actor_id))
self._triggered = True
if self.repeats:
self.reset()
self.trigger_loop(actor_ids=[self._actor_id])
class TimerHandler(object):
def __init__(self, node, actor):
super(TimerHandler, self).__init__()
self._actor = actor
self.node = node
def once(self, delay):
return TimerEvent(self._actor.id, delay, self.node.sched.trigger_loop)
def repeat(self, delay):
return TimerEvent(self._actor.id, delay, self.node.sched.trigger_loop, repeats=True)
def register(node, actor, events=None):
"""
Registers is called when the Event-system object is created.
Place an object in the event object - in this case the
nodes only timer object.
Also register any hooks for actor migration.
@TODO: Handle migration (automagically and otherwise.)
"""
return TimerHandler(node=node, actor=actor)<|fim▁end|> |
from calvin.runtime.south.plugins.async import async
from calvin.utilities.calvinlogger import get_logger |
<|file_name|>while-prelude-drop.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
<|fim▁hole|>enum t { a, b(String), }
fn make(i: int) -> t {
if i > 10 { return a; }
let mut s = String::from_str("hello");
// Ensure s is non-const.
s.push_str("there");
return b(s);
}
pub fn main() {
let mut i = 0;
// The auto slot for the result of make(i) should not leak.
while make(i) != a { i += 1; }
}<|fim▁end|> | use std::string::String;
#[deriving(PartialEq)] |
<|file_name|>sudoku.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import (unicode_literals, absolute_import, print_function, division)
from copy import deepcopy
from itertools import combinations
class Cell:
def __init__(self):
self.value = 0
self.row = set()
self.col = set()
self.sq = set()
self.rm_values = set()
def isSet(self):<|fim▁hole|> def values(self):
if self.value:
return set()
else:
return set(range(1, 10)) - self.row - self.col - self.sq - self.rm_values
def set(self, val):
if val > 0:
if val not in self.row and val not in self.col and val not in self.sq:
self.value = val
self.row.add(val)
self.col.add(val)
self.sq.add(val)
else:
raise ValueError
def rm_value(self, val):
if isinstance(val, int):
self.rm_values.add(val)
elif isinstance(val, set):
self.rm_values |= val
def __repr__(self):
if self.value == 0:
return ' '
else:
return repr(self.value)
def carre(i,j):
return i//3+3*(j//3)
def are_neigh(i,j,k,l):
return (i==k) + (j==l) + (carre(i,j)==carre(k,l))
def coord(dim, i, k):
if dim==0:
return i, k
elif dim==1:
return k, i
elif dim==2:
return 3*(i%3)+k%3,3*(i//3)+k//3
class Sudoku:
def __init__(self, start=None): #(((0,)*9, )*9):
self.grid = { }
self.turns = 0
# Cells initialisation
for i in range(9):
# self.grid[i] = { }
for j in range(9):
self.grid[i,j] = Cell()
# Rows initialisation
for j in range(9):
row = set()
for i in range(9):
self.grid[i,j].row = row
# Columns initialisation
for i in range(9):
col = set()
for j in range(9):
self.grid[i,j].col = col
# Squares initialisation
for c in range(9):
sq = set()
for i in range(3):
for j in range(3):
self.grid[i+3*(c%3),j+3*(c//3)].sq = sq
if start:
for j, c in enumerate(start):
for i, v in enumerate(c):
try:
self.set(i, j, v)
except:
print('###', i, j, v)
raise
def __repr__(self):
result = '-'*25 + "\n"
for j in range(8, -1, -1):
line = ''
for i in range(0, 9, 3):
line += "| %r %r %r " % (tuple( self.grid[k,j] for k in range(i, i+3) ))
result += "%s|\n" % line
if not j%3:
result += '-'*25 + "\n"
return result.rstrip()
@property
def solved(self):
return all( [ self.grid[i,j].isSet() for i in range(9) for j in range(9) ] )
def set(self, i, j, val):
self.grid[i,j].set(val)
def rm_value(self, i, j, val):
self.grid[i,j].rm_value(val)
def neigh_values(self, x, y, coord=False):
row_result = set()
for i in range(9):
if i != x:
if coord:
row_result.add((i,y))
else:
row_result |= self.grid[i,y].values
col_result = set()
for j in range(9):
if j != y:
if coord:
col_result.add((x,j))
else:
col_result |= self.grid[x,j].values
sq_result = set()
for i in range(3):
for j in range(3):
if i != x%3 or j != y%3:
if coord:
sq_result.add((i+3*(x//3),j+3*(y//3)))
else:
sq_result |= self.grid[i+3*(x//3),j+3*(y//3)].values
if coord:
return row_result | col_result | sq_result
else:
return (row_result, col_result, sq_result)
def rech_solitaire_nu(self):
chgt = False
# Solitaire nu
for i in range(9):
for j in range(9):
l = self.grid[i,j].values
if len(l) == 1:
v = l.pop()
print("%d,%d -> %d |" % (i, j, v), end=' ')
self.set(i, j, v)
chgt = True
self.turns += 1
return chgt
def rech_solitaire_camoufle(self):
chgt = False
# Solitaire camouflé
for i in range(9):
for j in range(9):
l = self.grid[i,j].values
for a in ( l - x for x in self.neigh_values(i, j) ):
if len(a) == 1:
v = a.pop()
print("%d,%d => %d |" % (i, j, v), end=' ')
self.set(i, j, v)
chgt = True
self.turns += 1
break
return chgt
def rech_gpes_dominants(self):
chgt = False
for v in range(1, 10):
candidates = [ (i,j) for i in range(9) for j in range(9) if v in self.grid[i,j].values ]
for candidat in candidates:
for dim in (0, 1): # colonne/ligne
copains = [ a for a in candidates if a[dim]==candidat[dim] and are_neigh(*candidat,*a) >= 2 ]
candid_mince = [ a for a in candidates if a[dim]==candidat[dim] and a not in copains ]
candid_sq = [ a for a in candidates if carre(*a)==carre(*candidat) and a not in copains ]
if not candid_mince:
for cell in candid_sq:
print("%d,%d -> -%d |" % (*cell, v), end=' ')
self.rm_value(*cell, v)
chgt = True
self.turns += 1
elif not candid_sq:
for cell in candid_mince:
print("%d,%d -> -%d |" % (*cell, v), end=' ')
self.rm_value(*cell, v)
chgt = True
self.turns += 1
return chgt
def rech_gpes_nus(self):
chgt = False
candidates = [ (i,j,self.grid[i,j].values) for i in range(9) for j in range(9) if self.grid[i,j].values ]
for (i,j,v) in candidates:
current_gpe = [(i,j)]
for (k,l,m) in candidates:
if all([ 1 <= are_neigh(*g,k,l) <= 2 for g in current_gpe ]) and m <= v:
current_gpe.append((k,l))
if len(current_gpe) == len(v):
for (k,l,m) in candidates:
intersect = m&v
if all([ 1 <= are_neigh(*g,k,l) <= 2 for g in current_gpe ]) and intersect:
print("%d,%d => -%s |" % (k,l,intersect), end=' ')
self.rm_value(k,l,intersect)
chgt = True
self.turns += 1
return chgt
def rech_gpes_camoufles(self):
chgt = False
candidates = [ (i,j,self.grid[i,j].values) for i in range(9) for j in range(9) ]
values_count = ( # col, lig, sq
{ i: {j: set() for j in range(1, 10)} for i in range(9)},
{ i: {j: set() for j in range(1, 10)} for i in range(9)},
{ i: {j: set() for j in range(1, 10)} for i in range(9)},
)
for (i, j, values) in candidates:
for v in values:
values_count[0][i][v].add((i,j))
values_count[1][j][v].add((i,j))
values_count[2][carre(i,j)][v].add((i,j))
for dim in (0, 1, 2): # colonne/ligne/carré
for k in range(9):
count_values = [ {'vals': set((v, )), 'cells': c} for (v,c) in values_count[dim][k].items() if len(c) > 1 ]
# len(c) = 0 correspond aux valeurs fixées. Et 1 au solitaire nu...
all_combinations = []
for n in range(1,5): # On limite au quatuor (si un quintet existe, il y aura aussi un quatuor complémentaire (5+4=9 cases)
all_combinations += combinations(count_values, n)
all_count_values = []
for glop in all_combinations:
tmp = {'vals': set(), 'cells': set() }
for plop in glop:
tmp['vals'] |= plop['vals']
tmp['cells'] |= plop['cells']
all_count_values.append(tmp)
for result in all_count_values:
if result['vals'] and len(result['cells'])==len(result['vals']):
for cell in result['cells']:
diff = self.grid[cell].values - result['vals']
if diff:
print("%d,%d ~> -%s |" % (*cell, diff), end=' ')
self.rm_value(*cell, diff)
chgt = True
self.turns += 1
return chgt
def rech_reseaux(self):
chgt = False
for v in range(1, 10):
candidates = [ (i,j) for i in range(9) for j in range(9) if v in self.grid[i,j].values ]
for dim in (0, 1): # colonne/ligne
other_dim = int(not dim)
current_dims = { i: set() for i in range(9) }
for a in candidates:
current_dims[a[dim]].add(a[other_dim])
all_combinations = []
for n in range(1,5): # On limite au quatuor (si un quintet existe, il y aura aussi un quatuor complémentaire (5+4=9 cases)
all_combinations += combinations([ ({i}, current_dims[i]) for i in current_dims if current_dims[i] ], n)
for combin in all_combinations:
current_dim = set()
current_other_dim = set()
for c in combin:
current_dim |= c[0]
current_other_dim |= c[1]
if len(current_dim) == len(current_other_dim):
for a in [ a for a in candidates if a[dim] not in current_dim and a[other_dim] in current_other_dim ]:
print("%d,%d *> -%d |" % (*a, v), end=' ')
self.grid[a].rm_value(v)
chgt = True
self.turns += 1
return chgt
def solve(self):
# https://fr.wikibooks.org/wiki/Résolution_de_casse-têtes/Résolution_du_sudoku
chgt = (True, )
while not self.solved and any(chgt):
chgt = (
self.rech_solitaire_nu(),
self.rech_solitaire_camoufle(),
)
if not any(chgt):
chgt = (
self.rech_gpes_dominants(),
self.rech_gpes_nus(),
self.rech_gpes_camoufles(),
self.rech_reseaux(),
)
#print("\n%r" % self)
#raw_input("Press Enter to continue...")
print("\n%r\n###### Résolu: %s en %d coups #######" % (self, self.solved, self.turns))
# if not self.solved:
# print([ (i,j,self.grid[i,j].values) for i in range(9) for j in range(9) ])<|fim▁end|> | return self.value > 0
@property |
<|file_name|>subdivider.cpp<|end_file_name|><|fim▁begin|>//
// Copyright 2013 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#include "internal.h"
#include "subdivider.h"
#include "topology.h"
using namespace std;
using namespace shim;
OpenSubdiv::OsdCpuComputeController* g_osdComputeController = 0;
shim::Subdivider::Subdivider(
const Topology& topo,
Layout refinedLayout,
DataType refinedIndexType,
int subdivisionLevels)
{
self = new SubdividerImpl();
if (!g_osdComputeController) {
g_osdComputeController = new OpenSubdiv::OsdCpuComputeController();
}
int numFloatsPerVertex = 0;
Layout::const_iterator it;
for (it = refinedLayout.begin(); it != refinedLayout.end(); ++it) {
if (*it != float32) {
cerr << "Unsupported vertex type." << endl;
break;
}
++numFloatsPerVertex;
}
OpenSubdiv::FarMeshFactory<OpenSubdiv::OsdVertex> meshFactory(
topo.self->hmesh,
subdivisionLevels);
self->farMesh = meshFactory.Create();
self->computeContext = OpenSubdiv::OsdCpuComputeContext::Create(
self->farMesh->GetSubdivisionTables(),
self->farMesh->GetVertexEditTables());
self->vertexBuffer = OpenSubdiv::OsdCpuVertexBuffer::Create(
numFloatsPerVertex, self->farMesh->GetNumVertices());
}
shim::Subdivider::~Subdivider()
{
delete self->computeContext;
delete self->farMesh;
delete self->vertexBuffer;
delete self;
}
void
shim::Subdivider::setCoarseVertices(const HeterogeneousBuffer& cage)
{
float* pFloats = (float*) &cage.Buffer[0];
int numFloats = cage.Buffer.size() / sizeof(float);
self->vertexBuffer->UpdateData(pFloats, /*start vertex*/ 0, numFloats);
}
void
shim::Subdivider::refine()
{
g_osdComputeController->Refine(self->computeContext,
self->farMesh->GetKernelBatches(),
self->vertexBuffer);
}
void
shim::Subdivider::getRefinedVertices(Buffer* refinedVertices)
{
float* pFloats = self->vertexBuffer->BindCpuBuffer();
int numFloats = self->vertexBuffer->GetNumElements() *
self->vertexBuffer->GetNumVertices();
unsigned char* srcBegin = (unsigned char*) pFloats;
unsigned char* srcEnd = srcBegin + numFloats * 4;
refinedVertices->assign(srcBegin, srcEnd);
}
<|fim▁hole|>{
OpenSubdiv::FarPatchTables const * patchTables =
self->farMesh->GetPatchTables();
if (patchTables) {
cerr << "Feature adaptive not supported" << endl;
return;
}
const OpenSubdiv::FarSubdivisionTables *tables =
self->farMesh->GetSubdivisionTables();
bool loop = (tables->GetScheme() == OpenSubdiv::FarSubdivisionTables::LOOP);
if (loop) {
cerr << "loop subdivision not supported" << endl;
return;
}
int level = tables->GetMaxLevel();
unsigned int const * indices = self->farMesh->GetPatchTables()->GetFaceVertices(level-1);
int numInts = self->farMesh->GetPatchTables()->GetNumFaces(level-1)*4;
unsigned char const * srcBegin = reinterpret_cast<unsigned char const *>(indices);
unsigned char const * srcEnd = srcBegin + numInts * 4;
refinedQuads->assign(srcBegin, srcEnd);
}<|fim▁end|> | void
shim::Subdivider::getRefinedQuads(Buffer* refinedQuads) |
<|file_name|>packetio.go<|end_file_name|><|fim▁begin|>package mysql
import (
"bufio"
"io"
. "github.com/wangjild/go-mysql-proxy/log"
"net"
)
type PacketIO struct {
reader io.Reader
writer io.Writer
Sequence uint8
}
func NewPacketIO(conn net.Conn) *PacketIO {
p := new(PacketIO)
p.reader = bufio.NewReader(conn)
p.writer = conn
p.Sequence = 0
return p
}
func (p *PacketIO) ReadPacket() ([]byte, error) {
var payload []byte
for {
var header [PacketHeadSize]byte
if n, err := io.ReadFull(p.reader, header[:]); err != nil {
AppLog.Warn("wrong packet format, head size is %d", n)
return nil, ErrBadConn
}
length := int(uint32(header[0]) | uint32(header[1])<<8 | uint32(header[2])<<16)
if length < 1 {
AppLog.Warn("wrong packet length, size is %d", length)
return nil, ErrBadPkgLen
}
if uint8(header[3]) != p.Sequence {
if uint8(header[3]) > p.Sequence {
return nil, ErrPktSyncMul
} else {
return nil, ErrPktSync
}
}
p.Sequence++
data := make([]byte, length, length)
var err error
if _, err = io.ReadFull(p.reader, data); err != nil {
AppLog.Warn("read packet from conn error: %s", err.Error())
return nil, ErrBadConn
}
lastPacket := (length < MaxPacketSize)
if lastPacket && payload == nil {
return data, nil
}
payload = append(payload, data...)
if lastPacket {
return payload, nil
}
}
}
//data already have header
func (p *PacketIO) WritePacket(data []byte) error {
length := len(data) - 4
for length >= MaxPayloadLen {
data[0] = 0xff
data[1] = 0xff
data[2] = 0xff
data[3] = p.Sequence
if n, err := p.writer.Write(data[:4+MaxPayloadLen]); err != nil {
return ErrBadConn
} else if n != (4 + MaxPayloadLen) {
return ErrBadConn
} else {
p.Sequence++
length -= MaxPayloadLen
data = data[MaxPayloadLen:]
}
}
data[0] = byte(length)
data[1] = byte(length >> 8)
data[2] = byte(length >> 16)<|fim▁hole|>
if n, err := p.writer.Write(data); err != nil {
return ErrBadConn
} else if n != len(data) {
return ErrBadConn
} else {
p.Sequence++
return nil
}
}<|fim▁end|> | data[3] = p.Sequence |
<|file_name|>step_delete_images_snapshots.go<|end_file_name|><|fim▁begin|>package ecs
import (
"context"
"fmt"
"log"
"github.com/denverdino/aliyungo/common"
"github.com/denverdino/aliyungo/ecs"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
)
type stepDeleteAlicloudImageSnapshots struct {
AlicloudImageForceDelete bool
AlicloudImageForceDeleteSnapshots bool
AlicloudImageName string
}
func (s *stepDeleteAlicloudImageSnapshots) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {<|fim▁hole|> config := state.Get("config").(Config)
ui.Say("Deleting image snapshots.")
// Check for force delete
if s.AlicloudImageForceDelete {
images, _, err := client.DescribeImages(&ecs.DescribeImagesArgs{
RegionId: common.Region(config.AlicloudRegion),
ImageName: s.AlicloudImageName,
})
if len(images) < 1 {
return multistep.ActionContinue
}
for _, image := range images {
if image.ImageOwnerAlias != string(ecs.ImageOwnerSelf) {
log.Printf("You can only delete instances based on customized images %s ", image.ImageId)
continue
}
err = client.DeleteImage(common.Region(config.AlicloudRegion), image.ImageId)
if err != nil {
err := fmt.Errorf("Failed to delete image: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
if s.AlicloudImageForceDeleteSnapshots {
for _, diskDevice := range image.DiskDeviceMappings.DiskDeviceMapping {
if err := client.DeleteSnapshot(diskDevice.SnapshotId); err != nil {
err := fmt.Errorf("Deleting ECS snapshot failed: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
}
}
}
}
return multistep.ActionContinue
}
func (s *stepDeleteAlicloudImageSnapshots) Cleanup(state multistep.StateBag) {
}<|fim▁end|> | client := state.Get("client").(*ecs.Client)
ui := state.Get("ui").(packer.Ui) |
<|file_name|>calls.rs<|end_file_name|><|fim▁begin|>use crate::types::{Error, Params, Value};
use crate::BoxFuture;
use std::fmt;
use std::future::Future;
use std::sync::Arc;
/// Metadata trait
pub trait Metadata: Clone + Send + 'static {}
impl Metadata for () {}
impl<T: Metadata> Metadata for Option<T> {}
impl<T: Metadata> Metadata for Box<T> {}
impl<T: Sync + Send + 'static> Metadata for Arc<T> {}
/// A future-conversion trait.
pub trait WrapFuture<T, E> {
/// Convert itself into a boxed future.
fn into_future(self) -> BoxFuture<Result<T, E>>;
}
impl<T: Send + 'static, E: Send + 'static> WrapFuture<T, E> for Result<T, E> {
fn into_future(self) -> BoxFuture<Result<T, E>> {
Box::pin(async { self })
}
}
impl<T, E> WrapFuture<T, E> for BoxFuture<Result<T, E>> {
fn into_future(self) -> BoxFuture<Result<T, E>> {
self
}
}
/// A synchronous or asynchronous method.
pub trait RpcMethodSync: Send + Sync + 'static {
/// Call method
fn call(&self, params: Params) -> BoxFuture<crate::Result<Value>>;
}
/// Asynchronous Method
pub trait RpcMethodSimple: Send + Sync + 'static {
/// Output future
type Out: Future<Output = Result<Value, Error>> + Send;
/// Call method
fn call(&self, params: Params) -> Self::Out;
}
/// Asynchronous Method with Metadata
pub trait RpcMethod<T: Metadata>: Send + Sync + 'static {
/// Call method
fn call(&self, params: Params, meta: T) -> BoxFuture<crate::Result<Value>>;
}
/// Notification
pub trait RpcNotificationSimple: Send + Sync + 'static {
/// Execute notification
fn execute(&self, params: Params);
}
/// Notification with Metadata
pub trait RpcNotification<T: Metadata>: Send + Sync + 'static {
/// Execute notification
fn execute(&self, params: Params, meta: T);
}
/// Possible Remote Procedures with Metadata
#[derive(Clone)]
pub enum RemoteProcedure<T: Metadata> {
/// A method call
Method(Arc<dyn RpcMethod<T>>),
/// A notification
Notification(Arc<dyn RpcNotification<T>>),
/// An alias to other method,
Alias(String),
}
impl<T: Metadata> fmt::Debug for RemoteProcedure<T> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
use self::RemoteProcedure::*;
match *self {
Method(..) => write!(fmt, "<method>"),
Notification(..) => write!(fmt, "<notification>"),
Alias(ref alias) => write!(fmt, "alias => {:?}", alias),
}
}
}
impl<F: Send + Sync + 'static, X: Send + 'static> RpcMethodSimple for F
where
F: Fn(Params) -> X,
X: Future<Output = Result<Value, Error>>,
{
type Out = X;
fn call(&self, params: Params) -> Self::Out {<|fim▁hole|>impl<F: Send + Sync + 'static, X: Send + 'static> RpcMethodSync for F
where
F: Fn(Params) -> X,
X: WrapFuture<Value, Error>,
{
fn call(&self, params: Params) -> BoxFuture<crate::Result<Value>> {
self(params).into_future()
}
}
impl<F: Send + Sync + 'static> RpcNotificationSimple for F
where
F: Fn(Params),
{
fn execute(&self, params: Params) {
self(params)
}
}
impl<F: Send + Sync + 'static, X: Send + 'static, T> RpcMethod<T> for F
where
T: Metadata,
F: Fn(Params, T) -> X,
X: Future<Output = Result<Value, Error>>,
{
fn call(&self, params: Params, meta: T) -> BoxFuture<crate::Result<Value>> {
Box::pin(self(params, meta))
}
}
impl<F: Send + Sync + 'static, T> RpcNotification<T> for F
where
T: Metadata,
F: Fn(Params, T),
{
fn execute(&self, params: Params, meta: T) {
self(params, meta)
}
}<|fim▁end|> | self(params)
}
}
|
<|file_name|>15.2.3.6-3-134.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 15.2.3.6-3-134
description: >
Object.defineProperty - 'value' property in 'Attributes' is own
accessor property that overrides an inherited data property
(8.10.5 step 5.a)
---*/
var obj = {};
var proto = {
value: "inheritedDataProperty"
};
var ConstructFun = function () { };
ConstructFun.prototype = proto;
<|fim▁hole|> }
});
Object.defineProperty(obj, "property", child);
assert.sameValue(obj.property, "ownAccessorProperty", 'obj.property');<|fim▁end|> | var child = new ConstructFun();
Object.defineProperty(child, "value", {
get: function () {
return "ownAccessorProperty"; |
<|file_name|>commstatemachine.js<|end_file_name|><|fim▁begin|>/*********************************************************************
*
* Software License Agreement (BSD License)
*
* Copyright (c) 2010, Robert Bosch LLC.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the Robert Bosch nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Authors: Benjamin Pitzer, Robert Bosch LLC
*
*********************************************************************/
/**
* Flag for CommStateMachine transitions
* @constant
*/
ros.actionlib.NO_TRANSITION = -1;
/**
* Flag for CommStateMachine transitions
* @constant
*/
ros.actionlib.INVALID_TRANSITION = -2;
/**
* Client side state machine to track the action client's state
*
* @class
* @augments Class
*/
ros.actionlib.CommStateMachine = Class.extend(
/** @lends ros.actionlib.CommStateMachine# */
{
/**
* Constructs a CommStateMachine and initializes its state with WAITING_FOR_GOAL_ACK.
*
* @param {ros.actionlib.ActionGoal} action_goal the action goal
* @param transition_cb callback function that is being called at state transitions
* @param feedback_cb callback function that is being called at the arrival of a feedback message
* @param send_goal_fn function will send the goal message to the action server
* @param send_cancel_fn function will send the cancel message to the action server
*/
init: function(action_goal, transition_cb, feedback_cb, send_goal_fn, send_cancel_fn) {
this.action_goal = action_goal;
this.transition_cb = transition_cb;
this.feedback_cb = feedback_cb;
this.send_goal_fn = send_goal_fn;
this.send_cancel_fn = send_cancel_fn;
this.state = ros.actionlib.CommState.WAITING_FOR_GOAL_ACK;
this.latest_goal_status = ros.actionlib.GoalStatus.PENDING;
this.latest_result = null;
this.set_transitions();
},
/**
* Helper method to construct the transition matrix.
*/
set_transitions: function() {
this.transitions = new Array();
for(var i=0;i<8;i++) {
this.transitions.push(new Array());
for(var j=0;j<9;j++) {
this.transitions[i].push(new Array());
}
switch(i) {
case ros.actionlib.CommState.WAITING_FOR_GOAL_ACK:
this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.CommState.PENDING];
this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.CommState.ACTIVE];
this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.CommState.PENDING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.CommState.PENDING, ros.actionlib.CommState.RECALLING];
this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.CommState.PENDING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.PREEMPTING];
break;
case ros.actionlib.CommState.PENDING:
this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.CommState.ACTIVE];
this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.CommState.RECALLING];
this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.CommState.RECALLING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.ACTIVE, ros.actionlib.CommState.PREEMPTING];
break;
case ros.actionlib.CommState.ACTIVE:
this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.PREEMPTING];
break;
case ros.actionlib.CommState.WAITING_FOR_RESULT:
this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.INVALID_TRANSITION];
break;
case ros.actionlib.CommState.WAITING_FOR_CANCEL_ACK:
this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.CommState.RECALLING];
this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.CommState.RECALLING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.PREEMPTING];
break;
case ros.actionlib.CommState.RECALLING:
this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.PREEMPTING, ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.CommState.PREEMPTING];
break;
case ros.actionlib.CommState.PREEMPTING:
this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.CommState.WAITING_FOR_RESULT];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.NO_TRANSITION];
break;
case ros.actionlib.CommState.DONE:
this.transitions[i][ros.actionlib.GoalStatus.PENDING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ACTIVE] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.REJECTED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLING] = [ros.actionlib.INVALID_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.RECALLED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.SUCCEEDED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.ABORTED] = [ros.actionlib.NO_TRANSITION];
this.transitions[i][ros.actionlib.GoalStatus.PREEMPTING] = [ros.actionlib.INVALID_TRANSITION];
break;
default:
ros_error("Unknown CommState "+i);
}
}
},
/**
* returns true if the other CommStateMachine is identical to this one
*
* @param {ros.actionlib.CommStateMachine} other other CommStateMachine
* @returns {Boolean} true if the other CommStateMachine is identical to this one
*/
isEqualTo: function(other) {
return this.action_goal.goal_id.id == other.action_goal.goal_id.id;
},
/**
* Manually set the state
*
* @param {ros.actionlib.CommState} state the new state for the CommStateMachine
*/
set_state: function(state) {
ros_debug("Transitioning CommState from "+this.state+" to "+state);
this.state = state;
},
/**
* Finds the status of a goal by its id
*
* @param {ros.actionlib.GoalStatusArray} status_array the status array
* @param {Integer} id the goal id
*/
_find_status_by_goal_id: function(status_array, id) {
for(s in status_array.status_list) {
var status = status_array.status_list[s];
if(status.goal_id.id == id) {
return status;
}
}
return null;
},
/**
* Main function to update the state machine by processing the goal status array
*
* @param {ros.actionlib.GoalStatusArray} status_array the status array
*/
update_status: function(status_array) {
if(this.state == ros.actionlib.CommState.DONE) {
return;
}
var status = this._find_status_by_goal_id(status_array, this.action_goal.goal_id.id);
// You mean you haven't heard of me?
if(!status) {
if(!(this.state in [ros.actionlib.CommState.WAITING_FOR_GOAL_ACK,
ros.actionlib.CommState.WAITING_FOR_RESULT,
ros.actionlib.CommState.DONE])) {
this._mark_as_lost();
}
return;
}
this.latest_goal_status = status;
// Determines the next state from the lookup table
if(this.state >= this.transitions.length) {
ros_error("CommStateMachine is in a funny state: " + this.state);
return;
}
if(status.status >= this.transitions[this.state].length) {
ros_error("Got an unknown status from the ActionServer: " + status.status);
return;
}
next_states = this.transitions[this.state][status.status];
// Knowing the next state, what should we do?
if(next_states[0] == ros.actionlib.NO_TRANSITION) {
}
else if(next_states[0] == ros.actionlib.INVALID_TRANSITION) {
ros_error("Invalid goal status transition from "+this.state+" to "+status.status);
}
else {
for(s in next_states) {
var state = next_states[s];
this.transition_to(state);
}
}
},<|fim▁hole|> * @param {ros.actionlib.CommState} state the new state for the CommStateMachine
*/
transition_to: function (state) {
ros_debug("Transitioning to "+state+" (from "+this.state+", goal: "+this.action_goal.goal_id.id+")");
this.state = state;
if(this.transition_cb) {
this.transition_cb(new ros.actionlib.ClientGoalHandle(this));
}
},
/**
* Mark state machine as lost
*/
_mark_as_lost: function() {
this.latest_goal_status.status = ros.actionlib.GoalStatus.LOST;
this.transition_to(ros.actionlib.CommState.DONE);
},
/**
* Main function to update the results by processing the action result
*
* @param action_result the action result
*/
update_result: function(action_result) {
// Might not be for us
if(this.action_goal.goal_id.id != action_result.status.goal_id.id)
return;
this.latest_goal_status = action_result.status;
this.latest_result = action_result;
if(this.state in [ros.actionlib.CommState.WAITING_FOR_GOAL_ACK,
ros.actionlib.CommState.WAITING_FOR_CANCEL_ACK,
ros.actionlib.CommState.PENDING,
ros.actionlib.CommState.ACTIVE,
ros.actionlib.CommState.WAITING_FOR_RESULT,
ros.actionlib.CommState.RECALLING,
ros.actionlib.CommState.PREEMPTING]) {
// Stuffs the goal status in the result into a GoalStatusArray
var status_array = new ros.actionlib.GoalStatusArray();
status_array.status_list.push(action_result.status);
this.update_status(status_array);
this.transition_to(ros.actionlib.CommState.DONE);
}
else if(this.state == ros.actionlib.CommState.DONE) {
ros_error("Got a result when we were already in the DONE state");
}
else {
ros_error("In a funny state: "+this.state);
}
},
/**
* Function to process the action feedback message
*
* @param action_feedback an action feedback message
*/
update_feedback: function(action_feedback) {
// Might not be for us
if(this.action_goal.goal_id.id != action_feedback.status.goal_id.id) {
return;
}
if(this.feedback_cb) {
this.feedback_cb(new ros.actionlib.ClientGoalHandle(this), action_feedback.feedback);
}
},
});<|fim▁end|> |
/**
* Make state machine transition to a new state
* |
<|file_name|>borrowck-wg-borrow-mut-to-imm-3.rs<|end_file_name|><|fim▁begin|>struct Wizard {
spells: ~[&'static str]
}
pub impl Wizard {
fn cast(&mut self) {
for self.spells.each |&spell| {<|fim▁hole|> }
}
pub fn main() {
let mut harry = Wizard {
spells: ~[ "expelliarmus", "expecto patronum", "incendio" ]
};
harry.cast();
}<|fim▁end|> | io::println(spell);
} |
<|file_name|>test_pb.py<|end_file_name|><|fim▁begin|># -*- Mode: Python; test-case-name: flumotion.test.test_pb -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Foundation.
# This file is distributed without any warranty; without even the implied
# warranty of merchantability or fitness for a particular purpose.
# See "LICENSE.GPL" in the source distribution for more information.
# Licensees having purchased or holding a valid Flumotion Advanced
# Streaming Server license may use this file in accordance with the
# Flumotion Advanced Streaming Server Commercial License Agreement.
# See "LICENSE.Flumotion" in the source distribution for more information.
# Headers in this file shall remain intact.
import crypt
from twisted.cred import portal
from twisted.internet import defer, reactor
from twisted.python import log as tlog
from twisted.spread import pb as tpb
from twisted.trial import unittest
from zope.interface import implements
from flumotion.common import testsuite
from flumotion.common import keycards, log, errors
from flumotion.component.bouncers import htpasswdcrypt, saltsha256
from flumotion.twisted import checkers, pb
from flumotion.twisted import portal as fportal
from flumotion.test.common import haveTwisted
htpasswdcryptConf = {
'name': 'testbouncer',
'plugs': {},
'properties': {'data': "user:qi1Lftt0GZC0o"}}
saltsha256Conf = {
'name': 'testbouncer',
'plugs': {},
'properties': {
'data':
("user:"
"iamsalt:"
"2f826124ada2b2cdf11f4fd427c9ca48de0ed49b41476266d8df08d2cf86120e")}}
### lots of fake objects to have fun with
class FakePortalPlaintext(portal.Portal):
# a fake portal with a checker that lets username, password in
def __init__(self):
checker = checkers.FlexibleCredentialsChecker()
checker.addUser("username", "password")
portal.Portal.__init__(self, FakeTRealm(), (checker, ))
class FakePortalWrapperPlaintext:
# a fake wrapper with a checker that lets username, password in
def __init__(self):
self.broker = FakeBroker()
self.portal = FakePortalplaintext()
class FakePortalWrapperCrypt:
# a fake wrapper with a checker that lets username, crypt(password, iq) in
def __init__(self):
self.checker = checkers.CryptChecker()
cryptPassword = crypt.crypt('password', 'iq')
self.checker.addUser("username", cryptPassword)
self.portal = portal.Portal(FakeTRealm(), (self.checker, ))
# FIXME: using real portal
class FakeBouncerPortal:
# a fake wrapper implementing BouncerPortal lookalike
def __init__(self, bouncer):
self.bouncer = bouncer
def login(self, keycard, mind, interfaces):
return self.bouncer.authenticate(keycard)
class FakeAvatar(tpb.Avatar):
implements(tpb.IPerspective)
loggedIn = loggedOut = False
def __init__(self):
pass
def logout(self):
self.loggedOut = True
class FakeTRealm:
def __init__(self):
self.avatar = FakeAvatar()
def requestAvatar(self, avatarId, mind, *ifaces):
interface = ifaces[0]
assert interface == tpb.IPerspective, (
"interface is %r and not IPerspective" % interface)
self.avatar.loggedIn = True
# we can return a deferred, or return directly
return defer.succeed((tpb.IPerspective,
self.avatar, self.avatar.logout))
class FakeFRealm(FakeTRealm):
def requestAvatar(self, avatarId, keycard, mind, *interfaces):
return FakeTRealm.requestAvatar(self, avatarId, mind, *interfaces)
class FakeMind(tpb.Referenceable):
pass
class FakeBroker(tpb.Broker):
pass
# our test for twisted's challenger
# this is done for comparison with our challenger
class TestTwisted_PortalAuthChallenger(testsuite.TestCase):
def setUp(self):
root = tpb.IPBRoot(FakePortalPlaintext()).rootObject(
broker=FakeBroker())
# PB server creates a challenge and a challenger to send to the client
self.challenge, self.challenger = root.remote_login('username')
def testRightPassword(self):
# client is asked to respond, so generate the response
response = tpb.respond(self.challenge, 'password')
self.challenger.remote_respond(response, None)
def testWrongPassword(self):
# client is asked to respond, so generate the response
response = tpb.respond(self.challenge, 'wrong')
d = self.challenger.remote_respond(response, None)
def wrongPasswordErrback(wrongpasserror):
self.assert_(isinstance(wrongpasserror.type(),
errors.NotAuthenticatedError))
d.addErrback(wrongPasswordErrback)
return d
### SHINY NEW FPB
class Test_BouncerWrapper(testsuite.TestCase):
def setUp(self):
broker = FakeBroker()
self.bouncer = htpasswdcrypt.HTPasswdCrypt(htpasswdcryptConf)
self.bouncerPortal = fportal.BouncerPortal(FakeFRealm(), self.bouncer)
self.wrapper = pb._BouncerWrapper(self.bouncerPortal, broker)
def tearDown(self):
self.bouncer.stop()
def testUACPPOk(self):
mind = FakeMind()
keycard = keycards.KeycardUACPP('user', 'test', '127.0.0.1')
d = self.wrapper.remote_login(keycard, mind,
'twisted.spread.pb.IPerspective')
def uacppOkCallback(result):
self.assert_(isinstance(result, tpb.AsReferenceable))
return result
d.addCallback(uacppOkCallback)
return d
def testUACPPWrongPassword(self):
keycard = keycards.KeycardUACPP('user', 'tes', '127.0.0.1')
d = self.wrapper.remote_login(keycard, "avatarId",
'twisted.spread.pb.IPerspective')
def uacppWrongPasswordErrback(wrongpasserror):
self.assert_(isinstance(wrongpasserror.type(),
errors.NotAuthenticatedError))
d.addErrback(uacppWrongPasswordErrback)
return d
def testUACPCCOk(self):
# create
keycard = keycards.KeycardUACPCC('user', '127.0.0.1')
# send
d = self.wrapper.remote_login(keycard, None,
'twisted.spread.pb.IPerspective')
def uacpccOkCallback(keycard):
self.assertEquals(keycard.state, keycards.REQUESTING)
# respond to challenge
keycard.setPassword('test')
d = self.wrapper.remote_login(keycard, None,
'twisted.spread.pb.IPerspective')
def uacpccOkCallback2(result):
self.assert_(isinstance(result, tpb.AsReferenceable))
return result
d.addCallback(uacpccOkCallback2)
return d
d.addCallback(uacpccOkCallback)
return d
def testUACPCCWrongUser(self):
# create
keycard = keycards.KeycardUACPCC('wronguser', '127.0.0.1')
# send
d = self.wrapper.remote_login(keycard, "avatarId",
'twisted.spread.pb.IPerspective')
def uacpccWrongUserCallback(keycard):
self.assertEquals(keycard.state, keycards.REQUESTING)
# respond to challenge
keycard.setPassword('test')
d = self.wrapper.remote_login(keycard, "avatarId",
'twisted.spread.pb.IPerspective')
def uacpccWrongUserErrback(failure):
self.assert_(isinstance(failure.type(),
errors.NotAuthenticatedError))
return True
d.addErrback(uacpccWrongUserErrback)
return d
d.addCallback(uacpccWrongUserCallback)
return d
def testUACPCCWrongPassword(self):
# create
keycard = keycards.KeycardUACPCC('user', '127.0.0.1')
# send
d = self.wrapper.remote_login(keycard, "avatarId",
'twisted.spread.pb.IPerspective')
def uacpccWrongPasswordCallback(keycard):
self.assertEquals(keycard.state, keycards.REQUESTING)
# respond to challenge
keycard.setPassword('wrong')
d = self.wrapper.remote_login(keycard, "avatarId",
'twisted.spread.pb.IPerspective')
def uacpccWrongPasswordErrback(failure):
self.assert_(isinstance(failure.type(),
errors.NotAuthenticatedError))
return True
d.addErrback(uacpccWrongPasswordErrback)
return d
d.addCallback(uacpccWrongPasswordCallback)
return d
def testUACPCCTamperWithChallenge(self):
# create challenger
keycard = keycards.KeycardUACPCC('user', '127.0.0.1')
self.assert_(keycard)
self.assertEquals(keycard.state, keycards.REQUESTING)
# submit for auth
d = self.wrapper.remote_login(keycard, "avatarId",
'twisted.spread.pb.IPerspective')
def uacpccTamperCallback(keycard):
self.assertEquals(keycard.state, keycards.REQUESTING)
# mess with challenge, respond to challenge and resubmit
keycard.challenge = "I am a h4x0r"
keycard.setPassword('test')
d = self.wrapper.remote_login(keycard, "avatarId",
'twisted.spread.pb.IPerspective')
def uacpccTamperErrback(failure):
self.assert_(isinstance(failure.type(),
errors.NotAuthenticatedError))
d.addErrback(uacpccTamperErrback)
return d
d.addCallback(uacpccTamperCallback)
return d
class Test_FPortalRoot(testsuite.TestCase):
def setUp(self):
self.bouncerPortal = fportal.BouncerPortal(FakeFRealm(), 'bouncer')
self.root = pb._FPortalRoot(self.bouncerPortal)
def testRootObject(self):
root = self.root.rootObject('a')
self.failUnless(isinstance(root, pb._BouncerWrapper))
self.assertEquals(root.broker, 'a')
class TestAuthenticator(testsuite.TestCase):
def testIssueNoInfo(self):
# not setting any useful auth info on the authenticator does not
# allow us to issue a keycard
a = pb.Authenticator(username="tarzan")
d = a.issue([
"flumotion.common.keycards.KeycardUACPP", ])
d.addCallback(lambda r: self.failIf(r))
return d
def testIssueUACPP(self):
# our authenticator by default only does challenge-based keycards
a = pb.Authenticator(username="tarzan", password="jane",
address="localhost")
d = a.issue([
"flumotion.common.keycards.KeycardUACPP", ])
d.addCallback(lambda r: self.failIf(r))
def testIssueUACPCC(self):
a = pb.Authenticator(username="tarzan", password="jane",
address="localhost")
d = a.issue([
"flumotion.common.keycards.KeycardUACPCC", ])
d.addCallback(lambda r: self.failUnless(isinstance(r,
keycards.KeycardUACPCC)))
return d
# time for the big kahuna
# base class so we can use different bouncers
class Test_FPBClientFactory(testsuite.TestCase):
def setUp(self):
self.realm = FakeFRealm()
self.bouncer = self.bouncerClass(self.bouncerConf)
self.portal = fportal.BouncerPortal(self.realm, self.bouncer)
self.serverFactory = tpb.PBServerFactory(self.portal,
unsafeTracebacks=0)
self.port = reactor.listenTCP(0, self.serverFactory,
interface="127.0.0.1")
self.portno = self.port.getHost().port
def flushNotAuthenticatedError(self):
try:
self.flushLoggedErrors(errors.NotAuthenticatedError)
except AttributeError:
tlog.flushErrors(errors.NotAuthenticatedError)
def tearDown(self):
self.bouncer.stop()
self.flushNotAuthenticatedError()
self.port.stopListening()
def clientDisconnect(self, factory, reference):
# clean up broker by waiting on Disconnect notify
d = defer.Deferred()
if reference:
reference.notifyOnDisconnect(lambda r: d.callback(None))
factory.disconnect()
if reference:
return d
# test with htpasswdcrypt bouncer first
class Test_FPBClientFactoryHTPasswdCrypt(Test_FPBClientFactory):
bouncerClass = htpasswdcrypt.HTPasswdCrypt
bouncerConf = htpasswdcryptConf
def testOk(self):
factory = pb.FPBClientFactory()
a = pb.Authenticator(username="user", password="test",
address="127.0.0.1")
# send
d = factory.login(a)
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
def OkCallback(result):
# make sure we really used challenge/response keycard
self.failUnless(isinstance(factory.keycard,
keycards.KeycardUACPCC))
self.assert_(isinstance(result, tpb.RemoteReference))
return self.clientDisconnect(factory, result)
d.addCallback(OkCallback)
return d
def testWrongPassword(self):
factory = pb.FPBClientFactory()
a = pb.Authenticator()
a = pb.Authenticator(username="user", password="wrong",
address="127.0.0.1")
d = factory.login(a)
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
log.debug("trial", "wait for result")
def WrongPasswordErrback(failure):
self.failUnless(isinstance(factory.keycard,
keycards.KeycardUACPCC))
# This is a CopiedFailure
self.assert_(failure.check(
"flumotion.common.errors.NotAuthenticatedError"))
log.debug("trial", "got failure %r" % failure)
c.disconnect()
return True
d.addErrback(WrongPasswordErrback)
return d
# FIXME: rewrite such that we can enforce a challenger, possibly
# by setting a property on the bouncer
def notestUACPCCOk(self):
factory = pb.FPBClientFactory()
# send
d = factory.login(self.authenticator, 'MIND')
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
def uacpccOkCallback(keycard):
# get result
self.assertEquals(keycard.state, keycards.REQUESTING)
# respond to challenge
keycard.setPassword('test')
d = factory.login(keycard, 'MIND')
# check if we have a remote reference
def uacpccOkCallback2(result):
self.assert_(isinstance(result, tpb.RemoteReference))
return self.clientDisconnect(factory, result)
d.addCallback(uacpccOkCallback2)
return d
d.addCallback(uacpccOkCallback)
return d
def testWrongUser(self):
factory = pb.FPBClientFactory()
# create
a = pb.Authenticator(username="wronguser", password="test",
address="127.0.0.1")
# send
d = factory.login(a)
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
def WrongUserCb(keycard):
self.fail("Should have returned NotAuthenticatedError")
def WrongUserEb(failure):
# find copied failure
self.failUnless(failure.check(
"flumotion.common.errors.NotAuthenticatedError"))
return self.clientDisconnect(factory, None)
d.addCallback(WrongUserCb)
d.addErrback(WrongUserEb)
return d
def notestUACPCCWrongPassword(self):
factory = pb.FPBClientFactory()
# create
keycard = keycards.KeycardUACPCC('user', '127.0.0.1')
# send
d = factory.login(keycard, 'MIND')
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
def uacpccWrongPasswordCallback(keycard):
self.assertEquals(keycard.state, keycards.REQUESTING)
# respond to challenge
keycard.setPassword('wrongpass')
d = factory.login(keycard, 'MIND')
def uacpccWrongPasswordErrback(failure):
# find copied failure
self.failUnless(failure.check(
"flumotion.common.errors.NotAuthenticatedError"))
return self.clientDisconnect(factory, None)
d.addErrback(uacpccWrongPasswordErrback)
return d
d.addCallback(uacpccWrongPasswordCallback)
return d
def notestUACPCCTamperWithChallenge(self):
factory = pb.FPBClientFactory()
# create
keycard = keycards.KeycardUACPCC('user', '127.0.0.1')
self.assert_(keycard)
self.assertEquals(keycard.state, keycards.REQUESTING)
# send
d = factory.login(keycard, 'MIND')
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
def uacpccTamperCallback(keycard):
self.assertEquals(keycard.state, keycards.REQUESTING)
# mess with challenge, respond to challenge and resubmit
keycard.challenge = "I am a h4x0r"
keycard.setPassword('test')
d = factory.login(keycard, 'MIND')
def uacpccTamperErrback(failure):
# find copied failure
self.failUnless(failure.check(
"flumotion.common.errors.NotAuthenticatedError"))
return self.clientDisconnect(factory, None)
d.addErrback(uacpccTamperErrback)
return d
d.addCallback(uacpccTamperCallback)
return d
# test with sha256 bouncer
class Test_FPBClientFactorySaltSha256(Test_FPBClientFactory):
bouncerClass = saltsha256.SaltSha256
bouncerConf = saltsha256Conf
def testOk(self):
factory = pb.FPBClientFactory()
a = pb.Authenticator(username="user", password="test",
address="127.0.0.1")
# send
d = factory.login(a)
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
def OkCallback(result):
# make sure we really used an SHA256 challenge/response keycard
self.failUnless(isinstance(factory.keycard,
keycards.KeycardUASPCC))
self.assert_(isinstance(result, tpb.RemoteReference))
return self.clientDisconnect(factory, result)
d.addCallback(OkCallback)
return d
def testWrongPassword(self):
factory = pb.FPBClientFactory()
a = pb.Authenticator(username="user", password="wrong",
address="127.0.0.1")
d = factory.login(a)
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
log.debug("trial", "wait for result")
def WrongPasswordErrback(failure):
# make sure we really used an SHA256 challenge/response keycard
self.failUnless(isinstance(factory.keycard,
keycards.KeycardUASPCC))
# This is a CopiedFailure
self.assert_(failure.check(
"flumotion.common.errors.NotAuthenticatedError"))
log.debug("trial", "got failure %r" % failure)
c.disconnect()
return True
d.addErrback(WrongPasswordErrback)
return d
def testWrongUser(self):
factory = pb.FPBClientFactory()
# create
a = pb.Authenticator(username="wronguser", password="test",
address="127.0.0.1")
# send
d = factory.login(a)
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
def WrongUserCb(keycard):
self.fail("Should have returned NotAuthenticatedError")
def WrongUserEb(failure):
# find copied failure
self.failUnless(failure.check(
"flumotion.common.errors.NotAuthenticatedError"))
return self.clientDisconnect(factory, None)
d.addCallback(WrongUserCb)
d.addErrback(WrongUserEb)
return d
# FIXME: do this with a fake authenticator that tampers with the challenge
def notestUACPCCTamperWithChallenge(self):
factory = pb.FPBClientFactory()
# create
keycard = keycards.KeycardUACPCC('user', '127.0.0.1')
self.assert_(keycard)
self.assertEquals(keycard.state, keycards.REQUESTING)
# send
d = factory.login(keycard, 'MIND')
c = reactor.connectTCP("127.0.0.1", self.portno, factory)
def uacpccTamperCallback(keycard):
self.assertEquals(keycard.state, keycards.REQUESTING)
# mess with challenge, respond to challenge and resubmit
keycard.challenge = "I am a h4x0r"
keycard.setPassword('test')
d = factory.login(keycard, 'MIND')
def uacpccTamperErrback(failure):
# find copied failure
self.failUnless(failure.check(
"flumotion.common.errors.NotAuthenticatedError"))
return self.clientDisconnect(factory, None)
d.addErrback(uacpccTamperErrback)
return d
d.addCallback(uacpccTamperCallback)
return d
<|fim▁hole|><|fim▁end|> | if __name__ == '__main__':
unittest.main() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.