code stringlengths 4 1.01M | language stringclasses 2 values |
|---|---|
var searchData=
[
['handler_5fallocator',['handler_allocator',['../classwebsocketpp_1_1transport_1_1asio_1_1handler__allocator.html',1,'websocketpp::transport::asio']]],
['hash32',['Hash32',['../classnfd_1_1name__tree_1_1Hash32.html',1,'nfd::name_tree']]],
['hash64',['Hash64',['../classnfd_1_1name__tree_1_1Hash64.html',1,'nfd::name_tree']]],
['hash_3c_20ndn_3a_3aname_20_3e',['hash< ndn::Name >',['../structstd_1_1hash_3_01ndn_1_1Name_01_4.html',1,'std']]],
['hash_3c_20ndn_3a_3autil_3a_3aethernet_3a_3aaddress_20_3e',['hash< ndn::util::ethernet::Address >',['../structstd_1_1hash_3_01ndn_1_1util_1_1ethernet_1_1Address_01_4.html',1,'std']]],
['hashable',['Hashable',['../classndn_1_1Hashable.html',1,'ndn']]],
['header',['Header',['../classndn_1_1lp_1_1field__location__tags_1_1Header.html',1,'ndn::lp::field_location_tags']]],
['hierarchicalchecker',['HierarchicalChecker',['../classndn_1_1security_1_1conf_1_1HierarchicalChecker.html',1,'ndn::security::conf']]],
['hijacker',['Hijacker',['../classns3_1_1Hijacker.html',1,'ns3']]],
['httpexception',['HttpException',['../classHttpException.html',1,'']]],
['hybi00',['hybi00',['../classwebsocketpp_1_1processor_1_1hybi00.html',1,'websocketpp::processor']]],
['hybi00_3c_20stub_5fconfig_20_3e',['hybi00< stub_config >',['../classwebsocketpp_1_1processor_1_1hybi00.html',1,'websocketpp::processor']]],
['hybi07',['hybi07',['../classwebsocketpp_1_1processor_1_1hybi07.html',1,'websocketpp::processor']]],
['hybi08',['hybi08',['../classwebsocketpp_1_1processor_1_1hybi08.html',1,'websocketpp::processor']]],
['hybi13',['hybi13',['../classwebsocketpp_1_1processor_1_1hybi13.html',1,'websocketpp::processor']]],
['hybi13_3c_20stub_5fconfig_20_3e',['hybi13< stub_config >',['../classwebsocketpp_1_1processor_1_1hybi13.html',1,'websocketpp::processor']]],
['hybi13_3c_20stub_5fconfig_5fext_20_3e',['hybi13< stub_config_ext >',['../classwebsocketpp_1_1processor_1_1hybi13.html',1,'websocketpp::processor']]],
['hyperkeylocatornamechecker',['HyperKeyLocatorNameChecker',['../classndn_1_1security_1_1conf_1_1HyperKeyLocatorNameChecker.html',1,'ndn::security::conf']]]
];
| Java |
/*
* qrest
*
* Copyright (C) 2008-2012 - Frédéric CORNU
*
* 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/>.
*/
#ifndef QT_NO_DEBUG
#include <QDebug>
#endif
#include "progressPie.h"
#include "../../../constants.h"
#include <QPaintEvent>
#include <QPainter>
#include <QLineEdit>
////////////////////////////////////////////////////////////////////////////
//
// INIT
//
////////////////////////////////////////////////////////////////////////////
ProgressPie::ProgressPie(QWidget* parent) :
QWidget(parent),
_value(Constants::PROGRESSPIE_DEFAULT_VALUE),
_pRedBrush(new QBrush(Qt::red)),
_pGreenBrush(new QBrush(Qt::darkGreen)) {
/*
* we want this widget to be enclosed within a square that has the same
* height as a default QLineEdit.
*/
QLineEdit usedForSizeHintHeight;
int size = usedForSizeHintHeight.sizeHint().height();
setFixedSize(size, size);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
}
ProgressPie::~ProgressPie() {
delete _pGreenBrush;
delete _pRedBrush;
}
////////////////////////////////////////////////////////////////////////////
//
// OVERRIDES
//
////////////////////////////////////////////////////////////////////////////
void ProgressPie::paintEvent(QPaintEvent* event) {
QPainter painter(this);
painter.setPen(Qt::NoPen);
painter.setRenderHint(QPainter::Antialiasing, true);
/*
* Qt draws angles with 1/16 degree precision.
*/
static const int STEPS = 16;
/*
* pie is drawn starting from top, so we set startAngle at -270°
*/
static const int TOP = -270* STEPS ;
/*
* how many degrees in a full circle ?
*/
static const int FULL_CIRCLE = 360;
/*
* draw red circle
*/
painter.setBrush(*_pRedBrush);
painter.drawEllipse(this->visibleRegion().boundingRect());
/*
* draw green pie
*/
painter.setBrush(*_pGreenBrush);
painter.drawPie(this->visibleRegion().boundingRect(), TOP,
static_cast<int> (-FULL_CIRCLE * _value * STEPS));
event->accept();
}
////////////////////////////////////////////////////////////////////////////
//
// SLOTS
//
////////////////////////////////////////////////////////////////////////////
void ProgressPie::setValue(const double value) {
_value = value;
repaint();
}
| Java |
package com.dotmarketing.servlets;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.dotcms.repackage.commons_lang_2_4.org.apache.commons.lang.time.FastDateFormat;
import com.dotmarketing.util.Constants;
import com.dotmarketing.util.Logger;
import com.liferay.util.FileUtil;
public class IconServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
FastDateFormat df = FastDateFormat.getInstance(Constants.RFC2822_FORMAT, TimeZone.getTimeZone("GMT"), Locale.US);
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String i = request.getParameter("i");
if(i !=null && i.length() > 0 && i.indexOf('.') < 0){
i="." + i;
}
String icon = com.dotmarketing.util.UtilMethods.getFileExtension(i);
java.text.SimpleDateFormat httpDate = new java.text.SimpleDateFormat(Constants.RFC2822_FORMAT, Locale.US);
httpDate.setTimeZone(TimeZone.getDefault());
// -------- HTTP HEADER/ MODIFIED SINCE CODE -----------//
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
c.setTime(new Date(0));
Date _lastModified = c.getTime();
String _eTag = "dot:icon-" + icon + "-" + _lastModified.getTime() ;
String ifModifiedSince = request.getHeader("If-Modified-Since");
String ifNoneMatch = request.getHeader("If-None-Match");
/*
* If the etag matches then the file is the same
*
*/
if(ifNoneMatch != null){
if(_eTag.equals(ifNoneMatch) || ifNoneMatch.equals("*")){
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED );
return;
}
}
/* Using the If-Modified-Since Header */
if(ifModifiedSince != null){
try{
Date ifModifiedSinceDate = httpDate.parse(ifModifiedSince);
if(_lastModified.getTime() <= ifModifiedSinceDate.getTime()){
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED );
return;
}
}
catch(Exception e){}
}
response.setHeader("Last-Modified", df.format(_lastModified));
response.setHeader("ETag", "\"" + _eTag +"\"");
ServletOutputStream out = response.getOutputStream();
response.setContentType("image/png");
java.util.GregorianCalendar expiration = new java.util.GregorianCalendar();
expiration.add(java.util.Calendar.YEAR, 1);
response.setHeader("Expires", httpDate.format(expiration.getTime()));
response.setHeader("Cache-Control", "max-age=" +(60*60*24*30*12));
File f = new File(FileUtil.getRealPath("/html/images/icons/" + icon + ".png"));
if(!f.exists()){
f = new File(FileUtil.getRealPath("/html/images/icons/ukn.png"));
}
response.setHeader("Content-Length", String.valueOf(f.length()));
BufferedInputStream fis = null;
try {
fis =
new BufferedInputStream(new FileInputStream(f));
int n;
while ((n = fis.available()) > 0) {
byte[] b = new byte[n];
int result = fis.read(b);
if (result == -1)
break;
out.write(b);
} // end while
}
catch (Exception e) {
Logger.error(this.getClass(), "cannot read:" + f.toString());
}
finally {
if (fis != null)
fis.close();
f=null;
}
out.close();
}
}
| Java |
# Copyright (C) 2011-2012 Google Inc.
# 2016 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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.
#
# YouCompleteMe 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 YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Not installing aliases from python-future; it's unreliable and slow.
from builtins import * # noqa
from future.utils import iterkeys
import vim
import os
import json
import re
from collections import defaultdict
from ycmd.utils import ( ByteOffsetToCodepointOffset, GetCurrentDirectory,
JoinLinesAsUnicode, ToBytes, ToUnicode )
from ycmd import user_options_store
BUFFER_COMMAND_MAP = { 'same-buffer' : 'edit',
'horizontal-split' : 'split',
'vertical-split' : 'vsplit',
'new-tab' : 'tabedit' }
FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT = (
'The requested operation will apply changes to {0} files which are not '
'currently open. This will therefore open {0} new files in the hidden '
'buffers. The quickfix list can then be used to review the changes. No '
'files will be written to disk. Do you wish to continue?' )
potential_hint_triggers = list( map( ToBytes, [ '[', '(', ',', ':' ] ) )
def CanComplete():
"""Returns whether it's appropriate to provide any completion at the current
line and column."""
try:
line, column = LineAndColumnAfterLastNonWhitespace()
except TypeError:
return False
if ( line, column ) == CurrentLineAndColumn():
return True
return ( ToBytes( vim.current.buffer[ line ][ column - 1 ] )
in potential_hint_triggers )
def SnappedLineAndColumn():
"""Will return CurrentLineAndColumn(), except when there's solely whitespace
between caret and a potential hint trigger, where it "snaps to trigger",
returning hint trigger's line and column instead."""
try:
line, column = LineAndColumnAfterLastNonWhitespace()
except TypeError:
return CurrentLineAndColumn()
if ( ToBytes( vim.current.buffer[ line ][ column - 1 ] )
in potential_hint_triggers ):
return ( line, column )
return CurrentLineAndColumn()
def LineAndColumnAfterLastNonWhitespace():
line, column = CurrentLineAndColumn()
line_value = vim.current.line[ :column ].rstrip()
while not line_value:
line = line - 1
if line == -1:
return None
line_value = vim.current.buffer[ line ].rstrip()
return line, len( line_value )
NO_SELECTION_MADE_MSG = "No valid selection was made; aborting."
def CurrentLineAndColumn():
"""Returns the 0-based current line and 0-based current column."""
# See the comment in CurrentColumn about the calculation for the line and
# column number
line, column = vim.current.window.cursor
line -= 1
return line, column
def CurrentColumn():
"""Returns the 0-based current column. Do NOT access the CurrentColumn in
vim.current.line. It doesn't exist yet when the cursor is at the end of the
line. Only the chars before the current column exist in vim.current.line."""
# vim's columns are 1-based while vim.current.line columns are 0-based
# ... but vim.current.window.cursor (which returns a (line, column) tuple)
# columns are 0-based, while the line from that same tuple is 1-based.
# vim.buffers buffer objects OTOH have 0-based lines and columns.
# Pigs have wings and I'm a loopy purple duck. Everything makes sense now.
return vim.current.window.cursor[ 1 ]
def CurrentLineContents():
return ToUnicode( vim.current.line )
def CurrentLineContentsAndCodepointColumn():
"""Returns the line contents as a unicode string and the 0-based current
column as a codepoint offset. If the current column is outside the line,
returns the column position at the end of the line."""
line = CurrentLineContents()
byte_column = CurrentColumn()
# ByteOffsetToCodepointOffset expects 1-based offset.
column = ByteOffsetToCodepointOffset( line, byte_column + 1 ) - 1
return line, column
def TextAfterCursor():
"""Returns the text after CurrentColumn."""
return ToUnicode( vim.current.line[ CurrentColumn(): ] )
def TextBeforeCursor():
"""Returns the text before CurrentColumn."""
return ToUnicode( vim.current.line[ :CurrentColumn() ] )
# Note the difference between buffer OPTIONS and VARIABLES; the two are not
# the same.
def GetBufferOption( buffer_object, option ):
# NOTE: We used to check for the 'options' property on the buffer_object which
# is available in recent versions of Vim and would then use:
#
# buffer_object.options[ option ]
#
# to read the value, BUT this caused annoying flickering when the
# buffer_object was a hidden buffer (with option = 'ft'). This was all due to
# a Vim bug. Until this is fixed, we won't use it.
to_eval = 'getbufvar({0}, "&{1}")'.format( buffer_object.number, option )
return GetVariableValue( to_eval )
def BufferModified( buffer_object ):
return bool( int( GetBufferOption( buffer_object, 'mod' ) ) )
def GetUnsavedAndSpecifiedBufferData( including_filepath ):
"""Build part of the request containing the contents and filetypes of all
dirty buffers as well as the buffer with filepath |including_filepath|."""
buffers_data = {}
for buffer_object in vim.buffers:
buffer_filepath = GetBufferFilepath( buffer_object )
if not ( BufferModified( buffer_object ) or
buffer_filepath == including_filepath ):
continue
buffers_data[ buffer_filepath ] = {
# Add a newline to match what gets saved to disk. See #1455 for details.
'contents': JoinLinesAsUnicode( buffer_object ) + '\n',
'filetypes': FiletypesForBuffer( buffer_object )
}
return buffers_data
def GetBufferNumberForFilename( filename, open_file_if_needed = True ):
return GetIntValue( u"bufnr('{0}', {1})".format(
EscapeForVim( os.path.realpath( filename ) ),
int( open_file_if_needed ) ) )
def GetCurrentBufferFilepath():
return GetBufferFilepath( vim.current.buffer )
def BufferIsVisible( buffer_number ):
if buffer_number < 0:
return False
window_number = GetIntValue( "bufwinnr({0})".format( buffer_number ) )
return window_number != -1
def GetBufferFilepath( buffer_object ):
if buffer_object.name:
return buffer_object.name
# Buffers that have just been created by a command like :enew don't have any
# buffer name so we use the buffer number for that.
return os.path.join( GetCurrentDirectory(), str( buffer_object.number ) )
def GetCurrentBufferNumber():
return vim.current.buffer.number
def GetBufferChangedTick( bufnr ):
return GetIntValue( 'getbufvar({0}, "changedtick")'.format( bufnr ) )
def UnplaceSignInBuffer( buffer_number, sign_id ):
if buffer_number < 0:
return
vim.command(
'try | exec "sign unplace {0} buffer={1}" | catch /E158/ | endtry'.format(
sign_id, buffer_number ) )
def PlaceSign( sign_id, line_num, buffer_num, is_error = True ):
# libclang can give us diagnostics that point "outside" the file; Vim borks
# on these.
if line_num < 1:
line_num = 1
sign_name = 'YcmError' if is_error else 'YcmWarning'
vim.command( 'sign place {0} name={1} line={2} buffer={3}'.format(
sign_id, sign_name, line_num, buffer_num ) )
def ClearYcmSyntaxMatches():
matches = VimExpressionToPythonType( 'getmatches()' )
for match in matches:
if match[ 'group' ].startswith( 'Ycm' ):
vim.eval( 'matchdelete({0})'.format( match[ 'id' ] ) )
def AddDiagnosticSyntaxMatch( line_num,
column_num,
line_end_num = None,
column_end_num = None,
is_error = True ):
"""Highlight a range in the current window starting from
(|line_num|, |column_num|) included to (|line_end_num|, |column_end_num|)
excluded. If |line_end_num| or |column_end_num| are not given, highlight the
character at (|line_num|, |column_num|). Both line and column numbers are
1-based. Return the ID of the newly added match."""
group = 'YcmErrorSection' if is_error else 'YcmWarningSection'
line_num, column_num = LineAndColumnNumbersClamped( line_num, column_num )
if not line_end_num or not column_end_num:
return GetIntValue(
"matchadd('{0}', '\%{1}l\%{2}c')".format( group, line_num, column_num ) )
# -1 and then +1 to account for column end not included in the range.
line_end_num, column_end_num = LineAndColumnNumbersClamped(
line_end_num, column_end_num - 1 )
column_end_num += 1
return GetIntValue(
"matchadd('{0}', '\%{1}l\%{2}c\_.\\{{-}}\%{3}l\%{4}c')".format(
group, line_num, column_num, line_end_num, column_end_num ) )
# Clamps the line and column numbers so that they are not past the contents of
# the buffer. Numbers are 1-based byte offsets.
def LineAndColumnNumbersClamped( line_num, column_num ):
new_line_num = line_num
new_column_num = column_num
max_line = len( vim.current.buffer )
if line_num and line_num > max_line:
new_line_num = max_line
max_column = len( vim.current.buffer[ new_line_num - 1 ] )
if column_num and column_num > max_column:
new_column_num = max_column
return new_line_num, new_column_num
def SetLocationList( diagnostics ):
"""Populate the location list with diagnostics. Diagnostics should be in
qflist format; see ":h setqflist" for details."""
vim.eval( 'setloclist( 0, {0} )'.format( json.dumps( diagnostics ) ) )
def OpenLocationList( focus = False, autoclose = False ):
"""Open the location list to full width at the bottom of the screen with its
height automatically set to fit all entries. This behavior can be overridden
by using the YcmLocationOpened autocommand. When focus is set to True, the
location list window becomes the active window. When autoclose is set to True,
the location list window is automatically closed after an entry is
selected."""
vim.command( 'botright lopen' )
SetFittingHeightForCurrentWindow()
if autoclose:
# This autocommand is automatically removed when the location list window is
# closed.
vim.command( 'au WinLeave <buffer> q' )
if VariableExists( '#User#YcmLocationOpened' ):
vim.command( 'doautocmd User YcmLocationOpened' )
if not focus:
JumpToPreviousWindow()
def SetQuickFixList( quickfix_list ):
"""Populate the quickfix list and open it. List should be in qflist format:
see ":h setqflist" for details."""
vim.eval( 'setqflist( {0} )'.format( json.dumps( quickfix_list ) ) )
def OpenQuickFixList( focus = False, autoclose = False ):
"""Open the quickfix list to full width at the bottom of the screen with its
height automatically set to fit all entries. This behavior can be overridden
by using the YcmQuickFixOpened autocommand.
See the OpenLocationList function for the focus and autoclose options."""
vim.command( 'botright copen' )
SetFittingHeightForCurrentWindow()
if autoclose:
# This autocommand is automatically removed when the quickfix window is
# closed.
vim.command( 'au WinLeave <buffer> q' )
if VariableExists( '#User#YcmQuickFixOpened' ):
vim.command( 'doautocmd User YcmQuickFixOpened' )
if not focus:
JumpToPreviousWindow()
def SetFittingHeightForCurrentWindow():
window_width = GetIntValue( 'winwidth( 0 )' )
fitting_height = 0
for line in vim.current.buffer:
fitting_height += len( line ) // window_width + 1
vim.command( '{0}wincmd _'.format( fitting_height ) )
def ConvertDiagnosticsToQfList( diagnostics ):
def ConvertDiagnosticToQfFormat( diagnostic ):
# See :h getqflist for a description of the dictionary fields.
# Note that, as usual, Vim is completely inconsistent about whether
# line/column numbers are 1 or 0 based in its various APIs. Here, it wants
# them to be 1-based. The documentation states quite clearly that it
# expects a byte offset, by which it means "1-based column number" as
# described in :h getqflist ("the first column is 1").
location = diagnostic[ 'location' ]
line_num = location[ 'line_num' ]
# libclang can give us diagnostics that point "outside" the file; Vim borks
# on these.
if line_num < 1:
line_num = 1
text = diagnostic[ 'text' ]
if diagnostic.get( 'fixit_available', False ):
text += ' (FixIt available)'
return {
'bufnr' : GetBufferNumberForFilename( location[ 'filepath' ] ),
'lnum' : line_num,
'col' : location[ 'column_num' ],
'text' : text,
'type' : diagnostic[ 'kind' ][ 0 ],
'valid' : 1
}
return [ ConvertDiagnosticToQfFormat( x ) for x in diagnostics ]
def GetVimGlobalsKeys():
return vim.eval( 'keys( g: )' )
def VimExpressionToPythonType( vim_expression ):
"""Returns a Python type from the return value of the supplied Vim expression.
If the expression returns a list, dict or other non-string type, then it is
returned unmodified. If the string return can be converted to an
integer, returns an integer, otherwise returns the result converted to a
Unicode string."""
result = vim.eval( vim_expression )
if not ( isinstance( result, str ) or isinstance( result, bytes ) ):
return result
try:
return int( result )
except ValueError:
return ToUnicode( result )
def HiddenEnabled( buffer_object ):
return bool( int( GetBufferOption( buffer_object, 'hid' ) ) )
def BufferIsUsable( buffer_object ):
return not BufferModified( buffer_object ) or HiddenEnabled( buffer_object )
def EscapedFilepath( filepath ):
return filepath.replace( ' ' , r'\ ' )
# Both |line| and |column| need to be 1-based
def TryJumpLocationInOpenedTab( filename, line, column ):
filepath = os.path.realpath( filename )
for tab in vim.tabpages:
for win in tab.windows:
if win.buffer.name == filepath:
vim.current.tabpage = tab
vim.current.window = win
vim.current.window.cursor = ( line, column - 1 )
# Center the screen on the jumped-to location
vim.command( 'normal! zz' )
return True
# 'filename' is not opened in any tab pages
return False
# Maps User command to vim command
def GetVimCommand( user_command, default = 'edit' ):
vim_command = BUFFER_COMMAND_MAP.get( user_command, default )
if vim_command == 'edit' and not BufferIsUsable( vim.current.buffer ):
vim_command = 'split'
return vim_command
# Both |line| and |column| need to be 1-based
def JumpToLocation( filename, line, column ):
# Add an entry to the jumplist
vim.command( "normal! m'" )
if filename != GetCurrentBufferFilepath():
# We prefix the command with 'keepjumps' so that opening the file is not
# recorded in the jumplist. So when we open the file and move the cursor to
# a location in it, the user can use CTRL-O to jump back to the original
# location, not to the start of the newly opened file.
# Sadly this fails on random occasions and the undesired jump remains in the
# jumplist.
user_command = user_options_store.Value( 'goto_buffer_command' )
if user_command == 'new-or-existing-tab':
if TryJumpLocationInOpenedTab( filename, line, column ):
return
user_command = 'new-tab'
vim_command = GetVimCommand( user_command )
try:
vim.command( 'keepjumps {0} {1}'.format( vim_command,
EscapedFilepath( filename ) ) )
# When the file we are trying to jump to has a swap file
# Vim opens swap-exists-choices dialog and throws vim.error with E325 error,
# or KeyboardInterrupt after user selects one of the options.
except vim.error as e:
if 'E325' not in str( e ):
raise
# Do nothing if the target file is still not opened (user chose (Q)uit)
if filename != GetCurrentBufferFilepath():
return
# Thrown when user chooses (A)bort in .swp message box
except KeyboardInterrupt:
return
vim.current.window.cursor = ( line, column - 1 )
# Center the screen on the jumped-to location
vim.command( 'normal! zz' )
def NumLinesInBuffer( buffer_object ):
# This is actually less than obvious, that's why it's wrapped in a function
return len( buffer_object )
# Calling this function from the non-GUI thread will sometimes crash Vim. At
# the time of writing, YCM only uses the GUI thread inside Vim (this used to
# not be the case).
def PostVimMessage( message, warning = True, truncate = False ):
"""Display a message on the Vim status line. By default, the message is
highlighted and logged to Vim command-line history (see :h history).
Unset the |warning| parameter to disable this behavior. Set the |truncate|
parameter to avoid hit-enter prompts (see :h hit-enter) when the message is
longer than the window width."""
echo_command = 'echom' if warning else 'echo'
# Displaying a new message while previous ones are still on the status line
# might lead to a hit-enter prompt or the message appearing without a
# newline so we do a redraw first.
vim.command( 'redraw' )
if warning:
vim.command( 'echohl WarningMsg' )
message = ToUnicode( message )
if truncate:
vim_width = GetIntValue( '&columns' )
message = message.replace( '\n', ' ' )
if len( message ) > vim_width:
message = message[ : vim_width - 4 ] + '...'
old_ruler = GetIntValue( '&ruler' )
old_showcmd = GetIntValue( '&showcmd' )
vim.command( 'set noruler noshowcmd' )
vim.command( "{0} '{1}'".format( echo_command,
EscapeForVim( message ) ) )
SetVariableValue( '&ruler', old_ruler )
SetVariableValue( '&showcmd', old_showcmd )
else:
for line in message.split( '\n' ):
vim.command( "{0} '{1}'".format( echo_command,
EscapeForVim( line ) ) )
if warning:
vim.command( 'echohl None' )
def PresentDialog( message, choices, default_choice_index = 0 ):
"""Presents the user with a dialog where a choice can be made.
This will be a dialog for gvim users or a question in the message buffer
for vim users or if `set guioptions+=c` was used.
choices is list of alternatives.
default_choice_index is the 0-based index of the default element
that will get choosen if the user hits <CR>. Use -1 for no default.
PresentDialog will return a 0-based index into the list
or -1 if the dialog was dismissed by using <Esc>, Ctrl-C, etc.
If you are presenting a list of options for the user to choose from, such as
a list of imports, or lines to insert (etc.), SelectFromList is a better
option.
See also:
:help confirm() in vim (Note that vim uses 1-based indexes)
Example call:
PresentDialog("Is this a nice example?", ["Yes", "No", "May&be"])
Is this a nice example?
[Y]es, (N)o, May(b)e:"""
to_eval = "confirm('{0}', '{1}', {2})".format(
EscapeForVim( ToUnicode( message ) ),
EscapeForVim( ToUnicode( "\n" .join( choices ) ) ),
default_choice_index + 1 )
try:
return GetIntValue( to_eval ) - 1
except KeyboardInterrupt:
return -1
def Confirm( message ):
"""Display |message| with Ok/Cancel operations. Returns True if the user
selects Ok"""
return bool( PresentDialog( message, [ "Ok", "Cancel" ] ) == 0 )
def SelectFromList( prompt, items ):
"""Ask the user to select an item from the list |items|.
Presents the user with |prompt| followed by a numbered list of |items|,
from which they select one. The user is asked to enter the number of an
item or click it.
|items| should not contain leading ordinals: they are added automatically.
Returns the 0-based index in the list |items| that the user selected, or a
negative number if no valid item was selected.
See also :help inputlist()."""
vim_items = [ prompt ]
vim_items.extend( [ "{0}: {1}".format( i + 1, item )
for i, item in enumerate( items ) ] )
# The vim documentation warns not to present lists larger than the number of
# lines of display. This is sound advice, but there really isn't any sensible
# thing we can do in that scenario. Testing shows that Vim just pages the
# message; that behaviour is as good as any, so we don't manipulate the list,
# or attempt to page it.
# For an explanation of the purpose of inputsave() / inputrestore(),
# see :help input(). Briefly, it makes inputlist() work as part of a mapping.
vim.eval( 'inputsave()' )
try:
# Vim returns the number the user entered, or the line number the user
# clicked. This may be wildly out of range for our list. It might even be
# negative.
#
# The first item is index 0, and this maps to our "prompt", so we subtract 1
# from the result and return that, assuming it is within the range of the
# supplied list. If not, we return negative.
#
# See :help input() for explanation of the use of inputsave() and inpput
# restore(). It is done in try/finally in case vim.eval ever throws an
# exception (such as KeyboardInterrupt)
selected = GetIntValue( "inputlist( " + json.dumps( vim_items ) + " )" ) - 1
except KeyboardInterrupt:
selected = -1
finally:
vim.eval( 'inputrestore()' )
if selected < 0 or selected >= len( items ):
# User selected something outside of the range
raise RuntimeError( NO_SELECTION_MADE_MSG )
return selected
def EscapeForVim( text ):
return ToUnicode( text.replace( "'", "''" ) )
def CurrentFiletypes():
return VimExpressionToPythonType( "&filetype" ).split( '.' )
def GetBufferFiletypes( bufnr ):
command = 'getbufvar({0}, "&ft")'.format( bufnr )
return VimExpressionToPythonType( command ).split( '.' )
def FiletypesForBuffer( buffer_object ):
# NOTE: Getting &ft for other buffers only works when the buffer has been
# visited by the user at least once, which is true for modified buffers
return GetBufferOption( buffer_object, 'ft' ).split( '.' )
def VariableExists( variable ):
return GetBoolValue( "exists( '{0}' )".format( EscapeForVim( variable ) ) )
def SetVariableValue( variable, value ):
vim.command( "let {0} = {1}".format( variable, json.dumps( value ) ) )
def GetVariableValue( variable ):
return vim.eval( variable )
def GetBoolValue( variable ):
return bool( int( vim.eval( variable ) ) )
def GetIntValue( variable ):
return int( vim.eval( variable ) )
def _SortChunksByFile( chunks ):
"""Sort the members of the list |chunks| (which must be a list of dictionaries
conforming to ycmd.responses.FixItChunk) by their filepath. Returns a new
list in arbitrary order."""
chunks_by_file = defaultdict( list )
for chunk in chunks:
filepath = chunk[ 'range' ][ 'start' ][ 'filepath' ]
chunks_by_file[ filepath ].append( chunk )
return chunks_by_file
def _GetNumNonVisibleFiles( file_list ):
"""Returns the number of file in the iterable list of files |file_list| which
are not curerntly open in visible windows"""
return len(
[ f for f in file_list
if not BufferIsVisible( GetBufferNumberForFilename( f, False ) ) ] )
def _OpenFileInSplitIfNeeded( filepath ):
"""Ensure that the supplied filepath is open in a visible window, opening a
new split if required. Returns the buffer number of the file and an indication
of whether or not a new split was opened.
If the supplied filename is already open in a visible window, return just
return its buffer number. If the supplied file is not visible in a window
in the current tab, opens it in a new vertical split.
Returns a tuple of ( buffer_num, split_was_opened ) indicating the buffer
number and whether or not this method created a new split. If the user opts
not to open a file, or if opening fails, this method raises RuntimeError,
otherwise, guarantees to return a visible buffer number in buffer_num."""
buffer_num = GetBufferNumberForFilename( filepath, False )
# We only apply changes in the current tab page (i.e. "visible" windows).
# Applying changes in tabs does not lead to a better user experience, as the
# quickfix list no longer works as you might expect (doesn't jump into other
# tabs), and the complexity of choosing where to apply edits is significant.
if BufferIsVisible( buffer_num ):
# file is already open and visible, just return that buffer number (and an
# idicator that we *didn't* open a split)
return ( buffer_num, False )
# The file is not open in a visible window, so we open it in a split.
# We open the file with a small, fixed height. This means that we don't
# make the current buffer the smallest after a series of splits.
OpenFilename( filepath, {
'focus': True,
'fix': True,
'size': GetIntValue( '&previewheight' ),
} )
# OpenFilename returns us to the original cursor location. This is what we
# want, because we don't want to disorientate the user, but we do need to
# know the (now open) buffer number for the filename
buffer_num = GetBufferNumberForFilename( filepath, False )
if not BufferIsVisible( buffer_num ):
# This happens, for example, if there is a swap file and the user
# selects the "Quit" or "Abort" options. We just raise an exception to
# make it clear to the user that the abort has left potentially
# partially-applied changes.
raise RuntimeError(
'Unable to open file: {0}\nFixIt/Refactor operation '
'aborted prior to completion. Your files have not been '
'fully updated. Please use undo commands to revert the '
'applied changes.'.format( filepath ) )
# We opened this file in a split
return ( buffer_num, True )
def ReplaceChunks( chunks ):
"""Apply the source file deltas supplied in |chunks| to arbitrary files.
|chunks| is a list of changes defined by ycmd.responses.FixItChunk,
which may apply arbitrary modifications to arbitrary files.
If a file specified in a particular chunk is not currently open in a visible
buffer (i.e., one in a window visible in the current tab), we:
- issue a warning to the user that we're going to open new files (and offer
her the option to abort cleanly)
- open the file in a new split, make the changes, then hide the buffer.
If for some reason a file could not be opened or changed, raises RuntimeError.
Otherwise, returns no meaningful value."""
# We apply the edits file-wise for efficiency, and because we must track the
# file-wise offset deltas (caused by the modifications to the text).
chunks_by_file = _SortChunksByFile( chunks )
# We sort the file list simply to enable repeatable testing
sorted_file_list = sorted( iterkeys( chunks_by_file ) )
# Make sure the user is prepared to have her screen mutilated by the new
# buffers
num_files_to_open = _GetNumNonVisibleFiles( sorted_file_list )
if num_files_to_open > 0:
if not Confirm(
FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( num_files_to_open ) ):
return
# Store the list of locations where we applied changes. We use this to display
# the quickfix window showing the user where we applied changes.
locations = []
for filepath in sorted_file_list:
( buffer_num, close_window ) = _OpenFileInSplitIfNeeded( filepath )
ReplaceChunksInBuffer( chunks_by_file[ filepath ],
vim.buffers[ buffer_num ],
locations )
# When opening tons of files, we don't want to have a split for each new
# file, as this simply does not scale, so we open the window, make the
# edits, then hide the window.
if close_window:
# Some plugins (I'm looking at you, syntastic) might open a location list
# for the window we just opened. We don't want that location list hanging
# around, so we close it. lclose is a no-op if there is no location list.
vim.command( 'lclose' )
# Note that this doesn't lose our changes. It simply "hides" the buffer,
# which can later be re-accessed via the quickfix list or `:ls`
vim.command( 'hide' )
# Open the quickfix list, populated with entries for each location we changed.
if locations:
SetQuickFixList( locations )
OpenQuickFixList()
PostVimMessage( 'Applied {0} changes'.format( len( chunks ) ),
warning = False )
def ReplaceChunksInBuffer( chunks, vim_buffer, locations ):
"""Apply changes in |chunks| to the buffer-like object |buffer|. Append each
chunk's start to the list |locations|"""
# We need to track the difference in length, but ensuring we apply fixes
# in ascending order of insertion point.
chunks.sort( key = lambda chunk: (
chunk[ 'range' ][ 'start' ][ 'line_num' ],
chunk[ 'range' ][ 'start' ][ 'column_num' ]
) )
# Remember the line number we're processing. Negative line number means we
# haven't processed any lines yet (by nature of being not equal to any
# real line number).
last_line = -1
line_delta = 0
for chunk in chunks:
if chunk[ 'range' ][ 'start' ][ 'line_num' ] != last_line:
# If this chunk is on a different line than the previous chunk,
# then ignore previous deltas (as offsets won't have changed).
last_line = chunk[ 'range' ][ 'end' ][ 'line_num' ]
char_delta = 0
( new_line_delta, new_char_delta ) = ReplaceChunk(
chunk[ 'range' ][ 'start' ],
chunk[ 'range' ][ 'end' ],
chunk[ 'replacement_text' ],
line_delta, char_delta,
vim_buffer,
locations )
line_delta += new_line_delta
char_delta += new_char_delta
# Replace the chunk of text specified by a contiguous range with the supplied
# text.
# * start and end are objects with line_num and column_num properties
# * the range is inclusive
# * indices are all 1-based
# * the returned character delta is the delta for the last line
#
# returns the delta (in lines and characters) that any position after the end
# needs to be adjusted by.
#
# NOTE: Works exclusively with bytes() instances and byte offsets as returned
# by ycmd and used within the Vim buffers
def ReplaceChunk( start, end, replacement_text, line_delta, char_delta,
vim_buffer, locations = None ):
# ycmd's results are all 1-based, but vim's/python's are all 0-based
# (so we do -1 on all of the values)
start_line = start[ 'line_num' ] - 1 + line_delta
end_line = end[ 'line_num' ] - 1 + line_delta
source_lines_count = end_line - start_line + 1
start_column = start[ 'column_num' ] - 1 + char_delta
end_column = end[ 'column_num' ] - 1
if source_lines_count == 1:
end_column += char_delta
# NOTE: replacement_text is unicode, but all our offsets are byte offsets,
# so we convert to bytes
replacement_lines = ToBytes( replacement_text ).splitlines( False )
if not replacement_lines:
replacement_lines = [ bytes( b'' ) ]
replacement_lines_count = len( replacement_lines )
# NOTE: Vim buffers are a list of byte objects on Python 2 but unicode
# objects on Python 3.
end_existing_text = ToBytes( vim_buffer[ end_line ] )[ end_column : ]
start_existing_text = ToBytes( vim_buffer[ start_line ] )[ : start_column ]
new_char_delta = ( len( replacement_lines[ -1 ] )
- ( end_column - start_column ) )
if replacement_lines_count > 1:
new_char_delta -= start_column
replacement_lines[ 0 ] = start_existing_text + replacement_lines[ 0 ]
replacement_lines[ -1 ] = replacement_lines[ -1 ] + end_existing_text
vim_buffer[ start_line : end_line + 1 ] = replacement_lines[:]
if locations is not None:
locations.append( {
'bufnr': vim_buffer.number,
'filename': vim_buffer.name,
# line and column numbers are 1-based in qflist
'lnum': start_line + 1,
'col': start_column + 1,
'text': replacement_text,
'type': 'F',
} )
new_line_delta = replacement_lines_count - source_lines_count
return ( new_line_delta, new_char_delta )
def InsertNamespace( namespace ):
if VariableExists( 'g:ycm_csharp_insert_namespace_expr' ):
expr = GetVariableValue( 'g:ycm_csharp_insert_namespace_expr' )
if expr:
SetVariableValue( "g:ycm_namespace_to_insert", namespace )
vim.eval( expr )
return
pattern = '^\s*using\(\s\+[a-zA-Z0-9]\+\s\+=\)\?\s\+[a-zA-Z0-9.]\+\s*;\s*'
existing_indent = ''
line = SearchInCurrentBuffer( pattern )
if line:
existing_line = LineTextInCurrentBuffer( line )
existing_indent = re.sub( r"\S.*", "", existing_line )
new_line = "{0}using {1};\n\n".format( existing_indent, namespace )
replace_pos = { 'line_num': line + 1, 'column_num': 1 }
ReplaceChunk( replace_pos, replace_pos, new_line, 0, 0, vim.current.buffer )
PostVimMessage( 'Add namespace: {0}'.format( namespace ), warning = False )
def SearchInCurrentBuffer( pattern ):
""" Returns the 1-indexed line on which the pattern matches
(going UP from the current position) or 0 if not found """
return GetIntValue( "search('{0}', 'Wcnb')".format( EscapeForVim( pattern )))
def LineTextInCurrentBuffer( line_number ):
""" Returns the text on the 1-indexed line (NOT 0-indexed) """
return vim.current.buffer[ line_number - 1 ]
def ClosePreviewWindow():
""" Close the preview window if it is present, otherwise do nothing """
vim.command( 'silent! pclose!' )
def JumpToPreviewWindow():
""" Jump the vim cursor to the preview window, which must be active. Returns
boolean indicating if the cursor ended up in the preview window """
vim.command( 'silent! wincmd P' )
return vim.current.window.options[ 'previewwindow' ]
def JumpToPreviousWindow():
""" Jump the vim cursor to its previous window position """
vim.command( 'silent! wincmd p' )
def JumpToTab( tab_number ):
"""Jump to Vim tab with corresponding number """
vim.command( 'silent! tabn {0}'.format( tab_number ) )
def OpenFileInPreviewWindow( filename ):
""" Open the supplied filename in the preview window """
vim.command( 'silent! pedit! ' + filename )
def WriteToPreviewWindow( message ):
""" Display the supplied message in the preview window """
# This isn't something that comes naturally to Vim. Vim only wants to show
# tags and/or actual files in the preview window, so we have to hack it a
# little bit. We generate a temporary file name and "open" that, then write
# the data to it. We make sure the buffer can't be edited or saved. Other
# approaches include simply opening a split, but we want to take advantage of
# the existing Vim options for preview window height, etc.
ClosePreviewWindow()
OpenFileInPreviewWindow( vim.eval( 'tempname()' ) )
if JumpToPreviewWindow():
# We actually got to the preview window. By default the preview window can't
# be changed, so we make it writable, write to it, then make it read only
# again.
vim.current.buffer.options[ 'modifiable' ] = True
vim.current.buffer.options[ 'readonly' ] = False
vim.current.buffer[:] = message.splitlines()
vim.current.buffer.options[ 'buftype' ] = 'nofile'
vim.current.buffer.options[ 'bufhidden' ] = 'wipe'
vim.current.buffer.options[ 'buflisted' ] = False
vim.current.buffer.options[ 'swapfile' ] = False
vim.current.buffer.options[ 'modifiable' ] = False
vim.current.buffer.options[ 'readonly' ] = True
# We need to prevent closing the window causing a warning about unsaved
# file, so we pretend to Vim that the buffer has not been changed.
vim.current.buffer.options[ 'modified' ] = False
JumpToPreviousWindow()
else:
# We couldn't get to the preview window, but we still want to give the user
# the information we have. The only remaining option is to echo to the
# status area.
PostVimMessage( message, warning = False )
def BufferIsVisibleForFilename( filename ):
"""Check if a buffer exists for a specific file."""
buffer_number = GetBufferNumberForFilename( filename, False )
return BufferIsVisible( buffer_number )
def CloseBuffersForFilename( filename ):
"""Close all buffers for a specific file."""
buffer_number = GetBufferNumberForFilename( filename, False )
while buffer_number != -1:
vim.command( 'silent! bwipeout! {0}'.format( buffer_number ) )
new_buffer_number = GetBufferNumberForFilename( filename, False )
if buffer_number == new_buffer_number:
raise RuntimeError( "Buffer {0} for filename '{1}' should already be "
"wiped out.".format( buffer_number, filename ) )
buffer_number = new_buffer_number
def OpenFilename( filename, options = {} ):
"""Open a file in Vim. Following options are available:
- command: specify which Vim command is used to open the file. Choices
are same-buffer, horizontal-split, vertical-split, and new-tab (default:
horizontal-split);
- size: set the height of the window for a horizontal split or the width for
a vertical one (default: '');
- fix: set the winfixheight option for a horizontal split or winfixwidth for
a vertical one (default: False). See :h winfix for details;
- focus: focus the opened file (default: False);
- watch: automatically watch for changes (default: False). This is useful
for logs;
- position: set the position where the file is opened (default: start).
Choices are start and end."""
# Set the options.
command = GetVimCommand( options.get( 'command', 'horizontal-split' ),
'horizontal-split' )
size = ( options.get( 'size', '' ) if command in [ 'split', 'vsplit' ] else
'' )
focus = options.get( 'focus', False )
# There is no command in Vim to return to the previous tab so we need to
# remember the current tab if needed.
if not focus and command == 'tabedit':
previous_tab = GetIntValue( 'tabpagenr()' )
else:
previous_tab = None
# Open the file.
try:
vim.command( '{0}{1} {2}'.format( size, command, filename ) )
# When the file we are trying to jump to has a swap file,
# Vim opens swap-exists-choices dialog and throws vim.error with E325 error,
# or KeyboardInterrupt after user selects one of the options which actually
# opens the file (Open read-only/Edit anyway).
except vim.error as e:
if 'E325' not in str( e ):
raise
# Otherwise, the user might have chosen Quit. This is detectable by the
# current file not being the target file
if filename != GetCurrentBufferFilepath():
return
except KeyboardInterrupt:
# Raised when the user selects "Abort" after swap-exists-choices
return
_SetUpLoadedBuffer( command,
filename,
options.get( 'fix', False ),
options.get( 'position', 'start' ),
options.get( 'watch', False ) )
# Vim automatically set the focus to the opened file so we need to get the
# focus back (if the focus option is disabled) when opening a new tab or
# window.
if not focus:
if command == 'tabedit':
JumpToTab( previous_tab )
if command in [ 'split', 'vsplit' ]:
JumpToPreviousWindow()
def _SetUpLoadedBuffer( command, filename, fix, position, watch ):
"""After opening a buffer, configure it according to the supplied options,
which are as defined by the OpenFilename method."""
if command == 'split':
vim.current.window.options[ 'winfixheight' ] = fix
if command == 'vsplit':
vim.current.window.options[ 'winfixwidth' ] = fix
if watch:
vim.current.buffer.options[ 'autoread' ] = True
vim.command( "exec 'au BufEnter <buffer> :silent! checktime {0}'"
.format( filename ) )
if position == 'end':
vim.command( 'silent! normal! Gzz' )
| Java |
<!-- resources/views/vendor/openpolice/nodes/2713-dept-page-calls-action.blade.php -->
<a class="btn btn-primary btn-lg"
href="/filing-your-police-complaint/{{ $d['deptRow']->dept_slug }}"
<?php /*
@if (in_array(substr($d['deptRow']->dept_slug, 0, 3), ['NY-', 'MA-', 'MD-', 'MN-', 'DC-']))
href="/filing-your-police-complaint/{{ $d['deptRow']->dept_slug }}"
@else
href="/join-beta-test/{{ $d['deptRow']->dept_slug }}"
@endif
*/ ?>
>File a Complaint or Compliment</a>
<div class="pT15 mT10"></div>
<style>
#node2707kids {
padding-top: 30px;
}
#blockWrap2710 {
margin-bottom: -20px;
}
</style> | Java |
<?php
Prado::Using('Application.Engine.*');
class CombinedView extends TPage
{
public $text;
public $tiroText;
public function onLoad()
{
global $ABS_PATH,$USERS_PREFIX;
$this->text = TextRecord::finder()->findByPk($_GET['id']);
$this->tiroText = new TiroText($ABS_PATH.'/'.$USERS_PREFIX.'/'.$this->User->Name.'/'.$this->text->dir_name);
// Display the text at the bottom.
$textDOM = new DomDocument;
$textDOM->loadXML($this->tiroText->getText());
$styleSheet = new DOMDocument;
$styleSheet->load('protected/Data/xsl/tiro2js_tree.xsl');
$proc = new XSLTProcessor;
$proc->importStyleSheet($styleSheet);
$this->LatinPreview->Controls->add($proc->transformToXML($textDOM));
}
}
?> | Java |
#if defined HAVE_CONFIG_H
#include "config.h"
#endif
#include <solver_core.hpp>
#include <triqs/operators/many_body_operator.hpp>
#include <triqs/hilbert_space/fundamental_operator_set.hpp>
#include <triqs/gfs.hpp>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <iomanip>
//#include <boost/mpi/communicator.hpp>
#include "triqs_cthyb_qmc.hpp"
using namespace std;
using namespace cthyb;
using triqs::utility::many_body_operator;
using triqs::utility::c;
using triqs::utility::c_dag;
using triqs::utility::n;
using namespace triqs::gfs;
using indices_type = triqs::utility::many_body_operator<double>::indices_t;
void ctqmc_triqs_run( bool rot_inv, bool leg_measure, bool hist, bool wrt_files, bool tot_not, /*boolean*/
int n_orbitals, int n_freq, int n_tau, int n_l, int n_cycles_, int cycle_length, int ntherm, int verbo, int seed, /*integer*/
double beta_, /*double*/
double *epsi, double *umat_ij, double *umat_ijkl, std::complex<double> *f_iw_ptr, std::complex<double> *g_iw_ptr, double *g_tau, double *gl, MPI_Fint *MPI_world_ptr ){ /*array pointers & simple pointers*/
cout.setf(ios::fixed); //cout.precision(17);
//Initialize Boost mpi environment
int rank;
boost::mpi::environment env;
//int rank = boost::mpi::communicator(MPI_Comm_f2c(*MPI_world_ptr), boost::mpi::comm_attach).rank();
{
boost::mpi::communicator c;
c << MPI_Comm_f2c( *MPI_world_ptr );
//auto c_ = MPI_Comm_f2c(*MPI_world_ptr);
//boost::mpi::communicator c = boost::mpi::communicator(MPI_Comm_f2c(*MPI_world_ptr), boost::mpi::comm_attach);
rank=c.rank();
//MPI_Comm_rank(MPI_Comm_f2c(*MPI_world_ptr), &rank);
}
// Parameters relay from Fortran and default values affectation
double beta = beta_; //Temperature inverse
int num_orbitals = n_orbitals;
//double U = U_; //Impurity site Interaction term
double mu = 0.0;//Chemical Potential Functionality avail but not used here
//bool n_n_only = !(rot_inv);//density-density?
int Nfreq = n_freq; //Number of Matsubara frequencies
int Ntau = n_tau; //Number of imaginary times
int Nl = n_l; //Number of Legendre measures 30
int n_cycles = n_cycles_;
int nspin = 2; //always it's Nature
//Print informations about the Solver Parameters
if(rank==0 && verbo>0){
std::cout << endl <<" == Key Input Parameters for the TRIQS CTHYB solver == "<<endl<<endl;
std::cout <<" Beta = "<< beta <<" [eV]^(-1) "<<endl;
std::cout <<" Mu = "<< mu <<" [eV]"<<endl;
std::cout <<" Nflavour = "<< num_orbitals <<endl;
std::cout <<" Nfreq = "<< Nfreq << endl;
std::cout <<" Ntau = "<< Ntau << endl;
std::cout <<" Nl = "<< Nl << endl;
std::cout <<" Ncycles = "<< n_cycles << endl;
std::cout <<" Cycle length = "<< cycle_length << endl;
std::cout <<" Ntherm = "<< ntherm << endl;
std::cout <<" Verbosity (0->3) = "<< verbo << endl;
std::cout <<" Abinit Seed = "<< seed << endl <<endl;
for(int o = 0; o < num_orbitals; ++o){
std::cout << " e- level["<< o+1 <<"] = "<< setprecision(17) << epsi[o] <<" [eV]"<< endl; //ed != cste => vecteur a parcourir ensuite
}
std::cout << endl;
std::cout <<" U(i,j) [eV] = " <<endl<< endl<<"\t";
for(int o = 0; o < num_orbitals; ++o){
for(int oo = 0; oo < num_orbitals; ++oo){
std::cout << setprecision(17) << fixed <<umat_ij[o+oo*num_orbitals] << "\t"; //ed != cste => vecteur a parcourir ensuite
}
std::cout << endl<<"\t";
}
}
// Hamiltonian definition
many_body_operator<double> H;
//Spin Orbit general case num_orbitals*2=Nflavour)
//Init Hamiltonian Basic terms
///H = init_Hamiltonian( epsi, num_orbitals, U, J ); // U=cste
if(!rot_inv){
if(rank==0 && verbo>0) std::cout <<endl<<" == Density-Density Terms Included == "<<endl<<endl;
H = init_Hamiltonian( epsi, num_orbitals, umat_ij );
//}else if(rank==0 && verbo>0) std::cout <<" == Rotationnaly Invariant Terms Not Included == "<< endl << endl;
//Include density-density term (J != 0) spin flips and pair hopping => density-density term case
}else{//if(rot_inv){
if(rank==0 && verbo>0)std::cout <<" == Rotationnaly Invariant Terms Included == "<< endl << endl;
if(tot_not){
H = init_fullHamiltonian( epsi, num_orbitals, umat_ijkl );
}else{ //up and down separation
H = init_fullHamiltonianUpDown( epsi, num_orbitals, umat_ijkl );
}
}//else if(rank==0 && verbo>0) std::cout <<endl<<" == Density-Density Terms Not Included == "<<endl<<endl;
std::map<std::string, indices_type> gf_struct;
if( tot_not ){
std::map<std::string, indices_type> gf_struct_tmp{{"tot",indices_type{}}};//{{"tot",indices_type{}}}; //{0,1}
for(int o = 0; o < num_orbitals; ++o){
gf_struct_tmp["tot"].push_back(o);
}
gf_struct = gf_struct_tmp;
}else{ //spin orb case: general case
std::map<std::string, indices_type> gf_struct_tmp{{"up",indices_type{}},{"down",indices_type{}}};
for(int o = 0; o < num_orbitals; ++o){
gf_struct_tmp["up"].push_back(o);
gf_struct_tmp["down"].push_back(o);
}
gf_struct = gf_struct_tmp;
}
if(rank==0 && verbo>0) std::cout <<" == Green Function Structure Initialized == "<< endl << endl;
// Construct CTQMC solver with mesh parameters
solver_core solver(beta, gf_struct, Nfreq, Ntau, Nl);
if(rank==0 && verbo>0) std::cout <<" == Solver Core Initialized == "<< endl << endl;
//Fill in "hybridation+eps"=F(iw)~Delta(iw) coming from fortran inside delta_iw term RHS
gf<imfreq> delta_iw = gf<imfreq>{{beta, Fermion, Nfreq}, {num_orbitals,num_orbitals}};
auto w_mesh = delta_iw.mesh();
ofstream delta_init; delta_init.open("delta_init_check"); // only on one rank !
if(rank==0){
delta_init << "# w_index l l' Im(iw) delta(iw)\n" << endl;
}
for(std::size_t w_index = 0; w_index < w_mesh.size(); ++w_index){
auto iw = w_mesh.index_to_point(w_index);
auto cell = delta_iw[w_index];
for(int o = 0; o < num_orbitals; ++o){
for(int oo = 0; oo < num_orbitals; ++oo){
cell(o,oo) = f_iw_ptr[o+oo*num_orbitals+w_index*num_orbitals*num_orbitals];
//cout <<"[IN C++]"<<" F[ w= "<< w_index <<" , l= "<< o <<" , l_= "<< oo <<" ] = "<< setprecision(15) << f_iw_ptr[o+oo*num_orbitals+w_index*num_orbitals*num_orbitals] << endl;
// if(o==oo){
//std::cout << w_index <<"\t"<< o <<"\t"<< oo <<"\t"<< imag(iw) <<"\t"<< setprecision(15) << f_iw_ptr[o+oo*num_orbitals+w_index*num_orbitals*num_orbitals] << endl;
// }
if(rank==0){
delta_init << w_index+1 <<"\t"<< o+1 <<"\t"<< oo+1 <<"\t"<< imag(iw) <<"\t"<< setprecision(17) << fixed << f_iw_ptr[o+oo*num_orbitals+w_index*num_orbitals*num_orbitals] << endl;
}
}
}
}
if(rank==0 && verbo>0) std::cout <<" == F(iw) Initialized == "<< endl << endl;
triqs::clef::placeholder<0> om_;
auto g0_iw = gf<imfreq>{{beta, Fermion, Nfreq}, {num_orbitals,num_orbitals}};
g0_iw(om_) << om_ + mu - delta_iw(om_); //calculate G0(iw)^-1 matrix
if(rank==0 && verbo>0) std::cout <<" == G0(iw)^-1 Initialized == "<< endl << endl;
if(tot_not){
solver.G0_iw()[0] = triqs::gfs::inverse( g0_iw ); //inverse G0(iw) matrix and affect to solver
}else{
for (int i = 0; i < nspin; ++i){
solver.G0_iw()[i] = triqs::gfs::inverse( g0_iw );
}
}
if(rank==0 && verbo>0) std::cout <<" == G0(iw)^-1 Inverted => G0(iw) Constructed == "<< endl << endl;
// if(rank==0){ //Output Test of none interacting G0
//
// ofstream G0_up, G0_down;
//
// G0_up.open("G0_up_non_interagissant");
// G0_up << "# w_index l l' Im(iw) Real(G0) Im(G0)\n" << endl;
//
//
// //Report G0_iw
// int compteur = 0;
// for(std::size_t w_index = 0; w_index < w_mesh.size(); ++w_index){
// auto iw = w_mesh.index_to_point(w_index);
// for(int oo = 0; oo < num_orbitals; ++oo){
// for(int o = 0; o < num_orbitals; ++o){
//
//
//
// G0_up << fixed << w_index <<"\t"<< o <<"\t"<< oo <<"\t"<< fixed<< imag(iw) <<"\t"<< real(solver.G0_iw()[0].data()(w_index,o,oo)) <<"\t"<< imag(solver.G0_iw()[0].data()(w_index,o,oo)) << endl;
// compteur++;
// }
// }
// }
// }
if(rank==0 && verbo>0) std::cout <<" == Solver Parametrization == "<< endl << endl;
// Solver parameters
auto paramCTQMC = solve_parameters_t(H, n_cycles);
paramCTQMC.max_time = -1;
paramCTQMC.random_name = "";
paramCTQMC.random_seed = 123 * rank + 567;//seed;
paramCTQMC.length_cycle = cycle_length;
paramCTQMC.n_warmup_cycles = ntherm;
paramCTQMC.verbosity=verbo;
paramCTQMC.measure_g_l = leg_measure;
//paramCTQMC.move_double = true;
// paramCTQMC.make_histograms=hist;
if(rank==0 && verbo>0) std::cout <<" == Starting Solver [node "<< rank <<"] == "<< endl << endl;
// Solve!
solver.solve(paramCTQMC);
if(rank==0 && verbo>0) std::cout <<" == Reporting == "<< endl << endl;
// Report some stuff
// if(rank==0){
// ofstream glegendre, g_iw;
// g_iw.open("g_iw");
//Report G_iw
int compteur = 0;
//g_iw << fixed << setprecision(17) << w_index << "\t";
for(int oo = 0; oo < num_orbitals; ++oo){
for(int o = 0; o < num_orbitals; ++o){
for(std::size_t w_index = 0; w_index < w_mesh.size(); ++w_index){ //Pour une frequence donnee
auto iw = w_mesh.index_to_point(w_index);
g_iw_ptr[compteur] = solver.G0_iw()[0].data()(w_index,o,oo);
//g_iw << fixed<< setprecision(17) << solver.G0_iw()[0].data()(w_index,o,oo);
compteur++;
}
}
//g_iw << endl;
}
//Report G_tau
compteur = 0;
for(int oo = 0; oo < num_orbitals; ++oo){
for(int o = 0; o < num_orbitals; ++o){
for(int tau = 0; tau < n_tau; ++tau){
g_tau[compteur]= solver.G_tau()[0].data()(tau,o,oo);
compteur++;
}
}
}
//Report G(l)
if( leg_measure ){
compteur = 0;
for(int oo = 0; oo < num_orbitals; ++oo){
for(int o = 0; o < num_orbitals; ++o){
for(int l = 0; l < n_l; ++l){
gl[compteur]= solver.G_l()[0].data()(l,o,oo);
compteur++;
}
}
}
}
//Write G(tau)
if( rank==0 && wrt_files ){
ofstream gtau;
gtau.open("Gtau_triqs.dat");
double _tau_=0.0;
for(int tau = 0; tau < n_tau; ++tau){
_tau_=((tau*beta)/n_tau)*27.2113845; //en Harthree
gtau << fixed << setprecision(17) <<_tau_ << "\t";
for(int o = 0; o < num_orbitals; ++o){
for(int oo = 0; oo < num_orbitals; ++oo){
gtau << fixed<< setprecision(17) << solver.G_tau()[0].data()(tau,o,oo) <<"\t";
}
}
gtau << endl;
}
ofstream g_iw;
g_iw.open("giw");
for(std::size_t w_index = 0; w_index < w_mesh.size(); ++w_index){
auto iw = w_mesh.index_to_point(w_index);
for(int o = 0; o < num_orbitals; ++o){
for(int oo = 0; oo < num_orbitals; ++oo){
g_iw << fixed << setprecision(17) << solver.G0_iw()[0].data()(w_index,o,oo);
}
}
g_iw << endl;
}
}
//Write U(i,j)
if( rank==0 && wrt_files ){
ofstream umat;
umat.open("umat");
for(int o = 0; o < num_orbitals; ++o){
for(int oo = 0; oo < num_orbitals; ++oo){
umat <<"U( "<< o+1 <<" , "<< oo+1 <<" )= "<< fixed << setprecision(17) << umat_ij[o+(oo*num_orbitals)] <<endl;
}
}
}
if( leg_measure && rank==0 && wrt_files ){
ofstream g_l;
g_l.open("gl");
for(int l = 0; l < n_l; ++l){
for(int o = 0; o < num_orbitals; ++o){
for(int oo = 0; oo < num_orbitals; ++oo){
g_l << fixed << setprecision(17) << solver.G_l()[0].data()(l,o,oo) <<"\t";
}
}
g_l << endl;
}
}
if(rank==0 && verbo>0) std::cout <<" == CTHYB-QMC Process Finished [node "<< rank <<"] == "<< endl << endl;
}
/********************************************************/
/****************** Functions Used **********************/
/********************************************************/
// Hamiltonian Initialization with precalculate coeff (J=0 and U(i,j))
many_body_operator<double> init_Hamiltonian( double *eps, int nflavor, double *U){
many_body_operator<double> H; double coeff;
for(int i = 0; i < nflavor; ++i)
for(int j = 0; j < nflavor; ++j){
//cas diago principale:
if(i==j){
H += eps[i] * n("tot",i) ;
}
else{
coeff = double(U[i+j*nflavor])*0.5;
//cout << "U = "<< U[i+j*nflavor] <<" /2 = "<< coeff <<endl;
H += coeff * n("tot",i) * n("tot",j);
}
}
return H;
}
// Hamiltonian Initialization with precalculated coeff U(i,j,k,l) in "tot" notation
many_body_operator<double> init_fullHamiltonian( double *eps, int nflavor, double *U){
many_body_operator<double> H; double coeff;
for(int i = 0; i < nflavor; ++i)
for(int j = 0; j < nflavor; ++j){
if(i==j){
H += eps[i] * n("tot",i) ; //Levels On diagonal Hamiltonian Matrix
}
for(int k = 0; k < nflavor; ++k)
for(int l = 0; l < nflavor; ++l){
//cas diago principale:
coeff = 0.5 * double( U[i+j*nflavor+k*nflavor*nflavor+l*nflavor*nflavor*nflavor] );
H += coeff * c_dag("tot",i)*c_dag("tot",j)*c("tot",l)*c("tot",k); //changing l <-> k order index to be in accordance with the Abinit definition
}
}
return H;
}
// Hamiltonian Initialization with precalculated coeff U(i,j,k,l) in "up" and "down" notation
many_body_operator<double> init_fullHamiltonianUpDown( double *eps, int nflavor, double *U ){
many_body_operator<double> H; double coeff;
for(int i = 0; i < nflavor; ++i)
for(int j = 0; j < nflavor; ++j){
if(i==j){
H += eps[i] * ( n("up",i) + n("down",i) ); //Levels On diagonal Hamiltonian Matrix
}
for(int k = 0; k < nflavor; ++k)
for(int l = 0; l < nflavor; ++l){
coeff = 0.5 * double(U[i+j*nflavor+k*nflavor*nflavor+l*nflavor*nflavor*nflavor]);
// for(int s = 0; s < nspin; ++s)
// for(int s1 = 0; s1 < nspin; ++s1){
H += coeff * c_dag("up",i) * c_dag("down",j) * c("up",l) * c("down",k);
H += coeff * c_dag("down",i) * c_dag("up",j) * c("down",l) * c("up",k);
// }
}
}
return H;
}
| Java |
#!/usr/bin/env python3
import os
import logging
import tempfile
import shutil
from graftm.sequence_search_results import SequenceSearchResult
from graftm.graftm_output_paths import GraftMFiles
from graftm.search_table import SearchTableWriter
from graftm.sequence_searcher import SequenceSearcher
from graftm.hmmsearcher import NoInputSequencesException
from graftm.housekeeping import HouseKeeping
from graftm.summarise import Stats_And_Summary
from graftm.pplacer import Pplacer
from graftm.create import Create
from graftm.update import Update
from graftm.unpack_sequences import UnpackRawReads
from graftm.graftm_package import GraftMPackage
from graftm.expand_searcher import ExpandSearcher
from graftm.diamond import Diamond
from graftm.getaxnseq import Getaxnseq
from graftm.sequence_io import SequenceIO
from graftm.timeit import Timer
from graftm.clusterer import Clusterer
from graftm.decorator import Decorator
from graftm.external_program_suite import ExternalProgramSuite
from graftm.archive import Archive
from graftm.decoy_filter import DecoyFilter
from biom.util import biom_open
T=Timer()
class UnrecognisedSuffixError(Exception):
pass
class Run:
PIPELINE_AA = "P"
PIPELINE_NT = "D"
_MIN_VERBOSITY_FOR_ART = 3 # with 2 then, only errors are printed
PPLACER_TAXONOMIC_ASSIGNMENT = 'pplacer'
DIAMOND_TAXONOMIC_ASSIGNMENT = 'diamond'
MIN_ALIGNED_FILTER_FOR_NUCLEOTIDE_PACKAGES = 95
MIN_ALIGNED_FILTER_FOR_AMINO_ACID_PACKAGES = 30
DEFAULT_MAX_SAMPLES_FOR_KRONA = 100
NO_ORFS_EXITSTATUS = 128
def __init__(self, args):
self.args = args
self.setattributes(self.args)
def setattributes(self, args):
self.hk = HouseKeeping()
self.s = Stats_And_Summary()
if args.subparser_name == 'graft':
commands = ExternalProgramSuite(['orfm', 'nhmmer', 'hmmsearch',
'mfqe', 'pplacer',
'ktImportText', 'diamond'])
self.hk.set_attributes(self.args)
self.hk.set_euk_hmm(self.args)
if args.euk_check:self.args.search_hmm_files.append(self.args.euk_hmm_file)
self.ss = SequenceSearcher(self.args.search_hmm_files,
(None if self.args.search_only else self.args.aln_hmm_file))
self.sequence_pair_list = self.hk.parameter_checks(args)
if hasattr(args, 'reference_package'):
self.p = Pplacer(self.args.reference_package)
elif self.args.subparser_name == "create":
commands = ExternalProgramSuite(['taxit', 'FastTreeMP',
'hmmalign', 'mafft'])
self.create = Create(commands)
def summarise(self, base_list, trusted_placements, reverse_pipe, times,
hit_read_count_list, max_samples_for_krona):
'''
summarise - write summary information to file, including otu table, biom
file, krona plot, and timing information
Parameters
----------
base_list : array
list of each of the files processed by graftm, with the path and
and suffixed removed
trusted_placements : dict
dictionary of placements with entry as the key, a taxonomy string
as the value
reverse_pipe : bool
True = run reverse pipe, False = run normal pipeline
times : array
list of the recorded times for each step in the pipeline in the
format: [search_step_time, alignment_step_time, placement_step_time]
hit_read_count_list : array
list containing sublists, one for each file run through the GraftM
pipeline, each two entries, the first being the number of putative
eukaryotic reads (when searching 16S), the second being the number
of hits aligned and placed in the tree.
max_samples_for_krona: int
If the number of files processed is greater than this number, then
do not generate a krona diagram.
Returns
-------
'''
# Summary steps.
placements_list = []
for base in base_list:
# First assign the hash that contains all of the trusted placements
# to a variable to it can be passed to otu_builder, to be written
# to a file. :)
placements = trusted_placements[base]
self.s.readTax(placements, GraftMFiles(base, self.args.output_directory, False).read_tax_output_path(base))
placements_list.append(placements)
#Generate coverage table
#logging.info('Building coverage table for %s' % base)
#self.s.coverage_of_hmm(self.args.aln_hmm_file,
# self.gmf.summary_table_output_path(base),
# self.gmf.coverage_table_path(base),
# summary_dict[base]['read_length'])
logging.info('Writing summary table')
with open(self.gmf.combined_summary_table_output_path(), 'w') as f:
self.s.write_tabular_otu_table(base_list, placements_list, f)
logging.info('Writing biom file')
with biom_open(self.gmf.combined_biom_output_path(), 'w') as f:
biom_successful = self.s.write_biom(base_list, placements_list, f)
if not biom_successful:
os.remove(self.gmf.combined_biom_output_path())
logging.info('Building summary krona plot')
if len(base_list) > max_samples_for_krona:
logging.warn("Skipping creation of Krona diagram since there are too many input files. The maximum can be overridden using --max_samples_for_krona")
else:
self.s.write_krona_plot(base_list, placements_list, self.gmf.krona_output_path())
# Basic statistics
placed_reads=[len(trusted_placements[base]) for base in base_list]
self.s.build_basic_statistics(times, hit_read_count_list, placed_reads, \
base_list, self.gmf.basic_stats_path())
# Delete unnecessary files
logging.info('Cleaning up')
for base in base_list:
directions = ['forward', 'reverse']
if reverse_pipe:
for i in range(0,2):
self.gmf = GraftMFiles(base, self.args.output_directory, directions[i])
self.hk.delete([self.gmf.for_aln_path(base),
self.gmf.rev_aln_path(base),
self.gmf.conv_output_rev_path(base),
self.gmf.conv_output_for_path(base),
self.gmf.euk_free_path(base),
self.gmf.euk_contam_path(base),
self.gmf.readnames_output_path(base),
self.gmf.sto_output_path(base),
self.gmf.orf_titles_output_path(base),
self.gmf.orf_output_path(base),
self.gmf.output_for_path(base),
self.gmf.output_rev_path(base)])
else:
self.gmf = GraftMFiles(base, self.args.output_directory, False)
self.hk.delete([self.gmf.for_aln_path(base),
self.gmf.rev_aln_path(base),
self.gmf.conv_output_rev_path(base),
self.gmf.conv_output_for_path(base),
self.gmf.euk_free_path(base),
self.gmf.euk_contam_path(base),
self.gmf.readnames_output_path(base),
self.gmf.sto_output_path(base),
self.gmf.orf_titles_output_path(base),
self.gmf.orf_output_path(base),
self.gmf.output_for_path(base),
self.gmf.output_rev_path(base)])
logging.info('Done, thanks for using graftM!\n')
def graft(self):
# The Graft pipeline:
# Searches for reads using hmmer, and places them in phylogenetic
# trees to derive a community structure.
if self.args.graftm_package:
gpkg = GraftMPackage.acquire(self.args.graftm_package)
else:
gpkg = None
REVERSE_PIPE = (True if self.args.reverse else False)
INTERLEAVED = (True if self.args.interleaved else False)
base_list = []
seqs_list = []
search_results = []
hit_read_count_list = []
db_search_results = []
if gpkg:
maximum_range = gpkg.maximum_range()
if self.args.search_diamond_file:
self.args.search_method = self.hk.DIAMOND_SEARCH_METHOD
diamond_db = self.args.search_diamond_file[0]
else:
diamond_db = gpkg.diamond_database_path()
if self.args.search_method == self.hk.DIAMOND_SEARCH_METHOD:
if not diamond_db:
logging.error("%s search method selected, but no diamond database specified. \
Please either provide a gpkg to the --graftm_package flag, or a diamond \
database to the --search_diamond_file flag." % self.args.search_method)
raise Exception()
else:
# Get the maximum range, if none exists, make one from the HMM profile
if self.args.maximum_range:
maximum_range = self.args.maximum_range
else:
if self.args.search_method==self.hk.HMMSEARCH_SEARCH_METHOD:
if not self.args.search_only:
maximum_range = self.hk.get_maximum_range(self.args.aln_hmm_file)
else:
logging.debug("Running search only pipeline. maximum_range not configured.")
maximum_range = None
else:
logging.warning('Cannot determine maximum range when using %s pipeline and with no GraftM package specified' % self.args.search_method)
logging.warning('Setting maximum_range to None (linked hits will not be detected)')
maximum_range = None
if self.args.search_diamond_file:
diamond_db = self.args.search_diamond_file
else:
if self.args.search_method == self.hk.HMMSEARCH_SEARCH_METHOD:
diamond_db = None
else:
logging.error("%s search method selected, but no gpkg or diamond database selected" % self.args.search_method)
if self.args.assignment_method == Run.DIAMOND_TAXONOMIC_ASSIGNMENT:
if self.args.reverse:
logging.warn("--reverse reads specified with --assignment_method diamond. Reverse reads will be ignored.")
self.args.reverse = None
# If merge reads is specified, check that there are reverse reads to merge with
if self.args.merge_reads and not hasattr(self.args, 'reverse'):
raise Exception("Programming error")
# Set the output directory if not specified and create that directory
logging.debug('Creating working directory: %s' % self.args.output_directory)
self.hk.make_working_directory(self.args.output_directory,
self.args.force)
# Set pipeline and evalue by checking HMM format
if self.args.search_only:
if self.args.search_method == self.hk.HMMSEARCH_SEARCH_METHOD:
hmm_type, hmm_tc = self.hk.setpipe(self.args.search_hmm_files[0])
logging.debug("HMM type: %s Trusted Cutoff: %s" % (hmm_type, hmm_tc))
else:
hmm_type, hmm_tc = self.hk.setpipe(self.args.aln_hmm_file)
logging.debug("HMM type: %s Trusted Cutoff: %s" % (hmm_type, hmm_tc))
if self.args.search_method == self.hk.HMMSEARCH_SEARCH_METHOD:
setattr(self.args, 'type', hmm_type)
if hmm_tc:
setattr(self.args, 'evalue', '--cut_tc')
else:
setattr(self.args, 'type', self.PIPELINE_AA)
if self.args.filter_minimum is not None:
filter_minimum = self.args.filter_minimum
else:
if self.args.type == self.PIPELINE_NT:
filter_minimum = Run.MIN_ALIGNED_FILTER_FOR_NUCLEOTIDE_PACKAGES
else:
filter_minimum = Run.MIN_ALIGNED_FILTER_FOR_AMINO_ACID_PACKAGES
# Generate expand_search database if required
if self.args.expand_search_contigs:
if self.args.graftm_package:
pkg = GraftMPackage.acquire(self.args.graftm_package)
else:
pkg = None
boots = ExpandSearcher(
search_hmm_files = self.args.search_hmm_files,
maximum_range = self.args.maximum_range,
threads = self.args.threads,
evalue = self.args.evalue,
min_orf_length = self.args.min_orf_length,
graftm_package = pkg)
# this is a hack, it should really use GraftMFiles but that class isn't currently flexible enough
new_database = (os.path.join(self.args.output_directory, "expand_search.hmm") \
if self.args.search_method == self.hk.HMMSEARCH_SEARCH_METHOD \
else os.path.join(self.args.output_directory, "expand_search")
)
if boots.generate_expand_search_database_from_contigs(
self.args.expand_search_contigs,
new_database,
self.args.search_method):
if self.args.search_method == self.hk.HMMSEARCH_SEARCH_METHOD:
self.ss.search_hmm.append(new_database)
else:
diamond_db = new_database
first_search_method = self.args.search_method
if self.args.decoy_database:
decoy_filter = DecoyFilter(Diamond(diamond_db, threads=self.args.threads),
Diamond(self.args.decoy_database,
threads=self.args.threads))
doing_decoy_search = True
elif self.args.search_method == self.hk.HMMSEARCH_AND_DIAMOND_SEARCH_METHOD:
decoy_filter = DecoyFilter(Diamond(diamond_db, threads=self.args.threads))
doing_decoy_search = True
first_search_method = self.hk.HMMSEARCH_SEARCH_METHOD
else:
doing_decoy_search = False
# For each pair (or single file passed to GraftM)
logging.debug('Working with %i file(s)' % len(self.sequence_pair_list))
for pair in self.sequence_pair_list:
# Guess the sequence file type, if not already specified to GraftM
unpack = UnpackRawReads(pair[0],
self.args.input_sequence_type,
INTERLEAVED)
# Set the basename, and make an entry to the summary table.
base = unpack.basename()
pair_direction = ['forward', 'reverse']
logging.info("Working on %s" % base)
# Make the working base subdirectory
self.hk.make_working_directory(os.path.join(self.args.output_directory,
base),
self.args.force)
# for each of the paired end read files
for read_file in pair:
unpack = UnpackRawReads(read_file,
self.args.input_sequence_type,
INTERLEAVED)
if read_file is None:
# placeholder for interleaved (second file is None)
continue
if not os.path.isfile(read_file): # Check file exists
logging.info('%s does not exist! Skipping this file..' % read_file)
continue
# Set the output file_name
if len(pair) == 2:
direction = 'interleaved' if pair[1] is None \
else pair_direction.pop(0)
logging.info("Working on %s reads" % direction)
self.gmf = GraftMFiles(base,
self.args.output_directory,
direction)
self.hk.make_working_directory(os.path.join(self.args.output_directory,
base,
direction),
self.args.force)
else:
direction = False
self.gmf = GraftMFiles(base,
self.args.output_directory,
direction)
if self.args.type == self.PIPELINE_AA:
logging.debug("Running protein pipeline")
try:
search_time, (result, complement_information) = self.ss.aa_db_search(
self.gmf,
base,
unpack,
first_search_method,
maximum_range,
self.args.threads,
self.args.evalue,
self.args.min_orf_length,
self.args.restrict_read_length,
diamond_db
)
except NoInputSequencesException as e:
logging.error("No sufficiently long open reading frames were found, indicating"
" either the input sequences are too short or the min orf length"
" cutoff is too high. Cannot continue sorry. Alternatively, there"
" is something amiss with the installation of OrfM. The specific"
" command that failed was: %s" % e.command)
exit(Run.NO_ORFS_EXITSTATUS)
# Or the DNA pipeline
elif self.args.type == self.PIPELINE_NT:
logging.debug("Running nucleotide pipeline")
search_time, (result, complement_information) = self.ss.nt_db_search(
self.gmf,
base,
unpack,
self.args.euk_check,
self.args.search_method,
maximum_range,
self.args.threads,
self.args.evalue
)
reads_detected = True
if not result.hit_fasta() or os.path.getsize(result.hit_fasta()) == 0:
logging.info('No reads found in %s' % base)
reads_detected = False
if self.args.search_only:
db_search_results.append(result)
base_list.append(base)
continue
# Filter out decoys if specified
if reads_detected and doing_decoy_search:
with tempfile.NamedTemporaryFile(prefix="graftm_decoy", suffix='.fa') as f:
tmpname = f.name
any_remaining = decoy_filter.filter(result.hit_fasta(),
tmpname)
if any_remaining:
shutil.move(tmpname, result.hit_fasta())
else:
# No hits remain after decoy filtering.
os.remove(result.hit_fasta())
continue
if self.args.assignment_method == Run.PPLACER_TAXONOMIC_ASSIGNMENT:
logging.info('aligning reads to reference package database')
hit_aligned_reads = self.gmf.aligned_fasta_output_path(base)
if reads_detected:
aln_time, aln_result = self.ss.align(
result.hit_fasta(),
hit_aligned_reads,
complement_information,
self.args.type,
filter_minimum
)
else:
aln_time = 'n/a'
if not os.path.exists(hit_aligned_reads): # If all were filtered out, or there just was none..
with open(hit_aligned_reads,'w') as f:
pass # just touch the file, nothing else
seqs_list.append(hit_aligned_reads)
db_search_results.append(result)
base_list.append(base)
search_results.append(result.search_result)
hit_read_count_list.append(result.hit_count)
# Write summary table
srchtw = SearchTableWriter()
srchtw.build_search_otu_table([x.search_objects for x in db_search_results],
base_list,
self.gmf.search_otu_table())
if self.args.search_only:
logging.info('Stopping before alignment and taxonomic assignment phase\n')
exit(0)
if self.args.merge_reads: # not run when diamond is the assignment mode- enforced by argparse grokking
logging.debug("Running merge reads output")
if self.args.interleaved:
fwd_seqs = seqs_list
rev_seqs = []
else:
base_list=base_list[0::2]
fwd_seqs = seqs_list[0::2]
rev_seqs = seqs_list[1::2]
merged_output=[GraftMFiles(base, self.args.output_directory, False).aligned_fasta_output_path(base) \
for base in base_list]
logging.debug("merged reads to %s", merged_output)
self.ss.merge_forev_aln(fwd_seqs, rev_seqs, merged_output)
seqs_list=merged_output
REVERSE_PIPE = False
elif REVERSE_PIPE:
base_list=base_list[0::2]
# Leave the pipeline if search only was specified
if self.args.search_and_align_only:
logging.info('Stopping before taxonomic assignment phase\n')
exit(0)
elif not any(base_list):
logging.error('No hits in any of the provided files. Cannot continue with no reads to assign taxonomy to.\n')
exit(0)
self.gmf = GraftMFiles('',
self.args.output_directory,
False)
if self.args.assignment_method == Run.PPLACER_TAXONOMIC_ASSIGNMENT:
clusterer=Clusterer()
# Classification steps
seqs_list=clusterer.cluster(seqs_list, REVERSE_PIPE)
logging.info("Placing reads into phylogenetic tree")
taxonomic_assignment_time, assignments=self.p.place(REVERSE_PIPE,
seqs_list,
self.args.resolve_placements,
self.gmf,
self.args,
result.slash_endings,
gpkg.taxtastic_taxonomy_path(),
clusterer)
assignments = clusterer.uncluster_annotations(assignments, REVERSE_PIPE)
elif self.args.assignment_method == Run.DIAMOND_TAXONOMIC_ASSIGNMENT:
logging.info("Assigning taxonomy with diamond")
taxonomic_assignment_time, assignments = self._assign_taxonomy_with_diamond(\
base_list,
db_search_results,
gpkg,
self.gmf)
aln_time = 'n/a'
else: raise Exception("Unexpected assignment method encountered: %s" % self.args.placement_method)
self.summarise(base_list, assignments, REVERSE_PIPE,
[search_time, aln_time, taxonomic_assignment_time],
hit_read_count_list, self.args.max_samples_for_krona)
@T.timeit
def _assign_taxonomy_with_diamond(self, base_list, db_search_results,
graftm_package, graftm_files):
'''Run diamond to assign taxonomy
Parameters
----------
base_list: list of str
list of sequence block names
db_search_results: list of DBSearchResult
the result of running hmmsearches
graftm_package: GraftMPackage object
Diamond is run against this database
graftm_files: GraftMFiles object
Result files are written here
Returns
-------
list of
1. time taken for assignment
2. assignments i.e. dict of base_list entry to dict of read names to
to taxonomies, or None if there was no hit detected.
'''
runner = Diamond(graftm_package.diamond_database_path(),
self.args.threads,
self.args.evalue)
taxonomy_definition = Getaxnseq().read_taxtastic_taxonomy_and_seqinfo\
(open(graftm_package.taxtastic_taxonomy_path()),
open(graftm_package.taxtastic_seqinfo_path()))
results = {}
# For each of the search results,
for i, search_result in enumerate(db_search_results):
if search_result.hit_fasta() is None:
sequence_id_to_taxonomy = {}
else:
sequence_id_to_hit = {}
# Run diamond
logging.debug("Running diamond on %s" % search_result.hit_fasta())
diamond_result = runner.run(search_result.hit_fasta(),
UnpackRawReads.PROTEIN_SEQUENCE_TYPE,
daa_file_basename=graftm_files.diamond_assignment_output_basename(base_list[i]))
for res in diamond_result.each([SequenceSearchResult.QUERY_ID_FIELD,
SequenceSearchResult.HIT_ID_FIELD]):
if res[0] in sequence_id_to_hit:
# do not accept duplicates
if sequence_id_to_hit[res[0]] != res[1]:
raise Exception("Diamond unexpectedly gave two hits for a single query sequence for %s" % res[0])
else:
sequence_id_to_hit[res[0]] = res[1]
# Extract taxonomy of the best hit, and add in the no hits
sequence_id_to_taxonomy = {}
for seqio in SequenceIO().read_fasta_file(search_result.hit_fasta()):
name = seqio.name
if name in sequence_id_to_hit:
# Add Root; to be in line with pplacer assignment method
sequence_id_to_taxonomy[name] = ['Root']+taxonomy_definition[sequence_id_to_hit[name]]
else:
# picked up in the initial search (by hmmsearch, say), but diamond misses it
sequence_id_to_taxonomy[name] = ['Root']
results[base_list[i]] = sequence_id_to_taxonomy
return results
def main(self):
if self.args.subparser_name == 'graft':
if self.args.verbosity >= self._MIN_VERBOSITY_FOR_ART: print('''
GRAFT
Joel Boyd, Ben Woodcroft
__/__
______|
_- - _ ________| |_____/
- - - | |____/_
- _ >>>> - >>>> ____|
- _- - - | ______
- _ |_____|
- |______
''')
self.graft()
elif self.args.subparser_name == 'create':
if self.args.verbosity >= self._MIN_VERBOSITY_FOR_ART: print('''
CREATE
Joel Boyd, Ben Woodcroft
/
>a /
------------- /
>b | |
-------- >>> | GPKG |
>c |________|
----------
''')
if self.args.dereplication_level < 0:
logging.error("Invalid dereplication level selected! please enter a positive integer")
exit(1)
else:
if not self.args.sequences:
if not self.args.alignment and not self.args.rerooted_annotated_tree \
and not self.args.rerooted_tree:
logging.error("Some sort of sequence data must be provided to run graftM create")
exit(1)
if self.args.taxonomy:
if self.args.rerooted_annotated_tree:
logging.error("--taxonomy is incompatible with --rerooted_annotated_tree")
exit(1)
if self.args.taxtastic_taxonomy or self.args.taxtastic_seqinfo:
logging.error("--taxtastic_taxonomy and --taxtastic_seqinfo are incompatible with --taxonomy")
exit(1)
elif self.args.rerooted_annotated_tree:
if self.args.taxtastic_taxonomy or self.args.taxtastic_seqinfo:
logging.error("--taxtastic_taxonomy and --taxtastic_seqinfo are incompatible with --rerooted_annotated_tree")
exit(1)
else:
if not self.args.taxtastic_taxonomy or not self.args.taxtastic_seqinfo:
logging.error("--taxonomy, --rerooted_annotated_tree or --taxtastic_taxonomy/--taxtastic_seqinfo is required")
exit(1)
if bool(self.args.taxtastic_taxonomy) ^ bool(self.args.taxtastic_seqinfo):
logging.error("Both or neither of --taxtastic_taxonomy and --taxtastic_seqinfo must be defined")
exit(1)
if self.args.alignment and self.args.hmm:
logging.warn("Using both --alignment and --hmm is rarely useful, but proceding on the assumption you understand.")
if len([_f for _f in [self.args.rerooted_tree,
self.args.rerooted_annotated_tree,
self.args.tree] if _f]) > 1:
logging.error("Only 1 input tree can be specified")
exit(1)
self.create.main(
dereplication_level = self.args.dereplication_level,
sequences = self.args.sequences,
alignment = self.args.alignment,
taxonomy = self.args.taxonomy,
rerooted_tree = self.args.rerooted_tree,
unrooted_tree = self.args.tree,
tree_log = self.args.tree_log,
prefix = self.args.output,
rerooted_annotated_tree = self.args.rerooted_annotated_tree,
min_aligned_percent = float(self.args.min_aligned_percent)/100,
taxtastic_taxonomy = self.args.taxtastic_taxonomy,
taxtastic_seqinfo = self.args.taxtastic_seqinfo,
hmm = self.args.hmm,
search_hmm_files = self.args.search_hmm_files,
force = self.args.force,
threads = self.args.threads
)
elif self.args.subparser_name == 'update':
logging.info("GraftM package %s specified to update with sequences in %s" % (self.args.graftm_package, self.args.sequences))
if self.args.regenerate_diamond_db:
gpkg = GraftMPackage.acquire(self.args.graftm_package)
logging.info("Regenerating diamond DB..")
gpkg.create_diamond_db()
logging.info("Diamond database regenerated.")
return
elif not self.args.sequences:
logging.error("--sequences is required unless regenerating the diamond DB")
exit(1)
if not self.args.output:
if self.args.graftm_package.endswith(".gpkg"):
self.args.output = self.args.graftm_package.replace(".gpkg", "-updated.gpkg")
else:
self.args.output = self.args.graftm_package + '-update.gpkg'
Update(ExternalProgramSuite(
['taxit', 'FastTreeMP', 'hmmalign', 'mafft'])).update(
input_sequence_path=self.args.sequences,
input_taxonomy_path=self.args.taxonomy,
input_graftm_package_path=self.args.graftm_package,
output_graftm_package_path=self.args.output)
elif self.args.subparser_name == 'expand_search':
args = self.args
if not args.graftm_package and not args.search_hmm_files:
logging.error("expand_search mode requires either --graftm_package or --search_hmm_files")
exit(1)
if args.graftm_package:
pkg = GraftMPackage.acquire(args.graftm_package)
else:
pkg = None
expandsearcher = ExpandSearcher(search_hmm_files = args.search_hmm_files,
maximum_range = args.maximum_range,
threads = args.threads,
evalue = args.evalue,
min_orf_length = args.min_orf_length,
graftm_package = pkg)
expandsearcher.generate_expand_search_database_from_contigs(args.contigs,
args.output_hmm,
search_method=ExpandSearcher.HMM_SEARCH_METHOD)
elif self.args.subparser_name == 'tree':
if self.args.graftm_package:
# shim in the paths from the graftm package, not overwriting
# any of the provided paths.
gpkg = GraftMPackage.acquire(self.args.graftm_package)
if not self.args.rooted_tree: self.args.rooted_tree = gpkg.reference_package_tree_path()
if not self.args.input_greengenes_taxonomy:
if not self.args.input_taxtastic_seqinfo:
self.args.input_taxtastic_seqinfo = gpkg.taxtastic_seqinfo_path()
if not self.args.input_taxtastic_taxonomy:
self.args.input_taxtastic_taxonomy = gpkg.taxtastic_taxonomy_path()
if self.args.rooted_tree:
if self.args.unrooted_tree:
logging.error("Both a rooted tree and an un-rooted tree were provided, so it's unclear what you are asking GraftM to do. \
If you're unsure see graftM tree -h")
exit(1)
elif self.args.reference_tree:
logging.error("Both a rooted tree and reference tree were provided, so it's unclear what you are asking GraftM to do. \
If you're unsure see graftM tree -h")
exit(1)
if not self.args.decorate:
logging.error("It seems a rooted tree has been provided, but --decorate has not been specified so it is unclear what you are asking graftM to do.")
exit(1)
dec = Decorator(tree_path = self.args.rooted_tree)
elif self.args.unrooted_tree and self.args.reference_tree:
logging.debug("Using provided reference tree %s to reroot %s" % (self.args.reference_tree,
self.args.unrooted_tree))
dec = Decorator(reference_tree_path = self.args.reference_tree,
tree_path = self.args.unrooted_tree)
else:
logging.error("Some tree(s) must be provided, either a rooted tree or both an unrooted tree and a reference tree")
exit(1)
if self.args.output_taxonomy is None and self.args.output_tree is None:
logging.error("Either an output tree or taxonomy must be provided")
exit(1)
if self.args.input_greengenes_taxonomy:
if self.args.input_taxtastic_seqinfo or self.args.input_taxtastic_taxonomy:
logging.error("Both taxtastic and greengenes taxonomy were provided, so its unclear what taxonomy you want graftM to decorate with")
exit(1)
logging.debug("Using input GreenGenes style taxonomy file")
dec.main(self.args.input_greengenes_taxonomy,
self.args.output_tree, self.args.output_taxonomy,
self.args.no_unique_tax, self.args.decorate, None)
elif self.args.input_taxtastic_seqinfo and self.args.input_taxtastic_taxonomy:
logging.debug("Using input taxtastic style taxonomy/seqinfo")
dec.main(self.args.input_taxtastic_taxonomy, self.args.output_tree,
self.args.output_taxonomy, self.args.no_unique_tax,
self.args.decorate, self.args.input_taxtastic_seqinfo)
else:
logging.error("Either a taxtastic taxonomy or seqinfo file was provided. GraftM cannot continue without both.")
exit(1)
elif self.args.subparser_name == 'archive':
# Back slashes in the ASCII art are escaped.
if self.args.verbosity >= self._MIN_VERBOSITY_FOR_ART: print("""
ARCHIVE
Joel Boyd, Ben Woodcroft
____.----.
____.----' \\
\\ \\
\\ \\
\\ \\
\\ ____.----'`--.__
\\___.----' | `--.____
/`-._ | __.-' \\
/ `-._ ___.---' \\
/ `-.____.---' \\ +------+
/ / | \\ \\ |`. |`.
/ / | \\ _.--' <===> | `+--+---+
`-. / | \\ __.--' | | | |
`-._ / | \\ __.--' | | | | |
| `-./ | \\_.-' | +---+--+ |
| | | `. | `. |
| | | `+------+
| | |
| | |
| | |
| | |
| | |
`-. | _.-'
`-. | __..--'
`-. | __.-'
`-|__.--'
""")
if self.args.create:
if self.args.extract:
logging.error("Please specify whether to either create or export a GraftM package")
exit(1)
if not self.args.graftm_package:
logging.error("Creating a GraftM package archive requires an package to be specified")
exit(1)
if not self.args.archive:
logging.error("Creating a GraftM package archive requires an output archive path to be specified")
exit(1)
archive = Archive()
archive.create(self.args.graftm_package, self.args.archive,
force=self.args.force)
elif self.args.extract:
archive = Archive()
archive.extract(self.args.archive, self.args.graftm_package,
force=self.args.force)
else:
logging.error("Please specify whether to either create or export a GraftM package")
exit(1)
else:
raise Exception("Unexpected subparser name %s" % self.args.subparser_name)
| Java |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package block_fn_marking
* @copyright Michael Gardener <mgardener@cissq.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$capabilities = array(
'block/fn_marking:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/my:manageblocks'
),
'block/fn_marking:addinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:manageblocks'
),
'block/fn_marking:viewblock' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'user' => CAP_PREVENT,
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'block/fn_marking:viewreadonly' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'user' => CAP_PREVENT,
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
)
); | Java |
// Search script generated by doxygen
// Copyright (C) 2009 by Dimitri van Heesch.
// The code in this file is loosly based on main.js, part of Natural Docs,
// which is Copyright (C) 2003-2008 Greg Valure
// Natural Docs is licensed under the GPL.
var indexSectionsWithContent =
{
0: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111001110111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
1: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011010000001010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
2: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111100010001110111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
3: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111001110111101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
4: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101111111001110111110111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
5: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010010000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
6: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011110000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
7: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
};
var indexSectionNames =
{
0: "all",
1: "classes",
2: "files",
3: "functions",
4: "variables",
5: "typedefs",
6: "defines",
7: "pages"
};
function convertToId(search)
{
var result = '';
for (i=0;i<search.length;i++)
{
var c = search.charAt(i);
var cn = c.charCodeAt(0);
if (c.match(/[a-z0-9]/))
{
result+=c;
}
else if (cn<16)
{
result+="_0"+cn.toString(16);
}
else
{
result+="_"+cn.toString(16);
}
}
return result;
}
function getXPos(item)
{
var x = 0;
if (item.offsetWidth)
{
while (item && item!=document.body)
{
x += item.offsetLeft;
item = item.offsetParent;
}
}
return x;
}
function getYPos(item)
{
var y = 0;
if (item.offsetWidth)
{
while (item && item!=document.body)
{
y += item.offsetTop;
item = item.offsetParent;
}
}
return y;
}
/* A class handling everything associated with the search panel.
Parameters:
name - The name of the global variable that will be
storing this instance. Is needed to be able to set timeouts.
resultPath - path to use for external files
*/
function SearchBox(name, resultsPath, inFrame, label)
{
if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
// ---------- Instance variables
this.name = name;
this.resultsPath = resultsPath;
this.keyTimeout = 0;
this.keyTimeoutLength = 500;
this.closeSelectionTimeout = 300;
this.lastSearchValue = "";
this.lastResultsPage = "";
this.hideTimeout = 0;
this.searchIndex = 0;
this.searchActive = false;
this.insideFrame = inFrame;
this.searchLabel = label;
// ----------- DOM Elements
this.DOMSearchField = function()
{ return document.getElementById("MSearchField"); }
this.DOMSearchSelect = function()
{ return document.getElementById("MSearchSelect"); }
this.DOMSearchSelectWindow = function()
{ return document.getElementById("MSearchSelectWindow"); }
this.DOMPopupSearchResults = function()
{ return document.getElementById("MSearchResults"); }
this.DOMPopupSearchResultsWindow = function()
{ return document.getElementById("MSearchResultsWindow"); }
this.DOMSearchClose = function()
{ return document.getElementById("MSearchClose"); }
this.DOMSearchBox = function()
{ return document.getElementById("MSearchBox"); }
// ------------ Event Handlers
// Called when focus is added or removed from the search field.
this.OnSearchFieldFocus = function(isActive)
{
this.Activate(isActive);
}
this.OnSearchSelectShow = function()
{
var searchSelectWindow = this.DOMSearchSelectWindow();
var searchField = this.DOMSearchSelect();
if (this.insideFrame)
{
var left = getXPos(searchField);
var top = getYPos(searchField);
left += searchField.offsetWidth + 6;
top += searchField.offsetHeight;
// show search selection popup
searchSelectWindow.style.display='block';
left -= searchSelectWindow.offsetWidth;
searchSelectWindow.style.left = left + 'px';
searchSelectWindow.style.top = top + 'px';
}
else
{
var left = getXPos(searchField);
var top = getYPos(searchField);
top += searchField.offsetHeight;
// show search selection popup
searchSelectWindow.style.display='block';
searchSelectWindow.style.left = left + 'px';
searchSelectWindow.style.top = top + 'px';
}
// stop selection hide timer
if (this.hideTimeout)
{
clearTimeout(this.hideTimeout);
this.hideTimeout=0;
}
return false; // to avoid "image drag" default event
}
this.OnSearchSelectHide = function()
{
this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()",
this.closeSelectionTimeout);
}
// Called when the content of the search field is changed.
this.OnSearchFieldChange = function(evt)
{
if (this.keyTimeout) // kill running timer
{
clearTimeout(this.keyTimeout);
this.keyTimeout = 0;
}
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==40 || e.keyCode==13)
{
if (e.shiftKey==1)
{
this.OnSearchSelectShow();
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
child.focus();
return;
}
}
return;
}
else if (window.frames.MSearchResults.searchResults)
{
var elem = window.frames.MSearchResults.searchResults.NavNext(0);
if (elem) elem.focus();
}
}
else if (e.keyCode==27) // Escape out of the search field
{
this.DOMSearchField().blur();
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.lastSearchValue = '';
this.Activate(false);
return;
}
// strip whitespaces
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
if (searchValue != this.lastSearchValue) // search value has changed
{
if (searchValue != "") // non-empty search
{
// set timer for search update
this.keyTimeout = setTimeout(this.name + '.Search()',
this.keyTimeoutLength);
}
else // empty search field
{
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.lastSearchValue = '';
}
}
}
this.SelectItemCount = function(id)
{
var count=0;
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
count++;
}
}
return count;
}
this.SelectItemSet = function(id)
{
var i,j=0;
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
var node = child.firstChild;
if (j==id)
{
node.innerHTML='•';
}
else
{
node.innerHTML=' ';
}
j++;
}
}
}
// Called when an search filter selection is made.
// set item with index id as the active item
this.OnSelectItem = function(id)
{
this.searchIndex = id;
this.SelectItemSet(id);
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
if (searchValue!="" && this.searchActive) // something was found -> do a search
{
this.Search();
}
}
this.OnSearchSelectKey = function(evt)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) // Down
{
this.searchIndex++;
this.OnSelectItem(this.searchIndex);
}
else if (e.keyCode==38 && this.searchIndex>0) // Up
{
this.searchIndex--;
this.OnSelectItem(this.searchIndex);
}
else if (e.keyCode==13 || e.keyCode==27)
{
this.OnSelectItem(this.searchIndex);
this.CloseSelectionWindow();
this.DOMSearchField().focus();
}
return false;
}
// --------- Actions
// Closes the results window.
this.CloseResultsWindow = function()
{
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.Activate(false);
}
this.CloseSelectionWindow = function()
{
this.DOMSearchSelectWindow().style.display = 'none';
}
// Performs a search.
this.Search = function()
{
this.keyTimeout = 0;
// strip leading whitespace
var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
var code = searchValue.toLowerCase().charCodeAt(0);
var hexCode;
if (code<16)
{
hexCode="0"+code.toString(16);
}
else
{
hexCode=code.toString(16);
}
var resultsPage;
var resultsPageWithSearch;
var hasResultsPage;
if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1')
{
resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
hasResultsPage = true;
}
else // nothing available for this search term
{
resultsPage = this.resultsPath + '/nomatches.html';
resultsPageWithSearch = resultsPage;
hasResultsPage = false;
}
window.frames.MSearchResults.location = resultsPageWithSearch;
var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
if (domPopupSearchResultsWindow.style.display!='block')
{
var domSearchBox = this.DOMSearchBox();
this.DOMSearchClose().style.display = 'inline';
if (this.insideFrame)
{
var domPopupSearchResults = this.DOMPopupSearchResults();
domPopupSearchResultsWindow.style.position = 'relative';
domPopupSearchResultsWindow.style.display = 'block';
var width = document.body.clientWidth - 8; // the -8 is for IE :-(
domPopupSearchResultsWindow.style.width = width + 'px';
domPopupSearchResults.style.width = width + 'px';
}
else
{
var domPopupSearchResults = this.DOMPopupSearchResults();
var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth;
var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1;
domPopupSearchResultsWindow.style.display = 'block';
left -= domPopupSearchResults.offsetWidth;
domPopupSearchResultsWindow.style.top = top + 'px';
domPopupSearchResultsWindow.style.left = left + 'px';
}
}
this.lastSearchValue = searchValue;
this.lastResultsPage = resultsPage;
}
// -------- Activation Functions
// Activates or deactivates the search panel, resetting things to
// their default values if necessary.
this.Activate = function(isActive)
{
if (isActive || // open it
this.DOMPopupSearchResultsWindow().style.display == 'block'
)
{
this.DOMSearchBox().className = 'MSearchBoxActive';
var searchField = this.DOMSearchField();
if (searchField.value == this.searchLabel) // clear "Search" term upon entry
{
searchField.value = '';
this.searchActive = true;
}
}
else if (!isActive) // directly remove the panel
{
this.DOMSearchBox().className = 'MSearchBoxInactive';
this.DOMSearchField().value = this.searchLabel;
this.searchActive = false;
this.lastSearchValue = ''
this.lastResultsPage = '';
}
}
}
// -----------------------------------------------------------------------
// The class that handles everything on the search results page.
function SearchResults(name)
{
// The number of matches from the last run of <Search()>.
this.lastMatchCount = 0;
this.lastKey = 0;
this.repeatOn = false;
// Toggles the visibility of the passed element ID.
this.FindChildElement = function(id)
{
var parentElement = document.getElementById(id);
var element = parentElement.firstChild;
while (element && element!=parentElement)
{
if (element.nodeName == 'DIV' && element.className == 'SRChildren')
{
return element;
}
if (element.nodeName == 'DIV' && element.hasChildNodes())
{
element = element.firstChild;
}
else if (element.nextSibling)
{
element = element.nextSibling;
}
else
{
do
{
element = element.parentNode;
}
while (element && element!=parentElement && !element.nextSibling);
if (element && element!=parentElement)
{
element = element.nextSibling;
}
}
}
}
this.Toggle = function(id)
{
var element = this.FindChildElement(id);
if (element)
{
if (element.style.display == 'block')
{
element.style.display = 'none';
}
else
{
element.style.display = 'block';
}
}
}
// Searches for the passed string. If there is no parameter,
// it takes it from the URL query.
//
// Always returns true, since other documents may try to call it
// and that may or may not be possible.
this.Search = function(search)
{
if (!search) // get search word from URL
{
search = window.location.search;
search = search.substring(1); // Remove the leading '?'
search = unescape(search);
}
search = search.replace(/^ +/, ""); // strip leading spaces
search = search.replace(/ +$/, ""); // strip trailing spaces
search = search.toLowerCase();
search = convertToId(search);
var resultRows = document.getElementsByTagName("div");
var matches = 0;
var i = 0;
while (i < resultRows.length)
{
var row = resultRows.item(i);
if (row.className == "SRResult")
{
var rowMatchName = row.id.toLowerCase();
rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
if (search.length<=rowMatchName.length &&
rowMatchName.substr(0, search.length)==search)
{
row.style.display = 'block';
matches++;
}
else
{
row.style.display = 'none';
}
}
i++;
}
document.getElementById("Searching").style.display='none';
if (matches == 0) // no results
{
document.getElementById("NoMatches").style.display='block';
}
else // at least one result
{
document.getElementById("NoMatches").style.display='none';
}
this.lastMatchCount = matches;
return true;
}
// return the first item with index index or higher that is visible
this.NavNext = function(index)
{
var focusItem;
while (1)
{
var focusName = 'Item'+index;
focusItem = document.getElementById(focusName);
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
{
break;
}
else if (!focusItem) // last element
{
break;
}
focusItem=null;
index++;
}
return focusItem;
}
this.NavPrev = function(index)
{
var focusItem;
while (1)
{
var focusName = 'Item'+index;
focusItem = document.getElementById(focusName);
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
{
break;
}
else if (!focusItem) // last element
{
break;
}
focusItem=null;
index--;
}
return focusItem;
}
this.ProcessKeys = function(e)
{
if (e.type == "keydown")
{
this.repeatOn = false;
this.lastKey = e.keyCode;
}
else if (e.type == "keypress")
{
if (!this.repeatOn)
{
if (this.lastKey) this.repeatOn = true;
return false; // ignore first keypress after keydown
}
}
else if (e.type == "keyup")
{
this.lastKey = 0;
this.repeatOn = false;
}
return this.lastKey!=0;
}
this.Nav = function(evt,itemIndex)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==13) return true;
if (!this.ProcessKeys(e)) return false;
if (this.lastKey==38) // Up
{
var newIndex = itemIndex-1;
var focusItem = this.NavPrev(newIndex);
if (focusItem)
{
var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
if (child && child.style.display == 'block') // children visible
{
var n=0;
var tmpElem;
while (1) // search for last child
{
tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
if (tmpElem)
{
focusItem = tmpElem;
}
else // found it!
{
break;
}
n++;
}
}
}
if (focusItem)
{
focusItem.focus();
}
else // return focus to search field
{
parent.document.getElementById("MSearchField").focus();
}
}
else if (this.lastKey==40) // Down
{
var newIndex = itemIndex+1;
var focusItem;
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem && elem.style.display == 'block') // children visible
{
focusItem = document.getElementById('Item'+itemIndex+'_c0');
}
if (!focusItem) focusItem = this.NavNext(newIndex);
if (focusItem) focusItem.focus();
}
else if (this.lastKey==39) // Right
{
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem) elem.style.display = 'block';
}
else if (this.lastKey==37) // Left
{
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem) elem.style.display = 'none';
}
else if (this.lastKey==27) // Escape
{
parent.searchBox.CloseResultsWindow();
parent.document.getElementById("MSearchField").focus();
}
else if (this.lastKey==13) // Enter
{
return true;
}
return false;
}
this.NavChild = function(evt,itemIndex,childIndex)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==13) return true;
if (!this.ProcessKeys(e)) return false;
if (this.lastKey==38) // Up
{
if (childIndex>0)
{
var newIndex = childIndex-1;
document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
}
else // already at first child, jump to parent
{
document.getElementById('Item'+itemIndex).focus();
}
}
else if (this.lastKey==40) // Down
{
var newIndex = childIndex+1;
var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
if (!elem) // last child, jump to parent next parent
{
elem = this.NavNext(itemIndex+1);
}
if (elem)
{
elem.focus();
}
}
else if (this.lastKey==27) // Escape
{
parent.searchBox.CloseResultsWindow();
parent.document.getElementById("MSearchField").focus();
}
else if (this.lastKey==13) // Enter
{
return true;
}
return false;
}
}
function setKeyActions(elem,action)
{
elem.setAttribute('onkeydown',action);
elem.setAttribute('onkeypress',action);
elem.setAttribute('onkeyup',action);
}
function setClassAttr(elem,attr)
{
elem.setAttribute('class',attr);
elem.setAttribute('className',attr);
}
function createResults()
{
var results = document.getElementById("SRResults");
for (var e=0; e<searchData.length; e++)
{
var id = searchData[e][0];
var srResult = document.createElement('div');
srResult.setAttribute('id','SR_'+id);
setClassAttr(srResult,'SRResult');
var srEntry = document.createElement('div');
setClassAttr(srEntry,'SREntry');
var srLink = document.createElement('a');
srLink.setAttribute('id','Item'+e);
setKeyActions(srLink,'return searchResults.Nav(event,'+e+')');
setClassAttr(srLink,'SRSymbol');
srLink.innerHTML = searchData[e][1][0];
srEntry.appendChild(srLink);
if (searchData[e][1].length==2) // single result
{
srLink.setAttribute('href',searchData[e][1][1][0]);
if (searchData[e][1][1][1])
{
srLink.setAttribute('target','_parent');
}
var srScope = document.createElement('span');
setClassAttr(srScope,'SRScope');
srScope.innerHTML = searchData[e][1][1][2];
srEntry.appendChild(srScope);
}
else // multiple results
{
srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")');
var srChildren = document.createElement('div');
setClassAttr(srChildren,'SRChildren');
for (var c=0; c<searchData[e][1].length-1; c++)
{
var srChild = document.createElement('a');
srChild.setAttribute('id','Item'+e+'_c'+c);
setKeyActions(srChild,'return searchResults.NavChild(event,'+e+','+c+')');
setClassAttr(srChild,'SRScope');
srChild.setAttribute('href',searchData[e][1][c+1][0]);
if (searchData[e][1][c+1][1])
{
srChild.setAttribute('target','_parent');
}
srChild.innerHTML = searchData[e][1][c+1][2];
srChildren.appendChild(srChild);
}
srEntry.appendChild(srChildren);
}
srResult.appendChild(srEntry);
results.appendChild(srResult);
}
}
| Java |
/***********************************************************************
**
** Sturdy - note-taking app
** Copyright (C) 2016 Vladislav Tronko <innermous@gmail.com>
**
** Sturdy 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 Sturdy. If not, see <http://www.gnu.org/licenses/>.
**
***********************************************************************/
#include "entrymanager.h"
#include <QDateTime>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QVariant>
#include <QDebug>
using namespace Core;
EntryManager::~EntryManager()
{
clear();
}
void EntryManager::close(int entryId)
{
Entry* entry = getEntry(entryId);
if (!entry)
return;
delete entry;
m_entries.erase(entryId);
}
void EntryManager::clear()
{
for (auto entry : m_entries) {
save(entry.first);
delete entry.second;
}
m_entries.clear();
}
bool EntryManager::save(int entryId) const
{
Entry* entry = m_entries.at(entryId);
if (!entry->isModified)
return true;
entry->timestamp = QDateTime().toTime_t();
entry->isModified = false;
QSqlDatabase db = QSqlDatabase::database();
QSqlQuery query(db);
query.prepare(QStringLiteral("UPDATE entries SET content = ?, timestamp = ? WHERE id= ?"));
query.addBindValue(entry->content);
query.addBindValue(entry->timestamp);
query.addBindValue(entryId);
return query.exec();
}
bool EntryManager::load(int entryId)
{
QSqlDatabase db = QSqlDatabase::database();
QSqlQuery query(db);
query.prepare(QStringLiteral("SELECT id, content, timestamp FROM entries WHERE id= ?"));
query.addBindValue(entryId);
if (!query.exec())
return false;
query.next();
Entry* entry = new Entry;
entry->id = query.value(0).toInt();
entry->content = query.value(1).toString();
entry->timestamp = query.value(2).toUInt();
m_entries.insert(std::make_pair<>(entry->id, entry));
return true;
}
Entry* EntryManager::getEntry(int entryId)
{
auto it = m_entries.find(entryId);
if (it == m_entries.end())
if (!load(entryId))
return nullptr;
return m_entries.at(entryId);
}
| Java |
# Rain_Water_Trapping
def trappedWater(a, size) :
# left[i] stores height of tallest bar to the to left of it including itself
left = [0] * size
# Right [i] stores height of tallest bar to the to right of it including itself
right = [0] * size
# Initialize result
waterVolume = 0
# filling left (list/array)
left[0] = a[0]
for i in range( 1, size):
left[i] = max(left[i-1], a[i])
# filling right (list/array)
right[size - 1] = a[size - 1]
for i in range(size - 2, - 1, - 1):
right[i] = max(right[i + 1], a[i]);
# Calculating volume of the accumulated water element by element
for i in range(0, size):
waterVolume += min(left[i],right[i]) - a[i]
return waterVolume
# main program
arr =[]
n = int(input()) #input the number of towers
for i in range(n):
arr.append(int(input())) #storing length of each tower in array
print("Maximum water that can be accumulated is ", trappedWater(arr, len(arr)))
#Input:
#12
#0
#1
#0
#2
#1
#0
#1
#3
#2
#1
#2
#1
#Output:
#The maximum water trapped is 6
| Java |
using System.Reflection;
using System.Runtime.CompilerServices;
namespace System.Security.Principal
{
public interface IIdentity
{
string AuthenticationType { get; }
bool IsAuthenticated { get; }
string Name { get; }
}
}
| Java |
/**
* Copyright (c) 2017 HES-SO Valais - Smart Infrastructure Laboratory (http://silab.hes.ch)
*
* This file is part of StructuredSimulationFramework.
*
* The StructuredSimulationFramework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The StructuredSimulationFramework 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 StructuredSimulationFramework.
* If not, see <http://www.gnu.org/licenses/>.
* */
package ch.hevs.silab.structuredsim.interfaces;
import java.util.List;
/**
* Name : IManageModifier
* <p>
* Description : Class to manage the modifier
* <p>
* Date : 25 July 2017
* @version 1.0
* @author Audrey Dupont
*/
public interface IManageModifier {
/**
* Method to initiate the modifier class inside a List
*/
public List<AModifier> initiateModifierList();
}
| Java |
## Contribution
If you want to add any enhancement feature or have found any bug and want to work on it, please open a new issue regarding that and put a message "I would like to work on it." And make sure every pull request should reference to an issue.
#### Points on how to make pull request
* You need to fork this repository to your account.
* Clone it using ``` git clone https://github.com/FOSSEE/eSim.git ```
* Always create a new branch before making any changes. You can create new branch using ```git branch <branch-name> ```
* Checkout into your new branch using ```git checkout <branch-name>```
* Make changes to code and once you are done use ```git add <path to file changed or added>```. Now commit changes with proper message using ```git commit -m "Your message"```.
* After commiting your changes push your changes to your forked repository using ```git push origin <branch-name>```
Finally create a pull request from github.
There should be only one commit per pull request.
* Please follow below guidelines for your commit message :
* Commit message should be like : Fixes issue #[issue_number] - one line message of work you did.
* After commit message, there should be a commit body where you can mention what you did in short or in detail.
Please follow above method to file pull requests.
| Java |
#Region "Microsoft.VisualBasic::e7960fcc4cc15725cc863a98473d765c, ..\interops\visualize\Circos\Circos\TrackDatas\Adapter\Highlights\Repeat.vb"
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xieguigang (xie.guigang@live.com)
' xie (genetics@smrucc.org)
'
' Copyright (c) 2016 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
' 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/>.
#End Region
Imports System.Drawing
Imports System.Text
Imports System.Text.RegularExpressions
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.Language
Imports Microsoft.VisualBasic.Linq.Extensions
Imports SMRUCC.genomics.ComponentModel
Imports SMRUCC.genomics.SequenceModel.FASTA
Namespace TrackDatas.Highlights
Public Class Repeat : Inherits Highlights
Sub New(repeat As IEnumerable(Of NtProps.Repeat), attrs As IEnumerable(Of Double))
Dim clMaps As IdentityColors = New IdentityGradients(attrs.Min, attrs.Max, 512)
Dim v As Double() = attrs.ToArray
Me.__source = New List(Of ValueTrackData)(
repeat.ToArray(Function(x) __creates(x, maps:=clMaps, attrs:=v)))
End Sub
Private Shared Function __creates(loci As NtProps.Repeat, maps As IdentityColors, attrs As Double()) As ValueTrackData
Dim left As Integer = CInt(Val(loci.Minimum.Replace(",", "")))
Dim Right As Integer = CInt(Val(loci.Maximum.Replace(",", "")))
Dim r As Double() = attrs.Skip(left).Take(Right - left).ToArray
Return New ValueTrackData With {
.start = left,
.end = Right,
.formatting = New Formatting With {
.fill_color = maps.GetColor(r.Average)
}
}
End Function
Sub New(repeat As IEnumerable(Of NtProps.Repeat), Optional Color As String = "Brown")
Me.__source = LinqAPI.MakeList(Of ValueTrackData) <=
_
From x As NtProps.Repeat
In repeat
Let left = CInt(Val(x.Minimum))
Let right = CInt(Val(x.Maximum))
Select New ValueTrackData With {
.start = left,
.end = right,
.formatting = New Formatting With {
.fill_color = Color
}
}
End Sub
End Class
End Namespace
| Java |
var __v=[
{
"Id": 2046,
"Chapter": 630,
"Name": "c++",
"Sort": 0
}
] | Java |
/*
* $Revision: 2299 $
*
* last checkin:
* $Author: gutwenger $
* $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $
***************************************************************/
/** \file
* \brief Declaration of class SplitHeuristic.
*
* \author Andrea Wagner
*
* \par License:
* This file is part of the Open Graph Drawing Framework (OGDF).
*
* Copyright (C). All rights reserved.
* See README.txt in the root directory of the OGDF installation for details.
*
* \par
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* Version 2 or 3 as published by the Free Software Foundation;
* see the file LICENSE.txt included in the packaging of this file
* for details.
*
* \par
* 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.
*
* \par
* 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.
*
* \see http://www.gnu.org/copyleft/gpl.html
***************************************************************/
#ifdef _MSC_VER
#pragma once
#endif
#ifndef OGDF_SPLIT_HEURISTIC_H
#define OGDF_SPLIT_HEURISTIC_H
#include <ogdf/basic/EdgeArray.h>
#include <ogdf/layered/CrossingsMatrix.h>
#include <ogdf/simultaneous/TwoLayerCrossMinSimDraw.h>
namespace ogdf {
//! The split heuristic for 2-layer crossing minimization.
class OGDF_EXPORT SplitHeuristic : public TwoLayerCrossMinSimDraw
{
public:
//! Initializes crossing minimization for hierarchy \a H.
void init (const Hierarchy &H);
//! Calls the split heuristic for level \a L.
void call (Level &L);
//! Calls the median heuristic for level \a L (simultaneous drawing).
void call (Level &L, const EdgeArray<unsigned int> *edgeSubGraph);
//! Does some clean-up after calls.
void cleanup ();
private:
CrossingsMatrix *m_cm;
Array<node> buffer;
void recCall(Level&, int low, int high);
};
}// end namespace ogdf
#endif
| Java |
-----------------------------------
-- Area: Pashhow Marshlands [S]
-- Mob: Virulent Peiste
-- Note: PH for Sugaar
-----------------------------------
local ID = require("scripts/zones/Pashhow_Marshlands_[S]/IDs")
require("scripts/globals/mobs")
-----------------------------------
function onMobDeath(mob, player, isKiller)
end
function onMobDespawn(mob)
phOnDespawn(mob, ID.mob.SUGAAR_PH, 5, 3600) -- 1 hour
end
| Java |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Mon May 06 00:15:52 EDT 2013 -->
<title>Uses of Class org.spongycastle.asn1.x509.ReasonFlags</title>
<meta name="date" content="2013-05-06">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.spongycastle.asn1.x509.ReasonFlags";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/spongycastle/asn1/x509/class-use/ReasonFlags.html" target="_top">Frames</a></li>
<li><a href="ReasonFlags.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.spongycastle.asn1.x509.ReasonFlags" class="title">Uses of Class<br>org.spongycastle.asn1.x509.ReasonFlags</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.spongycastle.asn1.x509">org.spongycastle.asn1.x509</a></td>
<td class="colLast">
<div class="block">Support classes useful for encoding and processing X.509 certificates.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.spongycastle.asn1.x509">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a> in <a href="../../../../../org/spongycastle/asn1/x509/package-summary.html">org.spongycastle.asn1.x509</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../org/spongycastle/asn1/x509/package-summary.html">org.spongycastle.asn1.x509</a> declared as <a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a></code></td>
<td class="colLast"><span class="strong">IssuingDistributionPoint.</span><code><strong><a href="../../../../../org/spongycastle/asn1/x509/IssuingDistributionPoint.html#onlySomeReasons">onlySomeReasons</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>(package private) <a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a></code></td>
<td class="colLast"><span class="strong">DistributionPoint.</span><code><strong><a href="../../../../../org/spongycastle/asn1/x509/DistributionPoint.html#reasons">reasons</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/spongycastle/asn1/x509/package-summary.html">org.spongycastle.asn1.x509</a> that return <a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a></code></td>
<td class="colLast"><span class="strong">IssuingDistributionPoint.</span><code><strong><a href="../../../../../org/spongycastle/asn1/x509/IssuingDistributionPoint.html#getOnlySomeReasons()">getOnlySomeReasons</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a></code></td>
<td class="colLast"><span class="strong">DistributionPoint.</span><code><strong><a href="../../../../../org/spongycastle/asn1/x509/DistributionPoint.html#getReasons()">getReasons</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../org/spongycastle/asn1/x509/package-summary.html">org.spongycastle.asn1.x509</a> with parameters of type <a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/spongycastle/asn1/x509/DistributionPoint.html#DistributionPoint(org.spongycastle.asn1.x509.DistributionPointName, org.spongycastle.asn1.x509.ReasonFlags, org.spongycastle.asn1.x509.GeneralNames)">DistributionPoint</a></strong>(<a href="../../../../../org/spongycastle/asn1/x509/DistributionPointName.html" title="class in org.spongycastle.asn1.x509">DistributionPointName</a> distributionPoint,
<a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a> reasons,
<a href="../../../../../org/spongycastle/asn1/x509/GeneralNames.html" title="class in org.spongycastle.asn1.x509">GeneralNames</a> cRLIssuer)</code> </td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../org/spongycastle/asn1/x509/IssuingDistributionPoint.html#IssuingDistributionPoint(org.spongycastle.asn1.x509.DistributionPointName, boolean, boolean, org.spongycastle.asn1.x509.ReasonFlags, boolean, boolean)">IssuingDistributionPoint</a></strong>(<a href="../../../../../org/spongycastle/asn1/x509/DistributionPointName.html" title="class in org.spongycastle.asn1.x509">DistributionPointName</a> distributionPoint,
boolean onlyContainsUserCerts,
boolean onlyContainsCACerts,
<a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">ReasonFlags</a> onlySomeReasons,
boolean indirectCRL,
boolean onlyContainsAttributeCerts)</code>
<div class="block">Constructor from given details.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/spongycastle/asn1/x509/ReasonFlags.html" title="class in org.spongycastle.asn1.x509">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/spongycastle/asn1/x509/class-use/ReasonFlags.html" target="_top">Frames</a></li>
<li><a href="ReasonFlags.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| Java |
<?php
$plugin->version = 2012060700;
//EOF
| Java |
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr">
<context>
<name></name>
<message id="id-app-launcher-name">
<location filename="asteroid-timer.desktop.h" line="6"/>
<source>Timer</source>
<translation>Timer</translation>
</message>
</context>
</TS>
| Java |
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#ifndef _DEFINES_H
#define _DEFINES_H
#include <AP_HAL_Boards.h>
// Just so that it's completely clear...
#define ENABLED 1
#define DISABLED 0
// this avoids a very common config error
#define ENABLE ENABLED
#define DISABLE DISABLED
// Flight modes
// ------------
#define YAW_HOLD 0 // heading hold at heading in control_yaw but allow input from pilot
#define YAW_ACRO 1 // pilot controlled yaw using rate controller
#define YAW_LOOK_AT_NEXT_WP 2 // point towards next waypoint (no pilot input accepted)
#define YAW_LOOK_AT_LOCATION 3 // point towards a location held in yaw_look_at_WP (no pilot input accepted)
#define YAW_CIRCLE 4 // point towards a location held in yaw_look_at_WP (no pilot input accepted)
#define YAW_LOOK_AT_HOME 5 // point towards home (no pilot input accepted)
#define YAW_LOOK_AT_HEADING 6 // point towards a particular angle (not pilot input accepted)
#define YAW_LOOK_AHEAD 7 // WARNING! CODE IN DEVELOPMENT NOT PROVEN
#define YAW_DRIFT 8 //
#define YAW_RESETTOARMEDYAW 9 // point towards heading at time motors were armed
#define ROLL_PITCH_STABLE 0 // pilot input roll, pitch angles
#define ROLL_PITCH_ACRO 1 // pilot inputs roll, pitch rotation rates in body frame
#define ROLL_PITCH_AUTO 2 // no pilot input. autopilot roll, pitch is sent to stabilize controller inputs
#define ROLL_PITCH_STABLE_OF 3 // pilot inputs roll, pitch angles which are mixed with optical flow based position controller lean anbles
#define ROLL_PITCH_DRIFT 4 //
#define ROLL_PITCH_LOITER 5 // pilot inputs the desired horizontal velocities
#define ROLL_PITCH_SPORT 6 // pilot inputs roll, pitch rotation rates in earth frame
#define ROLL_PITCH_AUTOTUNE 7 // description of new roll-pitch mode
#define ROLL_PITCH_HYBRID 8 // ST-JD pilot input roll, pitch angles when sticks are moved
#define THROTTLE_MANUAL 0 // manual throttle mode - pilot input goes directly to motors
#define THROTTLE_MANUAL_TILT_COMPENSATED 1 // mostly manual throttle but with some tilt compensation
#define THROTTLE_HOLD 2 // alt hold plus pilot input of climb rate
#define THROTTLE_AUTO 3 // auto pilot altitude controller with target altitude held in next_WP.alt
#define THROTTLE_LAND 4 // landing throttle controller
#define THROTTLE_MANUAL_HELI 5 // pilot manually controlled throttle for traditional helicopters
// sonar - for use with CONFIG_SONAR_SOURCE
#define SONAR_SOURCE_ADC 1
#define SONAR_SOURCE_ANALOG_PIN 2
// Ch6, Ch7 and Ch8 aux switch control
#define AUX_SWITCH_PWM_TRIGGER_HIGH 1800 // pwm value above which the ch7 or ch8 option will be invoked
#define AUX_SWITCH_PWM_TRIGGER_LOW 1200 // pwm value below which the ch7 or ch8 option will be disabled
#define CH6_PWM_TRIGGER_HIGH 1800
#define CH6_PWM_TRIGGER_LOW 1200
#define AUX_SWITCH_DO_NOTHING 0 // aux switch disabled
#define AUX_SWITCH_SET_HOVER 1 // deprecated
#define AUX_SWITCH_FLIP 2 // flip
#define AUX_SWITCH_SIMPLE_MODE 3 // change to simple mode
#define AUX_SWITCH_RTL 4 // change to RTL flight mode
#define AUX_SWITCH_SAVE_TRIM 5 // save current position as level
#define AUX_SWITCH_ADC_FILTER 6 // deprecated
#define AUX_SWITCH_SAVE_WP 7 // save mission waypoint or RTL if in auto mode
#define AUX_SWITCH_MULTI_MODE 8 // depending upon CH6 position Flip (if ch6 is low), RTL (if ch6 in middle) or Save WP (if ch6 is high)
#define AUX_SWITCH_CAMERA_TRIGGER 9 // trigger camera servo or relay
#define AUX_SWITCH_SONAR 10 // allow enabling or disabling sonar in flight which helps avoid surface tracking when you are far above the ground
#define AUX_SWITCH_FENCE 11 // allow enabling or disabling fence in flight
#define AUX_SWITCH_RESETTOARMEDYAW 12 // changes yaw to be same as when quad was armed
#define AUX_SWITCH_SUPERSIMPLE_MODE 13 // change to simple mode in middle, super simple at top
#define AUX_SWITCH_ACRO_TRAINER 14 // low = disabled, middle = leveled, high = leveled and limited
#define AUX_SWITCH_SPRAYER 15 // enable/disable the crop sprayer
#define AUX_SWITCH_AUTO 16 // change to auto flight mode
#define AUX_SWITCH_AUTOTUNE 17 // auto tune
#define AUX_SWITCH_LAND 18 // change to LAND flight mode
// values used by the ap.ch7_opt and ap.ch8_opt flags
#define AUX_SWITCH_LOW 0 // indicates auxiliar switch is in the low position (pwm <1200)
#define AUX_SWITCH_MIDDLE 1 // indicates auxiliar switch is in the middle position (pwm >1200, <1800)
#define AUX_SWITCH_HIGH 2 // indicates auxiliar switch is in the high position (pwm >1800)
// Frame types
#define UNDEFINED_FRAME 0
#define QUAD_FRAME 1
#define TRI_FRAME 2
#define HEXA_FRAME 3
#define Y6_FRAME 4
#define OCTA_FRAME 5
#define HELI_FRAME 6
#define OCTA_QUAD_FRAME 7
#define SINGLE_FRAME 8
#define PLUS_FRAME 0
#define X_FRAME 1
#define V_FRAME 2
// LED output
#define NORMAL_LEDS 0
#define SAVE_TRIM_LEDS 1
// Internal defines, don't edit and expect things to work
// -------------------------------------------------------
#define TRUE 1
#define FALSE 0
#define ToRad(x) radians(x) // *pi/180
#define ToDeg(x) degrees(x) // *180/pi
#define DEBUG 0
#define LOITER_RANGE 60 // for calculating power outside of loiter radius
#define T6 1000000
#define T7 10000000
// GPS type codes - use the names, not the numbers
#define GPS_PROTOCOL_NONE -1
#define GPS_PROTOCOL_NMEA 0
#define GPS_PROTOCOL_SIRF 1
#define GPS_PROTOCOL_UBLOX 2
#define GPS_PROTOCOL_IMU 3
#define GPS_PROTOCOL_MTK 4
#define GPS_PROTOCOL_HIL 5
#define GPS_PROTOCOL_MTK19 6
#define GPS_PROTOCOL_AUTO 7
// HIL enumerations
#define HIL_MODE_DISABLED 0
#define HIL_MODE_ATTITUDE 1
#define HIL_MODE_SENSORS 2
// Altitude status definitions
#define REACHED_ALT 0
#define DESCENDING 1
#define ASCENDING 2
// Auto Pilot modes
// ----------------
#define STABILIZE 0 // hold level position
#define ACRO 1 // rate control
#define ALT_HOLD 2 // AUTO control
#define AUTO 3 // AUTO control
#define GUIDED 4 // AUTO control
#define LOITER 5 // Hold a single location
#define RTL 6 // AUTO control
#define CIRCLE 7 // AUTO control
#define POSITION 8 // AUTO control
#define LAND 9 // AUTO control
#define OF_LOITER 10 // Hold a single location using optical flow sensor
#define DRIFT 11 // DRIFT mode (Note: 12 is no longer used)
#define SPORT 13 // earth frame rate control
#define HYBRID 14 // ST-JD Hybrid mode = Loiter with direct stick commands
#define NUM_MODES 15
// CH_6 Tuning
// -----------
#define CH6_NONE 0 // no tuning performed
#define CH6_STABILIZE_ROLL_PITCH_KP 1 // stabilize roll/pitch angle controller's P term
#define CH6_RATE_ROLL_PITCH_KP 4 // body frame roll/pitch rate controller's P term
#define CH6_RATE_ROLL_PITCH_KI 5 // body frame roll/pitch rate controller's I term
#define CH6_RATE_ROLL_PITCH_KD 21 // body frame roll/pitch rate controller's D term
#define CH6_STABILIZE_YAW_KP 3 // stabilize yaw heading controller's P term
#define CH6_YAW_RATE_KP 6 // body frame yaw rate controller's P term
#define CH6_YAW_RATE_KD 26 // body frame yaw rate controller's D term
#define CH6_ALTITUDE_HOLD_KP 14 // altitude hold controller's P term (alt error to desired rate)
#define CH6_THROTTLE_RATE_KP 7 // throttle rate controller's P term (desired rate to acceleration or motor output)
#define CH6_THROTTLE_RATE_KD 37 // throttle rate controller's D term (desired rate to acceleration or motor output)
#define CH6_THROTTLE_ACCEL_KP 34 // accel based throttle controller's P term
#define CH6_THROTTLE_ACCEL_KI 35 // accel based throttle controller's I term
#define CH6_THROTTLE_ACCEL_KD 36 // accel based throttle controller's D term
#define CH6_LOITER_POSITION_KP 12 // loiter distance controller's P term (position error to speed)
#define CH6_LOITER_RATE_KP 22 // loiter rate controller's P term (speed error to tilt angle)
#define CH6_LOITER_RATE_KI 28 // loiter rate controller's I term (speed error to tilt angle)
#define CH6_LOITER_RATE_KD 23 // loiter rate controller's D term (speed error to tilt angle)
#define CH6_WP_SPEED 10 // maximum speed to next way point (0 to 10m/s)
#define CH6_ACRO_RP_KP 25 // acro controller's P term. converts pilot input to a desired roll, pitch or yaw rate
#define CH6_ACRO_YAW_KP 40 // acro controller's P term. converts pilot input to a desired roll, pitch or yaw rate
#define CH6_RELAY 9 // switch relay on if ch6 high, off if low
#define CH6_HELI_EXTERNAL_GYRO 13 // TradHeli specific external tail gyro gain
#define CH6_OPTFLOW_KP 17 // optical flow loiter controller's P term (position error to tilt angle)
#define CH6_OPTFLOW_KI 18 // optical flow loiter controller's I term (position error to tilt angle)
#define CH6_OPTFLOW_KD 19 // optical flow loiter controller's D term (position error to tilt angle)
#define CH6_AHRS_YAW_KP 30 // ahrs's compass effect on yaw angle (0 = very low, 1 = very high)
#define CH6_AHRS_KP 31 // accelerometer effect on roll/pitch angle (0=low)
#define CH6_INAV_TC 32 // inertial navigation baro/accel and gps/accel time constant (1.5 = strong baro/gps correction on accel estimatehas very strong does not correct accel estimate, 7 = very weak correction)
#define CH6_DECLINATION 38 // compass declination in radians
#define CH6_CIRCLE_RATE 39 // circle turn rate in degrees (hard coded to about 45 degrees in either direction)
#define CH6_SONAR_GAIN 41 // sonar gain
// Acro Trainer types
#define ACRO_TRAINER_DISABLED 0
#define ACRO_TRAINER_LEVELING 1
#define ACRO_TRAINER_LIMITED 2
// Commands - Note that APM now uses a subset of the MAVLink protocol
// commands. See enum MAV_CMD in the GCS_Mavlink library
#define CMD_BLANK 0 // there is no command stored in the mem location
// requested
#define NO_COMMAND 0
// Navigation modes held in nav_mode variable
#define NAV_NONE 0
#define NAV_CIRCLE 1
#define NAV_LOITER 2
#define NAV_WP 3
#define NAV_HYBRID 4 // ST-JD: nav mode, used for initialisation on nav mode change
// Yaw behaviours during missions - possible values for WP_YAW_BEHAVIOR parameter
#define WP_YAW_BEHAVIOR_NONE 0 // auto pilot will never control yaw during missions or rtl (except for DO_CONDITIONAL_YAW command received)
#define WP_YAW_BEHAVIOR_LOOK_AT_NEXT_WP 1 // auto pilot will face next waypoint or home during rtl
#define WP_YAW_BEHAVIOR_LOOK_AT_NEXT_WP_EXCEPT_RTL 2 // auto pilot will face next waypoint except when doing RTL at which time it will stay in it's last
#define WP_YAW_BEHAVIOR_LOOK_AHEAD 3 // auto pilot will look ahead during missions and rtl (primarily meant for traditional helicotpers)
// Waypoint options
#define MASK_OPTIONS_RELATIVE_ALT 1
#define WP_OPTION_ALT_CHANGE 2
#define WP_OPTION_YAW 4
#define WP_OPTION_ALT_REQUIRED 8
#define WP_OPTION_RELATIVE 16
//#define WP_OPTION_ 32
//#define WP_OPTION_ 64
#define WP_OPTION_NEXT_CMD 128
// RTL state
#define RTL_STATE_START 0
#define RTL_STATE_INITIAL_CLIMB 1
#define RTL_STATE_RETURNING_HOME 2
#define RTL_STATE_LOITERING_AT_HOME 3
#define RTL_STATE_FINAL_DESCENT 4
#define RTL_STATE_LAND 5
// LAND state
#define LAND_STATE_FLY_TO_LOCATION 0
#define LAND_STATE_DESCENDING 1
//repeating events
#define RELAY_TOGGLE 5
// GCS Message ID's
/// NOTE: to ensure we never block on sending MAVLink messages
/// please keep each MSG_ to a single MAVLink message. If need be
/// create new MSG_ IDs for additional messages on the same
/// stream
enum ap_message {
MSG_HEARTBEAT,
MSG_ATTITUDE,
MSG_LOCATION,
MSG_EXTENDED_STATUS1,
MSG_EXTENDED_STATUS2,
MSG_NAV_CONTROLLER_OUTPUT,
MSG_CURRENT_WAYPOINT,
MSG_VFR_HUD,
MSG_RADIO_OUT,
MSG_RADIO_IN,
MSG_RAW_IMU1,
MSG_RAW_IMU2,
MSG_RAW_IMU3,
MSG_GPS_RAW,
MSG_SYSTEM_TIME,
MSG_SERVO_OUT,
MSG_NEXT_WAYPOINT,
MSG_NEXT_PARAM,
MSG_STATUSTEXT,
MSG_LIMITS_STATUS,
MSG_AHRS,
MSG_SIMSTATE,
MSG_HWSTATUS,
MSG_RETRY_DEFERRED // this must be last
};
// Logging parameters
#define TYPE_AIRSTART_MSG 0x00
#define TYPE_GROUNDSTART_MSG 0x01
#define LOG_ATTITUDE_MSG 0x01
#define LOG_MODE_MSG 0x03
#define LOG_CONTROL_TUNING_MSG 0x04
#define LOG_NAV_TUNING_MSG 0x05
#define LOG_PERFORMANCE_MSG 0x06
#define LOG_CMD_MSG 0x08
#define LOG_CURRENT_MSG 0x09
#define LOG_STARTUP_MSG 0x0A
#define LOG_OPTFLOW_MSG 0x0C
#define LOG_EVENT_MSG 0x0D
#define LOG_PID_MSG 0x0E
#define LOG_COMPASS_MSG 0x0F
#define LOG_INAV_MSG 0x11
#define LOG_CAMERA_MSG 0x12
#define LOG_ERROR_MSG 0x13
#define LOG_DATA_INT16_MSG 0x14
#define LOG_DATA_UINT16_MSG 0x15
#define LOG_DATA_INT32_MSG 0x16
#define LOG_DATA_UINT32_MSG 0x17
#define LOG_DATA_FLOAT_MSG 0x18
#define LOG_AUTOTUNE_MSG 0x19
#define LOG_AUTOTUNEDETAILS_MSG 0x1A
#define LOG_INDEX_MSG 0xF0
#define MAX_NUM_LOGS 50
#define MASK_LOG_ATTITUDE_FAST (1<<0)
#define MASK_LOG_ATTITUDE_MED (1<<1)
#define MASK_LOG_GPS (1<<2)
#define MASK_LOG_PM (1<<3)
#define MASK_LOG_CTUN (1<<4)
#define MASK_LOG_NTUN (1<<5)
#define MASK_LOG_RCIN (1<<6)
#define MASK_LOG_IMU (1<<7)
#define MASK_LOG_CMD (1<<8)
#define MASK_LOG_CURRENT (1<<9)
#define MASK_LOG_RCOUT (1<<10)
#define MASK_LOG_OPTFLOW (1<<11)
#define MASK_LOG_PID (1<<12)
#define MASK_LOG_COMPASS (1<<13)
#define MASK_LOG_INAV (1<<14)
#define MASK_LOG_CAMERA (1<<15)
// DATA - event logging
#define DATA_MAVLINK_FLOAT 1
#define DATA_MAVLINK_INT32 2
#define DATA_MAVLINK_INT16 3
#define DATA_MAVLINK_INT8 4
#define DATA_AP_STATE 7
#define DATA_INIT_SIMPLE_BEARING 9
#define DATA_ARMED 10
#define DATA_DISARMED 11
#define DATA_AUTO_ARMED 15
#define DATA_TAKEOFF 16
#define DATA_LAND_COMPLETE 18
#define DATA_NOT_LANDED 28
#define DATA_LOST_GPS 19
#define DATA_BEGIN_FLIP 21
#define DATA_END_FLIP 22
#define DATA_EXIT_FLIP 23
#define DATA_SET_HOME 25
#define DATA_SET_SIMPLE_ON 26
#define DATA_SET_SIMPLE_OFF 27
#define DATA_SET_SUPERSIMPLE_ON 29
#define DATA_AUTOTUNE_INITIALISED 30
#define DATA_AUTOTUNE_OFF 31
#define DATA_AUTOTUNE_RESTART 32
#define DATA_AUTOTUNE_COMPLETE 33
#define DATA_AUTOTUNE_ABANDONED 34
#define DATA_AUTOTUNE_REACHED_LIMIT 35
#define DATA_AUTOTUNE_TESTING 36
#define DATA_AUTOTUNE_SAVEDGAINS 37
#define DATA_SAVE_TRIM 38
#define DATA_SAVEWP_ADD_WP 39
#define DATA_SAVEWP_CLEAR_MISSION_RTL 40
#define DATA_FENCE_ENABLE 41
#define DATA_FENCE_DISABLE 42
#define DATA_ACRO_TRAINER_DISABLED 43
#define DATA_ACRO_TRAINER_LEVELING 44
#define DATA_ACRO_TRAINER_LIMITED 45
// RADIANS
#define RADX100 0.000174532925f
#define DEGX100 5729.57795f
// EEPROM addresses
#define EEPROM_MAX_ADDR 4096
// parameters get the first 1536 bytes of EEPROM, remainder is for waypoints
#define WP_START_BYTE 0x600 // where in memory home WP is stored + all other
// WP
#define WP_SIZE 15
// fence points are stored at the end of the EEPROM
#define MAX_FENCEPOINTS 6
#define FENCE_WP_SIZE sizeof(Vector2l)
#define FENCE_START_BYTE (EEPROM_MAX_ADDR-(MAX_FENCEPOINTS*FENCE_WP_SIZE))
#define MAX_WAYPOINTS ((FENCE_START_BYTE - WP_START_BYTE) / WP_SIZE) - 1 // -
// 1
// to
// be
// safe
// mark a function as not to be inlined
#define NOINLINE __attribute__((noinline))
// IMU selection
#define CONFIG_IMU_OILPAN 1
#define CONFIG_IMU_MPU6000 2
#define CONFIG_IMU_SITL 3
#define CONFIG_IMU_PX4 4
#define CONFIG_IMU_FLYMAPLE 5
#define AP_BARO_BMP085 1
#define AP_BARO_MS5611 2
#define AP_BARO_PX4 3
#define AP_BARO_MS5611_SPI 1
#define AP_BARO_MS5611_I2C 2
// Error message sub systems and error codes
#define ERROR_SUBSYSTEM_MAIN 1
#define ERROR_SUBSYSTEM_RADIO 2
#define ERROR_SUBSYSTEM_COMPASS 3
#define ERROR_SUBSYSTEM_OPTFLOW 4
#define ERROR_SUBSYSTEM_FAILSAFE_RADIO 5
#define ERROR_SUBSYSTEM_FAILSAFE_BATT 6
#define ERROR_SUBSYSTEM_FAILSAFE_GPS 7
#define ERROR_SUBSYSTEM_FAILSAFE_GCS 8
#define ERROR_SUBSYSTEM_FAILSAFE_FENCE 9
#define ERROR_SUBSYSTEM_FLIGHT_MODE 10
#define ERROR_SUBSYSTEM_GPS 11
#define ERROR_SUBSYSTEM_CRASH_CHECK 12
// general error codes
#define ERROR_CODE_ERROR_RESOLVED 0
#define ERROR_CODE_FAILED_TO_INITIALISE 1
// subsystem specific error codes -- radio
#define ERROR_CODE_RADIO_LATE_FRAME 2
// subsystem specific error codes -- failsafe_thr, batt, gps
#define ERROR_CODE_FAILSAFE_RESOLVED 0
#define ERROR_CODE_FAILSAFE_OCCURRED 1
// subsystem specific error codes -- compass
#define ERROR_CODE_COMPASS_FAILED_TO_READ 2
// subsystem specific error codes -- gps
#define ERROR_CODE_GPS_GLITCH 2
// subsystem specific error codes -- main
#define ERROR_CODE_MAIN_INS_DELAY 1
// subsystem specific error codes -- crash checker
#define ERROR_CODE_CRASH_CHECK_CRASH 1
// Arming Check Enable/Disable bits
#define ARMING_CHECK_NONE 0x00
#define ARMING_CHECK_ALL 0x01
#define ARMING_CHECK_BARO 0x02
#define ARMING_CHECK_COMPASS 0x04
#define ARMING_CHECK_GPS 0x08
#define ARMING_CHECK_INS 0x10
#define ARMING_CHECK_PARAMETERS 0x20
#define ARMING_CHECK_RC 0x40
#define ARMING_CHECK_VOLTAGE 0x80
// Radio failsafe definitions (FS_THR parameter)
#define FS_THR_DISABLED 0
#define FS_THR_ENABLED_ALWAYS_RTL 1
#define FS_THR_ENABLED_CONTINUE_MISSION 2
#define FS_THR_ENABLED_ALWAYS_LAND 3
// Battery failsafe definitions (FS_BATT_ENABLE parameter)
#define FS_BATT_DISABLED 0 // battery failsafe disabled
#define FS_BATT_LAND 1 // switch to LAND mode on battery failsafe
#define FS_BATT_RTL 2 // switch to RTL mode on battery failsafe
// GPS Failsafe definitions (FS_GPS_ENABLE parameter)
#define FS_GPS_DISABLED 0 // GPS failsafe disabled
#define FS_GPS_LAND 1 // switch to LAND mode on GPS Failsafe
#define FS_GPS_ALTHOLD 2 // switch to ALTHOLD mode on GPS failsafe
#define FS_GPS_LAND_EVEN_STABILIZE 3 // switch to LAND mode on GPS failsafe even if in a manual flight mode like Stabilize
#endif // _DEFINES_H
| Java |
using System;
using System.Linq;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Database;
using Geekbot.Core.Database.Models;
using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Extensions;
using Geekbot.Core.GuildSettingsManager;
using Geekbot.Core.RandomNumberGenerator;
using Localization = Geekbot.Core.Localization;
namespace Geekbot.Bot.Commands.Randomness
{
public class Ship : GeekbotCommandBase
{
private readonly IRandomNumberGenerator _randomNumberGenerator;
private readonly DatabaseContext _database;
public Ship(DatabaseContext database, IErrorHandler errorHandler, IRandomNumberGenerator randomNumberGenerator, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager)
{
_database = database;
_randomNumberGenerator = randomNumberGenerator;
}
[Command("Ship", RunMode = RunMode.Async)]
[Summary("Ask the Shipping meter")]
public async Task Command([Summary("@user1")] IUser user1, [Summary("@user2")] IUser user2)
{
try
{
var userKeys = user1.Id < user2.Id
? new Tuple<long, long>(user1.Id.AsLong(), user2.Id.AsLong())
: new Tuple<long, long>(user2.Id.AsLong(), user1.Id.AsLong());
var dbval = _database.Ships.FirstOrDefault(s =>
s.FirstUserId.Equals(userKeys.Item1) &&
s.SecondUserId.Equals(userKeys.Item2));
var shippingRate = 0;
if (dbval == null)
{
shippingRate = _randomNumberGenerator.Next(1, 100);
_database.Ships.Add(new ShipsModel()
{
FirstUserId = userKeys.Item1,
SecondUserId = userKeys.Item2,
Strength = shippingRate
});
await _database.SaveChangesAsync();
}
else
{
shippingRate = dbval.Strength;
}
var reply = $":heartpulse: **{Localization.Ship.Matchmaking}** :heartpulse:\r\n";
reply += $":two_hearts: {user1.Mention} :heart: {user2.Mention} :two_hearts:\r\n";
reply += $"0% [{BlockCounter(shippingRate)}] 100% - {DeterminateSuccess(shippingRate)}";
await ReplyAsync(reply);
}
catch (Exception e)
{
await ErrorHandler.HandleCommandException(e, Context);
}
}
private string DeterminateSuccess(int rate)
{
return (rate / 20) switch
{
0 => Localization.Ship.NotGoingToHappen,
1 => Localization.Ship.NotSuchAGoodIdea,
2 => Localization.Ship.ThereMightBeAChance,
3 => Localization.Ship.CouldWork,
4 => Localization.Ship.ItsAMatch,
_ => "nope"
};
}
private string BlockCounter(int rate)
{
var amount = rate / 10;
Console.WriteLine(amount);
var blocks = "";
for (var i = 1; i <= 10; i++)
if (i <= amount)
{
blocks += ":white_medium_small_square:";
if (i == amount)
blocks += $" {rate}% ";
}
else
{
blocks += ":black_medium_small_square:";
}
return blocks;
}
}
} | Java |
class CreateIp4NetworkLocationJoinTable < ActiveRecord::Migration
def change
create_join_table :ip4_networks, :locations do |t|
t.index [:ip4_network_id,:location_id], unique: true, name: 'ip4_network_location'
end
end
end
| Java |
using System;
using System.Diagnostics.CodeAnalysis;
using JetBrains.Annotations;
using NSubstitute;
using NUnit.Framework;
using Ploeh.AutoFixture.NUnit3;
using Selkie.EasyNetQ;
using Selkie.NUnit.Extensions;
using Selkie.Services.Common.Messages;
using Selkie.Windsor;
namespace Selkie.Services.Racetracks.Tests
{
[ExcludeFromCodeCoverage]
[TestFixture]
internal sealed class ServiceTests
{
[Theory]
[AutoNSubstituteData]
public void Constructor_ReturnsInstance_WhenCalled([NotNull] [Frozen] ISelkieBus bus,
[NotNull] Service service)
{
// assemble
// act
var sut = new Service(Substitute.For <ISelkieBus>(),
Substitute.For <ISelkieLogger>(),
Substitute.For <ISelkieManagementClient>());
// assert
Assert.NotNull(sut);
}
[Theory]
[AutoNSubstituteData]
public void ServiceInitializeSubscribesToPingRequestMessageTest([NotNull] [Frozen] ISelkieBus bus,
[NotNull] Service service)
{
// assemble
// act
service.Initialize();
string subscriptionId = service.GetType().ToString();
// assert
bus.Received().SubscribeAsync(subscriptionId,
Arg.Any <Action <PingRequestMessage>>());
}
[Theory]
[AutoNSubstituteData]
public void ServiceStartSendsMessageTest([NotNull] [Frozen] ISelkieBus bus,
[NotNull] Service service)
{
// assemble
// act
service.Start();
// assert
bus.Received().Publish(Arg.Is <ServiceStartedResponseMessage>(x => x.ServiceName == Service.ServiceName));
}
[Theory]
[AutoNSubstituteData]
public void ServiceStopSendsMessageTest([NotNull] [Frozen] ISelkieBus bus,
[NotNull] Service service)
{
// assemble
// act
service.Stop();
// assert
bus.Received().Publish(Arg.Is <ServiceStoppedResponseMessage>(x => x.ServiceName == Service.ServiceName));
}
}
} | Java |
<!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js">
<head>
{{ partial "head.html" . }}
</head>
<body class="td-{{ .Kind }}">
<header>
{{ partial "navbar.html" . }}
</header>
<div class="container-fluid td-outer">
<div class="td-main">
<div class="row flex-xl-nowrap">
<aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none">
{{ partial "sidebar.html" . }}
</aside>
<aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none">
{{ partial "page-meta-links.html" . }}
{{ partial "toc.html" . }}
{{ partial "taxonomy_terms_clouds.html" . }}
</aside>
<main class="col-12 col-md-9 col-xl-8 pl-md-5" role="main">
{{ partial "version-banner.html" . }}
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
{{ block "main" . }}{{ end }}
</main>
</div>
</div>
{{ partial "footer.html" . }}
</div>
{{ partial "scripts.html" . }}
</body>
</html>
| Java |
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package types
import (
"bytes"
"fmt"
"io"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/rlp"
)
type Receipt struct {
PostState []byte
CumulativeGasUsed *big.Int
Bloom Bloom
TxHash common.Hash
ContractAddress common.Address
logs state.Logs
GasUsed *big.Int
}
func NewReceipt(root []byte, cumulativeGasUsed *big.Int) *Receipt {
return &Receipt{PostState: common.CopyBytes(root), CumulativeGasUsed: new(big.Int).Set(cumulativeGasUsed)}
}
func (self *Receipt) SetLogs(logs state.Logs) {
self.logs = logs
}
func (self *Receipt) Logs() state.Logs {
return self.logs
}
func (self *Receipt) EncodeRLP(w io.Writer) error {
return rlp.Encode(w, []interface{}{self.PostState, self.CumulativeGasUsed, self.Bloom, self.logs})
}
func (self *Receipt) DecodeRLP(s *rlp.Stream) error {
var r struct {
PostState []byte
CumulativeGasUsed *big.Int
Bloom Bloom
TxHash common.Hash
ContractAddress common.Address
Logs state.Logs
GasUsed *big.Int
}
if err := s.Decode(&r); err != nil {
return err
}
self.PostState, self.CumulativeGasUsed, self.Bloom, self.TxHash, self.ContractAddress, self.logs, self.GasUsed = r.PostState, r.CumulativeGasUsed, r.Bloom, r.TxHash, r.ContractAddress, r.Logs, r.GasUsed
return nil
}
type ReceiptForStorage Receipt
func (self *ReceiptForStorage) EncodeRLP(w io.Writer) error {
storageLogs := make([]*state.LogForStorage, len(self.logs))
for i, log := range self.logs {
storageLogs[i] = (*state.LogForStorage)(log)
}
return rlp.Encode(w, []interface{}{self.PostState, self.CumulativeGasUsed, self.Bloom, self.TxHash, self.ContractAddress, storageLogs, self.GasUsed})
}
func (self *Receipt) RlpEncode() []byte {
bytes, err := rlp.EncodeToBytes(self)
if err != nil {
fmt.Println("TMP -- RECEIPT ENCODE ERROR", err)
}
return bytes
}
func (self *Receipt) Cmp(other *Receipt) bool {
if bytes.Compare(self.PostState, other.PostState) != 0 {
return false
}
return true
}
func (self *Receipt) String() string {
return fmt.Sprintf("receipt{med=%x cgas=%v bloom=%x logs=%v}", self.PostState, self.CumulativeGasUsed, self.Bloom, self.logs)
}
type Receipts []*Receipt
func (self Receipts) RlpEncode() []byte {
bytes, err := rlp.EncodeToBytes(self)
if err != nil {
fmt.Println("TMP -- RECEIPTS ENCODE ERROR", err)
}
return bytes
}
func (self Receipts) Len() int { return len(self) }
func (self Receipts) GetRlp(i int) []byte { return common.Rlp(self[i]) }
| Java |
/*
Simple DirectMedia Layer
Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_clipboard.h
*
* Include file for SDL clipboard handling
*/
#ifndef _SDL_clipboard_h
#define _SDL_clipboard_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Function prototypes */
/**
* \brief Put UTF-8 text into the clipboard
*
* \sa SDL_GetClipboardText()
*/
extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
/**
* \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
*
* \sa SDL_SetClipboardText()
*/
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
/**
* \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
*
* \sa SDL_GetClipboardText()
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_clipboard_h */
/* vi: set ts=4 sw=4 expandtab: */
| Java |
/**
* Hub Miner: a hubness-aware machine learning experimentation library.
* Copyright (C) 2014 Nenad Tomasev. Email: nenad.tomasev at gmail.com
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package draw.basic;
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import java.util.Arrays;
import java.util.List;
import javax.imageio.*;
import javax.swing.*;
/**
* This is a convenience class to create and optionally save to a file a
* BufferedImage of an area shown on the screen. It covers several different
* scenarios, so the image can be created of:
*
* a) an entire component b) a region of the component c) the entire desktop d)
* a region of the desktop
*
* This class can also be used to create images of components not displayed on a
* GUI. The only foolproof way to get an image in such cases is to make sure the
* component has been added to a realized window with code something like the
* following:
*
* JFrame frame = new JFrame(); frame.setContentPane( someComponent );
* frame.pack(); ScreenImage.createImage( someComponent );
*
* @author This code has been taken from the following web sources:
* https://www.wuestkamp.com/2012/02/java-save-component-to-image-make-screen-shot-of-component/
* http://tips4java.wordpress.com/2008/10/13/screen-image/
*/
public class ScreenImage {
private static List<String> imageTypes = Arrays.asList(
ImageIO.getWriterFileSuffixes());
/**
* Create a BufferedImage for Swing components. The entire component will be
* captured to an image.
*
* @param component Swing component to create the image from.
* @return image The image for the given region.
*/
public static BufferedImage createImage(JComponent component) {
Dimension dim = component.getSize();
if (dim.width == 0 || dim.height == 0) {
dim = component.getPreferredSize();
component.setSize(dim);
}
Rectangle region = new Rectangle(0, 0, dim.width, dim.height);
return ScreenImage.createImage(component, region);
}
/**
* Create a BufferedImage for Swing components. All or part of the component
* can be captured to an image.
*
* @param component Swing component to create the image from.
* @param region The region of the component to be captured to an image.
* @return image The image for the given region.
*/
public static BufferedImage createImage(JComponent component,
Rectangle region) {
if (!component.isDisplayable()) {
Dimension dim = component.getSize();
if (dim.width == 0 || dim.height == 0) {
dim = component.getPreferredSize();
component.setSize(dim);
}
layoutComponent(component);
}
BufferedImage image = new BufferedImage(region.width, region.height,
BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = image.createGraphics();
// Paint a background for non-opaque components.
if (!component.isOpaque()) {
g2d.setColor(component.getBackground());
g2d.fillRect(region.x, region.y, region.width, region.height);
}
g2d.translate(-region.x, -region.y);
component.paint(g2d);
g2d.dispose();
return image;
}
/**
* Convenience method to create a BufferedImage of the desktop.
*
* @param fileName Name of file to be created or null.
* @return image The image for the given region.
* @exception AWTException
* @exception IOException
*/
public static BufferedImage createDesktopImage() throws AWTException,
IOException {
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle region = new Rectangle(0, 0, dim.width, dim.height);
return ScreenImage.createImage(region);
}
/**
* Create a BufferedImage for AWT components.
*
* @param component AWT component to create image from
* @return image the image for the given region
* @exception AWTException see Robot class constructors
*/
public static BufferedImage createImage(Component component)
throws AWTException {
Point p = new Point(0, 0);
SwingUtilities.convertPointToScreen(p, component);
Rectangle region = component.getBounds();
region.x = p.x;
region.y = p.y;
return ScreenImage.createImage(region);
}
/**
* Create a BufferedImage from a rectangular region on the screen. This will
* include Swing components JFrame, JDialog and JWindow which all extend
* from Component, not JComponent.
*
* @param Region region on the screen to create image from
* @return Image the image for the given region
* @exception AWTException see Robot class constructors
*/
public static BufferedImage createImage(Rectangle region)
throws AWTException {
BufferedImage image = new Robot().createScreenCapture(region);
return image;
}
/**
* Write a BufferedImage to a File.
*
* @param Image image to be written.
* @param FileName name of file to be created.
* @exception IOException if an error occurs during writing.
*/
public static void writeImage(BufferedImage image, String fileName)
throws IOException {
if (fileName == null) {
return;
}
int offset = fileName.lastIndexOf(".");
if (offset == -1) {
String message = "file type was not specified";
throw new IOException(message);
}
String fileType = fileName.substring(offset + 1);
if (imageTypes.contains(fileType)) {
ImageIO.write(image, fileType, new File(fileName));
} else {
String message = "unknown writer file type (" + fileType + ")";
throw new IOException(message);
}
}
/**
* A recursive layout call on the component.
*
* @param component Component object.
*/
static void layoutComponent(Component component) {
synchronized (component.getTreeLock()) {
component.doLayout();
if (component instanceof Container) {
for (Component child :
((Container) component).getComponents()) {
layoutComponent(child);
}
}
}
}
}
| Java |
---
title: "爬虫之 Scrapy 框架"
layout: post
date: 2018-02-24 22:48
tag:
- 爬虫
blog: true
author: Topaz
summary: "BeautifulSoup Xpath"
permalink: Spiders-Scrapy-01
---
<h1 class="title"> 爬虫之 Scrapy 框架 </h1>
<h2> Table of Contents </h2>
- [Scrapy 简介](#c1)
- [主要组件](#c2)
- [工作流程](#c3)
- [安装](#c4)
- [基本命令](#c5)
- [HtmlXpathSelector](#c6)
- [写个基于 Scrapy 的爬虫项目](#c7)
- [Scrapy 自定义](#c8)
<a style="color: #AED6F1" href="https://topaz1618.github.io/Spiders-Scrapy-02"> ☞ Scrapy 文件详解</a>
<h2 id="c1"> Scrapy 简介 </h2>
Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架,使用Twisted异步网络库处理网络通讯,爬取网站数据,提取结构性数据的应用框架,可以应用在数据挖掘,信息处理,监测和自动化测试或存储历史数据等一系列的程序中
<h2 id="c2"> 主要组件 </h2>
{% highlight raw %}
- 引擎(Scrapy):用来处理整个系统的数据流处理, 触发事务(框架核心)
- 调度器(Scheduler):用来接受引擎发过来的请求, 压入队列中, 并在引擎再次请求的时候返回. 可以想像成一个URL(抓取网页的网址或者说是链接)的优先队列, 由它来决定下一个要抓取的网址是什么, 同时去除重复的网址
- 下载器(Downloader):用于下载网页内容, 并将网页内容返回给蜘蛛(Scrapy下载器是建立在twisted这个高效的异步模型上的)
- 爬虫(Spiders):爬虫是主要干活的, 用于从特定的网页中提取自己需要的信息, 即所谓的实体(Item) 。用户也可以从中提取出链接,让Scrapy继续抓取下一个页面
- 项目管道(Pipeline):负责处理爬虫从网页中抽取的实体,主要的功能是持久化实体、验证实体的有效性、清除不需要的信息。当页面被 爬虫解析后,将被发送到项目管道,并经过几个特定的次序处理数据
- 下载器中间件(Downloader Middlewares) :位于Scrapy引擎和下载器之间的框架,主要是处理Scrapy引擎与下载器之间的请求及响应
- 爬虫中间件(Spider Middlewares):介于Scrapy引擎和爬虫之间的框架,主要工作是处理蜘蛛的响应输入和请求输出
- 调度中间件(Scheduler Middewares):介于Scrapy引擎和调度之间的中间件,从Scrapy引擎发送到调度的请求和响应
{% endhighlight %}
<h2 id="c3"> 工作流程 </h2>
{% highlight raw %}
1. 引擎从调度器中取出一个链接(URL)用于接下来的抓取
2. 引擎把URL封装成一个请求(Request)传给下载器
3. 下载器把资源下载下来,并封装成应答包(Response)
4. 爬虫解析Response
5. 解析出实体(Item),则交给实体管道进行进一步的处理
6. 解析出的是链接(URL),则把URL交给调度器等待抓取
{% endhighlight %}
<h2 id="c4"> 安装 </h2>
#### Linux & Mac
{% highlight python %}
pip3 install scrapy
{% endhighlight %}
#### Windows
{% highlight python %}
pip3 install wheel
- 下载twisted
http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
- 进入下载目录
pip3 install Twisted-17.5.0-cp35-cp35m-win_amd64.whl
- 安装 scrapy
pip3 install scrapy
- 下载并安装pywin32
https://sourceforge.net/projects/pywin32/files/
{% endhighlight %}
<h2 id="c5"> 基本命令</h2>
{% highlight python %}
scrapy startproject [项目名称] # 创建项目
scrapy genspider [-t template] <name> <domain> #创建爬虫应用
scrapy list #展示爬虫应用列表
scrapy crawl [爬虫应用名称] #运行单独爬虫应用
scrapy genspider -l #查看所有命令
scrapy genspider -d [模板名称] #查看模板命令
{% endhighlight %}
<h2 id="c6"> HtmlXpathSelector </h2>
#### 简介
HtmlXpathSelector 是 Scrapy 自有的用于处理HTML文档的选择器,被称为XPath选择器(或简称为“选择器”),是因为它们“选择”由XPath表达式指定的HTML文档的某些部分。
#### 其它选择器
- BeautifulSoup:非常流行,缺点:速度很慢
- lxml:基于 ElementTree 的XML解析库(也解析HTML )
#### 应用
{% highlight python %}
from scrapy.selector import Selector, HtmlXPathSelector
from scrapy.http import HtmlResponse
html = """
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<ul>
<li class="item-"><a id='i12' href="link.html">first item</a></li>
<li class="item-0"><a id='i2' href="llink.html">first item</a></li>
<li class="item-1"><a href="llink2.html">second item<span>vv</span></a></li>
</ul>
<div><a href="llink2.html">second item</a></div>
</body>
</html>
"""
response = HtmlResponse(url='http://example.com', body=html,encoding='utf-8')
hxs = Selector(response)
#取出所有a标签
hxs = Selector(response=response).xpath('//a')
#取出所有有id属性的a标签
hxs = Selector(response=response).xpath('//a[@id]')
#取出开头为link的href标签
hxs = Selector(response=response).xpath('//a[starts-with(@href,"link")]' )
#取出链接包含link的href标签
hxs = Selector(response=response).xpath('//a[contains(@href, "link")]')
#正则,取出i开头后边是数字的
hxs = Selector(response=response).xpath('//a[re:test(@id, "i\d+")]')
hxs = Selector(response=response).xpath('//a[re:test(@id, "i\d+")]/text()').extract()
hxs = Selector(response=response).xpath('//a[re:test(@id, "i\d+")]/@href').extract()
hxs = Selector(response=response).xpath('/html/body/ul/li/a/@href').extract()
hxs = Selector(response=response).xpath('//body/ul/li/a/@href').extract_first()
#参考:https://doc.scrapy.org/en/0.12/topics/selectors.html
{% endhighlight %}
<h2 id="c7"> 写个基于 Scrapy 的爬虫项目 </h2>
#### 项目结构
{% highlight raw %}
cutetopaz/
scrapy.cfg #项目的主配置信息(真正爬虫相关的配置信息在settings.py文件中)
cutetopaz/
__init__.py
items.py #设置数据存储模板,用于结构化数据 如:Django的Model
pipelines.py #数据处理行为 如:一般结构化的数据持久化
settings.py #配置文件 如:递归的层数、并发数,延迟下载等
spiders/ #爬虫目录 如:创建文件,编写爬虫规则
__init__.py
xiaohuar.py #爬虫文件,一般正常人以网站域名命名
{% endhighlight %}
#### xiaohuar.py
{% highlight python %}
import scrapy
import hashlib
scrapy.selector import Selector
scrapy.http.request import Request
scrapy.http.cookies import CookieJar
scrapy import FormRequest
..items import XiaoHuarItem
class XiaoHuarSpider(scrapy.Spider):
name = "hira"
allowed_domains = ["xiaohuar.com"]
start_urls = ["http://www.xiaohuar.com/list-1-1.html",]
has_request_set = {}
def parse(self, response):
hxs = Selector(response)
items = hxs.select('//div[@class="item_list infinite_scroll"]/div')
for item in items:
src = item.xpath('.//div[@class="img"]/a/img/@src').extract_first()
name = item.xpath('.//div[@class="img"]/span/text()').extract_first()
school = item.xpath('.//div[@class="img"]/div[@class="btns"]/a/text()').extract_first() #==>广西大学
url = "http://www.xiaohuar.com%s" % src
obj = XiaoHuarItem(name=name,school=school, url=url)
yield obj
urls = hxs.xpath('//a[re:test(@href, "http://www.xiaohuar.com/ list-1-\d+.html")]/@href').extract() #拿到所有页面
for url in urls:
print("here is url:",url)
key = self.md5(url)
print('key!!!!!',key)
if key in self.has_request_set:
# print('你要的大字典',self.has_request_set)
pass
else:
self.has_request_set[key] = url
req = Request(url=url,method='GET',callback=self.parse)
yield req
@staticmethod
def md5(val):
ha = hashlib.md5()
ha.update(bytes(val, encoding='utf-8'))
key = ha.hexdigest()
return key
{% endhighlight %}
#### items.py
{% highlight python %}
import scrapy
class CutetopazItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
class XiaoHuarItem(scrapy.Item):
name = scrapy.Field()
school = scrapy.Field()
url = scrapy.Field()
{% endhighlight %}
#### pipelines.py
{% highlight python %}
import json
import os
import requests
class JsonPipeline(object):
'''按照settings.py里的顺序,先执行这个'''
def __init__(self):
self.file = open('xiaohua.txt', 'w')
def process_item(self, item, spider):
v = json.dumps(dict(item), ensure_ascii=False) #item ==> <class 'cutetopaz.items.XiaoHuarItem'> dict(item) ==> <class 'dict'> ,肉眼看的话item就是个字典啊,去掉dict()报错is not JSON serializable
self.file.write(v)
self.file.write('\n')
self.file.flush()
return item #返回一个json序列化后的item
class FilePipeline(object):
def __init__(self):
if not os.path.exists('imgs'): #创建个文件夹
os.makedirs('imgs')
def process_item(self, item, spider):
response = requests.get(item['url'], stream=True)
print('看看',response.__attrs__)
file_name = '%s_%s.jpg' % (item['name'], item['school'])
with open(os.path.join('imgs', file_name), mode='wb') as f:
f.write(response.content)
return item
{% endhighlight %}
#### settings.py
{% highlight python %}
ITEM_PIPELINES = {
'cutetopaz.pipelines.JsonPipeline': 100,
'cutetopaz.pipelines.FilePipeline': 300,
}
{% endhighlight %}
<h2 id="c8"> Scrapy 自定义 </h2>
#### 自定制命令
{% highlight raw %}
1.在spiders同级创建任意目录,如:commands
2.在其中创建 crawlall.py 文件 (此处文件名就是自定义的命令)
3.settings.py 中添加配置 COMMANDS_MODULE = '项目名称.目录名称'
4.项目目录中执行命令:scrapy crawlall
{% endhighlight %}
代码:
{% highlight python %}
from scrapy.commands import ScrapyCommand
from scrapy.utils.project import get_project_settings
class Command(ScrapyCommand):
requires_project = True
def syntax(self):
return '[options]'
def short_desc(self):
return 'Runs all of the spiders'
def run(self, args, opts):
spider_list = self.crawler_process.spiders.list()
for name in spider_list:
self.crawler_process.crawl(name, **opts.__dict__)
self.crawler_process.start()
{% endhighlight %}
#### 自定义扩展
自定义扩展时,利用信号在指定位置注册制定操作
{% highlight python %}
from scrapy import signals
class MyExtension(object):
def __init__(self, value):
self.value = value
@classmethod
def from_crawler(cls, crawler):
val = crawler.settings.getint('MMMM')
ext = cls(val)
crawler.signals.connect(ext.spider_opened, signal=signals.spider_opened)
crawler.signals.connect(ext.spider_closed, signal=signals.spider_closed)
return ext
def spider_opened(self, spider):
print('open')
def spider_closed(self, spider):
print('close')
{% endhighlight %}
#### 避免重复访问
Scrapy 默认使用 scrapy.dupefilter.RFPDupeFilter 进行去重,相关配置有
{% highlight raw %}
DUPEFILTER_CLASS = 'scrapy.dupefilter.RFPDupeFilter'
DUPEFILTER_DEBUG = False
JOBDIR = "保存范文记录的日志路径,如:/root/" # 最终路径为 /root/requests.seen
{% endhighlight %}
| Java |
@extends('admin.layout')
@section('styles')
<link href="/assets/css/pdfexport.css" rel="stylesheet">
@stop
@section('content')
<div class="container">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<p><a href="{{ url('admin/stavkeposla/show',[$evidencija->id]) }}" class="btn btn-warning pull-right"><i class="fa fa-arrow-circle-left"></i> Natrag</a></p>
<h4>Pregled stavke ponude</h4>
</div>
<div class="panel-body">
<div class="col-md-4 col-md-offset-5">
<button class="btn btn-primary" id="create_pdf"><i class="fa fa-file-pdf-o" aria-hidden="true"></i> Pretvori u PDF</button>
</div>
</div>
</div>
</div>
</div>
<page size="A4">
<div id="target">
<div class="row">
<div class="col-xs-12">
<div class="row top-head">
<div class="col-xs-3 head-left">
<img src="/assets/images/lukic-logo.png" alt="Waterrproofing co">
<h2>Mob. 098 111 222</h2>
</div>
<div class="col-xs-6 head-center">
<address>
<h1>WATERPROOFING CO</h1>
<h2>Zagreb <span>Ilica BB</span></h2>
<h2>OIB:72818256208</h2>
<h2><span>Žiro račun:</span> IBAN HR78948499611050015727</h2>
</address>
</div>
<div class="col-xs-3 head-right">
<img src="/assets/images/lukic-logo.png" alt="Waterrproofing co">
<h2>Tel fax 01 111 22 33</h2>
</div>
</div><!--top-head-->
<hr>
<div class="row top-adddress">
<div class="col-xs-6 head-adddress-left">
<p>Mjesto rada: {{ $evidencija->narucitelj_adresa }} </p>
</div>
<div class="col-xs-6 head-adddress-right">
<address class="pull-right">
<p><strong>{{ $evidencija->mjesto_rada }}</strong></p>
<p><strong>{{ $evidencija->narucitelj_adresa }}</strong></p>
<p><strong>OIB: {{ $evidencija->narucitelj_oib }}</strong></p>
</address>
</div>
</div><!--top-adddress-->
<div class="row invoice">
<div class="col-xs-12">
<h3>STAVKA PONUDE BR: 0{{ $evidencija->id }}.{{ $evidencija->created_at->format('my') }}-1</h3>
</div>
</div><!--invoice-->
<div class="row stavke">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><strong>Stavka br: {{ $stavka->broj_stavke }}</strong></h3>
<p><strong>Opis radova:</strong> {{ $stavka->opis_radova }}</p>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-condensed stavkamaterijal">
<thead>
<tr>
<th>Naziv materijala</th>
<th>Mjerna jedinica</th>
<th>Cijena materijala</th>
<th>Potrošnja</th>
<th>Materijal</th>
<th>Kalkul sat</th>
<th>Norma sat</th>
<th>Rad</th>
<th>Cijena po jm.</th>
<th>Ucinak m2 sat</th>
</tr>
</thead>
<tbody>
@foreach($stavkeposlovi as $pm)
<!-- foreach ($order->lineItems as $line) or some such thing here -->
<tr>
<td>{{ $pm->naziv_materijala }}</td>
<td>{{ $pm->mjerna_jedinica }}</td>
<td>{{ $pm->cijena_sa_popustom }}</td>
<td>{{ $pm->potrosnja_mat }}</td>
<td>{{ $pm->materijal }}</td>
<td>{{ $pm->kalkul_sat }}</td>
<td>{{ $pm->norma_sat }}</td>
<td>{{ $pm->rad }}</td>
<td>{{ $pm->cijena_po_jm }}</td>
<td>{{ $pm->ucinak_m2_sat }}</td>
</tr>
@endforeach
<tr>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line text-left"><strong>Cijena posla:</strong></td>
<td class="no-line text-right">{{ $stavka->cijena_posla }} - kn</td>
</tr>
<tr>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line"></td>
<td class="no-line text-left"><strong>Ukupna cijena:</strong></td>
<td class="no-line text-right">{{ $stavka->ukupna_cijena }} - kn</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="col-xs-7">
<p>Obračun prema stvarnim količinama.</p>
<p>{{ date('d.m.Y') }}</p>
</div>
<div class="col-xs-4">
<div class="pull-right">
<p class="line"><strong>Direktor</strong></p>
<p class="no-line"><strong>Ivica Ivić</strong></p>
</div>
</div>
<div class="col-xs-1"></div>
</div>
</div>
</div>
</div><!--/.stavke-->
<div class="row end">
</div><!--end-->
</div><!--col-xs-12-->
</div><!--row-->
</div>
</page>
@stop
@section('scripts')
<script src="/assets/js/jspdf.min.js"></script>
<script src="http://mrrio.github.io/jsPDF/dist/jspdf.debug.js"></script>
<script type="text/javascript" src="//cdn.rawgit.com/niklasvh/html2canvas/0.5.0-alpha2/dist/html2canvas.min.js"></script>
<script type="text/javascript">
(function(){
var target = $('#target'),
cache_width = target.width(),
a4 =[ 595.28, 841.89]; // for a4 size paper width and height
$('#create_pdf').on('click',function(){
$('#target').scrollTop(0);
createPDF();
});
//create pdf
function createPDF(){
getCanvas().then(function(canvas){
var
img = canvas.toDataURL("image/png"),
doc = new jsPDF({
unit:'px',
format:'a4'
});
doc.addImage(img, 'JPEG', 20, 20);
doc.save('ponuda.pdf');
target.width(cache_width);
});
}
// create canvas object
function getCanvas(){
target.width((a4[0]*1.33333) -60).css('max-width','none');
return html2canvas(target,{
imageTimeout:2000,
removeContainer:true
});
}
}());
</script>
@stop | Java |
/*
* Copyright (C) 2015 Bailey Forrest <baileycforrest@gmail.com>
*
* This file is part of CCC.
*
* CCC 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.
*
* CCC 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 CCC. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Interface for compliation manager
*/
#ifndef _MANAGER_H_
#define _MANAGER_H_
#include "ast/ast.h"
#include "ir/ir.h"
#include "lex/lex.h"
#include "lex/symtab.h"
#include "util/status.h"
/**
* Compilation manager structure. Manages data structures necessary for compiles
*/
typedef struct manager_t {
vec_t tokens;
symtab_t symtab;
lexer_t lexer;
token_man_t token_man;
fmark_man_t mark_man;
trans_unit_t *ast;
ir_trans_unit_t *ir;
bool parse_destroyed;
} manager_t;
/**
* Initialize a compilation mananger
*
* @param manager The compilation mananger to initialize
*/
void man_init(manager_t *manager);
/**
* Destroy a compilation mananger
*
* @param manager The compilation mananger to destroy
*/
void man_destroy(manager_t *manager);
/**
* Destroy a compilation mananger parsing data structures
*
* Calling this is optional because destructor destroys these. May be used to
* reduce memory usage however.
*
* @param manager The compilation mananger to destroy ast
*/
void man_destroy_parse(manager_t *manager);
/**
* Destroy a compilation mananger's ir
*
* Calling this is optional because destructor destroys ir. May be used to
* reduce memory usage however.
*
* @param manager The compilation mananger to destroy ir
*/
void man_destroy_ir(manager_t *manager);
status_t man_lex(manager_t *manager, char *filepath);
/**
* Parse a translation unit from a compilation manager.
*
* The manager's preprocessor must be set up first
*
* @param manager The compilation mananger to parse
* @param filepath Path to file to parse
* @param ast The parsed ast
* @return CCC_OK on success, error code on error.
*/
status_t man_parse(manager_t *manager, trans_unit_t **ast);
/**
* Parse an expression from a compilation manager.
*
* The manager's preprocessor must be set up first
*
* @param manager The compilation mananger to parse
* @param expr The parsed expression
* @return CCC_OK on success, error code on error.
*/
status_t man_parse_expr(manager_t *manager, expr_t **expr);
/**
* Translate the ast in a manager
*
* The manager must have a vaild ast from man_parse
*
* @param manager The compilation mananger to use
* @return Returns the ir tree
*/
ir_trans_unit_t *man_translate(manager_t *manager);
/**
* Print the tokens from a compilation manager
*
* The manager's preprocessor must be set up first
*
* @param manager The compilation mananger to use
* @return CCC_OK on success, error code on error.
*/
status_t man_dump_tokens(manager_t *manager);
#endif /* _MANAGER_H_ */
| Java |
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Sparesused */
$this->title = 'Create Sparesused';
$this->params['breadcrumbs'][] = ['label' => 'Sparesuseds', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="sparesused-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
| Java |
{% extends "base_nav.html" %}
{% load humanize %}
{% load i18n %}
{% load staticfiles %}
{% block "title" %}{% trans "Review Access Request" %}{% endblock %}
{% block "css" %}
<link href="{% static 'css/secrets.css' %}" rel="stylesheet">
{% endblock %}
{% block "content" %}
<script type="text/javascript">
$(function () {
$("[data-toggle='tooltip']").tooltip({container: 'body'});
});
</script>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>{% trans "Review Access Request" %}</h1>
<br>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="secret-attributes panel">
<br>
<table class="table-responsive">
<tr>
<td>{% trans "Requester" %}</td>
<td>
{{ access_request.requester }}
</td>
</tr>
<tr>
<td>{% trans "Secret" %}</td>
<td>
<a href="{{ access_request.secret.get_absolute_url }}">{{ access_request.secret.name }}</a>
</td>
</tr>
<tr>
<td>{% trans "Requested" %}</td>
<td>
<span data-toggle="tooltip" data-placement="top" title="{{ access_request.created|date:"Y-m-d H:i:s" }}">
{{ access_request.created|naturalday:"Y-m-d" }}
</span>
</td>
</tr>
{% if access_request.reason_request %}
<tr>
<td>{% trans "Reason" %}</td>
<td>
{{ access_request.reason_request }}
</td>
</tr>
{% endif %}
</table>
<br>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<form role="form" method="POST" action="{% url "secrets.access_request-review" hashid=access_request.hashid action="deny" %}">
{% csrf_token %}
<input type="text" class="form-control input-lg" name="reason" placeholder="{% trans "Reason for turning down the request (optional)" %}">
<br>
<button type="submit" class="btn btn-danger btn-lg pull-left">
<i class="fa fa-thumbs-down"></i> {% trans "Deny access" %}
</button>
</form>
<form role="form" method="POST" action="{% url "secrets.access_request-review" hashid=access_request.hashid action="allow" %}">
{% csrf_token %}
<button type="submit" class="btn btn-success btn-lg pull-right">
<i class="fa fa-thumbs-up"></i> {% trans "Allow access" %}
</button>
</form>
</div>
</div>
</div>
{% endblock %}
| Java |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# TODO prog_base.py - A starting template for Python scripts
#
# Copyright 2013 Robert B. Hawkins
#
"""
SYNOPSIS
TODO prog_base [-h,--help] [-v,--verbose] [--version]
DESCRIPTION
TODO This describes how to use this script. This docstring
will be printed by the script if there is an error or
if the user requests help (-h or --help).
EXAMPLES
TODO: Show some examples of how to use this script.
EXIT STATUS
TODO: List exit codes
AUTHOR
Rob Hawkins <webwords@txhawkins.net>
LICENSE
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
VERSION
1.0.0
"""
__author__ = "Rob Hawkins <webwords@txhawkins.net>"
__version__ = "1.0.0"
__date__ = "2013.12.01"
# Version Date Notes
# ------- ---------- -------------------------------------------------------
# 1.0.0 2013.12.01 Starting script template
#
import sys, os, traceback, argparse
import time
import re
#from pexpect import run, spawn
def test ():
global options, args
# TODO: Do something more interesting here...
print 'Hello from the test() function!'
def main ():
global options, args
# TODO: Do something more interesting here...
print 'Hello world!'
if __name__ == '__main__':
try:
start_time = time.time()
#parser = argparse.ArgumentParser(description="This is the program description", usage=globals()['__doc__'])
parser = argparse.ArgumentParser(description='This is the program description')
parser.add_argument('--version', action='version', version='%(prog)s v'+__version__)
parser.add_argument ('-v', '--verbose', action='store_true', help='produce verbose output')
parser.add_argument ('-t', '--test', action='store_true', help='run test suite')
args = parser.parse_args()
#if len(args) < 1:
# parser.error ('missing argument')
if args.verbose: print time.asctime()
if args.test:
test()
else:
main()
if args.verbose: print time.asctime()
if args.verbose: print 'TOTAL TIME IN MINUTES:',
if args.verbose: print (time.time() - start_time) / 60.0
sys.exit(0)
except KeyboardInterrupt, e: # Ctrl-C
raise e
except SystemExit, e: # sys.exit()
raise e
except Exception, e:
print 'ERROR, UNEXPECTED EXCEPTION'
print str(e)
traceback.print_exc()
os._exit(1)
| Java |
<!DOCTYPE html>
<html xml:lang="en-GB" lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
<head lang="en-GB">
<title>Ross Gammon’s Family Tree - SALTMARSH, Nellie</title>
<meta charset="UTF-8" />
<meta name ="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" />
<meta name ="apple-mobile-web-app-capable" content="yes" />
<meta name="generator" content="Gramps 4.2.8 http://gramps-project.org/" />
<meta name="author" content="" />
<link href="../../../images/favicon2.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../../css/narrative-screen.css" media="screen" rel="stylesheet" type="text/css" />
<link href="../../../css/narrative-print.css" media="print" rel="stylesheet" type="text/css" />
<link href="../../../css/ancestortree.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1 id="SiteTitle">Ross Gammon’s Family Tree</h1>
</div>
<div class="wrapper" id="nav" role="navigation">
<div class="container">
<ul class="menu" id="dropmenu">
<li class = "CurrentSection"><a href="../../../individuals.html" title="Individuals">Individuals</a></li>
<li><a href="../../../index.html" title="Surnames">Surnames</a></li>
<li><a href="../../../families.html" title="Families">Families</a></li>
<li><a href="../../../events.html" title="Events">Events</a></li>
<li><a href="../../../places.html" title="Places">Places</a></li>
<li><a href="../../../sources.html" title="Sources">Sources</a></li>
<li><a href="../../../repositories.html" title="Repositories">Repositories</a></li>
<li><a href="../../../media.html" title="Media">Media</a></li>
<li><a href="../../../thumbnails.html" title="Thumbnails">Thumbnails</a></li>
</ul>
</div>
</div>
<div class="content" id="IndividualDetail">
<h3>SALTMARSH, Nellie<sup><small></small></sup></h3>
<div id="summaryarea">
<table class="infolist">
<tr>
<td class="ColumnAttribute">Birth Name</td>
<td class="ColumnValue">
SALTMARSH, Nellie
</td>
</tr>
<tr>
<td class="ColumnAttribute">Gramps ID</td>
<td class="ColumnValue">I3011</td>
</tr>
<tr>
<td class="ColumnAttribute">Gender</td>
<td class="ColumnValue">female</td>
</tr>
<tr>
<td class="ColumnAttribute">Age at Death</td>
<td class="ColumnValue">72 years, 7 months, 30 days</td>
</tr>
</table>
</div>
<div class="subsection" id="events">
<h4>Events</h4>
<table class="infolist eventlist">
<thead>
<tr>
<th class="ColumnEvent">Event</th>
<th class="ColumnDate">Date</th>
<th class="ColumnPlace">Place</th>
<th class="ColumnDescription">Description</th>
<th class="ColumnNotes">Notes</th>
<th class="ColumnSources">Sources</th>
</tr>
</thead>
<tbody>
<tr>
<td class="ColumnEvent">
<a href="../../../evt/2/9/d15f5fdfc737c6ae020b165a92.html" title="Birth">
Birth
<span class="grampsid"> [E3288]</span>
</a>
</td>
<td class="ColumnDate">1875-05-02</td>
<td class="ColumnPlace">
<a href="../../../plc/c/4/d15f5fb92e843882bcabe3e6e4c.html" title="">
</a>
</td>
<td class="ColumnDescription"> </td>
<td class="ColumnNotes">
<div>
</div>
</td>
<td class="ColumnSources">
</td>
</tr>
<tr>
<td class="ColumnEvent">
<a href="../../../evt/1/2/d15f5fdfc7d2cb5bb6e4db0aa21.html" title="Death">
Death
<span class="grampsid"> [E3289]</span>
</a>
</td>
<td class="ColumnDate">1948</td>
<td class="ColumnPlace">
<a href="../../../plc/1/d/d15f5fdfc80455f1da835d10d1.html" title="">
</a>
</td>
<td class="ColumnDescription"> </td>
<td class="ColumnNotes">
<div>
</div>
</td>
<td class="ColumnSources">
</td>
</tr>
</tbody>
</table>
</div>
<div class="subsection" id="parents">
<h4>Parents</h4>
<table class="infolist">
<thead>
<tr>
<th class="ColumnAttribute">Relation to main person</th>
<th class="ColumnValue">Name</th>
<th class="ColumnValue">Relation within this family (if not by birth)</th>
</tr>
</thead>
<tbody>
</tbody>
<tr>
<td class="ColumnAttribute">Father</td>
<td class="ColumnValue">
<a href="../../../ppl/e/5/d15f5fde9511e3067925f537c5e.html">SALTMARSH, Richard<span class="grampsid"> [I2916]</span></a>
</td>
</tr>
<tr>
<td class="ColumnAttribute">Mother</td>
<td class="ColumnValue">
<a href="../../../ppl/b/6/d15f5fdfa0c318cef314f61c96b.html">DYER, Elizabeth<span class="grampsid"> [I2998]</span></a>
</td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/c/9/d15f5fdfa2844c2b56a5686d19c.html">SALTMARSH, Elizabeth<span class="grampsid"> [I2999]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Brother</td>
<td class="ColumnValue"> <a href="../../../ppl/b/4/d15f5fdfa4e48dce8bbcbeedf4b.html">SALTMARSH, Richard<span class="grampsid"> [I3000]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/f/a/d15f5fdfa92337411784f7a40af.html">SALTMARSH, Sarah<span class="grampsid"> [I3001]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/4/4/d15f5fdfabb4cd317d555aa9644.html">SALTMARSH, Annie<span class="grampsid"> [I3002]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/d/3/d15f5fdfadc673a028570d3303d.html">SALTMARSH, Fanny<span class="grampsid"> [I3003]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/b/5/d15f5fdfb11159d19acff5c205b.html">SALTMARSH, Dinah<span class="grampsid"> [I3004]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/8/2/d15f5fdfb454eceb98fec921e28.html">SALTMARSH, Laura Sarah<span class="grampsid"> [I3005]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Brother</td>
<td class="ColumnValue"> <a href="../../../ppl/1/1/d15f5fdfb674ec8396cde6ae911.html">SALTMARSH, Joseph<span class="grampsid"> [I3006]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Brother</td>
<td class="ColumnValue"> <a href="../../../ppl/d/e/d15f5fdfb866c91391ac0aec8ed.html">SALTMARSH, Arthur<span class="grampsid"> [I3007]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/9/3/d15f5fdfbec2053f1d4c3bd7c39.html">SALTMARSH, Emily<span class="grampsid"> [I3008]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Brother</td>
<td class="ColumnValue"> <a href="../../../ppl/d/8/d15f5fdfc1d3c32c960346d388d.html">SALTMARSH, John<span class="grampsid"> [I3009]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/b/b/d15f5fdfc3e3113bc7dca41b4bb.html">SALTMARSH, Charlotte<span class="grampsid"> [I3010]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> </td>
<td class="ColumnValue"> <a href="../../../ppl/9/3/d15f5fdfc6f1c1b003779b54739.html">SALTMARSH, Nellie<span class="grampsid"> [I3011]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Sister</td>
<td class="ColumnValue"> <a href="../../../ppl/b/2/d15f5fdfca4389f740f1857e02b.html">SALTMARSH, Florence<span class="grampsid"> [I3012]</span></a></td>
<td class="ColumnValue"></td>
</tr>
<tr>
<td class="ColumnAttribute"> Brother</td>
<td class="ColumnValue"> <a href="../../../ppl/1/b/d15f5fdfcc6c1c2b1026d4a6b1.html">SALTMARSH, William<span class="grampsid"> [I3013]</span></a></td>
<td class="ColumnValue"></td>
</tr>
</table>
</div>
<div class="subsection" id="families">
<h4>Families</h4>
<table class="infolist">
<tr class="BeginFamily">
<td class="ColumnType"> </td>
<td class="ColumnAttribute"> </td>
<td class="ColumnValue"><a href="../../../fam/4/c/d15f5fdfc9867118ce73148f4c4.html" title="Family of OGILVIE, John and SALTMARSH, Nellie">Family of OGILVIE, John and SALTMARSH, Nellie<span class="grampsid"> [F6404]</span></a></td>
</tr>
<tr class="BeginFamily">
<td class="ColumnType">Married</td>
<td class="ColumnAttribute">Husband</td>
<td class="ColumnValue">
<a href="../../../ppl/7/3/d15f60a2363420ed3fb6201ac37.html">OGILVIE, John<span class="grampsid"> [I18668]</span></a>
</td>
</tr>
<tr>
<td class="ColumnType"> </td>
<td class="ColumnAttribute"> </td>
<td class="ColumnValue">
<table class="infolist eventlist">
<thead>
<tr>
<th class="ColumnEvent">Event</th>
<th class="ColumnDate">Date</th>
<th class="ColumnPlace">Place</th>
<th class="ColumnDescription">Description</th>
<th class="ColumnNotes">Notes</th>
<th class="ColumnSources">Sources</th>
</tr>
</thead>
<tbody>
<tr>
<td class="ColumnEvent">
<a href="../../../evt/a/b/d15f60e15b35b46d4260945aba.html" title="Marriage">
Marriage
<span class="grampsid"> [E26432]</span>
</a>
</td>
<td class="ColumnDate">1918-07-10</td>
<td class="ColumnPlace">
<a href="../../../plc/8/f/d15f60e15bc16afb84461bc9bf8.html" title="">
</a>
</td>
<td class="ColumnDescription"> </td>
<td class="ColumnNotes">
<div>
</div>
</td>
<td class="ColumnSources">
<a href="#sref1a">1a</a>
</td>
</tr>
</tbody>
</table>
</td>
<tr>
<td class="ColumnType"> </td>
<td class="ColumnAttribute">Attributes</td>
<td class="ColumnValue">
<table class="infolist attrlist">
<thead>
<tr>
<th class="ColumnType">Type</th>
<th class="ColumnValue">Value</th>
<th class="ColumnNotes">Notes</th>
<th class="ColumnSources">Sources</th>
</tr>
</thead>
<tbody>
<tr>
<td class="ColumnType">_UID</td>
<td class="ColumnValue">70B154F442C634468BD1883D388376FD3A35</td>
<td class="ColumnNotes"><div></div></td>
<td class="ColumnSources"> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tr>
</table>
</div>
<div class="subsection" id="attributes">
<h4>Attributes</h4>
<table class="infolist attrlist">
<thead>
<tr>
<th class="ColumnType">Type</th>
<th class="ColumnValue">Value</th>
<th class="ColumnNotes">Notes</th>
<th class="ColumnSources">Sources</th>
</tr>
</thead>
<tbody>
<tr>
<td class="ColumnType">_UID</td>
<td class="ColumnValue">EB539E2A33426F4CA6DF9FA0688D30C5E41E</td>
<td class="ColumnNotes"><div></div></td>
<td class="ColumnSources"> </td>
</tr>
</tbody>
</table>
</div>
<div class="subsection" id="pedigree">
<h4>Pedigree</h4>
<ol class="pedigreegen">
<li>
<a href="../../../ppl/e/5/d15f5fde9511e3067925f537c5e.html">SALTMARSH, Richard<span class="grampsid"> [I2916]</span></a>
<ol>
<li class="spouse">
<a href="../../../ppl/b/6/d15f5fdfa0c318cef314f61c96b.html">DYER, Elizabeth<span class="grampsid"> [I2998]</span></a>
<ol>
<li>
<a href="../../../ppl/c/9/d15f5fdfa2844c2b56a5686d19c.html">SALTMARSH, Elizabeth<span class="grampsid"> [I2999]</span></a>
</li>
<li>
<a href="../../../ppl/b/4/d15f5fdfa4e48dce8bbcbeedf4b.html">SALTMARSH, Richard<span class="grampsid"> [I3000]</span></a>
</li>
<li>
<a href="../../../ppl/f/a/d15f5fdfa92337411784f7a40af.html">SALTMARSH, Sarah<span class="grampsid"> [I3001]</span></a>
</li>
<li>
<a href="../../../ppl/4/4/d15f5fdfabb4cd317d555aa9644.html">SALTMARSH, Annie<span class="grampsid"> [I3002]</span></a>
</li>
<li>
<a href="../../../ppl/d/3/d15f5fdfadc673a028570d3303d.html">SALTMARSH, Fanny<span class="grampsid"> [I3003]</span></a>
</li>
<li>
<a href="../../../ppl/8/2/d15f5fdfb454eceb98fec921e28.html">SALTMARSH, Laura Sarah<span class="grampsid"> [I3005]</span></a>
</li>
<li>
<a href="../../../ppl/b/5/d15f5fdfb11159d19acff5c205b.html">SALTMARSH, Dinah<span class="grampsid"> [I3004]</span></a>
</li>
<li>
<a href="../../../ppl/1/1/d15f5fdfb674ec8396cde6ae911.html">SALTMARSH, Joseph<span class="grampsid"> [I3006]</span></a>
</li>
<li>
<a href="../../../ppl/d/e/d15f5fdfb866c91391ac0aec8ed.html">SALTMARSH, Arthur<span class="grampsid"> [I3007]</span></a>
</li>
<li>
<a href="../../../ppl/9/3/d15f5fdfbec2053f1d4c3bd7c39.html">SALTMARSH, Emily<span class="grampsid"> [I3008]</span></a>
</li>
<li>
<a href="../../../ppl/d/8/d15f5fdfc1d3c32c960346d388d.html">SALTMARSH, John<span class="grampsid"> [I3009]</span></a>
</li>
<li>
<a href="../../../ppl/b/b/d15f5fdfc3e3113bc7dca41b4bb.html">SALTMARSH, Charlotte<span class="grampsid"> [I3010]</span></a>
</li>
<li class="thisperson">
SALTMARSH, Nellie
<ol class="spouselist">
<li class="spouse">
<a href="../../../ppl/7/3/d15f60a2363420ed3fb6201ac37.html">OGILVIE, John<span class="grampsid"> [I18668]</span></a>
</li>
</ol>
</li>
<li>
<a href="../../../ppl/b/2/d15f5fdfca4389f740f1857e02b.html">SALTMARSH, Florence<span class="grampsid"> [I3012]</span></a>
</li>
<li>
<a href="../../../ppl/1/b/d15f5fdfcc6c1c2b1026d4a6b1.html">SALTMARSH, William<span class="grampsid"> [I3013]</span></a>
</li>
</ol>
</li>
</ol>
</li>
</ol>
</div>
<div class="subsection" id="tree">
<h4>Ancestors</h4>
<div id="treeContainer" style="width:735px; height:602px;">
<div class="boxbg female AncCol0" style="top: 269px; left: 6px;">
<a class="noThumb" href="../../../ppl/9/3/d15f5fdfc6f1c1b003779b54739.html">
SALTMARSH, Nellie
</a>
</div>
<div class="shadow" style="top: 274px; left: 10px;"></div>
<div class="bvline" style="top: 301px; left: 165px; width: 15px"></div>
<div class="gvline" style="top: 306px; left: 165px; width: 20px"></div>
<div class="boxbg male AncCol1" style="top: 119px; left: 196px;">
<a class="noThumb" href="../../../ppl/e/5/d15f5fde9511e3067925f537c5e.html">
SALTMARSH, Richard
</a>
</div>
<div class="shadow" style="top: 124px; left: 200px;"></div>
<div class="bvline" style="top: 151px; left: 180px; width: 15px;"></div>
<div class="gvline" style="top: 156px; left: 185px; width: 20px;"></div>
<div class="bhline" style="top: 151px; left: 180px; height: 150px;"></div>
<div class="gvline" style="top: 156px; left: 185px; height: 150px;"></div>
<div class="bvline" style="top: 151px; left: 355px; width: 15px"></div>
<div class="gvline" style="top: 156px; left: 355px; width: 20px"></div>
<div class="boxbg male AncCol2" style="top: 44px; left: 386px;">
<a class="noThumb" href="../../../ppl/7/0/d15f5fb93c47b8feec7c96fd107.html">
SALTMARSH, William
</a>
</div>
<div class="shadow" style="top: 49px; left: 390px;"></div>
<div class="bvline" style="top: 76px; left: 370px; width: 15px;"></div>
<div class="gvline" style="top: 81px; left: 375px; width: 20px;"></div>
<div class="bhline" style="top: 76px; left: 370px; height: 75px;"></div>
<div class="gvline" style="top: 81px; left: 375px; height: 75px;"></div>
<div class="bvline" style="top: 76px; left: 545px; width: 15px"></div>
<div class="gvline" style="top: 81px; left: 545px; width: 20px"></div>
<div class="boxbg male AncCol3" style="top: 7px; left: 576px;">
<a class="noThumb" href="../../../ppl/b/5/d15f5fb94714b44224670d12b5b.html">
SALTMARSH, William
</a>
</div>
<div class="shadow" style="top: 12px; left: 580px;"></div>
<div class="bvline" style="top: 39px; left: 560px; width: 15px;"></div>
<div class="gvline" style="top: 44px; left: 565px; width: 20px;"></div>
<div class="bhline" style="top: 39px; left: 560px; height: 37px;"></div>
<div class="gvline" style="top: 44px; left: 565px; height: 37px;"></div>
<div class="boxbg female AncCol3" style="top: 81px; left: 576px;">
<a class="noThumb" href="../../../ppl/7/c/d15f5fb94b631e50cfe6f4e3fc7.html">
BUTLER, Mary
</a>
</div>
<div class="shadow" style="top: 86px; left: 580px;"></div>
<div class="bvline" style="top: 113px; left: 560px; width: 15px;"></div>
<div class="gvline" style="top: 118px; left: 565px; width: 20px;"></div>
<div class="bhline" style="top: 76px; left: 560px; height: 37px;"></div>
<div class="gvline" style="top: 81px; left: 565px; height: 37px;"></div>
<div class="boxbg female AncCol2" style="top: 194px; left: 386px;">
<a class="noThumb" href="../../../ppl/3/c/d15f5fb940b58ef52b9ce85adc3.html">
STEVENS, Elizabeth
</a>
</div>
<div class="shadow" style="top: 199px; left: 390px;"></div>
<div class="bvline" style="top: 226px; left: 370px; width: 15px;"></div>
<div class="gvline" style="top: 231px; left: 375px; width: 20px;"></div>
<div class="bhline" style="top: 151px; left: 370px; height: 75px;"></div>
<div class="gvline" style="top: 156px; left: 375px; height: 75px;"></div>
<div class="bvline" style="top: 226px; left: 545px; width: 15px"></div>
<div class="gvline" style="top: 231px; left: 545px; width: 20px"></div>
<div class="boxbg male AncCol3" style="top: 157px; left: 576px;">
<a class="noThumb" href="../../../ppl/7/3/d15f5fde7e7679ecf3079f2dd37.html">
STEVENS, Thomas
</a>
</div>
<div class="shadow" style="top: 162px; left: 580px;"></div>
<div class="bvline" style="top: 189px; left: 560px; width: 15px;"></div>
<div class="gvline" style="top: 194px; left: 565px; width: 20px;"></div>
<div class="bhline" style="top: 189px; left: 560px; height: 37px;"></div>
<div class="gvline" style="top: 194px; left: 565px; height: 37px;"></div>
<div class="boxbg female AncCol3" style="top: 231px; left: 576px;">
<a class="noThumb" href="../../../ppl/2/c/d15f5fde8121285d992e96c3c2.html">
PHILLIPS, Mary
</a>
</div>
<div class="shadow" style="top: 236px; left: 580px;"></div>
<div class="bvline" style="top: 263px; left: 560px; width: 15px;"></div>
<div class="gvline" style="top: 268px; left: 565px; width: 20px;"></div>
<div class="bhline" style="top: 226px; left: 560px; height: 37px;"></div>
<div class="gvline" style="top: 231px; left: 565px; height: 37px;"></div>
<div class="boxbg female AncCol1" style="top: 419px; left: 196px;">
<a class="noThumb" href="../../../ppl/b/6/d15f5fdfa0c318cef314f61c96b.html">
DYER, Elizabeth
</a>
</div>
<div class="shadow" style="top: 424px; left: 200px;"></div>
<div class="bvline" style="top: 451px; left: 180px; width: 15px;"></div>
<div class="gvline" style="top: 456px; left: 185px; width: 20px;"></div>
<div class="bhline" style="top: 301px; left: 180px; height: 150px;"></div>
<div class="gvline" style="top: 306px; left: 185px; height: 150px;"></div>
</div>
</div>
<div class="subsection" id="sourcerefs">
<h4>Source References</h4>
<ol>
<li>
<a href="../../../src/9/4/d15f60a23683e37d4ae44106449.html" title="Neroli Ferguson Email 21 November 2007" name ="sref1">
Neroli Ferguson Email 21 November 2007
<span class="grampsid"> [S0409]</span>
</a>
<ol>
<li id="sref1a">
<ul>
<li>
Confidence: Low
</li>
</ul>
</li>
</ol>
</li>
</ol>
</div>
</div>
<div class="fullclear"></div>
<div id="footer">
<p id="createdate">
Generated by <a href="http://gramps-project.org/">Gramps</a> 4.2.8<br />Last change was the 2015-08-05 19:54:13<br />Created for <a href="../../../ppl/9/e/d15f5fb48902c4fc1b421d249e9.html">GAMMON, Francis</a>
</p>
<p id="copyright">
</p>
</div>
</body>
</html>
| Java |
/*****************************************************************************
* Copyright (c) 2014-2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "../../common.h"
#include "../../interface/Viewport.h"
#include "../../paint/Paint.h"
#include "../../paint/Supports.h"
#include "../../world/Entity.h"
#include "../Track.h"
#include "../TrackPaint.h"
#include "../Vehicle.h"
/** rct2: 0x0076E5C9 */
static void paint_twist_structure(
paint_session* session, const Ride* ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height)
{
const TileElement* savedTileElement = static_cast<const TileElement*>(session->CurrentlyDrawnItem);
rct_ride_entry* rideEntry = get_ride_entry(ride->subtype);
Vehicle* vehicle = nullptr;
if (rideEntry == nullptr)
{
return;
}
height += 7;
uint32_t baseImageId = rideEntry->vehicles[0].base_image_id;
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && ride->vehicles[0] != SPRITE_INDEX_NULL)
{
vehicle = GetEntity<Vehicle>(ride->vehicles[0]);
session->InteractionType = ViewportInteractionItem::Entity;
session->CurrentlyDrawnItem = vehicle;
}
uint32_t frameNum = (direction * 88) % 216;
if (vehicle != nullptr)
{
frameNum += (vehicle->sprite_direction >> 3) << 4;
frameNum += vehicle->Pitch;
frameNum = frameNum % 216;
}
uint32_t imageColourFlags = session->TrackColours[SCHEME_MISC];
if (imageColourFlags == IMAGE_TYPE_REMAP)
{
imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(ride->vehicle_colours[0].Body, ride->vehicle_colours[0].Trim);
}
uint32_t structureFrameNum = frameNum % 24;
uint32_t imageId = (baseImageId + structureFrameNum) | imageColourFlags;
PaintAddImageAsParent(
session, imageId, { xOffset, yOffset, height }, { 24, 24, 48 }, { xOffset + 16, yOffset + 16, height });
rct_drawpixelinfo* dpi = &session->DPI;
if (dpi->zoom_level < 1 && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr)
{
for (int32_t i = 0; i < vehicle->num_peeps; i += 2)
{
imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(vehicle->peep_tshirt_colours[i], vehicle->peep_tshirt_colours[i + 1]);
uint32_t peepFrameNum = (frameNum + i * 12) % 216;
imageId = (baseImageId + 24 + peepFrameNum) | imageColourFlags;
PaintAddImageAsChild(session, imageId, xOffset, yOffset, 24, 24, 48, height, xOffset + 16, yOffset + 16, height);
}
}
session->CurrentlyDrawnItem = savedTileElement;
session->InteractionType = ViewportInteractionItem::Ride;
}
/** rct2: 0x0076D858 */
static void paint_twist(
paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
const TrackElement& trackElement)
{
if (ride == nullptr)
return;
trackSequence = track_map_3x3[direction][trackSequence];
const uint8_t edges = edges_3x3[trackSequence];
uint32_t imageId;
wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]);
StationObject* stationObject = ride_get_station_object(ride);
track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_MISC], height, floorSpritesCork, stationObject);
switch (trackSequence)
{
case 7:
if (track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation))
{
imageId = SPR_FENCE_ROPE_SW | session->TrackColours[SCHEME_MISC];
PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 29, 0, height + 3 });
}
if (track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation))
{
imageId = SPR_FENCE_ROPE_SE | session->TrackColours[SCHEME_MISC];
PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 3 });
}
break;
default:
track_paint_util_paint_fences(
session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_MISC], height,
fenceSpritesRope, session->CurrentRotation);
break;
}
switch (trackSequence)
{
case 1:
paint_twist_structure(session, ride, direction, 32, 32, height);
break;
case 3:
paint_twist_structure(session, ride, direction, 32, -32, height);
break;
case 5:
paint_twist_structure(session, ride, direction, 0, -32, height);
break;
case 6:
paint_twist_structure(session, ride, direction, -32, 32, height);
break;
case 7:
paint_twist_structure(session, ride, direction, -32, -32, height);
break;
case 8:
paint_twist_structure(session, ride, direction, -32, 0, height);
break;
}
int32_t cornerSegments = 0;
switch (trackSequence)
{
case 1:
cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC;
break;
case 3:
cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4;
break;
case 6:
cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0;
break;
case 7:
cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4;
break;
}
paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20);
paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0);
paint_util_set_general_support_height(session, height + 64, 0x20);
}
/**
* rct2: 0x0076D658
*/
TRACK_PAINT_FUNCTION get_track_paint_function_twist(int32_t trackType)
{
if (trackType != TrackElemType::FlatTrack3x3)
{
return nullptr;
}
return paint_twist;
}
| Java |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by texi2html, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Singular 2-0-4 Manual: D.5.8.6 is_reg</title>
<meta name="description" content="Singular 2-0-4 Manual: D.5.8.6 is_reg">
<meta name="keywords" content="Singular 2-0-4 Manual: D.5.8.6 is_reg">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
@import "sing_tex4ht_tex.css";
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:pre}
span.nolinebreak {white-space:pre}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" background="../singular_images/Mybg.png">
<a name="is_005freg"></a>
<table border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td align="left">
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr valign="top" align="left">
<td valign="middle" align="left"> <a href="index.htm"><img
src="../singular_images/singular-icon-transparent.png" width="50"
border="0" alt="Top"></a>
</td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="is_005fis.html#is_005fis" title="Previous section in reading order"><img src="../singular_images/a_left.png" border="0" alt="Back: D.5.8.5 is_is" align="middle"></a></td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="is_005fregs.html#is_005fregs" title="Next section in reading order"><img src="../singular_images/a_right.png" border="0" alt="Forward: D.5.8.7 is_regs" align="middle"></a></td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="SINGULAR-libraries.html#SINGULAR-libraries" title="Beginning of this chapter or previous chapter"><img src="../singular_images/a_leftdouble.png" border="0" alt="FastBack: Appendix D SINGULAR libraries" align="middle"></a></td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="Release-Notes.html#Release-Notes" title="Next chapter"><img src="../singular_images/a_rightdouble.png" border="0" alt="FastForward: E Release Notes" align="middle"></a></td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="sing_005flib.html#sing_005flib" title="Up section"><img src="../singular_images/a_up.png" border="0" alt="Up: D.5.8 sing_lib" align="middle"></a></td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="index.htm#Preface" title="Cover (top) of document"><img src="../singular_images/a_top.png" border="0" alt="Top: 1 Preface" align="middle"></a></td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="sing_toc.htm#SEC_Contents" title="Table of contents"><img src="../singular_images/a_tableofcon.png" border="0" alt="Contents: Table of Contents" align="middle"></a></td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="Index.html#Index" title="Index"><img src="../singular_images/a_index.png" border="0" alt="Index: F Index" align="middle"></a></td>
</tr>
<tr valign="top" align="left">
<td valign="middle" align="left"><a href="sing_abt.htm#SEC_About" title="About (help)"><img src="../singular_images/a_help.png" border="0" alt="About: About This Document" align="middle"></a></td>
</tr>
</table>
</td>
<td align="left">
<a name="is_005freg-1"></a>
<h4 class="subsubsection">D.5.8.6 is_reg</h4>
<a name="index-is_005freg"></a>
<p>Procedure from library <code>sing.lib</code> (see <a href="sing_005flib.html#sing_005flib">sing_lib</a>).
</p>
<dl compact="compact">
<dt><strong>Usage:</strong></dt>
<dd><p>is_reg(f,id); f poly, id ideal or module
</p>
</dd>
<dt><strong>Return:</strong></dt>
<dd><p>1 if multiplication with f is injective modulo id, 0 otherwise
</p>
</dd>
<dt><strong>Note:</strong></dt>
<dd><p>let R be the basering and id a submodule of R^n. The procedure checks
injectivity of multiplication with f on R^n/id. The basering may be a
quotient ring
</p>
</dd>
</dl>
<p><strong>Example:</strong>
</p><div class="smallexample">
<pre class="smallexample">LIB "sing.lib";
ring r = 32003,(x,y),ds;
ideal i = x8,y8;
ideal j = (x+y)^4;
i = intersect(i,j);
poly f = xy;
is_reg(f,i);
→ 0
</pre></div>
</td>
</tr>
</table>
<hr>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left"> <a href="index.htm"><img
src="../singular_images/singular-icon-transparent.png" width="50"
border="0" alt="Top"></a>
</td>
<td valign="middle" align="left"><a href="is_005fis.html#is_005fis" title="Previous section in reading order"><img src="../singular_images/a_left.png" border="0" alt="Back: D.5.8.5 is_is" align="middle"></a></td>
<td valign="middle" align="left"><a href="is_005fregs.html#is_005fregs" title="Next section in reading order"><img src="../singular_images/a_right.png" border="0" alt="Forward: D.5.8.7 is_regs" align="middle"></a></td>
<td valign="middle" align="left"><a href="SINGULAR-libraries.html#SINGULAR-libraries" title="Beginning of this chapter or previous chapter"><img src="../singular_images/a_leftdouble.png" border="0" alt="FastBack: Appendix D SINGULAR libraries" align="middle"></a></td>
<td valign="middle" align="left"><a href="Release-Notes.html#Release-Notes" title="Next chapter"><img src="../singular_images/a_rightdouble.png" border="0" alt="FastForward: E Release Notes" align="middle"></a></td>
<td valign="middle" align="left"><a href="sing_005flib.html#sing_005flib" title="Up section"><img src="../singular_images/a_up.png" border="0" alt="Up: D.5.8 sing_lib" align="middle"></a></td>
<td valign="middle" align="left"><a href="index.htm#Preface" title="Cover (top) of document"><img src="../singular_images/a_top.png" border="0" alt="Top: 1 Preface" align="middle"></a></td>
<td valign="middle" align="left"><a href="sing_toc.htm#SEC_Contents" title="Table of contents"><img src="../singular_images/a_tableofcon.png" border="0" alt="Contents: Table of Contents" align="middle"></a></td>
<td valign="middle" align="left"><a href="Index.html#Index" title="Index"><img src="../singular_images/a_index.png" border="0" alt="Index: F Index" align="middle"></a></td>
<td valign="middle" align="left"><a href="sing_abt.htm#SEC_About" title="About (help)"><img src="../singular_images/a_help.png" border="0" alt="About: About This Document" align="middle"></a></td>
</tr></table>
<font size="-1">
User manual for <a href="http://www.singular.uni-kl.de/"><i>Singular</i></a> version 2-0-4, October 2002,
generated by <a href="http://www.gnu.org/software/texinfo/"><i>texi2html</i></a>.
</font>
</body>
</html>
| Java |
use vars qw(%result_texis %result_texts %result_trees %result_errors
%result_indices %result_sectioning %result_nodes %result_menus
%result_floats %result_converted %result_converted_errors
%result_elements %result_directions_text);
use utf8;
$result_trees{'top_node_normalization'} = {
'contents' => [
{
'contents' => [],
'parent' => {},
'type' => 'text_root'
},
{
'args' => [
{
'contents' => [
{
'extra' => {
'command' => {}
},
'parent' => {},
'text' => ' ',
'type' => 'empty_spaces_after_command'
},
{
'parent' => {},
'text' => 'ToP'
},
{
'parent' => {},
'text' => '
',
'type' => 'spaces_at_end'
}
],
'parent' => {},
'type' => 'misc_line_arg'
}
],
'cmdname' => 'node',
'contents' => [
{
'parent' => {},
'text' => '
',
'type' => 'empty_line'
},
{
'contents' => [
{
'args' => [
{
'contents' => [
{
'parent' => {},
'text' => 'TOP'
}
],
'parent' => {},
'type' => 'brace_command_arg'
}
],
'cmdname' => 'xref',
'contents' => [],
'extra' => {
'brace_command_contents' => [
[
{}
]
],
'label' => {},
'node_argument' => {
'node_content' => [
{}
],
'normalized' => 'Top'
}
},
'line_nr' => {
'file_name' => '',
'line_nr' => 3,
'macro' => ''
},
'parent' => {}
},
{
'parent' => {},
'text' => '. '
},
{
'args' => [
{
'contents' => [
{
'parent' => {},
'text' => 'tOP'
}
],
'parent' => {},
'type' => 'brace_command_arg'
}
],
'cmdname' => 'xref',
'contents' => [],
'extra' => {
'brace_command_contents' => [
[
{}
]
],
'label' => {},
'node_argument' => {
'node_content' => [
{}
],
'normalized' => 'Top'
}
},
'line_nr' => {},
'parent' => {}
},
{
'parent' => {},
'text' => '.
'
}
],
'parent' => {},
'type' => 'paragraph'
},
{
'parent' => {},
'text' => '
',
'type' => 'empty_line'
},
{
'cmdname' => 'menu',
'contents' => [
{
'extra' => {
'command' => {}
},
'parent' => {},
'text' => '
',
'type' => 'empty_line_after_command'
},
{
'args' => [
{
'parent' => {},
'text' => '* ',
'type' => 'menu_entry_leading_text'
},
{
'contents' => [
{
'parent' => {},
'text' => 'tOP'
}
],
'parent' => {},
'type' => 'menu_entry_node'
},
{
'parent' => {},
'text' => '::',
'type' => 'menu_entry_separator'
},
{
'contents' => [
{
'contents' => [
{
'parent' => {},
'text' => '
'
}
],
'parent' => {},
'type' => 'preformatted'
}
],
'parent' => {},
'type' => 'menu_entry_description'
}
],
'extra' => {
'menu_entry_description' => {},
'menu_entry_node' => {
'node_content' => [
{}
],
'normalized' => 'Top'
}
},
'line_nr' => {
'file_name' => '',
'line_nr' => 6,
'macro' => ''
},
'parent' => {},
'type' => 'menu_entry'
},
{
'args' => [
{
'contents' => [
{
'extra' => {
'command' => {}
},
'parent' => {},
'text' => ' ',
'type' => 'empty_spaces_after_command'
},
{
'parent' => {},
'text' => 'menu'
},
{
'parent' => {},
'text' => '
',
'type' => 'spaces_at_end'
}
],
'parent' => {},
'type' => 'misc_line_arg'
}
],
'cmdname' => 'end',
'extra' => {
'command' => {},
'command_argument' => 'menu',
'text_arg' => 'menu'
},
'line_nr' => {
'file_name' => '',
'line_nr' => 7,
'macro' => ''
},
'parent' => {}
}
],
'extra' => {
'end_command' => {}
},
'line_nr' => {
'file_name' => '',
'line_nr' => 5,
'macro' => ''
},
'parent' => {}
}
],
'extra' => {
'node_content' => [
{}
],
'nodes_manuals' => [
{
'node_content' => [],
'normalized' => 'Top'
}
],
'normalized' => 'Top'
},
'line_nr' => {
'file_name' => '',
'line_nr' => 1,
'macro' => ''
},
'parent' => {}
}
],
'type' => 'document_root'
};
$result_trees{'top_node_normalization'}{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'};
$result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'extra'}{'command'} = $result_trees{'top_node_normalization'}{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0]{'contents'}[2]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'args'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'args'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'extra'}{'brace_command_contents'}[0][0] = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'args'}[0]{'contents'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'extra'}{'label'} = $result_trees{'top_node_normalization'}{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'extra'}{'node_argument'}{'node_content'}[0] = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'args'}[0]{'contents'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'args'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'args'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'extra'}{'brace_command_contents'}[0][0] = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'args'}[0]{'contents'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'extra'}{'label'} = $result_trees{'top_node_normalization'}{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'extra'}{'node_argument'}{'node_content'}[0] = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'args'}[0]{'contents'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'line_nr'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'line_nr'};
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[2]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'contents'}[3]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[1]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[2]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[0]{'extra'}{'command'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[1]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[1]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[2]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[3]{'contents'}[0]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[3]{'contents'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[3]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[3];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[3]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'extra'}{'menu_entry_description'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[3];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'extra'}{'menu_entry_node'}{'node_content'}[0] = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'args'}[1]{'contents'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[1]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'command'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'args'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'args'}[0]{'contents'}[1]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'args'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'args'}[0]{'contents'}[2]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'args'}[0];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'args'}[0]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'extra'}{'command'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'extra'}{'end_command'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'contents'}[2];
$result_trees{'top_node_normalization'}{'contents'}[1]{'contents'}[3]{'parent'} = $result_trees{'top_node_normalization'}{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'extra'}{'node_content'}[0] = $result_trees{'top_node_normalization'}{'contents'}[1]{'args'}[0]{'contents'}[1];
$result_trees{'top_node_normalization'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'} = $result_trees{'top_node_normalization'}{'contents'}[1]{'extra'}{'node_content'};
$result_trees{'top_node_normalization'}{'contents'}[1]{'parent'} = $result_trees{'top_node_normalization'};
$result_texis{'top_node_normalization'} = '@node ToP
@xref{TOP}. @xref{tOP}.
@menu
* tOP::
@end menu
';
$result_texts{'top_node_normalization'} = '
. .
* tOP::
';
$result_sectioning{'top_node_normalization'} = {};
$result_nodes{'top_node_normalization'} = {
'cmdname' => 'node',
'extra' => {
'normalized' => 'Top'
},
'menu_child' => {},
'menus' => [
{
'cmdname' => 'menu',
'extra' => {
'end_command' => {
'cmdname' => 'end',
'extra' => {
'command' => {},
'command_argument' => 'menu',
'text_arg' => 'menu'
}
}
}
}
],
'node_next' => {},
'node_prev' => {},
'node_up' => {
'extra' => {
'manual_content' => [
{
'text' => 'dir'
}
],
'top_node_up' => {}
},
'type' => 'top_node_up'
}
};
$result_nodes{'top_node_normalization'}{'menu_child'} = $result_nodes{'top_node_normalization'};
$result_nodes{'top_node_normalization'}{'menus'}[0]{'extra'}{'end_command'}{'extra'}{'command'} = $result_nodes{'top_node_normalization'}{'menus'}[0];
$result_nodes{'top_node_normalization'}{'node_next'} = $result_nodes{'top_node_normalization'};
$result_nodes{'top_node_normalization'}{'node_prev'} = $result_nodes{'top_node_normalization'};
$result_nodes{'top_node_normalization'}{'node_up'}{'extra'}{'top_node_up'} = $result_nodes{'top_node_normalization'};
$result_menus{'top_node_normalization'} = {
'cmdname' => 'node',
'extra' => {
'normalized' => 'Top'
},
'menu_child' => {},
'menu_up' => {},
'menu_up_hash' => {
'Top' => 1
}
};
$result_menus{'top_node_normalization'}{'menu_child'} = $result_menus{'top_node_normalization'};
$result_menus{'top_node_normalization'}{'menu_up'} = $result_menus{'top_node_normalization'};
$result_errors{'top_node_normalization'} = [
{
'error_line' => ':1: warning: For `ToP\', up in menu `ToP\' and up `(dir)\' don\'t match
',
'file_name' => '',
'line_nr' => 1,
'macro' => '',
'text' => 'For `ToP\', up in menu `ToP\' and up `(dir)\' don\'t match',
'type' => 'warning'
}
];
$result_converted{'info'}->{'top_node_normalization'} = 'This is , produced by tp version from .
File: , Node: Top, Next: Top, Prev: Top, Up: (dir)
*Note ToP::. *Note ToP::.
* Menu:
* tOP::
Tag Table:
Node: Top41
End Tag Table
';
1;
| Java |
/* xoreos-tools - Tools to help with xoreos development
*
* xoreos-tools is the legal property of its developers, whose names
* can be found in the AUTHORS file distributed with this source
* distribution.
*
* xoreos-tools 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.
*
* xoreos-tools 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 xoreos-tools. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
* Low-level detection of architecture/system properties.
*/
/* Based on ScummVM (<http://scummvm.org>) code, which is released
* under the terms of version 2 or later of the GNU General Public
* License.
*
* The original copyright note in ScummVM reads as follows:
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef COMMON_SYSTEM_H
#define COMMON_SYSTEM_H
#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif
#include "src/common/noreturn.h"
#include "src/common/fallthrough.h"
#if defined(_MSC_VER)
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#define FORCEINLINE __forceinline
#define PLUGIN_EXPORT __declspec(dllexport)
#if _MSC_VER < 1900
#define snprintf c99_snprintf
#define vsnprintf c99_vsnprintf
static FORCEINLINE int c99_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
int count = -1;
if (size != 0)
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
if (count == -1)
count = _vscprintf(format, ap);
return count;
}
static FORCEINLINE int c99_snprintf(char *str, size_t size, const char *format, ...) {
int count;
va_list ap;
va_start(ap, format);
count = c99_vsnprintf(str, size, format, ap);
va_end(ap);
return count;
}
#endif
#ifndef HAVE_STRTOLL
#define strtoll _strtoi64
#define HAVE_STRTOLL 1
#endif
#ifndef HAVE_STRTOULL
#define strtoull _strtoui64
#define HAVE_STRTOULL 1
#endif
#if !defined(XOREOS_LITTLE_ENDIAN) && !defined(XOREOS_BIG_ENDIAN)
#define XOREOS_LITTLE_ENDIAN 1
#endif
#ifndef WIN32
#define WIN32
#endif
#define IGNORE_UNUSED_VARIABLES __pragma(warning(disable : 4101))
#elif defined(__MINGW32__)
#if !defined(XOREOS_LITTLE_ENDIAN) && !defined(XOREOS_BIG_ENDIAN)
#define XOREOS_LITTLE_ENDIAN 1
#endif
#define PLUGIN_EXPORT __declspec(dllexport)
#ifndef WIN32
#define WIN32
#endif
#elif defined(UNIX)
#if !defined(XOREOS_LITTLE_ENDIAN) && !defined(XOREOS_BIG_ENDIAN)
#if defined(HAVE_CONFIG_H)
#if defined(WORDS_BIGENDIAN)
#define XOREOS_BIG_ENDIAN 1
#else
#define XOREOS_LITTLE_ENDIAN 1
#endif
#endif
#endif
#else
#error No system type defined
#endif
//
// GCC specific stuff
//
#if defined(__GNUC__)
#define PACKED_STRUCT __attribute__((__packed__))
#define GCC_PRINTF(x,y) __attribute__((__format__(printf, x, y)))
#if (__GNUC__ >= 3)
// Macro to ignore several "unused variable" warnings produced by GCC
#define IGNORE_UNUSED_VARIABLES _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"")
#endif
#if !defined(FORCEINLINE) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
#define FORCEINLINE inline __attribute__((__always_inline__))
#endif
#else
#define PACKED_STRUCT
#define GCC_PRINTF(x,y)
#endif
#if defined(__cplusplus)
#define UNUSED(x)
#else
#if defined(__GNUC__)
#define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
#else
#define UNUSED(x) UNUSED_ ## x
#endif
#endif
#if defined(__clang__)
// clang does not know the "unused-but-set-variable" (but claims to be GCC)
#undef IGNORE_UNUSED_VARIABLES
#define IGNORE_UNUSED_VARIABLES _Pragma("GCC diagnostic ignored \"-Wunused-variable\"")
#endif
//
// Fallbacks for various functions
//
#ifndef HAVE_STRTOF
#define strtof c99_strtof
static FORCEINLINE float c99_strtof(const char *nptr, char **endptr) {
return (float) strtod(nptr, endptr);
}
#define HAVE_STRTOF 1
#endif
#ifndef HAVE_STRTOLL
#define strtoll c99_strtoll
#include <cctype>
#include <cerrno>
#include <climits>
#ifndef LLONG_MAX
#define LLONG_MAX 0x7FFFFFFFFFFFFFFFlL
#endif
#ifndef LLONG_MIN
#define LLONG_MIN (-0x7FFFFFFFFFFFFFFFLL-1)
#endif
/** Convert a string to a long long.
*
* Based on OpenBSD's strtoll() function, released under the terms of
* the 3-clause BSD license.
*
* Ignores 'locale' stuff. Assumes that the upper and lower case
* alphabets and digits are each contiguous.
*/
static long long c99_strtoll(const char *nptr, char **endptr, int base) {
const char *s;
long long acc, cutoff;
int c;
int neg, any, cutlim;
/*
* Skip white space and pick up leading +/- sign if any.
* If base is 0, allow 0x for hex and 0 for octal, else
* assume decimal; if base is already 16, allow 0x.
*/
s = nptr;
do {
c = (unsigned char) *s++;
} while (isspace(c));
if (c == '-') {
neg = 1;
c = *s++;
} else {
neg = 0;
if (c == '+')
c = *s++;
}
if ((base == 0 || base == 16) &&
c == '0' && (*s == 'x' || *s == 'X')) {
c = s[1];
s += 2;
base = 16;
}
if (base == 0)
base = c == '0' ? 8 : 10;
/*
* Compute the cutoff value between legal numbers and illegal
* numbers. That is the largest legal value, divided by the
* base. An input number that is greater than this value, if
* followed by a legal input character, is too big. One that
* is equal to this value may be valid or not; the limit
* between valid and invalid numbers is then based on the last
* digit. For instance, if the range for long longs is
* [-9223372036854775808..9223372036854775807] and the input base
* is 10, cutoff will be set to 922337203685477580 and cutlim to
* either 7 (neg==0) or 8 (neg==1), meaning that if we have
* accumulated a value > 922337203685477580, or equal but the
* next digit is > 7 (or 8), the number is too big, and we will
* return a range error.
*
* Set any if any `digits' consumed; make it negative to indicate
* overflow.
*/
cutoff = neg ? LLONG_MIN : LLONG_MAX;
cutlim = cutoff % base;
cutoff /= base;
if (neg) {
if (cutlim > 0) {
cutlim -= base;
cutoff += 1;
}
cutlim = -cutlim;
}
for (acc = 0, any = 0;; c = (unsigned char) *s++) {
if (isdigit(c))
c -= '0';
else if (isalpha(c))
c -= isupper(c) ? 'A' - 10 : 'a' - 10;
else
break;
if (c >= base)
break;
if (any < 0)
continue;
if (neg) {
if (acc < cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = LLONG_MIN;
errno = ERANGE;
} else {
any = 1;
acc *= base;
acc -= c;
}
} else {
if (acc > cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = LLONG_MAX;
errno = ERANGE;
} else {
any = 1;
acc *= base;
acc += c;
}
}
}
if (endptr != 0)
*endptr = any ? const_cast<char *>(s - 1) : const_cast<char *>(nptr);
return (acc);
}
#define HAVE_STRTOLL 1
#endif
#ifndef HAVE_STRTOULL
#define strtoull c99_strtoull
#include <cctype>
#include <cerrno>
#include <climits>
#ifndef ULLONG_MAX
#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL
#endif
/** Convert a string to an unsigned long long.
*
* Based on OpenBSD's strtoull() function, released under the terms of
* the 3-clause BSD license.
*
* Ignores 'locale' stuff. Assumes that the upper and lower case
* alphabets and digits are each contiguous.
*/
static unsigned long long c99_strtoull(const char *nptr, char **endptr, int base) {
const char *s;
unsigned long long acc, cutoff;
int c;
int neg, any, cutlim;
/*
* See c99_strtoll() for comments as to the logic used.
*/
s = nptr;
do {
c = (unsigned char) *s++;
} while (isspace(c));
if (c == '-') {
neg = 1;
c = *s++;
} else {
neg = 0;
if (c == '+')
c = *s++;
}
if ((base == 0 || base == 16) &&
c == '0' && (*s == 'x' || *s == 'X')) {
c = s[1];
s += 2;
base = 16;
}
if (base == 0)
base = c == '0' ? 8 : 10;
cutoff = ULLONG_MAX / (unsigned long long)base;
cutlim = ULLONG_MAX % (unsigned long long)base;
for (acc = 0, any = 0;; c = (unsigned char) *s++) {
if (isdigit(c))
c -= '0';
else if (isalpha(c))
c -= isupper(c) ? 'A' - 10 : 'a' - 10;
else
break;
if (c >= base)
break;
if (any < 0)
continue;
if (acc > cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = ULLONG_MAX;
errno = ERANGE;
} else {
any = 1;
acc *= static_cast<unsigned long long>(base);
acc += c;
}
}
if (neg && any > 0)
acc = -acc;
if (endptr != 0)
*endptr = any ? const_cast<char *>(s - 1) : const_cast<char *>(nptr);
return (acc);
}
#define HAVE_STRTOULL 1
#endif
// Compatibility macro for dealing with the explicit bool cast problem.
#if __cplusplus < 201103L
#define XOREOS_EXPLICIT_OPERATOR_CONV
#else
#define XOREOS_EXPLICIT_OPERATOR_CONV explicit
#endif
//
// Fallbacks / default values for various special macros
//
#ifndef FORCEINLINE
#define FORCEINLINE inline
#endif
#ifndef STRINGBUFLEN
#define STRINGBUFLEN 1024
#endif
#ifndef MAXPATHLEN
#define MAXPATHLEN 256
#endif
#ifndef IGNORE_UNUSED_VARIABLES
#define IGNORE_UNUSED_VARIABLES
#endif
#endif // COMMON_SYSTEM_H
| Java |
/*
* dmfs - http://dmfs.org/
*
* Copyright (C) 2012 Marten Gajda <marten@dmfs.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
package org.dmfs.xmlserializer;
import java.io.IOException;
import java.io.Writer;
/**
* An abstract XML node.
*
* @author Marten Gajda <marten@dmfs.org>
*/
public abstract class XmlAbstractNode
{
/**
* State for new nodes.
*/
final static int STATE_NEW = 0;
/**
* State indicating the node has been opened and the start tag has been opened.
*/
final static int STATE_START_TAG_OPEN = 1;
/**
* State indication the node has been opened and the start tag has been closed, but the end tag is not written yet.
*/
final static int STATE_START_TAG_CLOSED = 2;
/**
* State indication the node has been closed (i.e. the end tag has been written).
*/
final static int STATE_CLOSED = 3;
/**
* The state of a node, initialized with {@link STATE_NEW}.
*/
int state = STATE_NEW;
/**
* The depth at which this node is located in the XML tree. Until this node has been added to a tree it is considered to be the root element.
*/
private int mDepth = 0;
/**
* Set the depth of this node (i.e. at which level it is located in the XML node tree).
*
* @param depth
* The depth.
*/
void setDepth(int depth)
{
mDepth = depth;
}
/**
* Get the depth of this node (i.e. at which level it is located in the XML node tree).
*
* @return The depth.
*/
final int getDepth()
{
return mDepth;
}
/**
* Assign the {@link XmlNamespaceRegistry} that belongs to this XML tree.
*
* @param namespaceRegistry
* The {@link XmlNamespaceRegistry} of this XMl tree.
* @throws InvalidValueException
*/
abstract void setNamespaceRegistry(XmlNamespaceRegistry namespaceRegistry) throws InvalidValueException;
/**
* Open this node for writing to a {@link Writer}
*
* @param out
* The {@link Writer} to write to.
* @throws IOException
* @throws InvalidStateException
* @throws InvalidValueException
*/
abstract void open(Writer out) throws IOException, InvalidStateException, InvalidValueException;
/**
* Close this node, flushing out all unwritten content.
*
* @throws IOException
* @throws InvalidStateException
* @throws InvalidValueException
*/
abstract void close() throws IOException, InvalidStateException, InvalidValueException;
}
| Java |
<? include('global.php'); ?>
<? // asp2php (vbscript) converted on Sat Apr 25 20:59:49 2015
$CODEPAGE="1252";?>
<? require("Connections/connrumbo.php"); ?>
<?
$Siniestros__DDcia="%";
if (($_POST["Cia"]!=""))
{
$Siniestros__DDcia=$_POST["Cia"];
}
?>
<?
// $Siniestros is of type "ADODB.Recordset"
echo $MM_connrumbo_STRING;
echo "SELECT Abonados.Nombre, Abonados.Apellido1, Abonados.Apellido2, Siniestro.Compañia as cpropia, Contrarios.Compañia as cia, Siniestro.Fase, Fases.Texto, Siniestro.Id, Siniestro.[Fecha Siniestro] FROM Fases INNER JOIN ((Abonados INNER JOIN Siniestro ON Abonados.Id = Siniestro.Abonado) INNER JOIN Contrarios ON Siniestro.Id = Contrarios.Siniestro) ON Fases.Id = Siniestro.Fase WHERE (((Contrarios.Compañia)like '%"+str_replace("'","''",$Siniestros__DDcia)+"%') AND ((Siniestro.Fase)<70)) ORDER BY Siniestro.Fase";
echo 0;
echo 2;
echo 1;
$rs=mysql_query();
$Siniestros_numRows=0;
?>
<?
$Repeat1__numRows=-1;
$Repeat1__index=0;
$Siniestros_numRows=$Siniestros_numRows+$Repeat1__numRows;
?>
<html>
<head>
<title>Listado por Cia. Contraria</title>
</head>
<body bgcolor="#FFFFFF" background="Imagenes/fondo.gif" bgproperties="fixed" text="#000000" topmargin="30">
<script language="JavaScript" src="menu.js"></script>
<table width="100%" border="1" cellspacing="0" bordercolor="#000000">
<tr bgcolor="#CCCCCC">
<td>Nombre</td>
<td>Fecha de siniestro </td>
<td>Compañia</td>
<td>Fase</td>
</tr>
<?
while((($Repeat1__numRows!=0) && (!($Siniestros==0))))
{
?>
<tr>
<td><a href="Siniestro.asp?Id=<? echo (->$Item["Id"]->$Value);?>"><? echo (->$Item["Nombre"]->$Value);?> <? echo (->$Item["Apellido1"]->$Value);?> <? echo (->$Item["Apellido2"]->$Value);?></a></td>
<td><? echo (->$Item["Fecha Siniestro"]->$Value);?></td>
<td><? echo (->$Item["cia"]->$Value);?></td>
<td><? echo (->$Item["Texto"]->$Value);?></td>
</tr>
<?
$Repeat1__index=$Repeat1__index+1;
$Repeat1__numRows=$Repeat1__numRows-1;
$Siniestros=mysql_fetch_array($Siniestros_query);
$Siniestros_BOF=0;
}
?>
</table>
</body>
</html>
<?
$Siniestros=null;
?>
| Java |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html >
<head><title>1.1.1.0 node_activity_vectors.py</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
<!-- html,index=2,3,4,5,next -->
<meta name="src" content="mammult_doc.tex">
<meta name="date" content="2015-10-19 17:14:00">
<link rel="stylesheet" type="text/css" href="mammult_doc.css">
</head><body
>
<!--l. 3--><div class="crosslinks"><p class="noindent">[<a
href="mammult_docsu5.html" >next</a>] [<a
href="mammult_docsu3.html" >prev</a>] [<a
href="mammult_docsu3.html#tailmammult_docsu3.html" >prev-tail</a>] [<a
href="#tailmammult_docsu4.html">tail</a>] [<a
href="mammult_docsu1.html#mammult_docsu4.html" >up</a>] </p></div>
<h5 class="subsubsectionHead"><a
id="x8-70001.1.1"></a><span
class="cmtt-10x-x-109">node</span><span
class="cmtt-10x-x-109">_activity</span><span
class="cmtt-10x-x-109">_vectors.py</span></h5>
<!--l. 3--><p class="noindent" ><span
class="cmbx-10x-x-109">NAME</span>
<!--l. 3--><p class="indent" > <span
class="cmbx-10x-x-109">node</span><span
class="cmbx-10x-x-109">_activity</span><span
class="cmbx-10x-x-109">_vectors.py </span>- compute the activity vectors of all the nodes of
a multiplex.
<!--l. 3--><p class="noindent" ><span
class="cmbx-10x-x-109">SYNOPSYS</span>
<!--l. 3--><p class="indent" > <span
class="cmbx-10x-x-109">node</span><span
class="cmbx-10x-x-109">_activity</span><span
class="cmbx-10x-x-109">_vectors.py </span><span
class="cmmi-10x-x-109"><</span><span
class="cmitt-10x-x-109">layer1</span><span
class="cmmi-10x-x-109">> </span><span
class="cmitt-10x-x-109">[</span><span
class="cmmi-10x-x-109"><</span><span
class="cmitt-10x-x-109">layer2</span><span
class="cmmi-10x-x-109">> </span><span
class="cmitt-10x-x-109">...]</span>
<!--l. 15--><p class="noindent" ><span
class="cmbx-10x-x-109">DESCRIPTION</span>
<!--l. 15--><p class="indent" > Compute and print on output the activity vectors of the nodes of a
multiplex network, whose layers are given as input in the files <span
class="cmti-10x-x-109">layer1</span>, <span
class="cmti-10x-x-109">layer2</span>,
etc.
<!--l. 15--><p class="indent" > Each input file contains the (undirected) edge list of a layer, and each line is
in the format:
<!--l. 15--><p class="indent" >   <span
class="cmti-10x-x-109">src</span><span
class="cmti-10x-x-109">_ID dest</span><span
class="cmti-10x-x-109">_ID</span>
<!--l. 15--><p class="indent" > where <span
class="cmti-10x-x-109">src</span><span
class="cmti-10x-x-109">_ID </span>and <span
class="cmti-10x-x-109">dest</span><span
class="cmti-10x-x-109">_ID </span>are the IDs of the two endpoints of an
edge.
<!--l. 26--><p class="noindent" ><span
class="cmbx-10x-x-109">OUTPUT</span>
<!--l. 26--><p class="indent" > The program prints on <span
class="cmtt-10x-x-109">stdout </span>a list of lines, where the n-th line contains
the activity vector of the n-th node, i.e. a bit-string where each bit is
set to “1” if the node is active on the corresponding layer, and to “0”
otherwise.
<!--l. 26--><p class="noindent" >As usual, node IDs start from zero and proceed sequentially, without gaps, i.e., if
a node ID is not present in any of the layer files given as input, the program
considers it as being isolated on all the layers, and will print on output a
bit-string of zeros.
<!--l. 28--><p class="noindent" ><span
class="cmbx-10x-x-109">REFERENCE</span>
<!--l. 28--><p class="indent" > V. Nicosia, V. Latora, “Measuring and modeling correlations in multiplex
networks”, <span
class="cmti-10x-x-109">Phys. Rev. E </span><span
class="cmbx-10x-x-109">92</span>, 032805 (2015).
<!--l. 28--><p class="indent" > Link to paper: <a
href="http://journals.aps.org/pre/abstract/10.1103/PhysRevE.92.032805" class="url" ><span
class="cmtt-10x-x-109">http://journals.aps.org/pre/abstract/10.1103/PhysRevE.92.032805</span></a>
<!--l. 3--><div class="crosslinks"><p class="noindent">[<a
href="mammult_docsu5.html" >next</a>] [<a
href="mammult_docsu3.html" >prev</a>] [<a
href="mammult_docsu3.html#tailmammult_docsu3.html" >prev-tail</a>] [<a
href="mammult_docsu4.html" >front</a>] [<a
href="mammult_docsu1.html#mammult_docsu4.html" >up</a>] </p></div>
<!--l. 3--><p class="indent" > <a
id="tailmammult_docsu4.html"></a>
</body></html>
| Java |
/*
Copyright (C) 2012 Statoil ASA, Norway.
The file 'config_content_node.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __CONFIG_CONTENT_NODE_H__
#define __CONFIG_CONTENT_NODE_H__
#ifdef __cplusplus
define extern "C" {
#endif
#include <ert/util/hash.h>
#include <ert/config/config_schema_item.h>
#include <ert/config/config_path_elm.h>
typedef struct config_content_node_struct config_content_node_type;
config_content_node_type * config_content_node_alloc( const config_schema_item_type * schema , const config_path_elm_type * cwd);
void config_content_node_add_value(config_content_node_type * node , const char * value);
void config_content_node_set(config_content_node_type * node , const stringlist_type * token_list);
char * config_content_node_alloc_joined_string(const config_content_node_type * node, const char * sep);
void config_content_node_free(config_content_node_type * node);
void config_content_node_free__(void * arg);
const char * config_content_node_get_full_string( config_content_node_type * node , const char * sep );
const char * config_content_node_iget(const config_content_node_type * node , int index);
bool config_content_node_iget_as_bool(const config_content_node_type * node , int index);
int config_content_node_iget_as_int(const config_content_node_type * node , int index);
double config_content_node_iget_as_double(const config_content_node_type * node , int index);
const char * config_content_node_iget_as_path(config_content_node_type * node , int index);
const char * config_content_node_iget_as_abspath( config_content_node_type * node , int index);
const char * config_content_node_iget_as_relpath( config_content_node_type * node , int index);
const stringlist_type * config_content_node_get_stringlist( const config_content_node_type * node );
const char * config_content_node_safe_iget(const config_content_node_type * node , int index);
int config_content_node_get_size( const config_content_node_type * node );
const char * config_content_node_get_kw( const config_content_node_type * node );
void config_content_node_assert_key_value( const config_content_node_type * node );
const config_path_elm_type * config_content_node_get_path_elm( const config_content_node_type * node );
void config_content_node_init_opt_hash( const config_content_node_type * node , hash_type * opt_hash , int elm_offset);
void config_content_node_fprintf( const config_content_node_type * node , FILE * stream );
#ifdef __cplusplus
}
#endif
#endif
| Java |
package beseenium.controller.ActionFactory;
/** Copyright(C) 2015 Jan P.C. Hanson & BeSeen Marketing Ltd
*
* 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/>.
*/
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import beseenium.controller.ActionDataFactory.ActionDataFactory;
import beseenium.controller.ActionFactory.elementActions.MakeClear;
import beseenium.controller.ActionFactory.elementActions.MakeClick;
import beseenium.controller.ActionFactory.elementActions.MakeGetAttribute;
import beseenium.controller.ActionFactory.elementActions.MakeGetCssValue;
import beseenium.controller.ActionFactory.elementActions.MakeGetLocation;
import beseenium.controller.ActionFactory.elementActions.MakeGetSize;
import beseenium.controller.ActionFactory.elementActions.MakeGetTagName;
import beseenium.controller.ActionFactory.elementActions.MakeGetText;
import beseenium.controller.ActionFactory.elementActions.MakeIsDisplayed;
import beseenium.controller.ActionFactory.elementActions.MakeIsEnabled;
import beseenium.controller.ActionFactory.elementActions.MakeIsSelected;
import beseenium.controller.ActionFactory.elementActions.MakeSendKeys;
import beseenium.controller.ActionFactory.elementActions.MakeSubmit;
import beseenium.controller.ActionFactory.findElementsBy.MakeFindElementsByClass;
import beseenium.controller.ActionFactory.findElementsBy.MakeFindElementsByCss;
import beseenium.controller.ActionFactory.findElementsBy.MakeFindElementsById;
import beseenium.controller.ActionFactory.findElementsBy.MakeFindElementsByLinkTxt;
import beseenium.controller.ActionFactory.findElementsBy.MakeFindElementsByName;
import beseenium.controller.ActionFactory.findElementsBy.MakeFindElementsByPartialLinkTxt;
import beseenium.controller.ActionFactory.findElementsBy.MakeFindElementsByTagName;
import beseenium.controller.ActionFactory.findElementsBy.MakeFindElementsByXpath;
import beseenium.controller.ActionFactory.navigateActions.MakeNavigateBack;
import beseenium.controller.ActionFactory.navigateActions.MakeNavigateForward;
import beseenium.controller.ActionFactory.navigateActions.MakeRefreshPage;
import beseenium.controller.ActionFactory.pageActions.MakeBrowserQuit;
import beseenium.controller.ActionFactory.pageActions.MakeGetPageSrc;
import beseenium.controller.ActionFactory.pageActions.MakeGetTitle;
import beseenium.controller.ActionFactory.pageActions.MakeGetURL;
import beseenium.controller.ActionFactory.pageActions.MakePageClose;
import beseenium.controller.ActionFactory.pageActions.MakePageGet;
import beseenium.exceptions.actionDataExceptions.ActionDataFactoryException;
import beseenium.exceptions.actionExceptions.ActionFactoryException;
import beseenium.model.action.AbstractAction;
/**
* this class is a factory for creating actions, it uses a factory method
* style pattern and a map implementation.
* @author JPC Hanson
*
*/
public class ActionFactory
{
/** the map to store the actions in **/
private Map<String, MakeAction> actionMap;
/** internal ActionDataFactory reference **/
private ActionDataFactory actionDataFactory;
/**
* default constructor creates and populates internal map
* @param actionDataFactory
* @throws ActionDataFactoryException
* @throws MalformedURLException
*
*/
public ActionFactory(ActionDataFactory actionDataFactory)
throws ActionDataFactoryException, MalformedURLException
{
super();
this.actionDataFactory = actionDataFactory;
this.actionMap = new HashMap<String, MakeAction>();
this.populateActionMap();
}
/**
* creates an Action
* @return AbstractAction
* @throws ActionFactoryException
* @throws ActionDataFactoryException
*/
public AbstractAction makeAction(String actionKey) throws ActionFactoryException
{
if(this.actionMap.containsKey(actionKey))
{return this.actionMap.get(actionKey).makeAction();}
else
{throw new ActionFactoryException("you cannot instanciate this type of Action '"
+actionKey+ "' Check your spelling, or refer to documentation");}
}
/**
* creates all possible actions and populates the map with them.
* @throws ActionDataFactoryException
*
*/
private void populateActionMap() throws ActionDataFactoryException
{
// //Page Actions
this.actionMap.put( "PageGet", new MakePageGet(actionDataFactory));
this.actionMap.put( "GetPageSrc", new MakeGetPageSrc(actionDataFactory));
this.actionMap.put( "BrowserQuit", new MakeBrowserQuit(actionDataFactory));
this.actionMap.put( "GetTitle", new MakeGetTitle(actionDataFactory));
this.actionMap.put( "GetURL", new MakeGetURL(actionDataFactory));
this.actionMap.put( "PageClose", new MakePageClose(actionDataFactory));
// //Navigation Actions
this.actionMap.put( "NavigateBack", new MakeNavigateBack(actionDataFactory));
this.actionMap.put( "NavigateForward", new MakeNavigateForward(actionDataFactory));
this.actionMap.put( "RefreshPage", new MakeRefreshPage(actionDataFactory));
// //Find Element Actions
this.actionMap.put( "FindElementsByClass", new MakeFindElementsByClass(actionDataFactory));
this.actionMap.put( "FindElementsByCss", new MakeFindElementsByCss(actionDataFactory));
this.actionMap.put( "FindElementsById", new MakeFindElementsById(actionDataFactory));
this.actionMap.put( "FindElementsByLinkTxt", new MakeFindElementsByLinkTxt(actionDataFactory));
this.actionMap.put( "FindElementsByName", new MakeFindElementsByName(actionDataFactory));
this.actionMap.put( "FindElementsByPartialLinkTxt", new MakeFindElementsByPartialLinkTxt(actionDataFactory));
this.actionMap.put( "FindElementsByTagName", new MakeFindElementsByTagName(actionDataFactory));
this.actionMap.put( "FindElementsByXpath", new MakeFindElementsByXpath(actionDataFactory));
// //Element Actions
this.actionMap.put( "Clear", new MakeClear(actionDataFactory));
this.actionMap.put( "Click", new MakeClick(actionDataFactory));
this.actionMap.put( "GetAttribute", new MakeGetAttribute(actionDataFactory));
this.actionMap.put( "GetCssValue", new MakeGetCssValue(actionDataFactory));
this.actionMap.put( "GetLocation", new MakeGetLocation(actionDataFactory));
this.actionMap.put( "GetSize", new MakeGetSize(actionDataFactory));
this.actionMap.put( "GetTagName", new MakeGetTagName(actionDataFactory));
this.actionMap.put( "GetText", new MakeGetText(actionDataFactory));
this.actionMap.put( "IsDisplayed", new MakeIsDisplayed(actionDataFactory));
this.actionMap.put( "IsEnabled", new MakeIsEnabled(actionDataFactory));
this.actionMap.put( "IsSelected", new MakeIsSelected(actionDataFactory));
this.actionMap.put( "SendKeys", new MakeSendKeys(actionDataFactory));
this.actionMap.put( "Submit", new MakeSubmit(actionDataFactory));
}
}
| Java |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package proyectomio.controlador.operaciones;
import proyectomio.accesoDatos.Controlador_BD;
import proyectomio.modelo.Consulta;
/**
*
* @author root
*/
public class Controlador_Conductor {
private final Controlador_BD CONTROLADOR_BD = new Controlador_BD();
public Consulta consultar_buses_asignados(int id_conductor) {
if (id_conductor != 0) {
Consulta consulta = new Consulta();
consulta = CONTROLADOR_BD.consultarBD("SELECT * FROM bus_empleado inner join bus on bus_empleado.placa_bus = bus.placa inner join ruta on ruta.id_ruta = bus.id_ruta where bus_empleado.id_empleado = " + id_conductor);
return consulta;
}
else{
Consulta consulta = new Consulta();
consulta = CONTROLADOR_BD.consultarBD("SELECT * FROM (bus_empleado inner join bus on bus_empleado.placa_bus = bus.placa) inner join ruta on ruta.id_ruta = bus.id_ruta;");
return consulta;
}
}
}
| Java |
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
pair<int, int> computeGreedyLongestPath(const vector<vector<int> > & adjList, int startV, const vector<int> & weightOfVertex);
int main(void)
{
int T, numV, numE, u, v, caseId;
vector<vector<int> > adjList;
vector<int> emptyList, weightOfVertex;
scanf("%d", &T);
pair<int, int> maxLearnAndDest;
caseId = 1;
while(caseId <= T)
{
scanf("%d %d", &numV, &numE);
adjList.assign(numV, emptyList);
weightOfVertex.assign(numV, 0);
for(v = 0; v < numV; v++)
scanf("%d", &weightOfVertex[v]);
for(int e = 0; e < numE; e++)
{
scanf("%d %d", &u, &v);
adjList[u].push_back(v);
}
maxLearnAndDest = computeGreedyLongestPath(adjList, 0, weightOfVertex);
printf("Case %d: %d %d\n", caseId, maxLearnAndDest.first, maxLearnAndDest.second);
caseId++;
}
return 0;
}
pair<int, int> computeGreedyLongestPath(const vector<vector<int> > & adjList, int startV, const vector<int> & weightOfVertex)
{
int v = startV, totalWeight, maxNeighborInd;
totalWeight = weightOfVertex[startV];
while(adjList[v].size() > 0)
{
maxNeighborInd = 0;
for(int ind = 1; ind < (int) adjList[v].size(); ind++)
if(weightOfVertex[adjList[v][ind]] > weightOfVertex[adjList[v][maxNeighborInd]])
maxNeighborInd = ind;
totalWeight += weightOfVertex[adjList[v][maxNeighborInd]];
v = adjList[v][maxNeighborInd];
}
return make_pair(totalWeight, v);
}
| Java |
<?php
// Copyright (c) Aura development team - Licensed under GNU GPL
// For more information, see licence.txt in the main folder
//
// This is a simple page to create accounts.
// Due to the need of reading conf files this script has to be located
// inside the Aura web folder, or you have to adjust some paths.
// --------------------------------------------------------------------------
include '../shared/Conf.class.php';
include '../shared/MabiDb.class.php';
$conf = new Conf();
$conf->load('../../conf/database.conf');
$db = new MabiDb();
$db->init($conf->get('database.host'), $conf->get('database.user'), $conf->get('database.pass'), $conf->get('database.db'));
$succs = false;
$error = '';
$user = '';
$pass = '';
$pass2 = '';
if(isset($_POST['register']))
{
$user = $_POST['user'];
$pass = $_POST['pass'];
$pass2 = $_POST['pass2'];
if(!preg_match('~^[a-z0-9]{4,20}$~i', $user))
$error = 'Invalid username (4-20 characters).';
else if($pass !== $pass2)
$error = 'Passwords don\'t match.';
else if(!preg_match('~^[a-z0-9]{6,24}$~i', $pass))
$error = 'Invalid password (6-24 characters).';
else if($db->accountExists($user))
$error = 'Username already exists.';
else
{
$db->createAccount($user, $pass);
$succs = true;
}
}
?>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Register - Aura</title>
<link rel="stylesheet" href="../shared/css/reset.css" media="all" />
<link rel="stylesheet" href="style.css" media="all" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!--[if IE]>
<script src="../shared/js/ie.js"></script>
<![endif]-->
</head>
<body>
<a href="<?php echo basename(__FILE__) ?>"><img src="../shared/images/logo_white.png" alt="Aura"/></a>
<?php if(!$succs): ?>
<?php if(!empty($error)): ?>
<div class="notice">
<?php echo $error ?>
</div>
<?php endif; ?>
<form method="post" action="<?php echo basename(__FILE__) ?>">
<table>
<tr>
<td class="desc">Username</td>
<td class="inpt"><input type="text" name="user" value="<?php echo $user ?>"/></td>
</tr>
<tr>
<td class="desc">Password</td>
<td class="inpt"><input type="password" name="pass" value="<?php echo $pass ?>"/></td>
</tr>
<tr>
<td class="desc">Password Repeat</td>
<td class="inpt"><input type="password" name="pass2" value="<?php echo $pass2 ?>"/></td>
</tr>
<tr>
<td class="desc"></td>
<td class="inpt"><input type="submit" name="register" value="Register"/></td>
</tr>
</table>
</form>
<?php else: ?>
<div class="notice">
<?php echo 'Account created successfully!' ?>
</div>
<?php endif; ?>
</body>
</html>
| Java |
<!DOCTYPE html>
<html lang="fr">
<html>
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="./assets/css/mail.css"/>
</head>
<body bgcolor="#E6E6FA">
<?php include 'back-submit-mail.php';?>
<h1 class="first"> </h1>
<?php
// define variables and set to empty values
$fnameErr = $lnameErr = $emailErr = $websiteErr = "";
$fname = $lname = $email = $subject = $website = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["fname"])) {
$fnameErr = "Firts name is required";
} else {
$fname = test_input($_POST["fname"]);
// check if name only contains letters and whitespace
if (!preg_match("/^[a-zA-Z ]*$/",$fname)) {
$fnameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["lname"])) {
$lnameErr = "Last name is required";
} else {
$lname = test_input($_POST["lname"]);
// check if name only contains letters and whitespace
if (!preg_match("/^[a-zA-Z ]*$/",$lname)) {
$lnameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["email"])) {
$emailErr = "Email is required";
} else {
$email = test_input($_POST["email"]);
// check if e-mail address is well-formed
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Invalid email format";
}
}
if (empty($_POST["subject"])) {
$subject = "";
} else {
$subject = test_input($_POST["subject"]);
}
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<!-- Form content -->
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<span class="error">*<?php echo $fnameErr;?></span>
<label for="fname">Prénom</label>
<input type="text" id="fname" name="fname" placeholder="Votre prénom...">
<span class="error">*<?php echo $lnameErr;?></span>
<label for="lname">Nom</label>
<input type="text" id="lname" name="lname" placeholder="Votre nom...">
<span class="error">*<?php echo $emailErr;?></span>
<label for="mail">Email</label>
<input type="text" id="mail" name="email" placeholder="Votre email...">
<label for="country">Pays</label>
<select id="country" name="country">
<option value="australia">Belgium</option>
<option value="usa">USA</option>
<option value="canada">Canada</option>
</select>
<label for="subject">Sujet</label>
<textarea id="subject" name="subject" placeholder="Ecrivez quelque chose..." style="height:200px"></textarea>
</form>
<?php
echo $fname;
echo "<br>";
echo $lname;
echo "<br>";
echo $email;
echo "<br>";
echo $subject;
echo "<br>";
?>
</body>
</html>
| Java |
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<!-- ===========================================================================================
Instituto Municipal de Planeación y Competitividad de Torreón.
Al usar, estudiar y copiar está aceptando los términos de uso de la información y del sitio web:
http://www.trcimplan.gob.mx/terminos/terminos-informacion.html
http://www.trcimplan.gob.mx/terminos/terminos-sitio.html
El software que lo construye está bajo la licencia GPL versión 3. © 2014, 2015, 2016.
Una copia está contenida en el archivo LICENCE al bajar desde GitHub.
Plataforma de Conocimiento https://github.com/guivaloz/PlataformaDeConocimiento
Agradecemos y compartimos las tecnologías abiertas y gratuitas sobre las que se basa:
Morris.js https://morrisjs.github.io/morris.js/
PHP http://php.net
StartBootStrap http://startbootstrap.com
Twitter Bootstrap http://getbootstrap.com
Descargue, aprenda y colabore con este Software Libre:
GitHub IMPLAN Torreón https://github.com/TRCIMPLAN/trcimplan.github.io
=========================================================================================== -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Superficie territorial medida en hectáreas.">
<meta name="author" content="Dirección de Investigación Estratégica">
<meta name="keywords" content="IMPLAN, Matamoros, Recursos Naturales">
<title>Superficie en Matamoros - IMPLAN Torreón</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+" crossorigin="anonymous">
<link href="../imagenes/favicon.png" rel="shortcut icon" type="image/x-icon">
<link href="../rss.xml" rel="alternate" type="application/rss+xml" title="IMPLAN Torreón">
<link href="../css/morris.css" rel="stylesheet">
<link href="../css/plugins/metisMenu/metisMenu.min.css" rel="stylesheet">
<link href="../css/sb-admin-2.css" rel="stylesheet">
<link href="../css/plataforma-de-conocimiento.css" rel="stylesheet">
<link href="../css/trcimplan.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Questrial|Roboto+Condensed:400,700" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html"><img class="navbar-brand-img" src="../imagenes/implan-barra-logo-chico-gris.png" alt="IMPLAN Torreón"></a>
</div>
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav" id="side-menu">
<li class="sidebar-search">
<form method="get" id="searchbox_015475140351266618625:04hulmghdys" action="http://www.trcimplan.gob.mx/buscador-resultados.html">
<input type="hidden" value="015475140351266618625:04hulmghdys" name="cx">
<input type="hidden" value="FORID:11" name="cof">
<div class="input-group custom-search-form">
<input type="text" class="form-control" placeholder="Buscar..." value="" name="s" id="s">
<span class="input-group-btn">
<button class="btn btn-default" type="submit" id="searchsubmit"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
</li>
<li><a href="../blog/index.html"><span class="navegacion-icono"><i class="fa fa-lightbulb-o"></i></span> Análisis Publicados</a></li>
<li class="active">
<a href="#"><span class="navegacion-icono"><i class="fa fa-area-chart"></i></span> Indicadores<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="../smi/introduccion.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Introducción al S.M.I.</a></li>
<li><a href="../indicadores-categorias/index.html"><span class="navegacion-icono"><i class="fa fa-th-list"></i></span> Indicadores por Categoría</a></li>
<li><a href="../smi/por-region.html"><span class="navegacion-icono"><i class="fa fa-table"></i></span> Indicadores por Región</a></li>
<li><a href="../smi-georreferenciados/index.html"><span class="navegacion-icono"><i class="fa fa-map-marker"></i></span> Georreferenciados</a></li>
<li><a href="../smi/datos-abiertos.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Datos Abiertos</a></li>
</ul>
</li>
<li>
<a href="#"><span class="navegacion-icono"><i class="fa fa-puzzle-piece"></i></span> IBC Torreón<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="../#"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Introducción</a></li>
<li><a href="../ibc-torreon/index.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Listado de Colonias</a></li>
<li><a href="../#"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Mapa de Colonias</a></li>
<li><a href="../#"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Datos Abiertos</a></li>
</ul>
</li>
<li>
<a href="#"><span class="navegacion-icono"><i class="fa fa-map-marker"></i></span> Información Geográfica<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="../sig/introduccion.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Introducción al S.I.G.</a></li>
<li><a href="../sig-planes/index.html"><span class="navegacion-icono"><i class="fa fa-server"></i></span> Planes</a></li>
<li><a href="../sig-mapas-torreon/index.html"><span class="navegacion-icono"><i class="fa fa-map-marker"></i></span> S.I.G. de Torreón</a></li>
<li><a href="../sig-mapas-torreon/zonificacion-secundaria.html"><span class="navegacion-icono"><i class="fa fa-map-marker"></i></span> Zonificación Secundaria</a></li>
</ul>
</li>
<li>
<a href="#"><span class="navegacion-icono"><i class="fa fa-sun-o"></i></span> Plan Estratégico Metropolitano<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="../plan-estrategico-metropolitano/introduccion.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Qué es el P.E.M.</a></li>
<li><a href="../plan-estrategico-metropolitano/metodologia.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Metodología</a></li>
<li><a href="../plan-estrategico-metropolitano/descripcion-del-proceso.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Descripción del Proceso</a></li>
</ul>
</li>
<li>
<a href="#"><span class="navegacion-icono"><i class="fa fa-check-square"></i></span> Banco de Proyectos<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="../proyectos/proyectos-por-ejes.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Proyectos por Ejes</a></li>
<li><a href="../proyectos/cartera-pem.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Cartera P.E.M.</a></li>
<li><a href="../proyectos/planes-y-programas.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Planes y Programas</a></li>
</ul>
</li>
<li><a href="../investigaciones/index.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Investigaciones</a></li>
<li>
<a href="#"><span class="navegacion-icono"><i class="fa fa-building-o"></i></span> Institucional<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="../institucional/vision-mision.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Visión / Misión</a></li>
<li><a href="../institucional/mensaje-director.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Mensaje del Director</a></li>
<li><a href="../autores/index.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Quienes Somos</a></li>
<li><a href="../institucional/estructura-organica.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Estructura Orgánica</a></li>
<li><a href="../institucional/modelo-operativo-universal.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Modelo Operativo Univ.</a></li>
<li><a href="../institucional/reglamentos.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Reglamentos</a></li>
<li><a href="../institucional/informacion-financiera.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Información Financiera</a></li>
<li><a href="http://www.icai.org.mx:8282/ipo/dependencia.php?dep=178" target="_blank"><span class="navegacion-icono"><i class="fa fa-external-link"></i></span> Transparencia</a></li>
</ul>
</li>
<li><a href="../consejo-directivo/integrantes.html"><span class="navegacion-icono"><i class="fa fa-users"></i></span> Consejo Directivo</a></li>
<li><a href="../sala-prensa/index.html"><span class="navegacion-icono"><i class="fa fa-comments"></i></span> Sala de Prensa</a></li>
<li><a href="../preguntas-frecuentes/preguntas-frecuentes.html"><span class="navegacion-icono"><i class="fa fa-question"></i></span> Preguntas Frecuentes</a></li>
<li>
<a href="#"><span class="navegacion-icono"><i class="fa fa-files-o"></i></span> Términos de Uso<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="../terminos/terminos-informacion.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> De la información</a></li>
<li><a href="../terminos/terminos-sitio.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Del sitio web</a></li>
<li><a href="../terminos/privacidad.html"><span class="navegacion-icono"><i class="fa fa-file-text-o"></i></span> Aviso de Privacidad</a></li>
</ul>
</li>
<li>
<a href="#"><span class="navegacion-icono"><i class="fa fa-phone"></i></span> Contacto<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="../contacto/contacto.html"><span class="navegacion-icono"><i class="fa fa-phone"></i></span> Medios de contacto</a></li>
<li><a href="../#"><span class="navegacion-icono"><i class="fa fa-external-link"></i></span> Comentarios y Sugerencias</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div id="page-wrapper">
<div class="cuerpo">
<article><div itemscope itemtype="http://schema.org/Article">
<div class="encabezado" style="background-color:#CA198A;">
<h1 itemprop="name">Superficie en Matamoros</h1>
<div class="encabezado-descripcion" itemprop="description">Superficie territorial medida en hectáreas.</div>
<div class="encabezado-autor-fecha">
Por <span itemprop="author">Dirección de Investigación Estratégica</span>
- <meta itemprop="datePublished" content="2016-03-09T10:53">09/03/2016 10:53
</div>
</div>
<meta itemprop="image" alt="Superficie en Matamoros" src="../smi/introduccion/imagen.jpg">
<div itemprop="articleBody">
<ul class="nav nav-tabs lenguetas" id="smi-indicador">
<li><a href="#smi-indicador-datos" data-toggle="tab">Datos</a></li>
<li><a href="#smi-indicador-otras_regiones" data-toggle="tab">Otras regiones</a></li>
</ul>
<div class="tab-content lengueta-contenido">
<div class="tab-pane" id="smi-indicador-datos">
<h3>Información recopilada</h3>
<table class="table table-hover table-bordered matriz">
<thead>
<tr>
<th>Fecha</th>
<th>Dato</th>
<th>Fuente</th>
<th>Notas</th>
</tr>
</thead>
<tbody>
<tr>
<td>31/12/2010</td>
<td>82,163.7300</td>
<td>INEGI</td>
<td></td>
</tr>
</tbody>
</table>
<p><b>Unidad:</b> Hectáreas.</p>
</div>
<div class="tab-pane" id="smi-indicador-otras_regiones">
<h3>Gráfica con los últimos datos de Superficie</h3>
<div id="graficaOtrasRegiones" class="grafica"></div>
<h3>Últimos datos de Superficie</h3>
<table class="table table-hover table-bordered matriz">
<thead>
<tr>
<th>Región</th>
<th>Fecha</th>
<th>Dato</th>
<th>Fuente</th>
<th>Notas</th>
</tr>
</thead>
<tbody>
<tr>
<td>Torreón</td>
<td>2010-12-31</td>
<td>124,199.7500</td>
<td>INEGI</td>
<td></td>
</tr>
<tr>
<td>Gómez Palacio</td>
<td>2010-12-31</td>
<td>84,546.5800</td>
<td>INEGI</td>
<td></td>
</tr>
<tr>
<td>Lerdo</td>
<td>2010-12-31</td>
<td>211,889.3200</td>
<td>INEGI</td>
<td></td>
</tr>
<tr>
<td>Matamoros</td>
<td>2010-12-31</td>
<td>82,163.7300</td>
<td>INEGI</td>
<td></td>
</tr>
<tr>
<td>La Laguna</td>
<td>2010-12-31</td>
<td>502,799.3800</td>
<td>INEGI</td>
<td>El indicador hace referencia a los cuatro municipios que conforman la Zona Metropolitana de la Laguna: Torreón, Matamoros, Gómez Palacio y Lerdo.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<article><div itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"">
<article><div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"">
<div class="direccion">
<span itemprop="addressLocality">Matamoros</span>, <span itemprop="addressRegion">Coahuila de Zaragoza</span>. <meta itemprop="addressCountry" content="MX">México.
</div>
</div></article>
</div></article>
</div></article>
<div class="contenido-social">
<h5>Compartir en Redes Sociales</h5>
<a href="https://twitter.com/share" class="twitter-share-button" data-via="trcimplan" data-lang="es">Twittear</a>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.trcimplan.gob.mx%2Findicadores-matamoros%2Fsustentabilidad-superficie.html&width=300&layout=button_count&action=like&show_faces=true&share=false&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:21px;" allowTransparency="true"></iframe>
</div>
</div>
<div class="mapa-inferior">
<div class="row">
<div class="col-md-8">
<a href="../index.html"><img class="img-responsive mapa-inferior-logo" src="../imagenes/implan-transparente-gris.png" alt="IMPLAN Torreón"></a>
</div>
<div class="col-md-4">
<div class="pull-right redes-sociales">
<a class="fa fa-twitter-square" href="http://www.twitter.com/trcimplan" target="_blank"></a>
<a class="fa fa-facebook-square" href="https://facebook.com/trcimplan" target="_blank"></a>
<a class="fa fa-google-plus-square" href="https://plus.google.com/106220426241750550649" target="_blank"></a>
<a class="fa fa-github-square" href="https://github.com/TRCIMPLAN" target="_blank"></a>
<a class="fa fa-rss-square" href="../rss.xml"></a>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="../js/raphael-min.js"></script>
<script src="../js/morris.min.js"></script>
<script src="../js/plugins/metisMenu/metisMenu.min.js"></script>
<script src="../js/sb-admin-2.js"></script>
<script>
// LENGUETA smi-indicador-otras_regiones
$('#smi-indicador a[href="#smi-indicador-otras_regiones"]').on('shown.bs.tab', function(e){
// Gráfica
if (typeof vargraficaOtrasRegiones === 'undefined') {
vargraficaOtrasRegiones = Morris.Bar({
element: 'graficaOtrasRegiones',
data: [{ region: 'Torreón', dato: 124199.7500 },{ region: 'Gómez Palacio', dato: 84546.5800 },{ region: 'Lerdo', dato: 211889.3200 },{ region: 'Matamoros', dato: 82163.7300 },{ region: 'La Laguna', dato: 502799.3800 }],
xkey: 'region',
ykeys: ['dato'],
labels: ['Dato'],
barColors: ['#FF5B02']
});
}
});
// TWITTER BOOTSTRAP TABS, ESTABLECER QUE LA LENGÜETA ACTIVA ES smi-indicador-datos
$(document).ready(function(){
$('#smi-indicador a[href="#smi-indicador-datos"]').tab('show')
});
</script>
<script>
// Twitter
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>
<script>
// Google Analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-58290501-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| Java |
# Daemonizable Commands for Symfony [](https://travis-ci.org/mac-cain13/daemonizable-command)
**A small bundle to create endless running commands with Symfony.**
These endless running commands are very easy to daemonize with something like Upstart or systemd.
## Why do I need this?
Because you want to create long running PHP/Symfony processes! For example to send mails with large attachment, process (delayed) payments or generate large PDF reports. They query the database or read from a message queue and do their job. This bundle makes it very easy to create such processes as Symfony commands.
## How to install?
Use composer to include it into your Symfony project:
`composer require wrep/daemonizable-command`
### What version to use?
Symfony did make some breaking changes, so you should make sure to use a compatible bundle version:
* Version 2.1.* for Symfony 4.0 and higher
* Version 2.0.* for Symfony 3.0 - 3.4
* Version 1.3.* for Symfony 2.8
When upgrading, please consult the [changelog](Changelog.md) to see what could break your code.
## How to use?
Just create a Symfony command that extends from `EndlessCommand` and off you go. Here is a minimal example:
```php
namespace Acme\DemoBundle\Command;
use Wrep\Daemonizable\Command\EndlessCommand;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;
class MinimalDemoCommand extends EndlessCommand
{
// This is just a normal Command::configure() method
protected function configure()
{
$this->setName('acme:minimaldemo')
->setDescription('An EndlessCommand implementation example');
}
// Execute will be called in a endless loop
protected function execute(InputInterface $input, OutputInterface $output)
{
// Tell the user what we're going to do.
// This will be a NullOutput if the user doesn't want any output at all,
// so you don't have to do any checks, just always write to the output.
$output->write('Updating timestamp... ');
// Do some work
file_put_contents( '/tmp/acme-timestamp.txt', time() );
// Tell the user we're done
$output->writeln('done');
}
}
```
Run it with `php app/console acme:minimaldemo`.
An [example with all the bells and whistles](examples/ExampleCommand.php) is also available and gives a good overview of best practices and how to do some basic things.
## How to daemonize?
Alright, now we have an endless running command *in the foreground*. Usefull for debugging, useless in production! So how do we make this thing a real daemon?
You should use [systemd](http://www.freedesktop.org/wiki/Software/systemd) to daemonize the command. They provide very robust daemonization, start your daemon on a reboot and also monitor the process so it will try to restart it in the case of a crash.
If you can't use Upstart or systemd, you can use `.lock` file with [LockHandler](http://symfony.com/doc/current/components/filesystem/lock_handler.html) with [crontab](https://wikipedia.org/wiki/Cron) wich start script every minute.
An [example Upstart script](examples/example-daemon.conf) is available, place your script in `/etc/init/` and start the daemon with `start example-daemon`. The name of the `.conf`-file will be the name of the daemon. A systemd example is not yet available, but it shouldn't be that hard to [figure out](http://patrakov.blogspot.nl/2011/01/writing-systemd-service-files.html).
## Command line switches
A few switches are available by default to make life somewhat easier:
* Use `-q` to suppress all output
* Use `--run-once` to only run the command once, usefull for debugging
* Use `--detect-leaks` to print a memory usage report after each run, read more in the next section
## Memory usage and leaks
Memory usage is very important for long running processes. Symfony is not the smallest framework around and if you leak some memory in your execute method your daemon will crash! The `EndlessCommand` classes have been checked for memory leaks, but you should also check your own code.
### How to prevent leaks?
Always start your command with the `-e prod --no-debug` flags. This disables all debugging features of Symfony that will eat up more and more memory.
Do not use Monolog in Symfony 2.2 and lower, there is a [bug in the MonologBundle](https://github.com/symfony/MonologBundle/issues/37) that starts the debughandler even though you disable the profiler. This eats up your memory. Note that this is [fixed](https://github.com/symfony/MonologBundle/commit/1fc0864a9344b15a04ed90612a91cf8e5b8fb305) in Symfony 2.3 and up.
Make sure you cleanup in the `execute`-method, make sure you're not appending data to an array every iteration or leave sockets/file handles open for example.
In case you are using the fingers-crossed handler in Monolog, this will also be a source of memory leaks. The idea of this handler is to keep all below-threshold log entries in memory and only flush those in case of an above-threshold entry. You can still use the fingers-crossed handler as long as you manually flush it at the end of the `execute`-method:
```
foreach ($this->getContainer()->get('logger')->getHandlers() as $handler)
{
if ($handler instanceof FingersCrossedHandler) {
$handler->clear();
}
}
```
### Detecting memory leaks
Run your command with the `--detect-leaks` flag. Remember that debug mode will eat memory so you'll need to run with `-e prod --no-debug --detect-leaks` for accurate reports.
After each iteration a memory report like this is printed on your console:
```
== MEMORY USAGE ==
Peak: 30038.86 KByte stable (0.000 %)
Cur.: 29856.46 KByte stable (0.000 %)
```
The first 3 iterations may be unstable in terms of memory usage, but after that it should be stable. *Even a slight increase of memory usage will crash your daemon over time!*
If you see an increase/stable/decrease loop you're probably save. It could be the garabage collector not cleaning up, you can fix this by using unset on variables to cleanup the memory yourself.
### Busting some myths
Calling `gc_collect_cycles()` will not help to resolve leaks. PHP will cleanup memory right in time all by itself, calling this method may slow down leaking memory, but will not solve it. Also it makes spotting leaks harder, so just don't use it.
If you run Symfony in production and non-debug mode it will not leak memory and you do not have to disable any SQL loggers. The only leak I runned into is the one in the MonologBundle mentioned above.
### Working with Doctrine
For reasons EndlessContainerAwareCommand clears after each Iteration Doctrine's EntityManager. Be aware of that.
You can override finishIteration() to avoid this behaviour but you have to handle the EM on your own then.
| Java |
{-# LANGUAGE ScopedTypeVariables #-}
import Bench
import Bench.Triangulations
main = print (qVertexSolBench trs)
| Java |
//
// Copyleft RIME Developers
// License: GPLv3
//
// 2013-04-18 GONG Chen <chen.sst@gmail.com>
//
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <rime/dict/table_db.h>
#include <rime/dict/user_db.h>
// Rime table entry format:
// phrase <Tab> code [ <Tab> weight ]
// for multi-syllable phrase, code is a space-separated list of syllables
// weight is a double precision float, defaulting to 0.0
namespace rime {
static bool rime_table_entry_parser(const Tsv& row,
std::string* key,
std::string* value) {
if (row.size() < 2 ||
row[0].empty() || row[1].empty()) {
return false;
}
std::string code(row[1]);
boost::algorithm::trim(code);
*key = code + " \t" + row[0];
UserDbValue v;
if (row.size() >= 3 && !row[2].empty()) {
try {
v.commits = boost::lexical_cast<int>(row[2]);
const double kS = 1e8;
v.dee = (v.commits + 1) / kS;
}
catch (...) {
}
}
*value = v.Pack();
return true;
}
static bool rime_table_entry_formatter(const std::string& key,
const std::string& value,
Tsv* tsv) {
Tsv& row(*tsv);
// key ::= code <space> <Tab> phrase
boost::algorithm::split(row, key,
boost::algorithm::is_any_of("\t"));
if (row.size() != 2 ||
row[0].empty() || row[1].empty())
return false;
UserDbValue v(value);
if (v.commits < 0) // deleted entry
return false;
boost::algorithm::trim(row[0]); // remove trailing space
row[0].swap(row[1]);
row.push_back(boost::lexical_cast<std::string>(v.commits));
return true;
}
const TextFormat TableDb::format = {
rime_table_entry_parser,
rime_table_entry_formatter,
"Rime table",
};
TableDb::TableDb(const std::string& name)
: TextDb(name + ".txt", "tabledb", TableDb::format) {
}
// StableDb
StableDb::StableDb(const std::string& name)
: TableDb(name) {}
bool StableDb::Open() {
if (loaded()) return false;
if (!Exists()) {
LOG(INFO) << "stabledb '" << name() << "' does not exist.";
return false;
}
return TableDb::OpenReadOnly();
}
} // namespace rime
| Java |
import React from 'react';
import { mount } from 'enzyme';
import { Link, HashRouter as Router } from 'react-router-dom';
import { Button } from 'react-bootstrap';
import BackHomeButton from '../BackHomeButton';
describe('<BackHomeButton/>', () => {
it('<BackHomeButton /> should render <Router/>', () => {
const component = mount(<BackHomeButton />);
expect(component.find(Router)).toHaveLength(1);
});
it('<BackHomeButton /> should render <Link/> with correct props', () => {
const component = mount(<BackHomeButton />);
expect(component.find(Router)).toHaveLength(1);
expect(component.find(Link)).toHaveLength(1);
const props = component.find(Link).props();
expect(props).toEqual({ to: '/', children: expect.anything() });
expect(component.find(Link)).toHaveLength(1);
});
it('<BackHomeButton /> should render <Button/> with correct props', () => {
const component = mount(<BackHomeButton />);
expect(component.find(Router)).toHaveLength(1);
expect(component.find(Link)).toHaveLength(1);
expect(component.find(Button)).toHaveLength(1);
const ButtonProps = component.find(Button).props();
expect(ButtonProps).toEqual({
variant: 'primary',
children: 'Back Home',
active: false,
disabled: false,
type: 'button',
});
});
});
| Java |
'use strict';
var Ose = require('ose');
var M = Ose.class(module, './index');
/** Docs {{{1
* @submodule bb.pagelet
*/
/**
* @caption Dashboard pagelet
*
* @readme
* Pagelet for creating dashboard content.
*
* @class bb.lib.pagelet.dashboard
* @type class
* @extends bb.lib.pagelet
*/
// Public {{{1
exports.loadData = function(cb) { // {{{2
/**
* Has a new list widget created and appends it to the main pagelet
* element. It also calls the "Ose.ui.dashboard()"
* method. "Ose.ui.dashboard()" governs what is diaplayed on the
* dashboard.
*
* @method loadData
*/
if (cb) {
this.doAfterDisplay = cb;
}
this.$('header').html('Dashboard');
this.$()
.empty()
.append(this.newWidget('list', 'list'))
;
if (Ose.ui.configData.dashboard) {
this.addContents(Ose.ui.configData.dashboard);
}
if (Ose.ui.dashboard) {
Ose.ui.dashboard(this, this.afterDisplay.bind(this));
} else {
this.afterDisplay();
}
};
exports.addContent = function(caption, stateObj) { // {{{2
/**
* Adds an item to the dashboard.
*
* @param caption {String} Text to be displayed
* @param stateObj {Object} State object that should be displayed when the user taps on this item.
*/
return this.addItem(caption, Ose.ui.bindContent(stateObj));
};
exports.addContents = function(data) { // {{{2
/**
* Adds items to the dashboard.
*
* @param data {Array} Array of items
*/
for (var i = 0; i < data.length; i++) {
var item = data[i];
this.addContent(item.caption, item.data);
}
};
exports.addItem = function(caption, onTap) { // {{{2
/**
* Adds an item to the dashboard.
*
* @param caption {String} Text to be displayed
* @param onTap {Function} Function to be called when the user taps on this item.
*/
return this.$('list > ul').append(
this.newWidget('listItem', null, {
tap: onTap,
caption: caption
})
);
};
exports.addPagelet = function(params, cb) { // {{{2
/**
* Adds an item to the dashboardk.
*
* @param caption {String} Text to be displayed
* @param cb {Function} Function to be called when the user taps on this item.
*/
var result = this.newPagelet(params);
$('<li>')
.append(result.html())
.appendTo(this.$('list > ul'))
;
result.loadData();
cb(); // TODO Send "cb" to loadData.
return result;
};
exports.verifyStateObj = function(data) { // {{{2
/**
* Verifies that data correspond to the displayed pagelet.
*
* @param data {Object} State object to be compared
*
* @returns {Boolean} Whether data correspond to the displayed pagelet
* @method verifyStateObj
*/
return data.pagelet === 'dashboard';
};
// }}}1
| Java |
/*
* File: Queue.h
* Author: Sileno Brito
*
* Created on 2 de Setembro de 2013, 11:27
*/
#ifndef QUEUE_H
#define QUEUE_H
#include <ext/struct/Node.h>
#include <ext/struct/List.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct list queue;
struct EngineQueue {
queue * (*createEmpty)(int(*cmp)(void *a, void *b), char *(*toString)(void *a), void (*destroy)(void *a));
int (*add)(queue *list, void *data);
int (*edit)(queue *list, void *oldElement, void *newElement);
int (*del)(queue *list);
void (*walk)(queue *list, void (*fnct)(void *data, void *extra), void *extra);
void * (*search)(queue *list, void *data);
char * (*toString)(queue *list);
void ** (*toArray)(queue *list, int * count);
void (*fromArray)(queue *list, void **, int count);
void (*destroy)(queue *list);
} Queue;
void initQueue();
#ifdef __cplusplus
}
#endif
#endif /* QUEUE_H */
| Java |
/*
*
* Mouse driver
*
*/
#include <kernel/system.h>
#include <kernel/logging.h>
#include <kernel/pipe.h>
#include <kernel/module.h>
#include <kernel/mouse.h>
#include <kernel/args.h>
static uint8_t mouse_cycle = 0;
static uint8_t mouse_byte[4];
#define PACKETS_IN_PIPE 1024
#define DISCARD_POINT 32
#define MOUSE_IRQ 12
#define MOUSE_PORT 0x60
#define MOUSE_STATUS 0x64
#define MOUSE_ABIT 0x02
#define MOUSE_BBIT 0x01
#define MOUSE_WRITE 0xD4
#define MOUSE_F_BIT 0x20
#define MOUSE_V_BIT 0x08
#define MOUSE_DEFAULT 0
#define MOUSE_SCROLLWHEEL 1
#define MOUSE_BUTTONS 2
static int8_t mouse_mode = MOUSE_DEFAULT;
static fs_node_t * mouse_pipe;
void (*ps2_mouse_alternate)(void) = NULL;
static void mouse_wait(uint8_t a_type) {
uint32_t timeout = 100000;
if (!a_type) {
while (--timeout) {
if ((inportb(MOUSE_STATUS) & MOUSE_BBIT) == 1) {
return;
}
}
debug_print(INFO, "mouse timeout");
return;
} else {
while (--timeout) {
if (!((inportb(MOUSE_STATUS) & MOUSE_ABIT))) {
return;
}
}
debug_print(INFO, "mouse timeout");
return;
}
}
static void mouse_write(uint8_t write) {
mouse_wait(1);
outportb(MOUSE_STATUS, MOUSE_WRITE);
mouse_wait(1);
outportb(MOUSE_PORT, write);
}
static uint8_t mouse_read(void) {
mouse_wait(0);
char t = inportb(MOUSE_PORT);
return t;
}
static int mouse_handler(struct regs *r) {
uint8_t status = inportb(MOUSE_STATUS);
while ((status & MOUSE_BBIT) && (status & MOUSE_F_BIT)) {
if (ps2_mouse_alternate) {
ps2_mouse_alternate();
break;
}
int8_t mouse_in = inportb(MOUSE_PORT);
switch (mouse_cycle) {
case 0:
mouse_byte[0] = mouse_in;
if (!(mouse_in & MOUSE_V_BIT)) break;
++mouse_cycle;
break;
case 1:
mouse_byte[1] = mouse_in;
++mouse_cycle;
break;
case 2:
mouse_byte[2] = mouse_in;
if (mouse_mode == MOUSE_SCROLLWHEEL || mouse_mode == MOUSE_BUTTONS) {
++mouse_cycle;
break;
}
goto finish_packet;
case 3:
mouse_byte[3] = mouse_in;
goto finish_packet;
}
goto read_next;
finish_packet:
mouse_cycle = 0;
/* We now have a full mouse packet ready to use */
mouse_device_packet_t packet;
packet.magic = MOUSE_MAGIC;
int x = mouse_byte[1];
int y = mouse_byte[2];
if (x && mouse_byte[0] & (1 << 4)) {
/* Sign bit */
x = x - 0x100;
}
if (y && mouse_byte[0] & (1 << 5)) {
/* Sign bit */
y = y - 0x100;
}
if (mouse_byte[0] & (1 << 6) || mouse_byte[0] & (1 << 7)) {
/* Overflow */
x = 0;
y = 0;
}
packet.x_difference = x;
packet.y_difference = y;
packet.buttons = 0;
if (mouse_byte[0] & 0x01) {
packet.buttons |= LEFT_CLICK;
}
if (mouse_byte[0] & 0x02) {
packet.buttons |= RIGHT_CLICK;
}
if (mouse_byte[0] & 0x04) {
packet.buttons |= MIDDLE_CLICK;
}
if (mouse_mode == MOUSE_SCROLLWHEEL && mouse_byte[3]) {
if ((int8_t)mouse_byte[3] > 0) {
packet.buttons |= MOUSE_SCROLL_DOWN;
} else if ((int8_t)mouse_byte[3] < 0) {
packet.buttons |= MOUSE_SCROLL_UP;
}
}
mouse_device_packet_t bitbucket;
while (pipe_size(mouse_pipe) > (int)(DISCARD_POINT * sizeof(packet))) {
read_fs(mouse_pipe, 0, sizeof(packet), (uint8_t *)&bitbucket);
}
write_fs(mouse_pipe, 0, sizeof(packet), (uint8_t *)&packet);
read_next:
break;
}
irq_ack(MOUSE_IRQ);
return 1;
}
static int ioctl_mouse(fs_node_t * node, int request, void * argp) {
if (request == 1) {
mouse_cycle = 0;
return 0;
}
return -1;
}
static int mouse_install(void) {
debug_print(NOTICE, "Initializing PS/2 mouse interface");
uint8_t status, result;
IRQ_OFF;
while ((inportb(0x64) & 1)) {
inportb(0x60);
}
mouse_pipe = make_pipe(sizeof(mouse_device_packet_t) * PACKETS_IN_PIPE);
mouse_wait(1);
outportb(MOUSE_STATUS, 0xA8);
mouse_read();
mouse_wait(1);
outportb(MOUSE_STATUS, 0x20);
mouse_wait(0);
status = inportb(0x60) | 3;
mouse_wait(1);
outportb(MOUSE_STATUS, 0x60);
mouse_wait(1);
outportb(MOUSE_PORT, status);
mouse_write(0xF6);
mouse_read();
mouse_write(0xF4);
mouse_read();
/* Try to enable scroll wheel (but not buttons) */
if (!args_present("nomousescroll")) {
mouse_write(0xF2);
mouse_read();
result = mouse_read();
mouse_write(0xF3);
mouse_read();
mouse_write(200);
mouse_read();
mouse_write(0xF3);
mouse_read();
mouse_write(100);
mouse_read();
mouse_write(0xF3);
mouse_read();
mouse_write(80);
mouse_read();
mouse_write(0xF2);
mouse_read();
result = mouse_read();
if (result == 3) {
mouse_mode = MOUSE_SCROLLWHEEL;
}
}
/* keyboard scancode set */
mouse_wait(1);
outportb(MOUSE_PORT, 0xF0);
mouse_wait(1);
outportb(MOUSE_PORT, 0x02);
mouse_wait(1);
mouse_read();
irq_install_handler(MOUSE_IRQ, mouse_handler, "ps2 mouse");
IRQ_RES;
uint8_t tmp = inportb(0x61);
outportb(0x61, tmp | 0x80);
outportb(0x61, tmp & 0x7F);
inportb(MOUSE_PORT);
while ((inportb(0x64) & 1)) {
inportb(0x60);
}
mouse_pipe->flags = FS_CHARDEVICE;
mouse_pipe->ioctl = ioctl_mouse;
vfs_mount("/dev/mouse", mouse_pipe);
return 0;
}
static int mouse_uninstall(void) {
/* TODO */
return 0;
}
MODULE_DEF(ps2mouse, mouse_install, mouse_uninstall);
| Java |
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n,m,A,B,C;
LL solve1(LL x,LL y){
LL ans=0;
ans+=y*max(max(A,B),C);
if(x%2==1){
ans+=max((x-1)*(A+C)/2,(x-1)*B);
}else{
ans+=max((x-2)*(A+C)/2,(x-2)*B);
ans+=max(B,min(A,C));
}
return ans;
}
LL solve2(LL x,LL y){
LL ans=0;
ans+=x*min(min(A,B),C);
if(y%2==1){
ans+=min((y-1)*(A+C)/2,(y-1)*B);
}else{
ans+=min((y-2)*(A+C)/2,(y-2)*B);
ans+=min(B,max(A,C));
}
return ans;
}
int main(){
int T;cin>>T;
for(int t=1;t<=T;t++){
cin>>n>>m;
cin>>A>>B>>C;
printf("Case #%d: %lld %lld\n",t,solve1(m+1,n-m-1),solve2(m-1,n-m+1));
}
return 0;
}
| Java |
package io.github.notsyncing.cowherd.files;
import io.github.notsyncing.cowherd.Cowherd;
import io.github.notsyncing.cowherd.commons.CowherdConfiguration;
import io.github.notsyncing.cowherd.commons.RouteType;
import io.github.notsyncing.cowherd.models.ActionMethodInfo;
import io.github.notsyncing.cowherd.models.RouteInfo;
import io.github.notsyncing.cowherd.models.UploadFileInfo;
import io.github.notsyncing.cowherd.routing.RouteManager;
import io.github.notsyncing.cowherd.server.CowherdLogger;
import io.github.notsyncing.cowherd.utils.StringUtils;
import io.vertx.core.Vertx;
import io.vertx.core.file.FileSystem;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDate;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;
/**
* 文件存储对象
* 用于方便分类存储各类文件
*/
public class FileStorage
{
private Map<Enum, Path> storagePaths = new ConcurrentHashMap<>();
private FileSystem fs;
private CowherdLogger log = CowherdLogger.getInstance(this);
public FileStorage(Vertx vertx)
{
init(vertx);
}
public FileStorage() throws IllegalAccessException, InvocationTargetException, InstantiationException {
this(Cowherd.dependencyInjector.getComponent(Vertx.class));
}
protected void init(Vertx vertx) {
try {
fs = vertx.fileSystem();
} catch (Exception e) {
log.e("Failed to create file storage", e);
}
}
/**
* 注册一个文件存储目录
* @param tag 标识该存储类型的枚举
* @param path 要注册的目录
* @throws IOException
*/
public void registerStoragePath(Enum tag, String path) throws IOException
{
registerStoragePath(tag, Paths.get(path));
}
/**
* 注册一个文件存储目录
* @param tag 标识该存储类型的枚举
* @param path 要注册的目录
* @throws IOException
*/
public void registerStoragePath(Enum tag, Path path) throws IOException
{
if (storagePaths.containsKey(tag)) {
log.w("Tag " + tag + " already registered to path " + storagePaths.get(tag) +
", will be overwritten to " + path);
}
storagePaths.put(tag, path);
if (!Files.exists(path)) {
Path p = Files.createDirectories(path);
log.i("Created storage path " + p + " for tag " + tag);
} else {
log.i("Registered storage path " + path + " to tag " + tag);
}
}
/**
* 获取存储类别标识所对应的存放目录
* @param tag 存储类别标识枚举
* @return 该类别标识所对应的存放目录
*/
public Path getStoragePath(Enum tag)
{
return storagePaths.get(tag);
}
/**
* 异步将文件存放至指定的存储类别中
* @param file 要存放的文件
* @param tag 存储类别标识枚举
* @param newFileName 新文件名,若为 null,则按原文件名存储
* @param noRemoveOld 为 true 则不删除源文件
* @return 指示存放是否完成的 CompletableFuture 对象,并包含文件相对于该分类存储目录的相对路径
*/
public CompletableFuture<Path> storeFile(Path file, Enum tag, String newFileName, boolean noRemoveOld) {
CompletableFuture<Path> f = new CompletableFuture<>();
String fileName = newFileName == null ? file.getFileName().toString() : newFileName;
Path store = storagePaths.get(tag);
Path to;
if (store == null) {
f.completeExceptionally(new Exception("Storage tag " + tag + " not registered!"));
return f;
}
if (CowherdConfiguration.isStoreFilesByDate()) {
LocalDate date = LocalDate.now();
to = store.resolve(String.valueOf(date.getYear())).resolve(String.valueOf(date.getMonthValue()))
.resolve(String.valueOf(date.getDayOfMonth()));
try {
Files.createDirectories(to);
} catch (Exception e) {
f.completeExceptionally(e);
return f;
}
to = to.resolve(fileName);
} else {
to = store.resolve(fileName);
}
final Path finalTo = to;
fs.copy(file.toString(), to.toString(), r -> {
if (r.succeeded()) {
if (noRemoveOld) {
f.complete(store.relativize(finalTo));
} else {
fs.delete(file.toString(), r2 -> {
if (r2.succeeded()) {
f.complete(finalTo);
} else {
f.completeExceptionally(r2.cause());
}
});
}
} else {
f.completeExceptionally(r.cause());
}
});
return f;
}
/**
* 异步将文件存放至指定的存储类别中
* @param file 要存放的文件
* @param tag 存储类别标识枚举
* @param newFileName 新文件名,若为 null,则按原文件名存储
* @param noRemoveOld 为 true 则不删除源文件
* @return 指示存放是否完成的 CompletableFuture 对象,并包含文件相对于该分类存储目录的相对路径
*/
public CompletableFuture<Path> storeFile(File file, Enum tag, String newFileName, boolean noRemoveOld)
{
return storeFile(file.toPath(), tag, newFileName, noRemoveOld);
}
/**
* 异步将文件存放至指定的存储类别中
* @param file 要存放的文件
* @param tag 存储类别标识枚举
* @param newFileName 新文件名,若为 null,则按原文件名存储
* @param noRemoveOld 为 true 则不删除源文件
* @return 指示存放是否完成的 CompletableFuture 对象,并包含文件相对于该分类存储目录的相对路径
*/
public CompletableFuture<Path> storeFile(String file, Enum tag, String newFileName, boolean noRemoveOld)
{
return storeFile(Paths.get(file), tag, newFileName, noRemoveOld);
}
/**
* 异步将上传的文件存放至指定的存储类别中
* @param file 要存放的上传文件信息对象
* @param tag 存储类别标识枚举
* @param newFileName 新文件名,若为 null,则按原文件名存储
* @param noRemoveOld 为 true 则不删除源文件
* @return 指示存放是否完成的 CompletableFuture 对象,并包含文件相对于该分类存储目录的相对路径
*/
public CompletableFuture<Path> storeFile(UploadFileInfo file, Enum tag, String newFileName, boolean noRemoveOld)
{
if (file == null) {
return CompletableFuture.completedFuture(null);
}
return storeFile(file.getFile(), tag, newFileName, noRemoveOld);
}
/**
* 异步将上传的文件按源文件名存放至指定的存储类别中,并删除源文件
* @param file 要存放的上传文件信息对象
* @param tag 存储类别标识枚举
* @return 指示存放是否完成的 CompletableFuture 对象,并包含文件相对于该分类存储目录的相对路径
*/
public CompletableFuture<Path> storeFile(UploadFileInfo file, Enum tag)
{
if (file == null) {
return CompletableFuture.completedFuture(null);
}
if ((StringUtils.isEmpty(file.getFilename())) && ((file.getFile() == null) || (file.getFile().length() <= 0))) {
return CompletableFuture.completedFuture(null);
}
return storeFile(file.getFile(), tag, file.getFilename(), false);
}
/**
* 异步将上传的文件以随机文件名(保持扩展名)存放至指定的存储类别中,并删除源文件
* @param file 要存放的上传文件信息对象
* @param tag 存储类别标识枚举
* @return 指示存放是否完成的 CompletableFuture 对象,并包含文件相对于该分类存储目录的相对路径
*/
public CompletableFuture<Path> storeFileWithRandomName(UploadFileInfo file, Enum tag)
{
if (file == null) {
return CompletableFuture.completedFuture(null);
}
if ((StringUtils.isEmpty(file.getFilename())) && ((file.getFile() == null) || (file.getFile().length() <= 0))) {
return CompletableFuture.completedFuture(null);
}
String fn = file.getFilename();
int e = fn.lastIndexOf('.');
String ext = e > 0 ? fn.substring(e) : "";
String filename = UUID.randomUUID().toString() + ext;
return storeFile(file.getFile(), tag, filename, false);
}
/**
* 获取文件在某一存储类别中的完整路径
* @param tag 存储类别标识枚举
* @param file 要获取完整路径的文件
* @return 该文件的完整路径
*/
public Path resolveFile(Enum tag, Path file)
{
return storagePaths.get(tag).resolve(file);
}
/**
* 获取文件中某一存储类别中的相对路径
* @param tag 存储类别标识枚举
* @param file 要获取相对路径的文件
* @return 该文件的相对路径
*/
public Path relativize(Enum tag, Path file)
{
return getStoragePath(tag).relativize(file);
}
private void addServerRoute(RouteInfo route)
{
Method m;
try {
m = CowherdFileStorageService.class.getMethod("getFile", Enum.class, String.class);
} catch (NoSuchMethodException e) {
log.e("No action for file storage!", e);
return;
}
RouteManager.addRoute(route, new ActionMethodInfo(m));
}
/**
* 注册一条直接访问指定文件存储的路由
* @param tag 存储类别标识枚举
* @param routeRegex 路由规则,必须包含一个名为 path 的命名匹配组,用于匹配要访问的文件的相对路径
*/
public void registerServerRoute(Enum tag, String routeRegex)
{
RouteInfo info = new RouteInfo();
info.setPath(routeRegex);
info.setType(RouteType.Http);
info.setOtherParameters(new Object[] { tag });
addServerRoute(info);
}
public void registerServerSimpleRoute(Enum tag, String route)
{
RouteInfo info = new RouteInfo();
info.setPath(route);
info.setType(RouteType.Http);
info.setOtherParameters(new Object[] { tag });
info.setFastRoute(true);
addServerRoute(info);
}
public void removeStoragePathIf(Predicate<Enum> predicate) {
storagePaths.entrySet().removeIf(e -> predicate.test(e.getKey()));
}
}
| Java |
/*
* Copyright 2014 Tilera Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, version 2.
*
* 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, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for
* more details.
*
*
* Perf_events support for Tile processor.
*
* This code is based upon the x86 perf event
* code, which is:
*
* Copyright (C) 2008 Thomas Gleixner <tglx@linutronix.de>
* Copyright (C) 2008-2009 Red Hat, Inc., Ingo Molnar
* Copyright (C) 2009 Jaswinder Singh Rajput
* Copyright (C) 2009 Advanced Micro Devices, Inc., Robert Richter
* Copyright (C) 2008-2009 Red Hat, Inc., Peter Zijlstra
* Copyright (C) 2009 Intel Corporation, <markus.t.metzger@intel.com>
* Copyright (C) 2009 Google, Inc., Stephane Eranian
*/
#include <linux/kprobes.h>
#include <linux/kernel.h>
#include <linux/kdebug.h>
#include <linux/mutex.h>
#include <linux/bitmap.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/perf_event.h>
#include <linux/atomic.h>
#include <asm/traps.h>
#include <asm/stack.h>
#include <asm/pmc.h>
#include <hv/hypervisor.h>
#define TILE_MAX_COUNTERS 4
#define PERF_COUNT_0_IDX 0
#define PERF_COUNT_1_IDX 1
#define AUX_PERF_COUNT_0_IDX 2
#define AUX_PERF_COUNT_1_IDX 3
struct cpu_hw_events
{
int n_events;
struct perf_event *events[TILE_MAX_COUNTERS]; /* counter order */
struct perf_event *event_list[TILE_MAX_COUNTERS]; /* enabled
order */
int assign[TILE_MAX_COUNTERS];
unsigned long active_mask[BITS_TO_LONGS(TILE_MAX_COUNTERS)];
unsigned long used_mask;
};
/* TILE arch specific performance monitor unit */
struct tile_pmu
{
const char *name;
int version;
const int *hw_events; /* generic hw events table */
/* generic hw cache events table */
const int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
[PERF_COUNT_HW_CACHE_OP_MAX]
[PERF_COUNT_HW_CACHE_RESULT_MAX];
int (*map_hw_event)(u64); /*method used to map
hw events */
int (*map_cache_event)(u64); /*method used to map
cache events */
u64 max_period; /* max sampling period */
u64 cntval_mask; /* counter width mask */
int cntval_bits; /* counter width */
int max_events; /* max generic hw events
in map */
int num_counters; /* number base + aux counters */
int num_base_counters; /* number base counters */
};
DEFINE_PER_CPU(u64, perf_irqs);
static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);
#define TILE_OP_UNSUPP (-1)
#ifndef __tilegx__
/* TILEPro hardware events map */
static const int tile_hw_event_map[] =
{
[PERF_COUNT_HW_CPU_CYCLES] = 0x01, /* ONE */
[PERF_COUNT_HW_INSTRUCTIONS] = 0x06, /* MP_BUNDLE_RETIRED */
[PERF_COUNT_HW_CACHE_REFERENCES] = TILE_OP_UNSUPP,
[PERF_COUNT_HW_CACHE_MISSES] = TILE_OP_UNSUPP,
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x16, /*
MP_CONDITIONAL_BRANCH_ISSUED */
[PERF_COUNT_HW_BRANCH_MISSES] = 0x14, /*
MP_CONDITIONAL_BRANCH_MISSPREDICT */
[PERF_COUNT_HW_BUS_CYCLES] = TILE_OP_UNSUPP,
};
#else
/* TILEGx hardware events map */
static const int tile_hw_event_map[] =
{
[PERF_COUNT_HW_CPU_CYCLES] = 0x181, /* ONE */
[PERF_COUNT_HW_INSTRUCTIONS] = 0xdb, /* INSTRUCTION_BUNDLE */
[PERF_COUNT_HW_CACHE_REFERENCES] = TILE_OP_UNSUPP,
[PERF_COUNT_HW_CACHE_MISSES] = TILE_OP_UNSUPP,
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0xd9, /*
COND_BRANCH_PRED_CORRECT */
[PERF_COUNT_HW_BRANCH_MISSES] = 0xda, /*
COND_BRANCH_PRED_INCORRECT */
[PERF_COUNT_HW_BUS_CYCLES] = TILE_OP_UNSUPP,
};
#endif
#define C(x) PERF_COUNT_HW_CACHE_##x
/*
* Generalized hw caching related hw_event table, filled
* in on a per model basis. A value of -1 means
* 'not supported', any other value means the
* raw hw_event ID.
*/
#ifndef __tilegx__
/* TILEPro hardware cache event map */
static const int tile_cache_event_map[PERF_COUNT_HW_CACHE_MAX]
[PERF_COUNT_HW_CACHE_OP_MAX]
[PERF_COUNT_HW_CACHE_RESULT_MAX] =
{
[C(L1D)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = 0x21, /* RD_MISS */
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = 0x22, /* WR_MISS */
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(L1I)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = 0x12, /* MP_ICACHE_HIT_ISSUED */
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(LL)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(DTLB)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = 0x1d, /* TLB_CNT */
[C(RESULT_MISS)] = 0x20, /* TLB_EXCEPTION */
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(ITLB)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = 0x13, /* MP_ITLB_HIT_ISSUED */
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(BPU)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
};
#else
/* TILEGx hardware events map */
static const int tile_cache_event_map[PERF_COUNT_HW_CACHE_MAX]
[PERF_COUNT_HW_CACHE_OP_MAX]
[PERF_COUNT_HW_CACHE_RESULT_MAX] =
{
[C(L1D)] = {
/*
* Like some other architectures (e.g. ARM), the performance
* counters don't differentiate between read and write
* accesses/misses, so this isn't strictly correct, but it's the
* best we can do. Writes and reads get combined.
*/
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = 0x44, /* RD_MISS */
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = 0x45, /* WR_MISS */
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(L1I)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(LL)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(DTLB)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = 0x40, /* TLB_CNT */
[C(RESULT_MISS)] = 0x43, /* TLB_EXCEPTION */
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = 0x40, /* TLB_CNT */
[C(RESULT_MISS)] = 0x43, /* TLB_EXCEPTION */
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(ITLB)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = 0xd4, /* ITLB_MISS_INT */
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = 0xd4, /* ITLB_MISS_INT */
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
[C(BPU)] = {
[C(OP_READ)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
[C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
[C(RESULT_MISS)] = TILE_OP_UNSUPP,
},
},
};
#endif
static atomic_t tile_active_events;
static DEFINE_MUTEX(perf_intr_reserve_mutex);
static int tile_map_hw_event(u64 config);
static int tile_map_cache_event(u64 config);
static int tile_pmu_handle_irq(struct pt_regs *regs, int fault);
/*
* To avoid new_raw_count getting larger then pre_raw_count
* in tile_perf_event_update(), we limit the value of max_period to 2^31 - 1.
*/
static const struct tile_pmu tilepmu =
{
#ifndef __tilegx__
.name = "tilepro",
#else
.name = "tilegx",
#endif
.max_events = ARRAY_SIZE(tile_hw_event_map),
.map_hw_event = tile_map_hw_event,
.hw_events = tile_hw_event_map,
.map_cache_event = tile_map_cache_event,
.cache_events = &tile_cache_event_map,
.cntval_bits = 32,
.cntval_mask = (1ULL << 32) - 1,
.max_period = (1ULL << 31) - 1,
.num_counters = TILE_MAX_COUNTERS,
.num_base_counters = TILE_BASE_COUNTERS,
};
static const struct tile_pmu *tile_pmu __read_mostly;
/*
* Check whether perf event is enabled.
*/
int tile_perf_enabled(void)
{
return atomic_read(&tile_active_events) != 0;
}
/*
* Read Performance Counters.
*/
static inline u64 read_counter(int idx)
{
u64 val = 0;
/* __insn_mfspr() only takes an immediate argument */
switch (idx)
{
case PERF_COUNT_0_IDX:
val = __insn_mfspr(SPR_PERF_COUNT_0);
break;
case PERF_COUNT_1_IDX:
val = __insn_mfspr(SPR_PERF_COUNT_1);
break;
case AUX_PERF_COUNT_0_IDX:
val = __insn_mfspr(SPR_AUX_PERF_COUNT_0);
break;
case AUX_PERF_COUNT_1_IDX:
val = __insn_mfspr(SPR_AUX_PERF_COUNT_1);
break;
default:
WARN_ON_ONCE(idx > AUX_PERF_COUNT_1_IDX ||
idx < PERF_COUNT_0_IDX);
}
return val;
}
/*
* Write Performance Counters.
*/
static inline void write_counter(int idx, u64 value)
{
/* __insn_mtspr() only takes an immediate argument */
switch (idx)
{
case PERF_COUNT_0_IDX:
__insn_mtspr(SPR_PERF_COUNT_0, value);
break;
case PERF_COUNT_1_IDX:
__insn_mtspr(SPR_PERF_COUNT_1, value);
break;
case AUX_PERF_COUNT_0_IDX:
__insn_mtspr(SPR_AUX_PERF_COUNT_0, value);
break;
case AUX_PERF_COUNT_1_IDX:
__insn_mtspr(SPR_AUX_PERF_COUNT_1, value);
break;
default:
WARN_ON_ONCE(idx > AUX_PERF_COUNT_1_IDX ||
idx < PERF_COUNT_0_IDX);
}
}
/*
* Enable performance event by setting
* Performance Counter Control registers.
*/
static inline void tile_pmu_enable_event(struct perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
unsigned long cfg, mask;
int shift, idx = hwc->idx;
/*
* prevent early activation from tile_pmu_start() in hw_perf_enable
*/
if (WARN_ON_ONCE(idx == -1))
{
return;
}
if (idx < tile_pmu->num_base_counters)
{
cfg = __insn_mfspr(SPR_PERF_COUNT_CTL);
}
else
{
cfg = __insn_mfspr(SPR_AUX_PERF_COUNT_CTL);
}
switch (idx)
{
case PERF_COUNT_0_IDX:
case AUX_PERF_COUNT_0_IDX:
mask = TILE_EVENT_MASK;
shift = 0;
break;
case PERF_COUNT_1_IDX:
case AUX_PERF_COUNT_1_IDX:
mask = TILE_EVENT_MASK << 16;
shift = 16;
break;
default:
WARN_ON_ONCE(idx < PERF_COUNT_0_IDX ||
idx > AUX_PERF_COUNT_1_IDX);
return;
}
/* Clear mask bits to enable the event. */
cfg &= ~mask;
cfg |= hwc->config << shift;
if (idx < tile_pmu->num_base_counters)
{
__insn_mtspr(SPR_PERF_COUNT_CTL, cfg);
}
else
{
__insn_mtspr(SPR_AUX_PERF_COUNT_CTL, cfg);
}
}
/*
* Disable performance event by clearing
* Performance Counter Control registers.
*/
static inline void tile_pmu_disable_event(struct perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
unsigned long cfg, mask;
int idx = hwc->idx;
if (idx == -1)
{
return;
}
if (idx < tile_pmu->num_base_counters)
{
cfg = __insn_mfspr(SPR_PERF_COUNT_CTL);
}
else
{
cfg = __insn_mfspr(SPR_AUX_PERF_COUNT_CTL);
}
switch (idx)
{
case PERF_COUNT_0_IDX:
case AUX_PERF_COUNT_0_IDX:
mask = TILE_PLM_MASK;
break;
case PERF_COUNT_1_IDX:
case AUX_PERF_COUNT_1_IDX:
mask = TILE_PLM_MASK << 16;
break;
default:
WARN_ON_ONCE(idx < PERF_COUNT_0_IDX ||
idx > AUX_PERF_COUNT_1_IDX);
return;
}
/* Set mask bits to disable the event. */
cfg |= mask;
if (idx < tile_pmu->num_base_counters)
{
__insn_mtspr(SPR_PERF_COUNT_CTL, cfg);
}
else
{
__insn_mtspr(SPR_AUX_PERF_COUNT_CTL, cfg);
}
}
/*
* Propagate event elapsed time into the generic event.
* Can only be executed on the CPU where the event is active.
* Returns the delta events processed.
*/
static u64 tile_perf_event_update(struct perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
int shift = 64 - tile_pmu->cntval_bits;
u64 prev_raw_count, new_raw_count;
u64 oldval;
int idx = hwc->idx;
u64 delta;
/*
* Careful: an NMI might modify the previous event value.
*
* Our tactic to handle this is to first atomically read and
* exchange a new raw count - then add that new-prev delta
* count to the generic event atomically:
*/
again:
prev_raw_count = local64_read(&hwc->prev_count);
new_raw_count = read_counter(idx);
oldval = local64_cmpxchg(&hwc->prev_count, prev_raw_count,
new_raw_count);
if (oldval != prev_raw_count)
{
goto again;
}
/*
* Now we have the new raw value and have updated the prev
* timestamp already. We can now calculate the elapsed delta
* (event-)time and add that to the generic event.
*
* Careful, not all hw sign-extends above the physical width
* of the count.
*/
delta = (new_raw_count << shift) - (prev_raw_count << shift);
delta >>= shift;
local64_add(delta, &event->count);
local64_sub(delta, &hwc->period_left);
return new_raw_count;
}
/*
* Set the next IRQ period, based on the hwc->period_left value.
* To be called with the event disabled in hw:
*/
static int tile_event_set_period(struct perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
int idx = hwc->idx;
s64 left = local64_read(&hwc->period_left);
s64 period = hwc->sample_period;
int ret = 0;
/*
* If we are way outside a reasonable range then just skip forward:
*/
if (unlikely(left <= -period))
{
left = period;
local64_set(&hwc->period_left, left);
hwc->last_period = period;
ret = 1;
}
if (unlikely(left <= 0))
{
left += period;
local64_set(&hwc->period_left, left);
hwc->last_period = period;
ret = 1;
}
if (left > tile_pmu->max_period)
{
left = tile_pmu->max_period;
}
/*
* The hw event starts counting from this event offset,
* mark it to be able to extra future deltas:
*/
local64_set(&hwc->prev_count, (u64) - left);
write_counter(idx, (u64)(-left) & tile_pmu->cntval_mask);
perf_event_update_userpage(event);
return ret;
}
/*
* Stop the event but do not release the PMU counter
*/
static void tile_pmu_stop(struct perf_event *event, int flags)
{
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct hw_perf_event *hwc = &event->hw;
int idx = hwc->idx;
if (__test_and_clear_bit(idx, cpuc->active_mask))
{
tile_pmu_disable_event(event);
cpuc->events[hwc->idx] = NULL;
WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED);
hwc->state |= PERF_HES_STOPPED;
}
if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE))
{
/*
* Drain the remaining delta count out of a event
* that we are disabling:
*/
tile_perf_event_update(event);
hwc->state |= PERF_HES_UPTODATE;
}
}
/*
* Start an event (without re-assigning counter)
*/
static void tile_pmu_start(struct perf_event *event, int flags)
{
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
int idx = event->hw.idx;
if (WARN_ON_ONCE(!(event->hw.state & PERF_HES_STOPPED)))
{
return;
}
if (WARN_ON_ONCE(idx == -1))
{
return;
}
if (flags & PERF_EF_RELOAD)
{
WARN_ON_ONCE(!(event->hw.state & PERF_HES_UPTODATE));
tile_event_set_period(event);
}
event->hw.state = 0;
cpuc->events[idx] = event;
__set_bit(idx, cpuc->active_mask);
unmask_pmc_interrupts();
tile_pmu_enable_event(event);
perf_event_update_userpage(event);
}
/*
* Add a single event to the PMU.
*
* The event is added to the group of enabled events
* but only if it can be scehduled with existing events.
*/
static int tile_pmu_add(struct perf_event *event, int flags)
{
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct hw_perf_event *hwc;
unsigned long mask;
int b, max_cnt;
hwc = &event->hw;
/*
* We are full.
*/
if (cpuc->n_events == tile_pmu->num_counters)
{
return -ENOSPC;
}
cpuc->event_list[cpuc->n_events] = event;
cpuc->n_events++;
hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
if (!(flags & PERF_EF_START))
{
hwc->state |= PERF_HES_ARCH;
}
/*
* Find first empty counter.
*/
max_cnt = tile_pmu->num_counters;
mask = ~cpuc->used_mask;
/* Find next free counter. */
b = find_next_bit(&mask, max_cnt, 0);
/* Should not happen. */
if (WARN_ON_ONCE(b == max_cnt))
{
return -ENOSPC;
}
/*
* Assign counter to event.
*/
event->hw.idx = b;
__set_bit(b, &cpuc->used_mask);
/*
* Start if requested.
*/
if (flags & PERF_EF_START)
{
tile_pmu_start(event, PERF_EF_RELOAD);
}
return 0;
}
/*
* Delete a single event from the PMU.
*
* The event is deleted from the group of enabled events.
* If it is the last event, disable PMU interrupt.
*/
static void tile_pmu_del(struct perf_event *event, int flags)
{
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
int i;
/*
* Remove event from list, compact list if necessary.
*/
for (i = 0; i < cpuc->n_events; i++)
{
if (cpuc->event_list[i] == event)
{
while (++i < cpuc->n_events)
{
cpuc->event_list[i - 1] = cpuc->event_list[i];
}
--cpuc->n_events;
cpuc->events[event->hw.idx] = NULL;
__clear_bit(event->hw.idx, &cpuc->used_mask);
tile_pmu_stop(event, PERF_EF_UPDATE);
break;
}
}
/*
* If there are no events left, then mask PMU interrupt.
*/
if (cpuc->n_events == 0)
{
mask_pmc_interrupts();
}
perf_event_update_userpage(event);
}
/*
* Propagate event elapsed time into the event.
*/
static inline void tile_pmu_read(struct perf_event *event)
{
tile_perf_event_update(event);
}
/*
* Map generic events to Tile PMU.
*/
static int tile_map_hw_event(u64 config)
{
if (config >= tile_pmu->max_events)
{
return -EINVAL;
}
return tile_pmu->hw_events[config];
}
/*
* Map generic hardware cache events to Tile PMU.
*/
static int tile_map_cache_event(u64 config)
{
unsigned int cache_type, cache_op, cache_result;
int code;
if (!tile_pmu->cache_events)
{
return -ENOENT;
}
cache_type = (config >> 0) & 0xff;
if (cache_type >= PERF_COUNT_HW_CACHE_MAX)
{
return -EINVAL;
}
cache_op = (config >> 8) & 0xff;
if (cache_op >= PERF_COUNT_HW_CACHE_OP_MAX)
{
return -EINVAL;
}
cache_result = (config >> 16) & 0xff;
if (cache_result >= PERF_COUNT_HW_CACHE_RESULT_MAX)
{
return -EINVAL;
}
code = (*tile_pmu->cache_events)[cache_type][cache_op][cache_result];
if (code == TILE_OP_UNSUPP)
{
return -EINVAL;
}
return code;
}
static void tile_event_destroy(struct perf_event *event)
{
if (atomic_dec_return(&tile_active_events) == 0)
{
release_pmc_hardware();
}
}
static int __tile_event_init(struct perf_event *event)
{
struct perf_event_attr *attr = &event->attr;
struct hw_perf_event *hwc = &event->hw;
int code;
switch (attr->type)
{
case PERF_TYPE_HARDWARE:
code = tile_pmu->map_hw_event(attr->config);
break;
case PERF_TYPE_HW_CACHE:
code = tile_pmu->map_cache_event(attr->config);
break;
case PERF_TYPE_RAW:
code = attr->config & TILE_EVENT_MASK;
break;
default:
/* Should not happen. */
return -EOPNOTSUPP;
}
if (code < 0)
{
return code;
}
hwc->config = code;
hwc->idx = -1;
if (attr->exclude_user)
{
hwc->config |= TILE_CTL_EXCL_USER;
}
if (attr->exclude_kernel)
{
hwc->config |= TILE_CTL_EXCL_KERNEL;
}
if (attr->exclude_hv)
{
hwc->config |= TILE_CTL_EXCL_HV;
}
if (!hwc->sample_period)
{
hwc->sample_period = tile_pmu->max_period;
hwc->last_period = hwc->sample_period;
local64_set(&hwc->period_left, hwc->sample_period);
}
event->destroy = tile_event_destroy;
return 0;
}
static int tile_event_init(struct perf_event *event)
{
int err = 0;
perf_irq_t old_irq_handler = NULL;
if (atomic_inc_return(&tile_active_events) == 1)
{
old_irq_handler = reserve_pmc_hardware(tile_pmu_handle_irq);
}
if (old_irq_handler)
{
pr_warn("PMC hardware busy (reserved by oprofile)\n");
atomic_dec(&tile_active_events);
return -EBUSY;
}
switch (event->attr.type)
{
case PERF_TYPE_RAW:
case PERF_TYPE_HARDWARE:
case PERF_TYPE_HW_CACHE:
break;
default:
return -ENOENT;
}
err = __tile_event_init(event);
if (err)
{
if (event->destroy)
{
event->destroy(event);
}
}
return err;
}
static struct pmu tilera_pmu =
{
.event_init = tile_event_init,
.add = tile_pmu_add,
.del = tile_pmu_del,
.start = tile_pmu_start,
.stop = tile_pmu_stop,
.read = tile_pmu_read,
};
/*
* PMU's IRQ handler, PMU has 2 interrupts, they share the same handler.
*/
int tile_pmu_handle_irq(struct pt_regs *regs, int fault)
{
struct perf_sample_data data;
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct perf_event *event;
struct hw_perf_event *hwc;
u64 val;
unsigned long status;
int bit;
__this_cpu_inc(perf_irqs);
if (!atomic_read(&tile_active_events))
{
return 0;
}
status = pmc_get_overflow();
pmc_ack_overflow(status);
for_each_set_bit(bit, &status, tile_pmu->num_counters)
{
event = cpuc->events[bit];
if (!event)
{
continue;
}
if (!test_bit(bit, cpuc->active_mask))
{
continue;
}
hwc = &event->hw;
val = tile_perf_event_update(event);
if (val & (1ULL << (tile_pmu->cntval_bits - 1)))
{
continue;
}
perf_sample_data_init(&data, 0, event->hw.last_period);
if (!tile_event_set_period(event))
{
continue;
}
if (perf_event_overflow(event, &data, regs))
{
tile_pmu_stop(event, 0);
}
}
return 0;
}
static bool __init supported_pmu(void)
{
tile_pmu = &tilepmu;
return true;
}
int __init init_hw_perf_events(void)
{
supported_pmu();
perf_pmu_register(&tilera_pmu, "cpu", PERF_TYPE_RAW);
return 0;
}
arch_initcall(init_hw_perf_events);
/* Callchain handling code. */
/*
* Tile specific backtracing code for perf_events.
*/
static inline void perf_callchain(struct perf_callchain_entry_ctx *entry,
struct pt_regs *regs)
{
struct KBacktraceIterator kbt;
unsigned int i;
/*
* Get the address just after the "jalr" instruction that
* jumps to the handler for a syscall. When we find this
* address in a backtrace, we silently ignore it, which gives
* us a one-step backtrace connection from the sys_xxx()
* function in the kernel to the xxx() function in libc.
* Otherwise, we lose the ability to properly attribute time
* from the libc calls to the kernel implementations, since
* oprofile only considers PCs from backtraces a pair at a time.
*/
unsigned long handle_syscall_pc = handle_syscall_link_address();
KBacktraceIterator_init(&kbt, NULL, regs);
kbt.profile = 1;
/*
* The sample for the pc is already recorded. Now we are adding the
* address of the callsites on the stack. Our iterator starts
* with the frame of the (already sampled) call site. If our
* iterator contained a "return address" field, we could have just
* used it and wouldn't have needed to skip the first
* frame. That's in effect what the arm and x86 versions do.
* Instead we peel off the first iteration to get the equivalent
* behavior.
*/
if (KBacktraceIterator_end(&kbt))
{
return;
}
KBacktraceIterator_next(&kbt);
/*
* Set stack depth to 16 for user and kernel space respectively, that
* is, total 32 stack frames.
*/
for (i = 0; i < 16; ++i)
{
unsigned long pc;
if (KBacktraceIterator_end(&kbt))
{
break;
}
pc = kbt.it.pc;
if (pc != handle_syscall_pc)
{
perf_callchain_store(entry, pc);
}
KBacktraceIterator_next(&kbt);
}
}
void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
struct pt_regs *regs)
{
perf_callchain(entry, regs);
}
void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
struct pt_regs *regs)
{
perf_callchain(entry, regs);
}
| Java |
package com.limelight.binding.input.driver;
public interface UsbDriverListener {
void reportControllerState(int controllerId, short buttonFlags,
float leftStickX, float leftStickY,
float rightStickX, float rightStickY,
float leftTrigger, float rightTrigger);
void deviceRemoved(int controllerId);
void deviceAdded(int controllerId);
}
| Java |
/* Project 16 Source Code~
* Copyright (C) 2012-2021 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
*
* This file is part of Project 16.
*
* Project 16 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.
*
* Project 16 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/>, or
* write to the Free Software Foundation, Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef __16_SPRI__
#define __16_SPRI__
//#include "src/lib/16_vrs.h"
#include "src/lib/16_vl.h"
//#include <hw/cpu/cpu.h>
//#include <hw/dos/dos.h>
#include <hw/vga/vrl.h>
#include "src/lib/16_ca.h"
#include "src/lib/scroll16.h"
/*
struct vrs_container{
// Size of a .vrs lob in memory
// minus header
dword data_size;
union{
byte far *buffer;
struct vrs_header far *vrs_hdr;
};
// Array of corresponding vrl line offsets
vrl1_vgax_offset_t **vrl_line_offsets;
};
*//*
struct vrl_container{
// Size of a .vrl blob in memory
// minus header
dword data_size;
union{
byte far *buffer;
struct vrl1_vgax_header far *vrl_header;
};
// Pointer to a corresponding vrl line offsets struct
vrl1_vgax_offset_t *line_offsets;
};
*/
/* Read .vrs file into memory
* In:
* + char *filename - name of the file to load
* + struct vrs_container *vrs_cont - pointer to the vrs_container
* to load the file into
* Out:
* + int - 0 on succes, 1 on failure
*/
void VRS_ReadVRS(char *filename, entity_t *enti, global_game_variables_t *gvar);
void VRS_LoadVRS(char *filename, entity_t *enti, global_game_variables_t *gvar);
void VRS_OpenVRS(char *filename, entity_t *enti, boolean rlsw, global_game_variables_t *gvar);
void VRS_ReadVRL(char *filename, entity_t *enti, global_game_variables_t *gvar);
void VRS_LoadVRL(char *filename, entity_t *enti, global_game_variables_t *gvar);
void VRS_OpenVRL(char *filename, entity_t *enti, boolean rlsw, global_game_variables_t *gvar);
/* Seek and return a specified .vrl blob from .vrs blob in memory
* In:
* + struct vrs_container *vrs_cont - pointer to the vrs_container
* with a loaded .vrs file
* + uint16_t id - id of the vrl to retrive
* + struct vrl_container * vrl_cont - pointer to vrl_container to load to
* Out:
* int - operation status
* to the requested .vrl blob
*/
int get_vrl_by_id(struct vrs_container far *vrs_cont, uint16_t id, struct vrl_container *vrl_cont);
void DrawVRL (unsigned int x,unsigned int y,struct vrl1_vgax_header *hdr,vrl1_vgax_offset_t *lineoffs/*array hdr->width long*/,unsigned char *data,unsigned int datasz);
//moved to 16_tdef.h
// struct sprite
// {
// // VRS container from which we will extract animation and image data
// struct vrs_container *spritesheet;
// // Container for a vrl sprite
// struct vrl_container *sprite_vrl_cont;
// // Current sprite id
// int curr_spri_id;
// // Index of a current sprite in an animation sequence
// int curr_anim_spri;
// // Current animation sequence
// struct vrs_animation_list_entry_t *curr_anim_list;
// // Index of current animation in relevant VRS offsets table
// int curr_anim;
// // Delay in time units untill we should change sprite
// int delay;
// // Position of sprite on screen
// int x, y;
// };
/* Retrive current animation name of sprite
* In:
* + struct sprite *spri - sprite to retrive current animation sequence name from
* Out:
* + char* - animation sequence name
*/
char* get_curr_anim_name(struct sprite *spri);
/* Change sprite's current animation to the one given by id
* In:
* struct sprite *spri - sprite to manipulate on
* int id - id of a new animation sequence of th sprite
* Out:
* int - 0 on success, -1 on error
*/
int set_anim_by_id(struct sprite *spri, int anim_id);
/* Animate sprite, triggering any events and changing indices if necessary
* NB: if you want to change animation sequence after a specific sprite is shown, you should call animate_spri first
* In:
* + struct sprite *spri - sprite to animate
*/
void animate_spri(entity_t *enti, video_t *video);
void print_anim_ids(struct sprite *spri);
#endif
| Java |
namespace DataStoreLib.Utils
{
using System;
using System.Configuration;
using System.Diagnostics;
using System.Net;
using System.Net.Mail;
/// <summary>
/// This class use to send mails
/// </summary>
public class MailManager
{
/// <summary>
/// Send an email
/// </summary>
/// <param name="toAddress">mail message to-Address</param>
/// <param name="fromAddress">mail message from-Address</param>
/// <param name="subject">mail message subject</param>
/// <param name="body">mail message body</param>
public bool SendMail(string toAddress, string fromAddress, string subject, string body)
{
try
{
string user = ConfigurationManager.AppSettings["User"];
string password = ConfigurationManager.AppSettings["Password"];
string host = ConfigurationManager.AppSettings["Host"];
int port = Convert.ToInt32(ConfigurationManager.AppSettings["Port"]);
bool enableSsl = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSsl"]);
////bool useDefaultCredentials = Convert.ToBoolean(ConfigurationManager.AppSettings["UseDefaultCredentials"]);
MailMessage mailMessage = new MailMessage();
mailMessage.IsBodyHtml = true;
if (string.IsNullOrWhiteSpace(fromAddress))
{
mailMessage.From = new MailAddress(ConfigurationManager.AppSettings["fromAddress"]); // Key from the config file
}
else
{
mailMessage.From = new MailAddress(fromAddress);
}
mailMessage.To.Add(toAddress); // Key from the config file
if (string.IsNullOrWhiteSpace(subject))
{
mailMessage.Subject = ConfigurationManager.AppSettings["subject"]; // Key from the config file
}
else
{
mailMessage.Subject = subject;
}
mailMessage.Body = body;
SmtpClient smtpServer = new SmtpClient(host); // Key the mail server
smtpServer.Port = port;
smtpServer.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["fromAddress"], ConfigurationManager.AppSettings["Password"]);
smtpServer.EnableSsl = enableSsl;
smtpServer.Send(mailMessage);
}
catch (Exception ex)
{
Trace.TraceWarning("Sending mail failed: {0}", ex);
return false;
}
return true;
}
}
}
| Java |
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace TutorialMod.Tiles
{
public class TutorialBiomeTile : ModTile
{
public override void SetDefaults()
{
Main.tileSolid[Type] = true; // Is the tile solid
AddMapEntry(new Color(255, 255, 0));
drop = mod.ItemType("TutorialBiomeBlock"); // What item drops after destorying the tile
}
}
}
| Java |
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.minecraft.src:
// GuiScreen, AchievementList, Achievement, GuiSmallButton,
// StatCollector, GuiButton, GameSettings, KeyBinding,
// FontRenderer, MathHelper, RenderEngine, Block,
// StatFileWriter, RenderItem, RenderHelper
public class GuiAchievements extends GuiScreen
{
private static final int field_27126_s;
private static final int field_27125_t;
private static final int field_27124_u;
private static final int field_27123_v;
protected int field_27121_a;
protected int field_27119_i;
protected int field_27118_j;
protected int field_27117_l;
protected double field_27116_m;
protected double field_27115_n;
protected double field_27114_o;
protected double field_27113_p;
protected double field_27112_q;
protected double field_27111_r;
private int field_27122_w;
private StatFileWriter field_27120_x;
public GuiAchievements(StatFileWriter p_i575_1_)
{
field_27121_a = 256;
field_27119_i = 202;
field_27118_j = 0;
field_27117_l = 0;
field_27122_w = 0;
field_27120_x = p_i575_1_;
char c = '\215';
char c1 = '\215';
field_27116_m = field_27114_o = field_27112_q = AchievementList.field_25195_b.field_25075_a * 24 - c / 2 - 12;
field_27115_n = field_27113_p = field_27111_r = AchievementList.field_25195_b.field_25074_b * 24 - c1 / 2;
}
public void func_6448_a()
{
field_949_e.clear();
field_949_e.add(new GuiSmallButton(1, field_951_c / 2 + 24, field_950_d / 2 + 74, 80, 20, StatCollector.func_25200_a("gui.done")));
}
protected void func_572_a(GuiButton p_572_1_)
{
if(p_572_1_.field_938_f == 1)
{
field_945_b.func_6272_a(null);
field_945_b.func_6259_e();
}
super.func_572_a(p_572_1_);
}
protected void func_580_a(char p_580_1_, int p_580_2_)
{
if(p_580_2_ == field_945_b.field_6304_y.field_1570_o.field_1370_b)
{
field_945_b.func_6272_a(null);
field_945_b.func_6259_e();
} else
{
super.func_580_a(p_580_1_, p_580_2_);
}
}
public void func_571_a(int p_571_1_, int p_571_2_, float p_571_3_)
{
if(Mouse.isButtonDown(0))
{
int i = (field_951_c - field_27121_a) / 2;
int j = (field_950_d - field_27119_i) / 2;
int k = i + 8;
int l = j + 17;
if((field_27122_w == 0 || field_27122_w == 1) && p_571_1_ >= k && p_571_1_ < k + 224 && p_571_2_ >= l && p_571_2_ < l + 155)
{
if(field_27122_w == 0)
{
field_27122_w = 1;
} else
{
field_27114_o -= p_571_1_ - field_27118_j;
field_27113_p -= p_571_2_ - field_27117_l;
field_27112_q = field_27116_m = field_27114_o;
field_27111_r = field_27115_n = field_27113_p;
}
field_27118_j = p_571_1_;
field_27117_l = p_571_2_;
}
if(field_27112_q < (double)field_27126_s)
{
field_27112_q = field_27126_s;
}
if(field_27111_r < (double)field_27125_t)
{
field_27111_r = field_27125_t;
}
if(field_27112_q >= (double)field_27124_u)
{
field_27112_q = field_27124_u - 1;
}
if(field_27111_r >= (double)field_27123_v)
{
field_27111_r = field_27123_v - 1;
}
} else
{
field_27122_w = 0;
}
func_578_i();
func_27109_b(p_571_1_, p_571_2_, p_571_3_);
GL11.glDisable(2896);
GL11.glDisable(2929);
func_27110_k();
GL11.glEnable(2896);
GL11.glEnable(2929);
}
public void func_570_g()
{
field_27116_m = field_27114_o;
field_27115_n = field_27113_p;
double d = field_27112_q - field_27114_o;
double d1 = field_27111_r - field_27113_p;
if(d * d + d1 * d1 < 4D)
{
field_27114_o += d;
field_27113_p += d1;
} else
{
field_27114_o += d * 0.84999999999999998D;
field_27113_p += d1 * 0.84999999999999998D;
}
}
protected void func_27110_k()
{
int i = (field_951_c - field_27121_a) / 2;
int j = (field_950_d - field_27119_i) / 2;
field_6451_g.func_873_b("Achievements", i + 15, j + 5, 0x404040);
}
protected void func_27109_b(int p_27109_1_, int p_27109_2_, float p_27109_3_)
{
int i = MathHelper.func_1108_b(field_27116_m + (field_27114_o - field_27116_m) * (double)p_27109_3_);
int j = MathHelper.func_1108_b(field_27115_n + (field_27113_p - field_27115_n) * (double)p_27109_3_);
if(i < field_27126_s)
{
i = field_27126_s;
}
if(j < field_27125_t)
{
j = field_27125_t;
}
if(i >= field_27124_u)
{
i = field_27124_u - 1;
}
if(j >= field_27123_v)
{
j = field_27123_v - 1;
}
int k = field_945_b.field_6315_n.func_1070_a("/terrain.png");
int l = field_945_b.field_6315_n.func_1070_a("/achievement/bg.png");
int i1 = (field_951_c - field_27121_a) / 2;
int j1 = (field_950_d - field_27119_i) / 2;
int k1 = i1 + 16;
int l1 = j1 + 17;
field_923_k = 0.0F;
GL11.glDepthFunc(518);
GL11.glPushMatrix();
GL11.glTranslatef(0.0F, 0.0F, -200F);
GL11.glEnable(3553);
GL11.glDisable(2896);
GL11.glEnable(32826);
GL11.glEnable(2903);
field_945_b.field_6315_n.func_1076_b(k);
int i2 = i + 288 >> 4;
int j2 = j + 288 >> 4;
int k2 = (i + 288) % 16;
int l2 = (j + 288) % 16;
Random random = new Random();
for(int i3 = 0; i3 * 16 - l2 < 155; i3++)
{
float f = 0.6F - ((float)(j2 + i3) / 25F) * 0.3F;
GL11.glColor4f(f, f, f, 1.0F);
for(int k3 = 0; k3 * 16 - k2 < 224; k3++)
{
random.setSeed(1234 + i2 + k3);
random.nextInt();
int j4 = random.nextInt(1 + j2 + i3) + (j2 + i3) / 2;
int l4 = Block.field_393_F.field_378_bb;
if(j4 > 37 || j2 + i3 == 35)
{
l4 = Block.field_403_A.field_378_bb;
} else
if(j4 == 22)
{
if(random.nextInt(2) == 0)
{
l4 = Block.field_391_ax.field_378_bb;
} else
{
l4 = Block.field_433_aO.field_378_bb;
}
} else
if(j4 == 10)
{
l4 = Block.field_388_I.field_378_bb;
} else
if(j4 == 8)
{
l4 = Block.field_386_J.field_378_bb;
} else
if(j4 > 4)
{
l4 = Block.field_338_u.field_378_bb;
} else
if(j4 > 0)
{
l4 = Block.field_336_w.field_378_bb;
}
func_550_b((k1 + k3 * 16) - k2, (l1 + i3 * 16) - l2, l4 % 16 << 4, (l4 >> 4) << 4, 16, 16);
}
}
GL11.glEnable(2929);
GL11.glDepthFunc(515);
GL11.glDisable(3553);
for(int j3 = 0; j3 < AchievementList.field_27388_e.size(); j3++)
{
Achievement achievement1 = (Achievement)AchievementList.field_27388_e.get(j3);
if(achievement1.field_25076_c == null)
{
continue;
}
int l3 = (achievement1.field_25075_a * 24 - i) + 11 + k1;
int k4 = (achievement1.field_25074_b * 24 - j) + 11 + l1;
int i5 = (achievement1.field_25076_c.field_25075_a * 24 - i) + 11 + k1;
int l5 = (achievement1.field_25076_c.field_25074_b * 24 - j) + 11 + l1;
boolean flag = field_27120_x.func_27183_a(achievement1);
boolean flag1 = field_27120_x.func_27181_b(achievement1);
char c = Math.sin(((double)(System.currentTimeMillis() % 600L) / 600D) * 3.1415926535897931D * 2D) <= 0.59999999999999998D ? '\202' : '\377';
int i8 = 0xff000000;
if(flag)
{
i8 = 0xff707070;
} else
if(flag1)
{
i8 = 65280 + (c << 24);
}
func_27100_a(l3, i5, k4, i8);
func_27099_b(i5, k4, l5, i8);
}
Achievement achievement = null;
RenderItem renderitem = new RenderItem();
RenderHelper.func_41089_c();
GL11.glDisable(2896);
GL11.glEnable(32826);
GL11.glEnable(2903);
for(int i4 = 0; i4 < AchievementList.field_27388_e.size(); i4++)
{
Achievement achievement2 = (Achievement)AchievementList.field_27388_e.get(i4);
int j5 = achievement2.field_25075_a * 24 - i;
int i6 = achievement2.field_25074_b * 24 - j;
if(j5 < -24 || i6 < -24 || j5 > 224 || i6 > 155)
{
continue;
}
if(field_27120_x.func_27183_a(achievement2))
{
float f1 = 1.0F;
GL11.glColor4f(f1, f1, f1, 1.0F);
} else
if(field_27120_x.func_27181_b(achievement2))
{
float f2 = Math.sin(((double)(System.currentTimeMillis() % 600L) / 600D) * 3.1415926535897931D * 2D) >= 0.59999999999999998D ? 0.8F : 0.6F;
GL11.glColor4f(f2, f2, f2, 1.0F);
} else
{
float f3 = 0.3F;
GL11.glColor4f(f3, f3, f3, 1.0F);
}
field_945_b.field_6315_n.func_1076_b(l);
int k6 = k1 + j5;
int j7 = l1 + i6;
if(achievement2.func_27093_f())
{
func_550_b(k6 - 2, j7 - 2, 26, 202, 26, 26);
} else
{
func_550_b(k6 - 2, j7 - 2, 0, 202, 26, 26);
}
if(!field_27120_x.func_27181_b(achievement2))
{
float f4 = 0.1F;
GL11.glColor4f(f4, f4, f4, 1.0F);
renderitem.field_27004_a = false;
}
GL11.glEnable(2896);
GL11.glEnable(2884);
renderitem.func_161_a(field_945_b.field_6314_o, field_945_b.field_6315_n, achievement2.field_27097_d, k6 + 3, j7 + 3);
GL11.glDisable(2896);
if(!field_27120_x.func_27181_b(achievement2))
{
renderitem.field_27004_a = true;
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
if(p_27109_1_ >= k1 && p_27109_2_ >= l1 && p_27109_1_ < k1 + 224 && p_27109_2_ < l1 + 155 && p_27109_1_ >= k6 && p_27109_1_ <= k6 + 22 && p_27109_2_ >= j7 && p_27109_2_ <= j7 + 22)
{
achievement = achievement2;
}
}
GL11.glDisable(2929);
GL11.glEnable(3042);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
field_945_b.field_6315_n.func_1076_b(l);
func_550_b(i1, j1, 0, 0, field_27121_a, field_27119_i);
GL11.glPopMatrix();
field_923_k = 0.0F;
GL11.glDepthFunc(515);
GL11.glDisable(2929);
GL11.glEnable(3553);
super.func_571_a(p_27109_1_, p_27109_2_, p_27109_3_);
if(achievement != null)
{
String s = StatCollector.func_25200_a(achievement.func_44020_i());
String s1 = achievement.func_27090_e();
int k5 = p_27109_1_ + 12;
int j6 = p_27109_2_ - 4;
if(field_27120_x.func_27181_b(achievement))
{
int l6 = Math.max(field_6451_g.func_871_a(s), 120);
int k7 = field_6451_g.func_27277_a(s1, l6);
if(field_27120_x.func_27183_a(achievement))
{
k7 += 12;
}
func_549_a(k5 - 3, j6 - 3, k5 + l6 + 3, j6 + k7 + 3 + 12, 0xc0000000, 0xc0000000);
field_6451_g.func_27278_a(s1, k5, j6 + 12, l6, 0xffa0a0a0);
if(field_27120_x.func_27183_a(achievement))
{
field_6451_g.func_50103_a(StatCollector.func_25200_a("achievement.taken"), k5, j6 + k7 + 4, 0xff9090ff);
}
} else
{
int i7 = Math.max(field_6451_g.func_871_a(s), 120);
String s2 = StatCollector.func_25199_a("achievement.requires", new Object[] {
StatCollector.func_25200_a(achievement.field_25076_c.func_44020_i())
});
int l7 = field_6451_g.func_27277_a(s2, i7);
func_549_a(k5 - 3, j6 - 3, k5 + i7 + 3, j6 + l7 + 12 + 3, 0xc0000000, 0xc0000000);
field_6451_g.func_27278_a(s2, k5, j6 + 12, i7, 0xff705050);
}
field_6451_g.func_50103_a(s, k5, j6, field_27120_x.func_27181_b(achievement) ? achievement.func_27093_f() ? -128 : -1 : achievement.func_27093_f() ? 0xff808040 : 0xff808080);
}
GL11.glEnable(2929);
GL11.glEnable(2896);
RenderHelper.func_1159_a();
}
public boolean func_6450_b()
{
return true;
}
static
{
field_27126_s = AchievementList.field_27392_a * 24 - 112;
field_27125_t = AchievementList.field_27391_b * 24 - 112;
field_27124_u = AchievementList.field_27390_c * 24 - 77;
field_27123_v = AchievementList.field_27389_d * 24 - 77;
}
}
| Java |
/*
* Copyright (c) 2014 Amahi
*
* This file is part of Amahi.
*
* Amahi 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.
*
* Amahi 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 Amahi. If not, see <http ://www.gnu.org/licenses/>.
*/
package org.amahi.anywhere;
import android.app.Application;
import android.content.Context;
import org.amahi.anywhere.activity.AuthenticationActivity;
import org.amahi.anywhere.activity.NavigationActivity;
import org.amahi.anywhere.activity.ServerAppActivity;
import org.amahi.anywhere.activity.ServerFileAudioActivity;
import org.amahi.anywhere.activity.ServerFileImageActivity;
import org.amahi.anywhere.activity.ServerFileVideoActivity;
import org.amahi.anywhere.activity.ServerFileWebActivity;
import org.amahi.anywhere.activity.ServerFilesActivity;
import org.amahi.anywhere.fragment.ServerFileDownloadingFragment;
import org.amahi.anywhere.fragment.NavigationFragment;
import org.amahi.anywhere.fragment.ServerAppsFragment;
import org.amahi.anywhere.fragment.ServerFileImageFragment;
import org.amahi.anywhere.fragment.ServerFilesFragment;
import org.amahi.anywhere.fragment.ServerSharesFragment;
import org.amahi.anywhere.fragment.SettingsFragment;
import org.amahi.anywhere.server.ApiModule;
import org.amahi.anywhere.service.AudioService;
import org.amahi.anywhere.service.VideoService;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
/**
* Application dependency injection module. Includes {@link org.amahi.anywhere.server.ApiModule} and
* provides application's {@link android.content.Context} for possible consumers.
*/
@Module(
includes = {
ApiModule.class
},
injects = {
AuthenticationActivity.class,
NavigationActivity.class,
ServerAppActivity.class,
ServerFilesActivity.class,
ServerFileAudioActivity.class,
ServerFileImageActivity.class,
ServerFileVideoActivity.class,
ServerFileWebActivity.class,
NavigationFragment.class,
ServerSharesFragment.class,
ServerAppsFragment.class,
ServerFilesFragment.class,
ServerFileImageFragment.class,
ServerFileDownloadingFragment.class,
SettingsFragment.class,
AudioService.class,
VideoService.class
}
)
class AmahiModule
{
private final Application application;
public AmahiModule(Application application) {
this.application = application;
}
@Provides
@Singleton
Context provideContext() {
return application;
}
}
| Java |
/*
* 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/>.
*/
/*
* ExifTagWriteOperation.java
* Copyright (C) 2019 University of Waikato, Hamilton, NZ
*/
package adams.flow.transformer.exiftagoperation;
/**
* Interface for EXIF tag write operations.
*
* @author FracPete (fracpete at waikato dot ac dot nz)
*/
public interface ExifTagWriteOperation<I, O>
extends ExifTagOperation<I, O> {
}
| Java |
Resume Pertemuan 3 Keamanan Jaringan
<p align="center">
<img src="../../img/kj3.png" width="400px">
</p>
Latar Belakang Masalah
Semua yang terhubung dengan jaringan tentu tidak ada yang aman, pasti ada celah hacker untuk masuk ke dalam jaringan, hacker mempunyai yang namanya anatomi hacking yang berguna untuk para hacker melakukan hacking.
1. Apa yang dimaksud dengan Anatomi Hacking?
2. Sebutkan dan jelaskan langkah - langkah pada Anatomi Hacking?
Anatomi Hacking adalah langkah langkah yang dilakukan secara berurutan yang digunakan dalam proses hacking. Selain itu Anatomi Hacking berfungsi untuk bertahan dari serangan serangan hacker yang menyerang sistem keamanan jaringan kita.
1. Reconnaissance berfungsi untuk melakukan penyelidikan pada sistem dari sebuah jaringan.
2. Scanning berfungsi melakukan pendeteksian dengan detail dari sistem.
3. Gaining Access berfungsi melakukan percobaan masuk ke dalam sistem yang di hack.
4. Maintaining access berfungsi untuk bagaimana supaya tetap bisa masuk dan membuat backdor.
5. Clearing Tracks berfungsi menghapus jejak/log Hacker.
Penutup
Kesimpulan
Dapt disimpulkan bahwa cara untuk melakukan suatu proses hacking atau meretas sebuah jaringan, tentu memiliki teknik atau langkah langkah yang bisa dilakukan agar dapat berhasil dilakukan dengan baik yaitu dengan Anatomi Hacking
Saran
Saran saya dalam melakukan hacking, kita harus teliti dan jangan lupa menghapus jejak log dan supaya porensi tidak bisa dilacak.
- Nama : Entol Achmad Fikry Ilhamy
- NPM : 1144115
- Kelas : 3C
- Prodi : D4 Teknik Informatika
- Mata Kuliah : Sistem Keamanan Jaringan
Link Github : [https://github.com/enfikry25/SistemKeamananJaringan](https://github.com/enfikry25/SistemKeamananJaringan)
Referensi :
1. [https://blog.tibandung.com/hacking-anatomy-plus-real-hacking-example/](https://blog.tibandung.com/hacking-anatomy-plus-real-hacking-example/)
Scan Plagiarisme
1. smallseotools - Link [https://drive.google.com/open?id=0B84lVJ2VqAfRNlVoRkZrbFdNUEk](https://drive.google.com/open?id=0B84lVJ2VqAfRNlVoRkZrbFdNUEk)
2. duplichecker - Link [https://drive.google.com/open?id=0B84lVJ2VqAfRSmtlWTJVVWpwMDA](https://drive.google.com/open?id=0B84lVJ2VqAfRSmtlWTJVVWpwMDA) | Java |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>增加角色</title>
<link href="/Public/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div>
<a href="javascript:history.go(-1);" class="btn btn-warning btn-sm pull-right">返回列表</a>
</div>
<div class="clearfix"></div>
<h3 class="text-center">新增系统角色</h3>
<div class="col-md-4 col-md-offset-4">
<form action="{$smarty.const.__SELF__}" method="post" class="form-horizontal">
<div class="form-group">
<label for="role_name" class="col-md-4 control-label">角色名:</label>
<div class="col-md-8">
<input type="text" class="form-control" name="role_name" id="role_name" autofocus>
</div>
</div>
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<input type="submit" value="完成" class="btn btn-success btn-sm">
</div>
</div>
</form>
</div>
<script id="jqLabel" src="/Public/js/jquery.min.js"></script>
<script>
if (!window.jQuery) {
var jq = document.createElement('script');
jq.src = "https://code.jquery.com/jquery-3.2.1.min.js";
document.body.replaceChild(jq, document.getElementById('jqLabel'));
} else {
/* do nothing */
}
</script>
<script src="/Public/bootstrap-3.3.7/js/bootstrap.min.js"></script>
</body>
</html> | Java |
<?php
/**
* Project form base class.
*
* @package fynance
* @subpackage form
* @author Your name here
*/
abstract class BaseFormPropel extends sfFormPropel
{
public function setup()
{
}
}
| Java |
package org.fnppl.opensdx.security;
/*
* Copyright (C) 2010-2015
* fine people e.V. <opensdx@fnppl.org>
* Henning Thieß <ht@fnppl.org>
*
* http://fnppl.org
*/
/*
* Software license
*
* As far as this file or parts of this file is/are software, rather than documentation, this software-license applies / shall be applied.
*
* This file is part of openSDX
* openSDX is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* openSDX 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 Lesser General Public License
* and GNU General Public License along with openSDX.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
* Documentation license
*
* As far as this file or parts of this file is/are documentation, rather than software, this documentation-license applies / shall be applied.
*
* This file is part of openSDX.
* Permission is granted to copy, distribute and/or modify this document
* under the terms of the GNU Free Documentation License, Version 1.3
* or any later version published by the Free Software Foundation;
* with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
* A copy of the license is included in the section entitled "GNU
* Free Documentation License" resp. in the file called "FDL.txt".
*
*/
public class SubKey extends OSDXKey {
protected MasterKey parentKey = null;
protected String parentkeyid = null;//could be the parentkey is not loaded - then *only* the id is present
protected SubKey() {
super();
super.setLevel(LEVEL_SUB);
}
//public Result uploadToKeyServer(KeyVerificator keyverificator) {
public Result uploadToKeyServer(KeyClient client) {
if (!hasPrivateKey()) {
System.out.println("uploadToKeyServer::!hasprivatekey");
return Result.error("no private key available");
}
if (!isPrivateKeyUnlocked()) {
System.out.println("uploadToKeyServer::!privatekeyunlocked");
return Result.error("private key is locked");
}
if (authoritativekeyserver.equals("LOCAL")) {
System.out.println("uploadToKeyServer::authoritativekeyserver==local");
return Result.error("authoritative keyserver can not be LOCAL");
}
//if (authoritativekeyserverPort<=0) return Result.error("authoritative keyserver port not set");
if (parentKey==null) {
System.out.println("uploadToKeyServer::parentkey==null");
return Result.error("missing parent key");
}
try {
//KeyClient client = new KeyClient(authoritativekeyserver, KeyClient.OSDX_KEYSERVER_DEFAULT_PORT, "", keyverificator);
// KeyClient client = new KeyClient(
// authoritativekeyserver,
// 80, //TODO HT 2011-06-26 check me!!!
// //KeyClient.OSDX_KEYSERVER_DEFAULT_PORT,
// "",
// keyverificator
// );
//System.out.println("Before SubKey.putSubkey...");
boolean ok = client.putSubKey(this, parentKey);
//System.out.println("AFTER SubKey.putSubkey -> "+ok);
if (ok) {
return Result.succeeded();
} else {
return Result.error(client.getMessage());
}
} catch (Exception ex) {
ex.printStackTrace();
return Result.error(ex);
}
}
public String getParentKeyID() {
if (parentKey!=null) return parentKey.getKeyID();
else return parentkeyid;
}
public void setParentKey(MasterKey parent) {
unsavedChanges = true;
parentKey = parent;
parentkeyid = parent.getKeyID();
authoritativekeyserver = parent.authoritativekeyserver;
//authoritativekeyserverPort = parent.authoritativekeyserverPort;
}
public MasterKey getParentKey() {
return parentKey;
}
public void setLevel(int level) {
if (this instanceof RevokeKey && isSub()) {
super.setLevel(LEVEL_REVOKE);
} else {
throw new RuntimeException("ERROR not allowed to set level for SubKey");
}
}
public void setParentKeyID(String id) {
unsavedChanges = true;
parentkeyid = id;
parentKey = null;
}
}
| Java |
/*<html><pre> -<a href="qh-merge.htm"
>-------------------------------</a><a name="TOP">-</a>
merge.h
header file for merge.c
see qh-merge.htm and merge.c
copyright (c) 1993-2003, The Geometry Center
*/
#ifndef qhDEFmerge
#define qhDEFmerge 1
/*============ -constants- ==============*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEredundant">-</a>
qh_ANGLEredundant
indicates redundant merge in mergeT->angle
*/
#define qh_ANGLEredundant 6.0
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEdegen">-</a>
qh_ANGLEdegen
indicates degenerate facet in mergeT->angle
*/
#define qh_ANGLEdegen 5.0
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEconcave">-</a>
qh_ANGLEconcave
offset to indicate concave facets in mergeT->angle
notes:
concave facets are assigned the range of [2,4] in mergeT->angle
roundoff error may make the angle less than 2
*/
#define qh_ANGLEconcave 1.5
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="MRG">-</a>
MRG... (mergeType)
indicates the type of a merge (mergeT->type)
*/
typedef enum { /* in sort order for facet_mergeset */
MRGnone= 0,
MRGcoplanar, /* centrum coplanar */
MRGanglecoplanar, /* angle coplanar */
/* could detect half concave ridges */
MRGconcave, /* concave ridge */
MRGflip, /* flipped facet. facet1 == facet2 */
MRGridge, /* duplicate ridge (qh_MERGEridge) */
/* degen and redundant go onto degen_mergeset */
MRGdegen, /* degenerate facet (not enough neighbors) facet1 == facet2 */
MRGredundant, /* redundant facet (vertex subset) */
/* merge_degenredundant assumes degen < redundant */
MRGmirror, /* mirror facet from qh_triangulate */
ENDmrg
} mergeType;
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_MERGEapex">-</a>
qh_MERGEapex
flag for qh_mergefacet() to indicate an apex merge
*/
#define qh_MERGEapex True
/*============ -structures- ====================*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="mergeT">-</a>
mergeT
structure used to merge facets
*/
typedef struct mergeT mergeT;
struct mergeT { /* initialize in qh_appendmergeset */
realT angle; /* angle between normals of facet1 and facet2 */
facetT *facet1; /* will merge facet1 into facet2 */
facetT *facet2;
mergeType type;
};
/*=========== -macros- =========================*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="FOREACHmerge_">-</a>
FOREACHmerge_( merges ) {...}
assign 'merge' to each merge in merges
notes:
uses 'mergeT *merge, **mergep;'
if qh_mergefacet(),
restart since qh.facet_mergeset may change
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHmerge_( merges ) FOREACHsetelement_(mergeT, merges, merge)
/*============ prototypes in alphabetical order after pre/postmerge =======*/
void qh_premerge (vertexT *apex, realT maxcentrum, realT maxangle);
void qh_postmerge (const char *reason, realT maxcentrum, realT maxangle,
boolT vneighbors);
void qh_all_merges (boolT othermerge, boolT vneighbors);
void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle);
setT *qh_basevertices( facetT *samecycle);
void qh_checkconnect (void /* qh new_facets */);
boolT qh_checkzero (boolT testall);
int qh_compareangle(const void *p1, const void *p2);
int qh_comparemerge(const void *p1, const void *p2);
int qh_comparevisit (const void *p1, const void *p2);
void qh_copynonconvex (ridgeT *atridge);
void qh_degen_redundant_facet (facetT *facet);
void qh_degen_redundant_neighbors (facetT *facet, facetT *delfacet);
vertexT *qh_find_newvertex (vertexT *oldvertex, setT *vertices, setT *ridges);
void qh_findbest_test (boolT testcentrum, facetT *facet, facetT *neighbor,
facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp);
facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp);
void qh_flippedmerges(facetT *facetlist, boolT *wasmerge);
void qh_forcedmerges( boolT *wasmerge);
void qh_getmergeset(facetT *facetlist);
void qh_getmergeset_initial (facetT *facetlist);
void qh_hashridge (setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex);
ridgeT *qh_hashridge_find (setT *hashtable, int hashsize, ridgeT *ridge,
vertexT *vertex, vertexT *oldvertex, int *hashslot);
void qh_makeridges(facetT *facet);
void qh_mark_dupridges(facetT *facetlist);
void qh_maydropneighbor (facetT *facet);
int qh_merge_degenredundant (void);
void qh_merge_nonconvex( facetT *facet1, facetT *facet2, mergeType mergetype);
void qh_mergecycle (facetT *samecycle, facetT *newfacet);
void qh_mergecycle_all (facetT *facetlist, boolT *wasmerge);
void qh_mergecycle_facets( facetT *samecycle, facetT *newfacet);
void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet);
void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex);
void qh_mergefacet2d (facetT *facet1, facetT *facet2);
void qh_mergeneighbors(facetT *facet1, facetT *facet2);
void qh_mergeridges(facetT *facet1, facetT *facet2);
void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex);
void qh_mergevertex_del (vertexT *vertex, facetT *facet1, facetT *facet2);
void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2);
void qh_mergevertices(setT *vertices1, setT **vertices);
setT *qh_neighbor_intersections (vertexT *vertex);
void qh_newvertices (setT *vertices);
boolT qh_reducevertices (void);
vertexT *qh_redundant_vertex (vertexT *vertex);
boolT qh_remove_extravertices (facetT *facet);
vertexT *qh_rename_sharedvertex (vertexT *vertex, facetT *facet);
void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex);
void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges,
facetT *oldfacet, facetT *neighborA);
boolT qh_test_appendmerge (facetT *facet, facetT *neighbor);
boolT qh_test_vneighbors (void /* qh newfacet_list */);
void qh_tracemerge (facetT *facet1, facetT *facet2);
void qh_tracemerging (void);
void qh_updatetested( facetT *facet1, facetT *facet2);
setT *qh_vertexridges (vertexT *vertex);
void qh_vertexridges_facet (vertexT *vertex, facetT *facet, setT **ridges);
void qh_willdelete (facetT *facet, facetT *replace);
#endif /* qhDEFmerge */
| Java |
# d3-examples | Java |
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is machine-generated by lib/unicore/mktables from the Unicode
# database, Version 5.2.0. Any changes made here will be lost!
# !!!!!!! INTERNAL PERL USE ONLY !!!!!!!
# This file is for internal use by the Perl program only. The format and even
# the name or existence of this file are subject to change without notice.
# Don't use it directly.
# This file returns the 128 code points in Unicode Version 5.2.0 that match
# any of the following regular expression constructs:
#
# \p{Block=Kannada}
# \p{Blk=Kannada}
# \p{Is_Block=Kannada}
# \p{Is_Blk=Kannada}
#
# \p{In_Kannada}
#
# Note that contrary to what you might expect, the above is NOT the same
# as any of: \p{Kannada}, \p{Is_Kannada}
#
# perluniprops.pod should be consulted for the syntax rules for any of these,
# including if adding or subtracting white space, underscore, and hyphen
# characters matters or doesn't matter, and other permissible syntactic
# variants. Upper/lower case distinctions never matter.
#
# A colon can be substituted for the equals sign, and anything to the left of
# the equals (or colon) can be combined with anything to the right. Thus,
# for example,
# \p{Is_Blk: Kannada}
# is also valid.
#
# The format of the lines of this file is: START\tSTOP\twhere START is the
# starting code point of the range, in hex; STOP is the ending point, or if
# omitted, the range has just one code point. Numbers in comments in
# [brackets] indicate how many code points are in the range.
return <<'END';
0C80 0CFF # [128]
END
| Java |
<?php
class Sign_in_with_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function get_sign_with($name)
{
$this->db->select('setting, name');
$this->db->where('code', 'sign_in_with');
$this->db->where('name', $name);
$this->db->from($this->db->dbprefix('module'));
$query=$this->db->get();
if($query->num_rows() > 0){
$array=array();
$row =$query->row_array();
$setting =unserialize($row['setting']);
$array['name'] =$row['name'];
$array['id'] =$setting['appid'];
$array['secret'] =$setting['appkey'];
$array['extra'] =$setting['extra'];
return $array;
}
return FALSE;
}
public function get_sign_with_toedit()
{
$this->db->select('*');
$this->db->where('user_id', $_SESSION['user_id']);
$this->db->from($this->db->dbprefix('user_sign_in_with'));
$query=$this->db->get();
if($query->num_rows() > 0){
return $query->result_array();
}
return FALSE;
}
public function get_sign_withs(){
$this->db->select('setting, name');
$this->db->where('code', 'sign_in_with');
$this->db->order_by('store_order', 'ASC');
$this->db->from($this->db->dbprefix('module'));
$query=$this->db->get();
if($query->num_rows() > 0){
$array=array();
$row=$query->result_array();
foreach($row as $key=>$value){
$array[$row[$key]['name']]['setting']=unserialize($row[$key]['setting']);
if($array[$row[$key]['name']]['setting']['status'] == '0'){
unset($array[$row[$key]['name']]);
}
}
return $array;
}
return FALSE;
}
public function select_user_for_vid($via, $uid){
$this->db->select('user_id');
$this->db->where('via', $via);
$this->db->where('uid', $uid);
$this->db->from($this->db->dbprefix('user_sign_in_with'));
$query=$this->db->get();
if($query->num_rows() > 0){
return $query->row_array()['user_id'];
}
return FALSE;
}
public function add_user_sign_in_with($data){
$this->db->insert($this->db->dbprefix('user'), $data['adduser']);
$data['addsgin']['user_id']=$this->db->insert_id();
$_SESSION['user_id']=$data['addsgin']['user_id'];
$this->db->insert($this->db->dbprefix('user_sign_in_with'), $data['addsgin']);
$this->load->model('common/user_activity_model');
$this->user_activity_model->add_activity($data['addsgin']['user_id'], 'register', array('title'=>sprintf(lang_line('success_bind_login'), $data['adduser']['nickname']), 'msg'=>''));
}
//帐号绑定
public function add_bind_accounts($data){
$data['addsgin']['user_id']=$_SESSION['user_id'];
$this->db->insert($this->db->dbprefix('user_sign_in_with'), $data['addsgin']);
$this->load->model('common/user_activity_model');
$this->user_activity_model->add_activity($data['addsgin']['user_id'], 'bind', array('title'=>sprintf(lang_line('success_bind'), $data['adduser']['nickname']), 'msg'=>''));
}
//解绑
public function unbundling($via, $nickname){
$this->db->where('via', $via);
$this->db->where('user_id', $_SESSION['user_id']);
$this->db->delete($this->db->dbprefix('user_sign_in_with'));
}
} | Java |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'enrol_self', language 'en_us', branch 'MOODLE_22_STABLE'
*
* @package enrol_self
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['defaultrole_desc'] = 'Select role which should be assigned to users during self enrollment';
$string['editenrolment'] = 'Edit enrollment';
$string['enrolenddaterror'] = 'Enrollment end date cannot be earlier than start date';
$string['enrolme'] = 'Enroll me';
$string['enrolperiod'] = 'Enrollment period';
$string['enrolperiod_desc'] = 'Default length of the enrollment period (in seconds).';
$string['enrolperiod_help'] = 'Length of time that the enrollment is valid, starting with the moment the user enrolls themselves. If disabled, the enrollment duration will be unlimited.';
$string['groupkey'] = 'Use group enrollment keys';
$string['groupkey_desc'] = 'Use group enrollment keys by default.';
$string['groupkey_help'] = 'In addition to restricting access to the course to only those who know the key, use of a group enrollment key means users are automatically added to the group when they enroll in the course. To use a group enrollment key, an enrollment key must be specified in the course settings as well as the group enrollment key in the group settings.';
$string['longtimenosee'] = 'Unenroll inactive after';
$string['longtimenosee_help'] = 'If users haven\'t accessed a course for a long time, then they are automatically unenrolled. This parameter specifies that time limit.';
$string['maxenrolled'] = 'Max enrolled users';
$string['maxenrolled_help'] = 'Specifies the maximum number of users that can self enroll. 0 means no limit.';
$string['maxenrolledreached'] = 'Maximum number of users allowed to self-enroll was already reached.';
$string['nopassword'] = 'No enrollment key required.';
$string['password'] = 'Enrollment key';
$string['password_help'] = 'An enrollment key enables access to the course to be restricted to only those who know the key. If the field is left blank, any user may enroll in the course. If an enrollment key is specified, any user attempting to enroll in the course will be required to supply the key. Note that a user only needs to supply the enrollment key ONCE, when they enroll in the course.';
$string['passwordinvalid'] = 'Incorrect enrollment key, please try again';
$string['passwordinvalidhint'] = 'That enrollment key was incorrect, please try again<br />
(Here\'s a hint - it starts with \'{$a}\')';
$string['pluginname'] = 'Self enrollment';
$string['pluginname_desc'] = 'The self enrollment plugin allows users to choose which courses they want to participate in. The courses may be protected by an enrollment key. Internally the enrollment is done via the manual enrollment plugin which has to be enabled in the same course.';
$string['requirepassword'] = 'Require enrollment key';
$string['requirepassword_desc'] = 'Require enrollment key in new courses and prevent removing of enrollment key from existing courses.';
$string['self:config'] = 'Configure self enroll instances';
$string['self:manage'] = 'Manage enrolled users';
$string['self:unenrol'] = 'Unenroll users from course';
$string['self:unenrolself'] = 'Unenroll self from the course';
$string['sendcoursewelcomemessage_help'] = 'If enabled, users receive a welcome message via email when they self-enroll in a course.';
$string['status'] = 'Allow self enrollments';
$string['status_desc'] = 'Allow users to self enroll into course by default.';
$string['status_help'] = 'This setting determines whether a user can enroll (and also unenroll if they have the appropriate permission) themselves from the course.';
$string['unenrol'] = 'Unenroll user';
$string['unenrolselfconfirm'] = 'Do you really want to unenroll yourself from course "{$a}"?';
$string['unenroluser'] = 'Do you really want to unenroll "{$a->user}" from course "{$a->course}"?';
$string['usepasswordpolicy_desc'] = 'Use standard password policy for enrollment keys.';
| Java |
<?php
namespace MCPETRADE\MultiTradeAPI\Commands;
use pocketmine\Player;
use pocketmine\command\CommandSender;
use pocketmine\utils\TextFormat as TE;
use MCPETRADE\MultiTradeAPI\MTAPI;
use MCPETRADE\MultiTradeAPI\Commands\BaseCommand;
Class FlyCommand extends BaseCommand
{
public function __construct(MTAPI $plugin)
{
parent::__construct($plugin, "fly", "Включить\выключить режим полёта");
$this->getPlugin()->getLogger()->notice(TE::LIGHT_PURPLE . "Fly загружен.");
$this->setPermission("trade.commands.fly");
}
public function execute(CommandSender $sender, $command, array $args)
{
if(!($sender instanceof Player)) return;
if(!$this->testPermission($sender)) return;
if($sender->getAllowFlight(true)){
$sender->setAllowFlight(false);
$sender->sendMessage($this->getPlugin()->getPrefix() . "§f Вы§b успешно §cотключили §fрежим полёта!");
}else{
$sender->setAllowFlight(true);$sender->sendMessage($this->getPlugin()->getPrefix() . "§f Вы§b успешно §aвключили §fрежим полёта!");
}
}
}
?> | Java |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("GradeCalculator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Hewlett-Packard Company")]
[assembly: AssemblyProduct("GradeCalculator")]
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("94209e1d-148d-4cb2-b0f6-38ea6ab2f107")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| Java |
package bpmn;
public class DataStore extends Artifact {
public DataStore() {
super();
}
public DataStore(int xPos, int yPos, String text) {
super();
setText(text);
}
public String toString() {
return "BPMN data store";
}
}
| Java |
<?php
/**
* @package Arastta eCommerce
* @copyright Copyright (C) 2015 Arastta Association. All rights reserved. (arastta.org)
* @credits See CREDITS.txt for credits and other copyright notices.
* @license GNU General Public License version 3; see LICENSE.txt
*/
class Affiliate {
private $affiliate_id;
private $firstname;
private $lastname;
private $email;
private $telephone;
private $fax;
private $code;
public function __construct($registry) {
$this->config = $registry->get('config');
$this->db = $registry->get('db');
$this->request = $registry->get('request');
$this->session = $registry->get('session');
if (isset($this->session->data['affiliate_id'])) {
$affiliate_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "affiliate WHERE affiliate_id = '" . (int)$this->session->data['affiliate_id'] . "' AND status = '1'");
if ($affiliate_query->num_rows) {
$this->affiliate_id = $affiliate_query->row['affiliate_id'];
$this->firstname = $affiliate_query->row['firstname'];
$this->lastname = $affiliate_query->row['lastname'];
$this->email = $affiliate_query->row['email'];
$this->telephone = $affiliate_query->row['telephone'];
$this->fax = $affiliate_query->row['fax'];
$this->code = $affiliate_query->row['code'];
$this->db->query("UPDATE " . DB_PREFIX . "affiliate SET ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "' WHERE affiliate_id = '" . (int)$this->session->data['affiliate_id'] . "'");
} else {
$this->logout();
}
}
}
public function login($email, $password) {
$affiliate_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "affiliate WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1' AND approved = '1'");
if ($affiliate_query->num_rows) {
$this->session->data['affiliate_id'] = $affiliate_query->row['affiliate_id'];
$this->affiliate_id = $affiliate_query->row['affiliate_id'];
$this->firstname = $affiliate_query->row['firstname'];
$this->lastname = $affiliate_query->row['lastname'];
$this->email = $affiliate_query->row['email'];
$this->telephone = $affiliate_query->row['telephone'];
$this->fax = $affiliate_query->row['fax'];
$this->code = $affiliate_query->row['code'];
return true;
} else {
return false;
}
}
public function logout() {
unset($this->session->data['affiliate_id']);
$this->affiliate_id = '';
$this->firstname = '';
$this->lastname = '';
$this->email = '';
$this->telephone = '';
$this->fax = '';
}
public function isLogged() {
return $this->affiliate_id;
}
public function getId() {
return $this->affiliate_id;
}
public function getFirstName() {
return $this->firstname;
}
public function getLastName() {
return $this->lastname;
}
public function getEmail() {
return $this->email;
}
public function getTelephone() {
return $this->telephone;
}
public function getFax() {
return $this->fax;
}
public function getCode() {
return $this->code;
}
}
| Java |
#include "defs.h"
#include "fdefs.h"
#include <stdlib.h>
void
gasify(job)
char *job;
{
char command[MAXCOMM] ;
char g_type[MAXCOMM] ;
double temp_y ;
double temp_slope ;
double rho_shock ;
double temp_shock ;
double gas_frac ;
double rhobar ;
double metal ;
double rho ;
int i,j ;
int old_nsph ;
struct dark_particle *dp ;
/* Gas particles are created from dark matter particles.
* Masses are gas_frac * masses of dm particles
* dm particle masses are multiplied by (1-gas_frac).
* Temperatures are set to t=temp_y*(rho/rhobar)^temp_slope,
* or to t=temp_shock if rho/rhobar>rho_shock.
*/
if (!boxes_loaded[0]){
printf("<sorry, no boxes are loaded, %s>\n",title) ;
}
else {
if (sscanf(job,"%s %lf %lf %lf %lf %lf %lf %lf %s",command,&gas_frac,
&rhobar,&temp_y,&temp_slope,&rho_shock,&temp_shock,
&metal,g_type) == 8) {
calc_density(&box0_smx, 1, 0, 0);
header.nbodies += boxlist[0].ndark ;
old_nsph = header.nsph ;
header.nsph += boxlist[0].ndark ;
if(header.nsph != 0) {
gas_particles = (struct gas_particle *) realloc(gas_particles,
header.nsph*sizeof(*gas_particles));
if(gas_particles == NULL) {
printf("<sorry, no memory for gas particles, %s>\n",title) ;
return ;
}
mark_gas = (short *)realloc(mark_gas,header.nsph*sizeof(*mark_gas));
if(mark_gas == NULL) {
printf("<sorry, no memory for gas particle markers, %s>\n",
title) ;
return ;
}
for (i = old_nsph; i < header.nsph; i++) mark_gas[i] = 0;
}
else
gas_particles = NULL;
for (i = 0 ;i < boxlist[0].ndark ;i++) {
dp = boxlist[0].dp[i] ;
gas_particles[i+old_nsph].mass = gas_frac*(dp->mass) ;
dp->mass = (1. - gas_frac)*(dp->mass) ;
for(j = 0; j < header.ndim; j++){
gas_particles[i+old_nsph].pos[j] = dp->pos[j] ;
gas_particles[i+old_nsph].vel[j] = dp->vel[j] ;
}
gas_particles[i+old_nsph].rho =
gas_frac*(box0_smx->kd->p[i].fDensity);
gas_particles[i+old_nsph].temp = temp_y*
pow((gas_particles[i+old_nsph].rho/rhobar),temp_slope) ;
if (gas_particles[i+old_nsph].rho > rhobar*rho_shock) {
gas_particles[i+old_nsph].temp = temp_shock ;
}
gas_particles[i+old_nsph].hsmooth =
sqrt(box0_smx->kd->p[i].fBall2)/2.0;
gas_particles[i+old_nsph].metals = metal ;
gas_particles[i+old_nsph].phi = dp->phi ;
}
if(box0_smx) {
kdFinish(box0_smx->kd);
smFinish(box0_smx);
box0_smx = NULL;
}
boxes_loaded[0] = NO ;
unload_all() ;
active_box = 0 ;
binary_loaded = LOADED ;
current_project = NO ;
current_color = NO ;
divv_loaded = NO ;
hneutral_loaded = NO ;
meanmwt_loaded = NO ;
xray_loaded = NO ;
dudt_loaded = NO ;
starform_loaded = NO ;
}
else if (sscanf(job,"%s %lf %lf %lf %lf %lf %lf %lf %s",command,
&gas_frac,&rhobar,&temp_y,&temp_slope,&rho_shock,
&temp_shock,&metal,g_type) == 9) {
if (strcmp(g_type,"destroy") != 0 && strcmp(g_type,"d") != 0){
printf("<sorry, %s is not a gasify type, %s",g_type,title) ;
return;
}
calc_density(&box0_smx, 1, 0, 0);
printf("<warning, destroying original dark and gas particles, %s>\n",
title) ;
header.nbodies -= header.nsph ;
header.nsph = boxlist[0].ndark ;
header.ndark = 0 ;
if(header.nsph != 0) {
dark_particles = (struct dark_particle *) realloc(dark_particles,
header.nsph*sizeof(*gas_particles));
if(dark_particles == NULL) {
printf("<sorry, no memory for gas particles, %s>\n",title) ;
return ;
}
gas_particles = (struct gas_particle *)dark_particles ;
free(mark_dark) ;
if(header.nsph != 0)
mark_gas = (short *)calloc(header.nsph, sizeof(*mark_gas));
if(mark_gas == NULL && header.nsph != 0) {
printf("<sorry, no memory for gas particle markers, %s>\n",
title) ;
return ;
}
for (i = 0; i < header.nsph; i++) mark_gas[i] = 0;
}
else
gas_particles = NULL;
for (i = boxlist[0].ndark - 1 ;i >= 0 ;i--) {
dp = boxlist[0].dp[i] ;
gas_particles[i].phi = dp->phi ;
gas_particles[i].metals = metal ;
gas_particles[i].hsmooth = sqrt(box0_smx->kd->p[i].fBall2)/2.0;
rho = gas_frac*(box0_smx->kd->p[i].fDensity);
gas_particles[i].temp = temp_y*pow((rho/rhobar),temp_slope) ;
if (rho > rhobar*rho_shock) {
gas_particles[i].temp = temp_shock ;
}
gas_particles[i].rho = rho ;
for(j = header.ndim - 1; j >= 0; j--){
gas_particles[i+old_nsph].vel[j] = dp->vel[j] ;
}
for(j = header.ndim - 1; j >= 0; j--){
gas_particles[i+old_nsph].pos[j] = dp->pos[j] ;
}
gas_particles[i].mass = gas_frac*(dp->mass) ;
}
if(box0_smx) {
kdFinish(box0_smx->kd);
smFinish(box0_smx);
box0_smx = NULL;
}
dark_particles = NULL;
boxes_loaded[0] = NO ;
unload_all() ;
active_box = 0 ;
binary_loaded = LOADED ;
current_project = NO ;
current_color = NO ;
divv_loaded = NO ;
hneutral_loaded = NO ;
meanmwt_loaded = NO ;
xray_loaded = NO ;
starform_loaded = NO ;
dudt_loaded = NO ;
}
else {
input_error(command) ;
}
}
}
| Java |
# -*- coding: utf-8 -*-
from exceptions import DropPage, AbortProcess
| Java |
# -*- coding: utf-8 -*-
import re
from django.utils.safestring import mark_safe
from django.contrib.admin.widgets import AdminFileWidget
from django.template.defaultfilters import slugify
from django.utils.encoding import smart_text
from unidecode import unidecode
from django.forms.widgets import FILE_INPUT_CONTRADICTION, CheckboxInput, ClearableFileInput
class ImagePreviewWidget(AdminFileWidget):
template_name = 'admin/attachment/widgets/preview_image_input.html'
def render(self, name, value, attrs=None, renderer=None):
output = []
output.append(super(AdminFileWidget, self).render(name, value, attrs)) # really for AdminFileWidget
instance = getattr(value, 'instance', None)
if instance is not None and value:
output = ['<a target="_blank" href="%s"><img src="%s" alt="%s"/></a>' % \
(instance.image.url, instance.thumb.url, instance.image)] + output
return mark_safe(u''.join(output))
def value_from_datadict(self, data, files, name):
for key, file in files.items():
filename = file._get_name()
ext = u""
if '.' in filename:
ext = u"." + filename.rpartition('.')[2]
filename = filename.rpartition('.')[0]
filename = re.sub(r'[_.,:;@#$%^&?*|()\[\]]', '-', filename)
filename = slugify(unidecode(smart_text(filename))) + ext
files[key]._set_name(filename)
upload = super(ImagePreviewWidget, self).value_from_datadict(data, files, name)
if not self.is_required and CheckboxInput().value_from_datadict(
data, files, self.clear_checkbox_name(name)):
if upload:
# If the user contradicts themselves (uploads a new file AND
# checks the "clear" checkbox), we return a unique marker
# object that FileField will turn into a ValidationError.
return FILE_INPUT_CONTRADICTION
# False signals to clear any existing value, as opposed to just None
return False
return upload
class ImagePreviewWidgetHorizontal(ImagePreviewWidget):
template_name = 'admin/attachment/widgets/preview_image_input_horizontal.html'
class ImagePreviewWidgetVertical(ImagePreviewWidget):
template_name = 'admin/attachment/widgets/preview_image_input_vertical.html'
class FileWidget(ClearableFileInput):
def value_from_datadict(self, data, files, name):
for key, file in files.items():
filename = file._get_name()
ext = u""
if '.' in filename:
ext = u"." + filename.rpartition('.')[2]
filename = filename.rpartition('.')[0]
filename = re.sub(r'[_.,:;@#$%^&?*|()\[\]]', '-', filename)
filename = slugify(unidecode(smart_text(filename))) + ext
files[key]._set_name(filename)
return files.get(name, None)
| Java |
package com.fomdeveloper.planket.injection;
import android.app.Application;
import android.content.Context;
import android.net.ConnectivityManager;
import com.fomdeveloper.planket.BuildConfig;
import com.fomdeveloper.planket.NetworkManager;
import com.fomdeveloper.planket.bus.RxEventBus;
import com.fomdeveloper.planket.data.PlanketDatabase;
import com.fomdeveloper.planket.data.PaginatedDataManager;
import com.fomdeveloper.planket.data.api.FlickrOauthService;
import com.fomdeveloper.planket.data.api.FlickrService;
import com.fomdeveloper.planket.data.api.oauth.OAuthManager;
import com.fomdeveloper.planket.data.api.oauth.OAuthManagerImpl;
import com.fomdeveloper.planket.data.api.oauth.OAuthToken;
import com.fomdeveloper.planket.data.prefs.PlanketBoxPreferences;
import com.fomdeveloper.planket.data.prefs.UserHelper;
import com.fomdeveloper.planket.data.repository.FlickrRepository;
import com.fomdeveloper.planket.ui.presentation.base.oauth.OauthPresenter;
import com.fomdeveloper.planket.ui.presentation.ego.EgoPresenter;
import com.fomdeveloper.planket.ui.presentation.main.MainPresenter;
import com.fomdeveloper.planket.ui.presentation.photodetail.PhotoDetailPresenter;
import com.fomdeveloper.planket.ui.presentation.profile.ProfilePresenter;
import com.fomdeveloper.planket.ui.presentation.searchphotos.SearchPresenter;
import com.google.gson.Gson;
import com.squareup.picasso.Picasso;
import org.mockito.Mockito;
import java.io.IOException;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import rx.Scheduler;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import se.akerfeldt.okhttp.signpost.OkHttpOAuthConsumer;
import se.akerfeldt.okhttp.signpost.SigningInterceptor;
/**
* Created by Fernando on 24/12/2016.
*/
@Module
public class MockAppModule {
/************* MOCKS *************/
@Provides @Singleton
public UserHelper provideUserHelper(){
return Mockito.mock(PlanketBoxPreferences.class);
}
@Provides @Singleton
public FlickrRepository provideFlickrRepository(){
return Mockito.mock(FlickrRepository.class);
}
@Provides @Singleton
public NetworkManager provideNetworkManager(){
return Mockito.mock(NetworkManager.class);
}
/**************************/
private Application application;
public MockAppModule(Application application) {
this.application = application;
}
@Provides @Singleton
public Context provideContext(){
return this.application;
}
@Provides @Singleton
public Gson provideGson(){
return new Gson();
}
@Provides @Singleton
public ConnectivityManager provideConnectivityManager(){
return (ConnectivityManager) application.getSystemService(Context.CONNECTIVITY_SERVICE);
}
@Provides @Singleton
public PlanketBoxPreferences providePlanketPreferences(Context context, Gson gson){
return new PlanketBoxPreferences(context,gson);
}
@Provides @Singleton
public PlanketDatabase providePlanketDatabase(Context context){
return new PlanketDatabase(context);
}
@Provides @Singleton @Named("main_thread")
public Scheduler provideMainScheduler(){
return AndroidSchedulers.mainThread();
}
@Provides @Singleton @Named("io_thread")
public Scheduler provideIOScheduler(){
return Schedulers.io();
}
@Provides @Singleton
public RxEventBus provideRxBus(){
return new RxEventBus();
}
@Provides @Singleton
public Picasso providePicasso(Context context){
return Picasso.with(context);
}
@Provides @Named("non_oauth") @Singleton
public OkHttpClient provideOkHttpClient(OkHttpOAuthConsumer okHttpOAuthConsumer, PlanketBoxPreferences planketBoxPreferences){
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel( BuildConfig.DEBUG? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE);
Interceptor paramInterceptor = new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
HttpUrl url = request.url().newBuilder()
.addQueryParameter(FlickrService.PARAM_API_KEY, BuildConfig.FLICKR_API_KEY)
.addQueryParameter(FlickrService.PARAM_FORMAT,"json")
.addQueryParameter(FlickrService.PARAM_JSONCALLBACK,"1")
.build();
request = request.newBuilder().url(url).build();
return chain.proceed(request);
}
};
OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder()
.addInterceptor(paramInterceptor)
.addInterceptor(loggingInterceptor)
.addInterceptor(new SigningInterceptor(okHttpOAuthConsumer));
if (planketBoxPreferences.getAccessToken()!=null){
OAuthToken oAuthToken = planketBoxPreferences.getAccessToken();
okHttpOAuthConsumer.setTokenWithSecret(oAuthToken.getToken(),oAuthToken.getTokenSecret());
}
return okHttpClientBuilder.build();
}
@Provides @Singleton
public OkHttpOAuthConsumer provideOkHttpOAuthConsumer(){
return new OkHttpOAuthConsumer(BuildConfig.FLICKR_API_KEY, BuildConfig.FLICKR_CONSUMER_SECRET);
}
@Provides @Named("oauth") @Singleton
public OkHttpClient provideOauthOkHttpClient(OkHttpOAuthConsumer okHttpOAuthConsumer){
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel( BuildConfig.DEBUG? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE);
return new OkHttpClient.Builder()
.addInterceptor(loggingInterceptor)
.addInterceptor(new SigningInterceptor(okHttpOAuthConsumer))
.build();
}
@Provides @Named("non_oauth") @Singleton
public Retrofit provideRetrofit(@Named("non_oauth") OkHttpClient okHttpClient){
return new Retrofit.Builder()
.baseUrl( FlickrService.ENDPOINT )
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.client(okHttpClient)
.build();
}
@Provides @Named("oauth") @Singleton
public Retrofit provideOauthRetrofit(@Named("oauth") OkHttpClient okHttpClient){
return new Retrofit.Builder()
.baseUrl( FlickrOauthService.ENDPOINT )
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.client(okHttpClient)
.build();
}
@Provides @Singleton
public FlickrService provideFlickrService(@Named("non_oauth") Retrofit retrofit){
return retrofit.create(FlickrService.class);
}
@Provides @Singleton
public FlickrOauthService provideFlickrOauthService(@Named("oauth") Retrofit retrofit){
return retrofit.create(FlickrOauthService.class);
}
@Provides @Singleton
public OAuthManager provideOAuthManager(FlickrOauthService flickrOauthService,OkHttpOAuthConsumer okHttpOAuthConsumer, PlanketBoxPreferences planketBoxPreferences, Context context){
return new OAuthManagerImpl(flickrOauthService,okHttpOAuthConsumer, planketBoxPreferences, context);
}
@Provides
public PaginatedDataManager providePaginatedManager(){
return new PaginatedDataManager();
}
@Provides
public MainPresenter provideMainPresenter(FlickrRepository flickrRepository, PlanketBoxPreferences planketBoxPreferences, RxEventBus rxEventBus, @Named("main_thread") Scheduler mainScheduler, @Named("io_thread") Scheduler ioScheduler){
return new MainPresenter(flickrRepository, planketBoxPreferences, rxEventBus, mainScheduler, ioScheduler);
}
@Provides
public OauthPresenter provideFlickrLoginPresenter(OAuthManager oAuthManager, @Named("main_thread") Scheduler mainScheduler, @Named("io_thread") Scheduler ioScheduler){
return new OauthPresenter(oAuthManager, mainScheduler, ioScheduler);
}
@Provides
public SearchPresenter provideSearchPresenter(FlickrRepository flickrRepository, PaginatedDataManager paginatedDataManager, @Named("main_thread") Scheduler mainScheduler, @Named("io_thread") Scheduler ioScheduler){
return new SearchPresenter(flickrRepository, paginatedDataManager, mainScheduler, ioScheduler);
}
@Provides
public PhotoDetailPresenter providePhotoDetailPresenter(FlickrRepository flickrRepository, @Named("main_thread") Scheduler mainScheduler, @Named("io_thread") Scheduler ioScheduler){
return new PhotoDetailPresenter(flickrRepository, mainScheduler, ioScheduler);
}
@Provides
public EgoPresenter provideEgoPresenter(FlickrRepository flickrRepository, PaginatedDataManager paginatedDataManager, @Named("main_thread") Scheduler mainScheduler, @Named("io_thread") Scheduler ioScheduler){
return new EgoPresenter(flickrRepository, paginatedDataManager, mainScheduler, ioScheduler);
}
@Provides
public ProfilePresenter provideProfilePresenter(FlickrRepository flickrRepository, @Named("main_thread") Scheduler mainScheduler, @Named("io_thread") Scheduler ioScheduler){
return new ProfilePresenter(flickrRepository, mainScheduler, ioScheduler);
}
}
| Java |
/*
** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
** Copyright (C) 2011 Spolecne s.r.o., http://www.biophysics.com
**
** 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/>.
**/
#define AACD_MODULE "Decoder[FFMPEG/WMA]"
#include "aac-array-common.h"
#include <string.h>
#include "libavcodec/avcodec.h"
#include "libavcodec/aac_parser.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/mpeg4audio.h"
#include "libavutil/mem.h"
#include "libavutil/log.h"
#include "libavformat/avformat.h"
typedef struct AACDFFmpegInfo {
AACDCommonInfo *cinfo;
AVInputFormat *avifmt;
AVFormatContext *avfctx;
AVPacket *avpkt;
AVPacket *pkt;
int audio_stream_index;
unsigned int bytesconsumed;
} AACDFFmpegInfo;
extern AVCodec wmav1_decoder;
extern AVCodec wmav2_decoder;
extern AVInputFormat asf_demuxer;
static const char* aacd_ffwma_name()
{
return "FFmpeg/WMA";
}
static const char *aacd_ffwma_logname( void *ctx )
{
return AACD_MODULE;
}
/**
* Creates a new AVPacket.
*/
static AVPacket* aacd_ff_create_avpkt()
{
AVPacket *avpkt = (AVPacket*) av_mallocz( sizeof(AVPacket));
avpkt->data = NULL;
avpkt->size = 0;
return avpkt;
}
/**
* A wrapper method which reads packets.
* It only reads them from the internal pre-fetched buffer in AACDCommonInfo.
*/
static int aacd_ff_io_read_packet( void *opaque, uint8_t *buf, int buf_size)
{
AACD_TRACE( "io_read_packet() start" );
AACDFFmpegInfo *ff = (AACDFFmpegInfo*) opaque;
AACDCommonInfo *cinfo = ff->cinfo;
if (cinfo->bytesleft < buf_size)
{
// Let's cheat now:
AACDArrayInfo *ainfo = (AACDArrayInfo*) cinfo;
if (!aacda_read_buffer( ainfo ))
{
AACD_INFO( "io_read_packet() EOF detected" );
}
}
int len = buf_size < cinfo->bytesleft ? buf_size : cinfo->bytesleft;
if (!len)
{
AACD_WARN( "read_packet(): no bytes left, returning 0" );
return 0;
}
memcpy( buf, cinfo->buffer, len );
cinfo->buffer += len;
cinfo->bytesleft -= len;
ff->bytesconsumed += len;
AACD_TRACE( "io_read_packet() stop" );
return len;
}
/**
* Creates a new ByteIOContext.
*/
static ByteIOContext* aacd_ff_create_byteioctx( AACDFFmpegInfo *ff )
{
int buffer_size = ff->cinfo->bbsize;
unsigned char *buffer = av_mallocz( buffer_size );
ByteIOContext *pb = av_alloc_put_byte( buffer, buffer_size, 0, ff, aacd_ff_io_read_packet, NULL, NULL);
if (!pb)
{
av_free( buffer );
AACD_WARN( "create_byteioctx(): ByteIOContext could not be created" );
}
return pb;
}
/**
* Destroys a ByteIOContext.
*/
static void aacd_ff_destroy_byteioctx( ByteIOContext *pb )
{
if (!pb) return;
if (pb->buffer) av_free( pb->buffer );
av_free( pb );
}
/**
* Destroys our context.
*/
static void aacd_ff_destroy( AACDFFmpegInfo *ff )
{
if ( !ff ) return;
AACD_TRACE( "destroy() start" );
AVFormatContext *ic = ff->avfctx;
if ( ic )
{
if ( ff->audio_stream_index > -1) avcodec_close( ic->streams[ff->audio_stream_index]->codec );
ByteIOContext *pb = ic->pb;
av_close_input_stream( ff->avfctx );
if ( pb ) aacd_ff_destroy_byteioctx( pb );
}
if (ff->avpkt) av_free( ff->avpkt );
if (ff->pkt) av_free( ff->pkt );
av_free( ff );
AACD_TRACE( "destroy() stop" );
}
static void aacd_ffwma_stop( AACDCommonInfo *cinfo, void *ext )
{
if ( !ext ) return;
AACDFFmpegInfo *ff = (AACDFFmpegInfo*) ext;
aacd_ff_destroy( ff );
}
/**
* Initializes our context.
*/
static int aacd_ff_init( void **pext, AVInputFormat *fmt )
{
AACD_TRACE( "init() start" );
av_log_set_level( AV_LOG_VERBOSE );
AACDFFmpegInfo *ff = (AACDFFmpegInfo*) av_mallocz( sizeof(struct AACDFFmpegInfo));
if (!ff) return -1;
ff->avpkt = aacd_ff_create_avpkt();
ff->pkt = aacd_ff_create_avpkt();
if (!ff->avpkt || !ff->pkt)
{
AACD_ERROR( "init() out of memory error !" );
aacd_ff_destroy( ff );
return -2;
}
ff->avifmt = fmt;
ff->audio_stream_index = -1;
av_log( ff->avfctx, AV_LOG_INFO, "Test of AV_LOG_INFO\n" );
av_log( ff->avfctx, AV_LOG_DEBUG, "Test of AV_LOG_DEBUG\n" );
av_log( ff->avfctx, AV_LOG_VERBOSE, "Test of AV_LOG_VERBOSE\n" );
(*pext) = ff;
AACD_TRACE( "init() stop" );
return 0;
}
static int aacd_ffwma_init( void **pext )
{
return aacd_ff_init( pext, &asf_demuxer );
}
/**
* Finds a stream's position or return -1.
* This method also discards all streams.
*/
static int aacd_ff_find_stream( AVFormatContext *ic, enum AVMediaType codec_type )
{
int i;
int ret = -1;
for (i = 0; i < ic->nb_streams; i++)
{
AVStream *st = ic->streams[i];
AVCodecContext *avctx = st->codec;
st->discard = AVDISCARD_ALL;
if (ret == -1 && avctx->codec_type == codec_type) ret = i;
}
return ret;
}
/**
* Simple method for looking up only our supported codecs.
*/
static AVCodec* aacd_ffwma_find_codec( enum CodecID id )
{
switch (id)
{
case CODEC_ID_WMAV1: return &wmav1_decoder;
case CODEC_ID_WMAV2: return &wmav2_decoder;
}
return NULL;
}
static long aacd_ffwma_start( AACDCommonInfo *cinfo, void *ext, unsigned char *buffer, unsigned long buffer_size)
{
AACD_TRACE( "start() start" );
AACDFFmpegInfo *ff = (AACDFFmpegInfo*) ext;
ff->cinfo = cinfo;
// take control over the input reading:
cinfo->input_ctrl = 1;
ByteIOContext *pb = aacd_ff_create_byteioctx( ff );
if (!pb) return -1;
AACD_TRACE( "start() opening stream" );
ff->bytesconsumed = 0;
int err = av_open_input_stream( &ff->avfctx, pb, "filename.asf", ff->avifmt, NULL );
AVFormatContext *ic = ff->avfctx;
if (err)
{
char s[80];
av_strerror( err, s, 80);
AACD_ERROR("start() cannot open demuxer - [%d] - $s", err, s );
// we must dealloc what we allocated locally:
aacd_ff_destroy_byteioctx( pb );
return -1;
}
AACD_TRACE( "start() stream opened" );
//err = av_find_stream_info(ic)
AACD_DEBUG( "start() streams=%d", ic->nb_streams);
dump_format(ic, 0, "", 0);
ff->audio_stream_index = aacd_ff_find_stream( ic, AVMEDIA_TYPE_AUDIO );
if (ff->audio_stream_index < 0)
{
AACD_ERROR( "start() cannot find audio stream" );
return -1;
}
AVStream *st = ic->streams[ff->audio_stream_index];
st->discard = AVDISCARD_DEFAULT;
AVCodecContext *avctx = st->codec;
AACD_DEBUG( "start() samplerate=%d channels=%d codec=%x", avctx->sample_rate, avctx->channels, avctx->codec_id);
AVCodec *codec = aacd_ffwma_find_codec( avctx->codec_id );
if (!codec)
{
AACD_ERROR("start() audio - not a WMA codec - %x", avctx->codec_id);
return -1;
}
if (avcodec_open( avctx, codec ))
{
AACD_ERROR("start() audio cannot open audio codec - %x", avctx->codec_id);
return -1;
}
cinfo->samplerate = avctx->sample_rate;
cinfo->channels = avctx->channels;
AACD_TRACE( "start() stop - ic->format=%x, ff->avfctx->format=%x", ic->iformat, ff->avfctx->iformat );
// we return more than we consumed:
return ff->bytesconsumed;
}
static int aacd_ffwma_decode( AACDCommonInfo *cinfo, void *ext, unsigned char *buffer, unsigned long buffer_size, jshort *jsamples, jint outLen )
{
AACD_TRACE( "decode() start" );
AACDFFmpegInfo *ff = (AACDFFmpegInfo*) ext;
AVFormatContext *ic = ff->avfctx;
AVPacket *avpkt = ff->avpkt;
AVPacket *pkt = ff->pkt;
ff->bytesconsumed = 0;
#ifdef AACD_LOGLEVEL_TRACE
ic->debug = FF_FDEBUG_TS;
#endif
while (!pkt->size)
{
AACD_TRACE( "decode() calling av_read_frame..." );
int err = av_read_frame( ic, avpkt );
AACD_TRACE( "decode() av_read_frame returned: %d", err );
if (err < 0)
{
AACD_ERROR( "decode() cannot read av frame" );
return AACD_DECODE_EOF;
}
if (avpkt->stream_index == ff->audio_stream_index)
{
pkt->data = avpkt->data;
pkt->size = avpkt->size;
break;
}
// TODO: delete packet's buffer ?
AACD_TRACE( "decode() : freeing packet's data" );
av_freep( &avpkt->data );
}
AACD_TRACE( "decode() packet demuxed, will decode..." );
AVCodecContext *avctx = ic->streams[ff->audio_stream_index]->codec;
AVCodec *codec = avctx->codec;
AACD_DEBUG( "decode() frame_size=%d", avctx->frame_size );
// aac_decode_frame
int outSize = outLen * 2;
int consumed = (*codec->decode)( avctx, jsamples, &outSize, pkt );
if (consumed <= 0)
{
AACD_ERROR( "decode() cannot decode frame pkt->size=%d, outSize=%d, error: %d", pkt->size, outSize, consumed );
if ( cinfo->frame_samples < outLen * 3 / 2 )
{
AACD_WARN( "decode() trying to obtain large output buffer" );
return AACD_DECODE_OUTPUT_NEEDED;
}
pkt->size = 0;
return AACD_DECODE_OTHER;
}
pkt->data += consumed;
pkt->size -= consumed;
cinfo->frame_bytesconsumed = consumed;
//cinfo->frame_samples = avctx->frame_size * avctx->channels;
cinfo->frame_samples = (outSize >> 1);
AACD_TRACE( "decode() stop - consumed %d, pkt->size=%d", consumed, pkt->size );
return AACD_DECODE_OK;
}
static int aacd_ffwma_probe( unsigned char *buffer, int len )
{
return 0;
}
AACDDecoder aacd_ffmpeg_wma_decoder = {
aacd_ffwma_name,
aacd_ffwma_init,
aacd_ffwma_start,
aacd_ffwma_decode,
aacd_ffwma_stop,
aacd_ffwma_probe
};
| Java |
/*Hoi André,
Na iets meer gedachten hierover zou ik de interface een tikkeltje willen aanpassen, om iets meer aan te sluiten bij de DPPP-filosofie. Ik ben het aan het implementeren, kan zijn dat het niet afkomt tijdens de vlucht. Ik stuur m'n idee nu vast zodat jij niet onnodig werk zit te doen.
Stel dat jouw klasse DDESolver heet, dan zou de constructor de parset mee krijgen:*/
class MultiDirSolver {
public:
MultiDirSolver(const Parset& parset, HDF5bestand*);
init(size_t nants, size_t ndir, size_t nchan);
// TODO this should receive weights!
// Float per vis or per pol x vis?
process(vector<DComplex*> data, vector<float*> data, vector<vector<DComplex* > > mdata);
// -- eventuele opruimacties (bijvoorbeeld wegschrijven van de data)
finish();
// -- hier kun je wat op het scherm dumpen aan statistieken
showCounts();
};
| Java |
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "simulation/ElementsCommon.h"
int VIRS_update(UPDATE_FUNC_ARGS);
int VRSS_graphics(GRAPHICS_FUNC_ARGS)
{
*pixel_mode |= NO_DECO;
return 1;
}
void VRSS_init_element(ELEMENT_INIT_FUNC_ARGS)
{
elem->Identifier = "DEFAULT_PT_VRSS";
elem->Name = "VRSS";
elem->Colour = COLPACK(0xD408CD);
elem->MenuVisible = 0;
elem->MenuSection = SC_SOLIDS;
elem->Enabled = 1;
elem->Advection = 0.0f;
elem->AirDrag = 0.00f * CFDS;
elem->AirLoss = 0.90f;
elem->Loss = 0.00f;
elem->Collision = 0.0f;
elem->Gravity = 0.0f;
elem->Diffusion = 0.00f;
elem->HotAir = 0.000f * CFDS;
elem->Falldown = 0;
elem->Flammable = 0;
elem->Explosive = 0;
elem->Meltable = 0;
elem->Hardness = 1;
elem->Weight = 100;
elem->DefaultProperties.temp = R_TEMP + 273.15f;
elem->HeatConduct = 251;
elem->Latent = 0;
elem->Description = "Solid Virus. Turns everything it touches into virus.";
elem->State = ST_SOLID;
elem->Properties = TYPE_SOLID;
elem->LowPressureTransitionThreshold = IPL;
elem->LowPressureTransitionElement = NT;
elem->HighPressureTransitionThreshold = IPH;
elem->HighPressureTransitionElement = NT;
elem->LowTemperatureTransitionThreshold = ITL;
elem->LowTemperatureTransitionElement = NT;
elem->HighTemperatureTransitionThreshold = 305.0f;
elem->HighTemperatureTransitionElement = PT_VIRS;
elem->DefaultProperties.pavg[1] = 250;
elem->Update = &VIRS_update;
elem->Graphics = &VRSS_graphics;
elem->Init = &VRSS_init_element;
}
| Java |
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Subject.php,v 1.1.2.3 2011-05-30 08:31:08 root Exp $
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* Topic of the resource
*
* @category Zend
* @package Zend_Gdata
* @subpackage DublinCore
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_DublinCore_Extension_Subject extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'dc';
protected $_rootElement = 'subject';
/**
* Constructor for Zend_Gdata_DublinCore_Extension_Subject which
* Topic of the resource
*
* @param DOMElement $element (optional) DOMElement from which this
* object should be constructed.
*/
public function __construct($value = null)
{
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
parent::__construct();
$this->_text = $value;
}
}
| Java |
package asdf.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
public class Solution {
/**
* (反转单词串 ) Given an input string, reverse the string word by word.
*
* For example, Given s = "the sky is blue", return "blue is sky the".
*
* Clarification:
*
* What constitutes a word?
*
* A sequence of non-space characters constitutes a word.
*
* Could the input string contain leading or trailing spaces?
*
* Yes. However, your reversed string should not contain leading or trailing
* spaces.
*
* How about multiple spaces between two words?
*
* Reduce them to a single space in the reversed string.
*/
// 首尾空格
// 中间空格
public String reverseWords(String s) {
String[] strs = s.trim().split(" ");
StringBuffer sb = new StringBuffer();
for (int i = strs.length - 1; i > 0; i--) {
if (strs[i].length()>0&&strs[i].charAt(0)!=' ') {//空格串
sb.append(strs[i]);
sb.append(' ');
}
}
if (strs.length > 0) {
sb.append(strs[0]);
}
return sb.toString();
}
public static void main(String[] args) {
Solution solution = new Solution();
System.out.println(solution.reverseWords(""));
System.out.println(solution.reverseWords(" "));
System.out.println(solution.reverseWords("the sky is blue"));
System.out.println(solution.reverseWords(" the sky is blue "));
System.out.println(solution.reverseWords(" 1"));
}
}
| Java |
var express = require('express'),
router = express.Router(),
adminModel = require('../models/adminModel'),
moment = require('moment'),
helperFun = require('../lib/helperFunc'),
md5 = require('md5');
router
.get('',function (request,response){
adminModel.find({},{"__v" : 0, "password" : 0, "emailCode" : 0},function (err,result){
if(err){
return response.status(500).send({"message" : "Internal Server Error" , "err" : err}).end();
}
response.status(200).send(result).end();
})
})
.post('/login',function (request,response){
var username = request.body.username;
var password = md5(request.body.password);
if((username == null || '') || (password == '' || null)){
return response.status(400).send({'message' : 'Parameters are missing'}).end();
}
adminModel.findOne({ $and:[ {'username':username}, {'password':password}]}, function (err,admin){
if(err){
return response.status(500).send({'message' : 'Internal Server error. Please try again later','err' :err}).end();
}
if(admin == null){
return response.status(400).send({'message' : 'Invalid Username OR Password'}).end();
}
response.status(200).send(admin).end();
})
})
.post('/update',function (request,response){
var adminObj = request.body.admin;
if(adminObj == null){
return response.status(400).send({'message' : 'Parameters are missing'}).end();
}
adminModel.findOne({"_id" : adminObj._id,'password' : md5(adminObj.password)},function (err,admin){
if(err){
return response.status(500).send({'message' : 'Internal Server error. Please try again later','err' :err}).end();
}
if(admin == null){
return response.status(400).send({'message' : 'Invalid Password'}).end();
}
admin.password = md5(adminObj.password);
admin.username = adminObj.username;
admin.firstName = adminObj.firstName;
admin.lastName = adminObj.lastName;
admin.email = adminObj.email;
admin.save(function (error,adminNew){
if(error){
return response.status(500).send({'message' : 'Internal Server error. Please try again later','err' :err}).end();
}
response.status(200).send(adminNew).end();
})
})
})
.post('/addAdmin', function (request,response){
var admin = request.body.admin;
if(admin == null || ''){
return response.status(400).send({'message' : 'Parameters are missing'}).end();
}
admin.password = md5(admin.password);
// admin.createdOn = moment().format('MM-DD-YYYY hh:mm a');
var newAdmin = new adminModel(admin);
newAdmin.save(function (err,result){
if(err){
return response.status(500).send({'message' : 'Internal Server error. Please try again later','err' :err}).end();
}
response.status(200).send(result).end();
});
})
module.exports = router; | Java |
Ember.Handlebars.helper('headTitle', function(title) {
Ember.$('head').find('title').text(title);
}, 'title'); | Java |
/*
* Parameters.h
*
* Created on: 31/01/2017
* Author: Lucas Teske
*/
#ifndef SRC_PARAMETERS_H_
#define SRC_PARAMETERS_H_
#define Q(x) #x
#define QUOTE(x) Q(x)
// These are the parameters used by the demodulator. Change with care.
// GOES HRIT Settings
#define HRIT_CENTER_FREQUENCY 1694100000
#define HRIT_SYMBOL_RATE 927000
#define HRIT_RRC_ALPHA 0.3f
// GOES LRIT Settings
#define LRIT_CENTER_FREQUENCY 1691000000
#define LRIT_SYMBOL_RATE 293883
#define LRIT_RRC_ALPHA 0.5f
// Loop Settings
#define LOOP_ORDER 2
#define RRC_TAPS 63
#define PLL_ALPHA 0.001f
#define CLOCK_ALPHA 0.0037f
#define CLOCK_MU 0.5f
#define CLOCK_OMEGA_LIMIT 0.005f
#define CLOCK_GAIN_OMEGA (CLOCK_ALPHA * CLOCK_ALPHA) / 4.0f
#define AGC_RATE 0.01f
#define AGC_REFERENCE 0.5f
#define AGC_GAIN 1.f
#define AGC_MAX_GAIN 4000
#define AIRSPY_MINI_DEFAULT_SAMPLERATE 3000000
#define AIRSPY_R2_DEFAULT_SAMPLERATE 2500000
#define DEFAULT_SAMPLE_RATE AIRSPY_MINI_DEFAULT_SAMPLERATE
#define DEFAULT_DECIMATION 1
#define DEFAULT_DEVICE_NUMBER 0
#define DEFAULT_DECODER_ADDRESS "127.0.0.1"
#define DEFAULT_DECODER_PORT 5000
#define DEFAULT_LNA_GAIN 5
#define DEFAULT_VGA_GAIN 5
#define DEFAULT_MIX_GAIN 5
#define DEFAULT_BIAST 0
// FIFO Size in Samples
// 1024 * 1024 samples is about 4Mb of ram.
// This should be more than enough
#define FIFO_SIZE (1024 * 1024)
// Config parameters
#define CFG_SYMBOL_RATE "symbolRate"
#define CFG_FREQUENCY "frequency"
#define CFG_RRC_ALPHA "rrcAlpha"
#define CFG_MODE "mode"
#define CFG_SAMPLE_RATE "sampleRate"
#define CFG_DECIMATION "decimation"
#define CFG_AGC "agcEnabled"
#define CFG_MIXER_GAIN "mixerGain"
#define CFG_LNA_GAIN "lnaGain"
#define CFG_VGA_GAIN "vgaGain"
#define CFG_DEVICE_TYPE "deviceType"
#define CFG_FILENAME "filename"
#define CFG_CONSTELLATION "sendConstellation"
#define CFG_PLL_ALPHA "pllAlpha"
#define CFG_DECODER_ADDRESS "decoderAddress"
#define CFG_DECODER_PORT "decoderPort"
#define CFG_DEVICE_NUM "deviceNumber"
#define CFG_SPYSERVER_HOST "spyserverHost"
#define CFG_SPYSERVER_PORT "spyserverPort"
#define CFG_BIAST "biast"
// Compilation parameters
#ifndef MAJOR_VERSION
#define MAJOR_VERSION unk
#endif
#ifndef MINOR_VERSION
#define MINOR_VERSION unk
#endif
#ifndef MAINT_VERSION
#define MAINT_VERSION unk
#endif
#ifndef GIT_SHA1
#define GIT_SHA1 unk
#endif
#endif /* SRC_PARAMETERS_H_ */
| Java |
package com.osiykm.flist.services.programs;
import com.osiykm.flist.entities.Book;
import com.osiykm.flist.enums.BookStatus;
import com.osiykm.flist.repositories.BookRepository;
import com.osiykm.flist.services.parser.FanfictionUrlParserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/***
* @author osiykm
* created 28.09.2017 22:49
*/
@Component
@Slf4j
public class BookUpdaterProgram extends BaseProgram {
private final FanfictionUrlParserService urlParserService;
private final BookRepository bookRepository;
@Autowired
public BookUpdaterProgram(FanfictionUrlParserService urlParserService, BookRepository bookRepository) {
this.urlParserService = urlParserService;
this.bookRepository = bookRepository;
}
@Override
public void run() {
List<Book> books;
List<Book> updatedBooks;
log.info("Start update books");
books = bookRepository.findByStatusNot(BookStatus.COMPLETED);
log.info("find " + books.size() + "books for update");
updatedBooks = new ArrayList<>();
for (Book book :
books) {
if (isAlive()) {
Book updatedBook = urlParserService.getBook(book.getUrl());
updatedBooks.add(book.setSize(updatedBook.getSize()).setChapters(updatedBook.getChapters()).setStatus(updatedBook.getStatus()));
} else {
break;
}
}
log.info("updated " + updatedBooks.size() + " books");
bookRepository.save(updatedBooks);
stop();
}
}
| Java |
<?php
/**
*
* @package mahara
* @subpackage artefact-cloud
* @author Gregor Anzelj
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2012-2016 Gregor Anzelj, info@povsod.com
*
*/
defined('INTERNAL') || die();
$string['pluginname'] = 'Cloud service';
$string['cloud'] = 'Cloud service';
$string['clouds'] = 'Cloud services';
$string['service'] = 'Service';
$string['servicefiles'] = '%s Files';
$string['unknownservice'] = 'Unknown Service';
$string['account'] = 'Account';
$string['manage'] = 'Manage';
$string['access'] = 'Access';
$string['accessgrant'] = 'Grant access';
$string['accessrevoke'] = 'Revoke access';
$string['accessrevoked'] = 'Access revoked successfully';
$string['httprequestcode'] = 'HTTP request unsuccessful with code: %s';
$string['ticketnotreturned'] = 'There was no ticket';
$string['requesttokennotreturned'] = 'There was no request token';
$string['accesstokennotreturned'] = 'There was no access token';
$string['accesstokensaved'] = 'Access token saved sucessfully';
$string['accesstokensavefailed'] = 'Failed to save access token';
$string['servererror'] = 'There was server error when downloading a file';
$string['userinfo'] = 'User information';
$string['username'] = 'User name';
$string['useremail'] = 'User email';
$string['userprofile'] = 'User profile';
$string['userid'] = 'User ID';
$string['usageinfo'] = 'Usage information';
$string['filename'] = 'File name';
$string['foldername'] = 'Folder name';
$string['description'] = 'Description';
$string['Shared'] = 'Shared';
$string['Revision'] = 'Revision';
$string['fileaccessdenied'] = 'You cannot access this file';
$string['folderaccessdenied'] = 'You cannot access this folder';
$string['consenttitle'] = 'The app %s would like to connect with your %s account';
$string['consentmessage'] = 'By entering the details in the form below, you are authorizing this application or website to access the files in your account.';
$string['allow'] = 'Allow';
$string['deny'] = 'Deny';
$string['filedetails'] = 'Details about %s';
$string['exporttomahara'] = 'Export to Mahara';
$string['export'] = 'Export';
$string['selectfileformat'] = 'Select format to export file to:';
$string['savetofolder'] = 'Save file to folder:';
$string['savetomahara'] = 'Save to Mahara';
$string['save'] = 'Save';
$string['preview'] = 'Preview';
$string['download'] = 'Download';
$string['servicenotconfigured'] = 'This service is not configured yet.';
$string['servicenotauthorised'] = 'This service is not authorised yet.';
/* ===== jQuery DataTable strings ===== */
$string['loading'] = 'Loading ...';
$string['processing'] = 'Processing ...';
$string['firstpage'] = 'First';
$string['previouspage'] = 'Previous';
$string['nextpage'] = 'Next';
$string['lastpage'] = 'Last';
$string['emptytable'] = 'No data available in table';
$string['info'] = 'Showing _START_ to _END_ of _TOTAL_ entries'; // Don't translate: _START_, _END_ and _TOTAL_
$string['infoempty'] = 'No entries to show';
$string['infofiltered'] = '(filtered from _MAX_ total entries)'; // Don't tanslate: _MAX_
$string['lengthmenu'] = 'Show _MENU_ entries'; // Don't tanslate: _MENU_
$string['search'] = 'Search:';
$string['zerorecords'] = 'No matching entries found';
| Java |
import json
from collections import (
Counter,
defaultdict as deft
)
from copy import deepcopy as cp
# from cPickle import (
# dump as to_pickle,
# load as from_pickle
# )
from StringIO import StringIO
from TfIdfMatrix import TfIdfMatrix
from Tools import from_csv
class CategoryTree:
def __init__(self, categories_by_concept, terms,
categories, tfidf, max_depth=5, min_df=20
):
self.min_df = min_df
self.path_categories_by_concept = categories_by_concept
self.path_categories = categories
self.path_terms = terms
self.max_depth = max_depth
self.observed_category = deft(bool)
self.id_by_concept = dict([])
self.concept_by_id = dict([])
self.term_is_category = deft(bool)
self.parents_by_category = dict([])
self.parents_by_concept = deft(list)
self.id_by_term = dict([])
self.term_by_id = dict([])
self.has_parents = deft(bool)
self.tfidf = tfidf
self.pulling = set([])
self.vector_by_category = deft(Counter)
self.contributors_by_category = deft(set)
self.projected = Counter()
def build(self):
for i, c in enumerate(self.concept_by_id.values()):
self(c)
if not i % 100:
t = float(len(self.concept_by_id.keys()))
print i, int(t), round(i / t, 2)
# if i >= 5000:
# break
def dump(self):
# Simulate a file with StringIO
out = open('vector.dump.txt', 'wb')
for i, (_id, projections) in enumerate(self.projected.items()):
if not i % 100:
print i, len(self.projected.keys())
if not projections:
continue
features = [
(self.tfidf.word_by_id[wid], round(weight, 4))
for wid, weight in self.vector_by_category[_id].most_common()
if round(weight, 4)
]
record = (
_id,
self.concept_by_id[_id],
features
)
out.write('%s\n' % str(record))
out.close()
def __call__(self, category):
self.pulling = set([])
return self.__pull(None, 0, category, dict([]))
def __get_parents(self, _id):
parents = []
name = self.concept_by_id[_id]
if (
not self.observed_category[name] or
not self.observed_category[_id] or
not self.has_parents[_id]
):
return []
else:
for i in self.parents_by_category[_id]:
if not self.observed_category[i]:
continue
_name = self.concept_by_id[i]
parents.append(_name)
return set(parents) - self.pulling
def __pull(self, vector, depth, category, tree):
_id = self.id_by_concept[category]
if not self.pulling:
# print
# print
# print category, _id
# print [self.term_by_id[x] for x in self.contributors_by_category[_id]]
# print self.vector_by_category[_id].most_common(20)
vector = self.vector_by_category[_id]
if not self.observed_category[category]:
return dict([])
parents = self.__get_parents(_id)
if not parents or depth >= self.max_depth:
tree[category] = dict([])
else:
subtree = dict([])
self.pulling.update(parents)
for parent in parents:
subtree = self.__pull(vector, depth + 1, parent, subtree)
tree[category] = subtree
self.__project(vector, tree)
return tree
def __project(self, vector, tree):
if not tree.keys():
return
else:
for key, subtree in tree.items():
_id = self.id_by_concept[key]
self.projected[_id] += 1
self.__add2vec(vector, _id)
self.__project(vector, subtree)
def __add2vec(self, vector, _id):
# for w, weight in vector.items():
# __id = self.tfidf.id_by_word[w]
for __id, weight in vector.items():
self.vector_by_category[_id][__id] += weight
def load(self):
self.__load_terms()
self.__load_categories()
self.__load_assignments()
def __load_categories(self):
for concept, _id in from_csv(self.path_categories):
_id = int(_id)
self.id_by_concept[concept] = _id
self.concept_by_id[_id] = concept
self.observed_category[_id] = True
self.observed_category[concept] = True
# print concept, _id, len(self.id_by_concept.keys())
# exit()
def __load_terms(self):
for term, _id in from_csv(self.path_terms):
_id = int(_id)
self.term_by_id[_id] = term
self.id_by_term[term] = _id
if not term.startswith('Category:'):
continue
self.term_is_category[term] = True
self.term_is_category[_id] = True
def __load_assignments(self):
for row in from_csv(self.path_categories_by_concept):
ints = [int(field) for field in row]
term_id = ints[0]
term = self.term_by_id[term_id]
if self.term_is_category[term_id] and \
self.observed_category[term]:
term = self.term_by_id[term_id]
cat_id = self.id_by_concept[term]
assignments = [i for i in ints[1:] if self.observed_category[i]]
self.parents_by_category[cat_id] = assignments
self.has_parents[cat_id] = True
else:
vector = self.tfidf.content(term_id)
assignments = [i for i in ints[1:] if self.observed_category[i]]
self.parents_by_concept[term_id] = assignments
for a_id in assignments:
for w, weight in vector:
if self.tfidf.df[w] < self.min_df:
continue
#print term, term_id, self.concept_by_id[a_id], w, self.vector_by_category[a_id][w], '\t+%f' % weight
self.vector_by_category[a_id][w] += weight
self.contributors_by_category[a_id].update([term_id])
if __name__ == '__main__':
import random
from random import shuffle as randomize
tfidf = TfIdfMatrix()
tfidf.load_features('bkp.big.out/vector.term.csv')
tfidf.load_distribution('bkp.big.out/vector.index.csv')
# tfidf.load_features('vector.term.csv')
# tfidf.load_distribution('vector.index.csv')
ctree = CategoryTree(
'bkp.big.out/category.index.csv',
'bkp.big.out/term.csv',
'bkp.big.out/category.csv',
# 'category.index.csv',
# 'term.csv',
# 'category.csv',
tfidf,
max_depth=1
)
ctree.load()
ctree.build()
ctree.dump()
| Java |
/*!
* Bootstrap v3.3.6 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body {
margin:0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
a {
background-color: transparent;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
margin: .67em 0;
font-size: 2em;
}
mark {
color: #000;
background: #ff0;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sup {
top: -.5em;
}
sub {
bottom: -.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
height: 0;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
margin: 0;
font: inherit;
color: inherit;
}
button {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
input {
line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
input[type="search"] {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
fieldset {
padding: .35em .625em .75em;
margin: 0 2px;
border: 1px solid #c0c0c0;
}
legend {
padding: 0;
border: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0;
}
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*,
*:before,
*:after {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="#"]:after,
a[href^="javascript:"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
.navbar {
display: none;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table td,
.table th {
background-color: #fff !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.glyphicon-asterisk:before {
content: "\002a";
}
.glyphicon-plus:before {
content: "\002b";
}
.glyphicon-euro:before,
.glyphicon-eur:before {
content: "\20ac";
}
.glyphicon-minus:before {
content: "\2212";
}
.glyphicon-cloud:before {
content: "\2601";
}
.glyphicon-envelope:before {
content: "\2709";
}
.glyphicon-pencil:before {
content: "\270f";
}
.glyphicon-glass:before {
content: "\e001";
}
.glyphicon-music:before {
content: "\e002";
}
.glyphicon-search:before {
content: "\e003";
}
.glyphicon-heart:before {
content: "\e005";
}
.glyphicon-star:before {
content: "\e006";
}
.glyphicon-star-empty:before {
content: "\e007";
}
.glyphicon-user:before {
content: "\e008";
}
.glyphicon-film:before {
content: "\e009";
}
.glyphicon-th-large:before {
content: "\e010";
}
.glyphicon-th:before {
content: "\e011";
}
.glyphicon-th-list:before {
content: "\e012";
}
.glyphicon-ok:before {
content: "\e013";
}
.glyphicon-remove:before {
content: "\e014";
}
.glyphicon-zoom-in:before {
content: "\e015";
}
.glyphicon-zoom-out:before {
content: "\e016";
}
.glyphicon-off:before {
content: "\e017";
}
.glyphicon-signal:before {
content: "\e018";
}
.glyphicon-cog:before {
content: "\e019";
}
.glyphicon-trash:before {
content: "\e020";
}
.glyphicon-home:before {
content: "\e021";
}
.glyphicon-file:before {
content: "\e022";
}
.glyphicon-time:before {
content: "\e023";
}
.glyphicon-road:before {
content: "\e024";
}
.glyphicon-download-alt:before {
content: "\e025";
}
.glyphicon-download:before {
content: "\e026";
}
.glyphicon-upload:before {
content: "\e027";
}
.glyphicon-inbox:before {
content: "\e028";
}
.glyphicon-play-circle:before {
content: "\e029";
}
.glyphicon-repeat:before {
content: "\e030";
}
.glyphicon-refresh:before {
content: "\e031";
}
.glyphicon-list-alt:before {
content: "\e032";
}
.glyphicon-lock:before {
content: "\e033";
}
.glyphicon-flag:before {
content: "\e034";
}
.glyphicon-headphones:before {
content: "\e035";
}
.glyphicon-volume-off:before {
content: "\e036";
}
.glyphicon-volume-down:before {
content: "\e037";
}
.glyphicon-volume-up:before {
content: "\e038";
}
.glyphicon-qrcode:before {
content: "\e039";
}
.glyphicon-barcode:before {
content: "\e040";
}
.glyphicon-tag:before {
content: "\e041";
}
.glyphicon-tags:before {
content: "\e042";
}
.glyphicon-book:before {
content: "\e043";
}
.glyphicon-bookmark:before {
content: "\e044";
}
.glyphicon-print:before {
content: "\e045";
}
.glyphicon-camera:before {
content: "\e046";
}
.glyphicon-font:before {
content: "\e047";
}
.glyphicon-bold:before {
content: "\e048";
}
.glyphicon-italic:before {
content: "\e049";
}
.glyphicon-text-height:before {
content: "\e050";
}
.glyphicon-text-width:before {
content: "\e051";
}
.glyphicon-align-left:before {
content: "\e052";
}
.glyphicon-align-center:before {
content: "\e053";
}
.glyphicon-align-right:before {
content: "\e054";
}
.glyphicon-align-justify:before {
content: "\e055";
}
.glyphicon-list:before {
content: "\e056";
}
.glyphicon-indent-left:before {
content: "\e057";
}
.glyphicon-indent-right:before {
content: "\e058";
}
.glyphicon-facetime-video:before {
content: "\e059";
}
.glyphicon-picture:before {
content: "\e060";
}
.glyphicon-map-marker:before {
content: "\e062";
}
.glyphicon-adjust:before {
content: "\e063";
}
.glyphicon-tint:before {
content: "\e064";
}
.glyphicon-edit:before {
content: "\e065";
}
.glyphicon-share:before {
content: "\e066";
}
.glyphicon-check:before {
content: "\e067";
}
.glyphicon-move:before {
content: "\e068";
}
.glyphicon-step-backward:before {
content: "\e069";
}
.glyphicon-fast-backward:before {
content: "\e070";
}
.glyphicon-backward:before {
content: "\e071";
}
.glyphicon-play:before {
content: "\e072";
}
.glyphicon-pause:before {
content: "\e073";
}
.glyphicon-stop:before {
content: "\e074";
}
.glyphicon-forward:before {
content: "\e075";
}
.glyphicon-fast-forward:before {
content: "\e076";
}
.glyphicon-step-forward:before {
content: "\e077";
}
.glyphicon-eject:before {
content: "\e078";
}
.glyphicon-chevron-left:before {
content: "\e079";
}
.glyphicon-chevron-right:before {
content: "\e080";
}
.glyphicon-plus-sign:before {
content: "\e081";
}
.glyphicon-minus-sign:before {
content: "\e082";
}
.glyphicon-remove-sign:before {
content: "\e083";
}
.glyphicon-ok-sign:before {
content: "\e084";
}
.glyphicon-question-sign:before {
content: "\e085";
}
.glyphicon-info-sign:before {
content: "\e086";
}
.glyphicon-screenshot:before {
content: "\e087";
}
.glyphicon-remove-circle:before {
content: "\e088";
}
.glyphicon-ok-circle:before {
content: "\e089";
}
.glyphicon-ban-circle:before {
content: "\e090";
}
.glyphicon-arrow-left:before {
content: "\e091";
}
.glyphicon-arrow-right:before {
content: "\e092";
}
.glyphicon-arrow-up:before {
content: "\e093";
}
.glyphicon-arrow-down:before {
content: "\e094";
}
.glyphicon-share-alt:before {
content: "\e095";
}
.glyphicon-resize-full:before {
content: "\e096";
}
.glyphicon-resize-small:before {
content: "\e097";
}
.glyphicon-exclamation-sign:before {
content: "\e101";
}
.glyphicon-gift:before {
content: "\e102";
}
.glyphicon-leaf:before {
content: "\e103";
}
.glyphicon-fire:before {
content: "\e104";
}
.glyphicon-eye-open:before {
content: "\e105";
}
.glyphicon-eye-close:before {
content: "\e106";
}
.glyphicon-warning-sign:before {
content: "\e107";
}
.glyphicon-plane:before {
content: "\e108";
}
.glyphicon-calendar:before {
content: "\e109";
}
.glyphicon-random:before {
content: "\e110";
}
.glyphicon-comment:before {
content: "\e111";
}
.glyphicon-magnet:before {
content: "\e112";
}
.glyphicon-chevron-up:before {
content: "\e113";
}
.glyphicon-chevron-down:before {
content: "\e114";
}
.glyphicon-retweet:before {
content: "\e115";
}
.glyphicon-shopping-cart:before {
content: "\e116";
}
.glyphicon-folder-close:before {
content: "\e117";
}
.glyphicon-folder-open:before {
content: "\e118";
}
.glyphicon-resize-vertical:before {
content: "\e119";
}
.glyphicon-resize-horizontal:before {
content: "\e120";
}
.glyphicon-hdd:before {
content: "\e121";
}
.glyphicon-bullhorn:before {
content: "\e122";
}
.glyphicon-bell:before {
content: "\e123";
}
.glyphicon-certificate:before {
content: "\e124";
}
.glyphicon-thumbs-up:before {
content: "\e125";
}
.glyphicon-thumbs-down:before {
content: "\e126";
}
.glyphicon-hand-right:before {
content: "\e127";
}
.glyphicon-hand-left:before {
content: "\e128";
}
.glyphicon-hand-up:before {
content: "\e129";
}
.glyphicon-hand-down:before {
content: "\e130";
}
.glyphicon-circle-arrow-right:before {
content: "\e131";
}
.glyphicon-circle-arrow-left:before {
content: "\e132";
}
.glyphicon-circle-arrow-up:before {
content: "\e133";
}
.glyphicon-circle-arrow-down:before {
content: "\e134";
}
.glyphicon-globe:before {
content: "\e135";
}
.glyphicon-wrench:before {
content: "\e136";
}
.glyphicon-tasks:before {
content: "\e137";
}
.glyphicon-filter:before {
content: "\e138";
}
.glyphicon-briefcase:before {
content: "\e139";
}
.glyphicon-fullscreen:before {
content: "\e140";
}
.glyphicon-dashboard:before {
content: "\e141";
}
.glyphicon-paperclip:before {
content: "\e142";
}
.glyphicon-heart-empty:before {
content: "\e143";
}
.glyphicon-link:before {
content: "\e144";
}
.glyphicon-phone:before {
content: "\e145";
}
.glyphicon-pushpin:before {
content: "\e146";
}
.glyphicon-usd:before {
content: "\e148";
}
.glyphicon-gbp:before {
content: "\e149";
}
.glyphicon-sort:before {
content: "\e150";
}
.glyphicon-sort-by-alphabet:before {
content: "\e151";
}
.glyphicon-sort-by-alphabet-alt:before {
content: "\e152";
}
.glyphicon-sort-by-order:before {
content: "\e153";
}
.glyphicon-sort-by-order-alt:before {
content: "\e154";
}
.glyphicon-sort-by-attributes:before {
content: "\e155";
}
.glyphicon-sort-by-attributes-alt:before {
content: "\e156";
}
.glyphicon-unchecked:before {
content: "\e157";
}
.glyphicon-expand:before {
content: "\e158";
}
.glyphicon-collapse-down:before {
content: "\e159";
}
.glyphicon-collapse-up:before {
content: "\e160";
}
.glyphicon-log-in:before {
content: "\e161";
}
.glyphicon-flash:before {
content: "\e162";
}
.glyphicon-log-out:before {
content: "\e163";
}
.glyphicon-new-window:before {
content: "\e164";
}
.glyphicon-record:before {
content: "\e165";
}
.glyphicon-save:before {
content: "\e166";
}
.glyphicon-open:before {
content: "\e167";
}
.glyphicon-saved:before {
content: "\e168";
}
.glyphicon-import:before {
content: "\e169";
}
.glyphicon-export:before {
content: "\e170";
}
.glyphicon-send:before {
content: "\e171";
}
.glyphicon-floppy-disk:before {
content: "\e172";
}
.glyphicon-floppy-saved:before {
content: "\e173";
}
.glyphicon-floppy-remove:before {
content: "\e174";
}
.glyphicon-floppy-save:before {
content: "\e175";
}
.glyphicon-floppy-open:before {
content: "\e176";
}
.glyphicon-credit-card:before {
content: "\e177";
}
.glyphicon-transfer:before {
content: "\e178";
}
.glyphicon-cutlery:before {
content: "\e179";
}
.glyphicon-header:before {
content: "\e180";
}
.glyphicon-compressed:before {
content: "\e181";
}
.glyphicon-earphone:before {
content: "\e182";
}
.glyphicon-phone-alt:before {
content: "\e183";
}
.glyphicon-tower:before {
content: "\e184";
}
.glyphicon-stats:before {
content: "\e185";
}
.glyphicon-sd-video:before {
content: "\e186";
}
.glyphicon-hd-video:before {
content: "\e187";
}
.glyphicon-subtitles:before {
content: "\e188";
}
.glyphicon-sound-stereo:before {
content: "\e189";
}
.glyphicon-sound-dolby:before {
content: "\e190";
}
.glyphicon-sound-5-1:before {
content: "\e191";
}
.glyphicon-sound-6-1:before {
content: "\e192";
}
.glyphicon-sound-7-1:before {
content: "\e193";
}
.glyphicon-copyright-mark:before {
content: "\e194";
}
.glyphicon-registration-mark:before {
content: "\e195";
}
.glyphicon-cloud-download:before {
content: "\e197";
}
.glyphicon-cloud-upload:before {
content: "\e198";
}
.glyphicon-tree-conifer:before {
content: "\e199";
}
.glyphicon-tree-deciduous:before {
content: "\e200";
}
.glyphicon-cd:before {
content: "\e201";
}
.glyphicon-save-file:before {
content: "\e202";
}
.glyphicon-open-file:before {
content: "\e203";
}
.glyphicon-level-up:before {
content: "\e204";
}
.glyphicon-copy:before {
content: "\e205";
}
.glyphicon-paste:before {
content: "\e206";
}
.glyphicon-alert:before {
content: "\e209";
}
.glyphicon-equalizer:before {
content: "\e210";
}
.glyphicon-king:before {
content: "\e211";
}
.glyphicon-queen:before {
content: "\e212";
}
.glyphicon-pawn:before {
content: "\e213";
}
.glyphicon-bishop:before {
content: "\e214";
}
.glyphicon-knight:before {
content: "\e215";
}
.glyphicon-baby-formula:before {
content: "\e216";
}
.glyphicon-tent:before {
content: "\26fa";
}
.glyphicon-blackboard:before {
content: "\e218";
}
.glyphicon-bed:before {
content: "\e219";
}
.glyphicon-apple:before {
content: "\f8ff";
}
.glyphicon-erase:before {
content: "\e221";
}
.glyphicon-hourglass:before {
content: "\231b";
}
.glyphicon-lamp:before {
content: "\e223";
}
.glyphicon-duplicate:before {
content: "\e224";
}
.glyphicon-piggy-bank:before {
content: "\e225";
}
.glyphicon-scissors:before {
content: "\e226";
}
.glyphicon-bitcoin:before {
content: "\e227";
}
.glyphicon-btc:before {
content: "\e227";
}
.glyphicon-xbt:before {
content: "\e227";
}
.glyphicon-yen:before {
content: "\00a5";
}
.glyphicon-jpy:before {
content: "\00a5";
}
.glyphicon-ruble:before {
content: "\20bd";
}
.glyphicon-rub:before {
content: "\20bd";
}
.glyphicon-scale:before {
content: "\e230";
}
.glyphicon-ice-lolly:before {
content: "\e231";
}
.glyphicon-ice-lolly-tasted:before {
content: "\e232";
}
.glyphicon-education:before {
content: "\e233";
}
.glyphicon-option-horizontal:before {
content: "\e234";
}
.glyphicon-option-vertical:before {
content: "\e235";
}
.glyphicon-menu-hamburger:before {
content: "\e236";
}
.glyphicon-modal-window:before {
content: "\e237";
}
.glyphicon-oil:before {
content: "\e238";
}
.glyphicon-grain:before {
content: "\e239";
}
.glyphicon-sunglasses:before {
content: "\e240";
}
.glyphicon-text-size:before {
content: "\e241";
}
.glyphicon-text-color:before {
content: "\e242";
}
.glyphicon-text-background:before {
content: "\e243";
}
.glyphicon-object-align-top:before {
content: "\e244";
}
.glyphicon-object-align-bottom:before {
content: "\e245";
}
.glyphicon-object-align-horizontal:before {
content: "\e246";
}
.glyphicon-object-align-left:before {
content: "\e247";
}
.glyphicon-object-align-vertical:before {
content: "\e248";
}
.glyphicon-object-align-right:before {
content: "\e249";
}
.glyphicon-triangle-right:before {
content: "\e250";
}
.glyphicon-triangle-left:before {
content: "\e251";
}
.glyphicon-triangle-bottom:before {
content: "\e252";
}
.glyphicon-triangle-top:before {
content: "\e253";
}
.glyphicon-console:before {
content: "\e254";
}
.glyphicon-superscript:before {
content: "\e255";
}
.glyphicon-subscript:before {
content: "\e256";
}
.glyphicon-menu-left:before {
content: "\e257";
}
.glyphicon-menu-right:before {
content: "\e258";
}
.glyphicon-menu-down:before {
content: "\e259";
}
.glyphicon-menu-up:before {
content: "\e260";
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 10px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333;
background-color: #fff;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
a {
color: #337ab7;
text-decoration: none;
}
a:hover,
a:focus {
color: #23527c;
text-decoration: underline;
}
a:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
figure {
margin: 0;
}
img {
vertical-align: middle;
}
.img-responsive,
.thumbnail > img,
.thumbnail a > img,
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
}
.img-rounded {
border-radius: 6px;
}
.img-thumbnail {
display: inline-block;
max-width: 100%;
height: auto;
padding: 4px;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
[role="button"] {
cursor: pointer;
}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {
font-weight: normal;
line-height: 1;
color: #777;
}
h1,
.h1,
h2,
.h2,
h3,
.h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {
font-size: 65%;
}
h4,
.h4,
h5,
.h5,
h6,
.h6 {
margin-top: 10px;
margin-bottom: 10px;
}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {
font-size: 75%;
}
h1,
.h1 {
font-size: 36px;
}
h2,
.h2 {
font-size: 30px;
}
h3,
.h3 {
font-size: 24px;
}
h4,
.h4 {
font-size: 18px;
}
h5,
.h5 {
font-size: 14px;
}
h6,
.h6 {
font-size: 12px;
}
p {
margin: 0 0 10px;
}
.lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 300;
line-height: 1.4;
}
@media (min-width: 768px) {
.lead {
font-size: 21px;
}
}
small,
.small {
font-size: 85%;
}
mark,
.mark {
padding: .2em;
background-color: #fcf8e3;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-justify {
text-align: justify;
}
.text-nowrap {
white-space: nowrap;
}
.text-lowercase {
text-transform: lowercase;
}
.text-uppercase {
text-transform: uppercase;
}
.text-capitalize {
text-transform: capitalize;
}
.text-muted {
color: #777;
}
.text-primary {
color: #337ab7;
}
a.text-primary:hover,
a.text-primary:focus {
color: #286090;
}
.text-success {
color: #3c763d;
}
a.text-success:hover,
a.text-success:focus {
color: #2b542c;
}
.text-info {
color: #31708f;
}
a.text-info:hover,
a.text-info:focus {
color: #245269;
}
.text-warning {
color: #8a6d3b;
}
a.text-warning:hover,
a.text-warning:focus {
color: #66512c;
}
.text-danger {
color: #a94442;
}
a.text-danger:hover,
a.text-danger:focus {
color: #843534;
}
.bg-grey {
color:black;
background-color: #DFDBDB;
}
.bg-primary {
color: #fff;
background-color: #337ab7;
}
a.bg-primary:hover,
a.bg-primary:focus {
background-color: #286090;
}
.bg-success {
background-color: #dff0d8;
}
a.bg-success:hover,
a.bg-success:focus {
background-color: #c1e2b3;
}
.bg-info {
background-color: #d9edf7;
}
a.bg-info:hover,
a.bg-info:focus {
background-color: #afd9ee;
}
.bg-warning {
background-color: #fcf8e3;
}
a.bg-warning:hover,
a.bg-warning:focus {
background-color: #f7ecb5;
}
.bg-danger {
background-color: #f2dede;
}
a.bg-danger:hover,
a.bg-danger:focus {
background-color: #e4b9b9;
}
.page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eee;
}
ul,
ol {
margin-top: 0;
margin-bottom: 10px;
}
ul ul,
ol ul,
ul ol,
ol ol {
margin-bottom: 0;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.list-inline {
padding-left: 0;
margin-left: -5px;
list-style: none;
}
.list-inline > li {
display: inline-block;
padding-right: 5px;
padding-left: 5px;
}
dl {
margin-top: 0;
margin-bottom: 20px;
}
dt,
dd {
line-height: 1.42857143;
}
dt {
font-weight: bold;
}
dd {
margin-left: 0;
}
@media (min-width: 768px) {
.dl-horizontal dt {
float: left;
width: 160px;
overflow: hidden;
clear: left;
text-align: right;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #777;
}
.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eee;
}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {
margin-bottom: 0;
}
blockquote footer,
blockquote small,
blockquote .small {
display: block;
font-size: 80%;
line-height: 1.42857143;
color: #777;
}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {
content: '\2014 \00A0';
}
.blockquote-reverse,
blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
text-align: right;
border-right: 5px solid #eee;
border-left: 0;
}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {
content: '';
}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.42857143;
}
code,
kbd,
pre,
samp {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px;
}
kbd {
padding: 2px 4px;
font-size: 90%;
color: #fff;
background-color: #333;
border-radius: 3px;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
}
kbd kbd {
padding: 0;
font-size: 100%;
font-weight: bold;
-webkit-box-shadow: none;
box-shadow: none;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.42857143;
color: #333;
word-break: break-all;
word-wrap: break-word;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
}
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.container {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
.container-fluid {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
}
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
float: left;
}
.col-xs-12 {
width: 100%;
}
.col-xs-11 {
width: 91.66666667%;
}
.col-xs-10 {
width: 83.33333333%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-8 {
width: 66.66666667%;
}
.col-xs-7 {
width: 58.33333333%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-5 {
width: 41.66666667%;
}
.col-xs-4 {
width: 33.33333333%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-2 {
width: 16.66666667%;
}
.col-xs-1 {
width: 8.33333333%;
}
.col-xs-pull-12 {
right: 100%;
}
.col-xs-pull-11 {
right: 91.66666667%;
}
.col-xs-pull-10 {
right: 83.33333333%;
}
.col-xs-pull-9 {
right: 75%;
}
.col-xs-pull-8 {
right: 66.66666667%;
}
.col-xs-pull-7 {
right: 58.33333333%;
}
.col-xs-pull-6 {
right: 50%;
}
.col-xs-pull-5 {
right: 41.66666667%;
}
.col-xs-pull-4 {
right: 33.33333333%;
}
.col-xs-pull-3 {
right: 25%;
}
.col-xs-pull-2 {
right: 16.66666667%;
}
.col-xs-pull-1 {
right: 8.33333333%;
}
.col-xs-pull-0 {
right: auto;
}
.col-xs-push-12 {
left: 100%;
}
.col-xs-push-11 {
left: 91.66666667%;
}
.col-xs-push-10 {
left: 83.33333333%;
}
.col-xs-push-9 {
left: 75%;
}
.col-xs-push-8 {
left: 66.66666667%;
}
.col-xs-push-7 {
left: 58.33333333%;
}
.col-xs-push-6 {
left: 50%;
}
.col-xs-push-5 {
left: 41.66666667%;
}
.col-xs-push-4 {
left: 33.33333333%;
}
.col-xs-push-3 {
left: 25%;
}
.col-xs-push-2 {
left: 16.66666667%;
}
.col-xs-push-1 {
left: 8.33333333%;
}
.col-xs-push-0 {
left: auto;
}
.col-xs-offset-12 {
margin-left: 100%;
}
.col-xs-offset-11 {
margin-left: 91.66666667%;
}
.col-xs-offset-10 {
margin-left: 83.33333333%;
}
.col-xs-offset-9 {
margin-left: 75%;
}
.col-xs-offset-8 {
margin-left: 66.66666667%;
}
.col-xs-offset-7 {
margin-left: 58.33333333%;
}
.col-xs-offset-6 {
margin-left: 50%;
}
.col-xs-offset-5 {
margin-left: 41.66666667%;
}
.col-xs-offset-4 {
margin-left: 33.33333333%;
}
.col-xs-offset-3 {
margin-left: 25%;
}
.col-xs-offset-2 {
margin-left: 16.66666667%;
}
.col-xs-offset-1 {
margin-left: 8.33333333%;
}
.col-xs-offset-0 {
margin-left: 0;
}
@media (min-width: 768px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
.col-sm-10 {
width: 83.33333333%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666667%;
}
.col-sm-7 {
width: 58.33333333%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666667%;
}
.col-sm-4 {
width: 33.33333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.66666667%;
}
.col-sm-1 {
width: 8.33333333%;
}
.col-sm-pull-12 {
right: 100%;
}
.col-sm-pull-11 {
right: 91.66666667%;
}
.col-sm-pull-10 {
right: 83.33333333%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-8 {
right: 66.66666667%;
}
.col-sm-pull-7 {
right: 58.33333333%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-5 {
right: 41.66666667%;
}
.col-sm-pull-4 {
right: 33.33333333%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-2 {
right: 16.66666667%;
}
.col-sm-pull-1 {
right: 8.33333333%;
}
.col-sm-pull-0 {
right: auto;
}
.col-sm-push-12 {
left: 100%;
}
.col-sm-push-11 {
left: 91.66666667%;
}
.col-sm-push-10 {
left: 83.33333333%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-8 {
left: 66.66666667%;
}
.col-sm-push-7 {
left: 58.33333333%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-5 {
left: 41.66666667%;
}
.col-sm-push-4 {
left: 33.33333333%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-2 {
left: 16.66666667%;
}
.col-sm-push-1 {
left: 8.33333333%;
}
.col-sm-push-0 {
left: auto;
}
.col-sm-offset-12 {
margin-left: 100%;
}
.col-sm-offset-11 {
margin-left: 91.66666667%;
}
.col-sm-offset-10 {
margin-left: 83.33333333%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-8 {
margin-left: 66.66666667%;
}
.col-sm-offset-7 {
margin-left: 58.33333333%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-5 {
margin-left: 41.66666667%;
}
.col-sm-offset-4 {
margin-left: 33.33333333%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-2 {
margin-left: 16.66666667%;
}
.col-sm-offset-1 {
margin-left: 8.33333333%;
}
.col-sm-offset-0 {
margin-left: 0;
}
}
@media (min-width: 992px) {
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: left;
}
.col-md-12 {
width: 100%;
}
.col-md-11 {
width: 91.66666667%;
}
.col-md-10 {
width: 83.33333333%;
}
.col-md-9 {
width: 75%;
}
.col-md-8 {
width: 66.66666667%;
}
.col-md-7 {
width: 58.33333333%;
}
.col-md-6 {
width: 50%;
}
.col-md-5 {
width: 41.66666667%;
}
.col-md-4 {
width: 33.33333333%;
}
.col-md-3 {
width: 25%;
}
.col-md-2 {
width: 16.66666667%;
}
.col-md-1 {
width: 8.33333333%;
}
.col-md-pull-12 {
right: 100%;
}
.col-md-pull-11 {
right: 91.66666667%;
}
.col-md-pull-10 {
right: 83.33333333%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-8 {
right: 66.66666667%;
}
.col-md-pull-7 {
right: 58.33333333%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-5 {
right: 41.66666667%;
}
.col-md-pull-4 {
right: 33.33333333%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-2 {
right: 16.66666667%;
}
.col-md-pull-1 {
right: 8.33333333%;
}
.col-md-pull-0 {
right: auto;
}
.col-md-push-12 {
left: 100%;
}
.col-md-push-11 {
left: 91.66666667%;
}
.col-md-push-10 {
left: 83.33333333%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-8 {
left: 66.66666667%;
}
.col-md-push-7 {
left: 58.33333333%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-5 {
left: 41.66666667%;
}
.col-md-push-4 {
left: 33.33333333%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-2 {
left: 16.66666667%;
}
.col-md-push-1 {
left: 8.33333333%;
}
.col-md-push-0 {
left: auto;
}
.col-md-offset-12 {
margin-left: 100%;
}
.col-md-offset-11 {
margin-left: 91.66666667%;
}
.col-md-offset-10 {
margin-left: 83.33333333%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-8 {
margin-left: 66.66666667%;
}
.col-md-offset-7 {
margin-left: 58.33333333%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-5 {
margin-left: 41.66666667%;
}
.col-md-offset-4 {
margin-left: 33.33333333%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-2 {
margin-left: 16.66666667%;
}
.col-md-offset-1 {
margin-left: 8.33333333%;
}
.col-md-offset-0 {
margin-left: 0;
}
}
@media (min-width: 1200px) {
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left;
}
.col-lg-12 {
width: 100%;
}
.col-lg-11 {
width: 91.66666667%;
}
.col-lg-10 {
width: 83.33333333%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-8 {
width: 66.66666667%;
}
.col-lg-7 {
width: 58.33333333%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-5 {
width: 41.66666667%;
}
.col-lg-4 {
width: 33.33333333%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-2 {
width: 16.66666667%;
}
.col-lg-1 {
width: 8.33333333%;
}
.col-lg-pull-12 {
right: 100%;
}
.col-lg-pull-11 {
right: 91.66666667%;
}
.col-lg-pull-10 {
right: 83.33333333%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-8 {
right: 66.66666667%;
}
.col-lg-pull-7 {
right: 58.33333333%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-5 {
right: 41.66666667%;
}
.col-lg-pull-4 {
right: 33.33333333%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-2 {
right: 16.66666667%;
}
.col-lg-pull-1 {
right: 8.33333333%;
}
.col-lg-pull-0 {
right: auto;
}
.col-lg-push-12 {
left: 100%;
}
.col-lg-push-11 {
left: 91.66666667%;
}
.col-lg-push-10 {
left: 83.33333333%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-8 {
left: 66.66666667%;
}
.col-lg-push-7 {
left: 58.33333333%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-5 {
left: 41.66666667%;
}
.col-lg-push-4 {
left: 33.33333333%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-2 {
left: 16.66666667%;
}
.col-lg-push-1 {
left: 8.33333333%;
}
.col-lg-push-0 {
left: auto;
}
.col-lg-offset-12 {
margin-left: 100%;
}
.col-lg-offset-11 {
margin-left: 91.66666667%;
}
.col-lg-offset-10 {
margin-left: 83.33333333%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-8 {
margin-left: 66.66666667%;
}
.col-lg-offset-7 {
margin-left: 58.33333333%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-5 {
margin-left: 41.66666667%;
}
.col-lg-offset-4 {
margin-left: 33.33333333%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-2 {
margin-left: 16.66666667%;
}
.col-lg-offset-1 {
margin-left: 8.33333333%;
}
.col-lg-offset-0 {
margin-left: 0;
}
}
table {
background-color: transparent;
}
caption {
padding-top: 8px;
padding-bottom: 8px;
color: #777;
text-align: left;
}
th {
text-align: left;
}
.table {
width: 100%;
max-width: 100%;
margin-bottom: 20px;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
padding: 8px;
line-height: 1.42857143;
vertical-align: top;
border-top: 1px solid #ddd;
}
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #ddd;
}
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > th,
.table > caption + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > td,
.table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.table > tbody + tbody {
border-top: 2px solid #ddd;
}
.table .table {
background-color: #fff;
}
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
padding: 5px;
}
.table-bordered {
border: 1px solid #ddd;
}
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
border: 1px solid #ddd;
}
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.table-striped > tbody > tr:nth-of-type(odd) {
background-color: #f9f9f9;
}
.table-hover > tbody > tr:hover {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
display: table-column;
float: none;
}
table td[class*="col-"],
table th[class*="col-"] {
position: static;
display: table-cell;
float: none;
}
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.table-hover > tbody > tr > td.active:hover,
.table-hover > tbody > tr > th.active:hover,
.table-hover > tbody > tr.active:hover > td,
.table-hover > tbody > tr:hover > .active,
.table-hover > tbody > tr.active:hover > th {
background-color: #e8e8e8;
}
.table > thead > tr > td.success,
.table > tbody > tr > td.success,
.table > tfoot > tr > td.success,
.table > thead > tr > th.success,
.table > tbody > tr > th.success,
.table > tfoot > tr > th.success,
.table > thead > tr.success > td,
.table > tbody > tr.success > td,
.table > tfoot > tr.success > td,
.table > thead > tr.success > th,
.table > tbody > tr.success > th,
.table > tfoot > tr.success > th {
background-color: #dff0d8;
}
.table-hover > tbody > tr > td.success:hover,
.table-hover > tbody > tr > th.success:hover,
.table-hover > tbody > tr.success:hover > td,
.table-hover > tbody > tr:hover > .success,
.table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6;
}
.table > thead > tr > td.info,
.table > tbody > tr > td.info,
.table > tfoot > tr > td.info,
.table > thead > tr > th.info,
.table > tbody > tr > th.info,
.table > tfoot > tr > th.info,
.table > thead > tr.info > td,
.table > tbody > tr.info > td,
.table > tfoot > tr.info > td,
.table > thead > tr.info > th,
.table > tbody > tr.info > th,
.table > tfoot > tr.info > th {
background-color: #d9edf7;
}
.table-hover > tbody > tr > td.info:hover,
.table-hover > tbody > tr > th.info:hover,
.table-hover > tbody > tr.info:hover > td,
.table-hover > tbody > tr:hover > .info,
.table-hover > tbody > tr.info:hover > th {
background-color: #c4e3f3;
}
.table > thead > tr > td.warning,
.table > tbody > tr > td.warning,
.table > tfoot > tr > td.warning,
.table > thead > tr > th.warning,
.table > tbody > tr > th.warning,
.table > tfoot > tr > th.warning,
.table > thead > tr.warning > td,
.table > tbody > tr.warning > td,
.table > tfoot > tr.warning > td,
.table > thead > tr.warning > th,
.table > tbody > tr.warning > th,
.table > tfoot > tr.warning > th {
background-color: #fcf8e3;
}
.table-hover > tbody > tr > td.warning:hover,
.table-hover > tbody > tr > th.warning:hover,
.table-hover > tbody > tr.warning:hover > td,
.table-hover > tbody > tr:hover > .warning,
.table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc;
}
.table > thead > tr > td.danger,
.table > tbody > tr > td.danger,
.table > tfoot > tr > td.danger,
.table > thead > tr > th.danger,
.table > tbody > tr > th.danger,
.table > tfoot > tr > th.danger,
.table > thead > tr.danger > td,
.table > tbody > tr.danger > td,
.table > tfoot > tr.danger > td,
.table > thead > tr.danger > th,
.table > tbody > tr.danger > th,
.table > tfoot > tr.danger > th {
background-color: #f2dede;
}
.table-hover > tbody > tr > td.danger:hover,
.table-hover > tbody > tr > th.danger:hover,
.table-hover > tbody > tr.danger:hover > td,
.table-hover > tbody > tr:hover > .danger,
.table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc;
}
.table-responsive {
min-height: .01%;
overflow-x: auto;
}
@media screen and (max-width: 767px) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #ddd;
}
.table-responsive > .table {
margin-bottom: 0;
}
.table-responsive > .table > thead > tr > th,
.table-responsive > .table > tbody > tr > th,
.table-responsive > .table > tfoot > tr > th,
.table-responsive > .table > thead > tr > td,
.table-responsive > .table > tbody > tr > td,
.table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.table-responsive > .table-bordered {
border: 0;
}
.table-responsive > .table-bordered > thead > tr > th:first-child,
.table-responsive > .table-bordered > tbody > tr > th:first-child,
.table-responsive > .table-bordered > tfoot > tr > th:first-child,
.table-responsive > .table-bordered > thead > tr > td:first-child,
.table-responsive > .table-bordered > tbody > tr > td:first-child,
.table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.table-responsive > .table-bordered > thead > tr > th:last-child,
.table-responsive > .table-bordered > tbody > tr > th:last-child,
.table-responsive > .table-bordered > tfoot > tr > th:last-child,
.table-responsive > .table-bordered > thead > tr > td:last-child,
.table-responsive > .table-bordered > tbody > tr > td:last-child,
.table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.table-responsive > .table-bordered > tbody > tr:last-child > th,
.table-responsive > .table-bordered > tfoot > tr:last-child > th,
.table-responsive > .table-bordered > tbody > tr:last-child > td,
.table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-weight: bold;
}
input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
line-height: normal;
}
input[type="file"] {
display: block;
}
input[type="range"] {
display: block;
width: 100%;
}
select[multiple],
select[size] {
height: auto;
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
}
.form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
}
.form-control::-moz-placeholder {
color: #999;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #999;
}
.form-control::-webkit-input-placeholder {
color: #999;
}
.form-control::-ms-expand {
background-color: transparent;
border: 0;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
background-color: #eee;
opacity: 1;
}
.form-control[disabled],
fieldset[disabled] .form-control {
cursor: not-allowed;
}
textarea.form-control {
height: auto;
}
input[type="search"] {
-webkit-appearance: none;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control,
input[type="month"].form-control {
line-height: 34px;
}
input[type="date"].input-sm,
input[type="time"].input-sm,
input[type="datetime-local"].input-sm,
input[type="month"].input-sm,
.input-group-sm input[type="date"],
.input-group-sm input[type="time"],
.input-group-sm input[type="datetime-local"],
.input-group-sm input[type="month"] {
line-height: 30px;
}
input[type="date"].input-lg,
input[type="time"].input-lg,
input[type="datetime-local"].input-lg,
input[type="month"].input-lg,
.input-group-lg input[type="date"],
.input-group-lg input[type="time"],
.input-group-lg input[type="datetime-local"],
.input-group-lg input[type="month"] {
line-height: 46px;
}
}
.form-group {
margin-bottom: 15px;
}
.radio,
.checkbox {
position: relative;
display: block;
margin-top: 10px;
margin-bottom: 10px;
}
.radio label,
.checkbox label {
min-height: 20px;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
position: absolute;
margin-top: 4px \9;
margin-left: -20px;
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: -5px;
}
.radio-inline,
.checkbox-inline {
position: relative;
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
vertical-align: middle;
cursor: pointer;
}
.radio-inline + .radio-inline,
.checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"].disabled,
input[type="checkbox"].disabled,
fieldset[disabled] input[type="radio"],
fieldset[disabled] input[type="checkbox"] {
cursor: not-allowed;
}
.radio-inline.disabled,
.checkbox-inline.disabled,
fieldset[disabled] .radio-inline,
fieldset[disabled] .checkbox-inline {
cursor: not-allowed;
}
.radio.disabled label,
.checkbox.disabled label,
fieldset[disabled] .radio label,
fieldset[disabled] .checkbox label {
cursor: not-allowed;
}
.form-control-static {
min-height: 34px;
padding-top: 7px;
padding-bottom: 7px;
margin-bottom: 0;
}
.form-control-static.input-lg,
.form-control-static.input-sm {
padding-right: 0;
padding-left: 0;
}
.input-sm {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-sm {
height: 30px;
line-height: 30px;
}
textarea.input-sm,
select[multiple].input-sm {
height: auto;
}
.form-group-sm .form-control {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.form-group-sm select.form-control {
height: 30px;
line-height: 30px;
}
.form-group-sm textarea.form-control,
.form-group-sm select[multiple].form-control {
height: auto;
}
.form-group-sm .form-control-static {
height: 30px;
min-height: 32px;
padding: 6px 10px;
font-size: 12px;
line-height: 1.5;
}
.input-lg {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
select.input-lg {
height: 46px;
line-height: 46px;
}
textarea.input-lg,
select[multiple].input-lg {
height: auto;
}
.form-group-lg .form-control {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
.form-group-lg select.form-control {
height: 46px;
line-height: 46px;
}
.form-group-lg textarea.form-control,
.form-group-lg select[multiple].form-control {
height: auto;
}
.form-group-lg .form-control-static {
height: 46px;
min-height: 38px;
padding: 11px 16px;
font-size: 18px;
line-height: 1.3333333;
}
.has-feedback {
position: relative;
}
.has-feedback .form-control {
padding-right: 42.5px;
}
.form-control-feedback {
position: absolute;
top: 0;
right: 0;
z-index: 2;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
pointer-events: none;
}
.input-lg + .form-control-feedback,
.input-group-lg + .form-control-feedback,
.form-group-lg .form-control + .form-control-feedback {
width: 46px;
height: 46px;
line-height: 46px;
}
.input-sm + .form-control-feedback,
.input-group-sm + .form-control-feedback,
.form-group-sm .form-control + .form-control-feedback {
width: 30px;
height: 30px;
line-height: 30px;
}
.has-success .help-block,
.has-success .control-label,
.has-success .radio,
.has-success .checkbox,
.has-success .radio-inline,
.has-success .checkbox-inline,
.has-success.radio label,
.has-success.checkbox label,
.has-success.radio-inline label,
.has-success.checkbox-inline label {
color: #3c763d;
}
.has-success .form-control {
border-color: #3c763d;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}
.has-success .form-control:focus {
border-color: #2b542c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
}
.has-success .input-group-addon {
color: #3c763d;
background-color: #dff0d8;
border-color: #3c763d;
}
.has-success .form-control-feedback {
color: #3c763d;
}
.has-warning .help-block,
.has-warning .control-label,
.has-warning .radio,
.has-warning .checkbox,
.has-warning .radio-inline,
.has-warning .checkbox-inline,
.has-warning.radio label,
.has-warning.checkbox label,
.has-warning.radio-inline label,
.has-warning.checkbox-inline label {
color: #8a6d3b;
}
.has-warning .form-control {
border-color: #8a6d3b;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}
.has-warning .form-control:focus {
border-color: #66512c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
}
.has-warning .input-group-addon {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #8a6d3b;
}
.has-warning .form-control-feedback {
color: #8a6d3b;
}
.has-error .help-block,
.has-error .control-label,
.has-error .radio,
.has-error .checkbox,
.has-error .radio-inline,
.has-error .checkbox-inline,
.has-error.radio label,
.has-error.checkbox label,
.has-error.radio-inline label,
.has-error.checkbox-inline label {
color: #a94442;
}
.has-error .form-control {
border-color: #a94442;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}
.has-error .form-control:focus {
border-color: #843534;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
}
.has-error .input-group-addon {
color: #a94442;
background-color: #f2dede;
border-color: #a94442;
}
.has-error .form-control-feedback {
color: #a94442;
}
.has-feedback label ~ .form-control-feedback {
top: 25px;
}
.has-feedback label.sr-only ~ .form-control-feedback {
top: 0;
}
.help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
}
@media (min-width: 768px) {
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.form-inline .form-control-static {
display: inline-block;
}
.form-inline .input-group {
display: inline-table;
vertical-align: middle;
}
.form-inline .input-group .input-group-addon,
.form-inline .input-group .input-group-btn,
.form-inline .input-group .form-control {
width: auto;
}
.form-inline .input-group > .form-control {
width: 100%;
}
.form-inline .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio,
.form-inline .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio label,
.form-inline .checkbox label {
padding-left: 0;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0;
}
.form-inline .has-feedback .form-control-feedback {
top: 0;
}
}
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
padding-top: 7px;
margin-top: 0;
margin-bottom: 0;
}
.form-horizontal .radio,
.form-horizontal .checkbox {
min-height: 27px;
}
.form-horizontal .form-group {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
padding-top: 7px;
margin-bottom: 0;
text-align: right;
}
}
.form-horizontal .has-feedback .form-control-feedback {
right: 15px;
}
@media (min-width: 768px) {
.form-horizontal .form-group-lg .control-label {
padding-top: 11px;
font-size: 18px;
}
}
@media (min-width: 768px) {
.form-horizontal .form-group-sm .control-label {
padding-top: 6px;
font-size: 12px;
}
}
.btn {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.btn:focus,
.btn:active:focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn.active.focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.btn:hover,
.btn:focus,
.btn.focus {
color: #333;
text-decoration: none;
}
.btn:active,
.btn.active {
background-image: none;
outline: 0;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
cursor: not-allowed;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
opacity: .65;
}
a.btn.disabled,
fieldset[disabled] a.btn {
pointer-events: none;
}
.btn-default {
color: #333;
background-color: #fff;
border-color: #ccc;
}
.btn-default:focus,
.btn-default.focus {
color: #333;
background-color: #e6e6e6;
border-color: #8c8c8c;
}
.btn-default:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.btn-default:active:hover,
.btn-default.active:hover,
.open > .dropdown-toggle.btn-default:hover,
.btn-default:active:focus,
.btn-default.active:focus,
.open > .dropdown-toggle.btn-default:focus,
.btn-default:active.focus,
.btn-default.active.focus,
.open > .dropdown-toggle.btn-default.focus {
color: #333;
background-color: #d4d4d4;
border-color: #8c8c8c;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
background-image: none;
}
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled.focus,
.btn-default[disabled].focus,
fieldset[disabled] .btn-default.focus {
background-color: #fff;
border-color: #ccc;
}
.btn-default .badge {
color: #fff;
background-color: #333;
}
.btn-primary {
color: #fff;
background-color: #337ab7;
border-color: #2e6da4;
}
.btn-primary:focus,
.btn-primary.focus {
color: #fff;
background-color: #286090;
border-color: #122b40;
}
.btn-primary:hover {
color: #fff;
background-color: #286090;
border-color: #204d74;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
color: #fff;
background-color: #286090;
border-color: #204d74;
}
.btn-primary:active:hover,
.btn-primary.active:hover,
.open > .dropdown-toggle.btn-primary:hover,
.btn-primary:active:focus,
.btn-primary.active:focus,
.open > .dropdown-toggle.btn-primary:focus,
.btn-primary:active.focus,
.btn-primary.active.focus,
.open > .dropdown-toggle.btn-primary.focus {
color: #fff;
background-color: #204d74;
border-color: #122b40;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary[disabled].focus,
fieldset[disabled] .btn-primary.focus {
background-color: #337ab7;
border-color: #2e6da4;
}
.btn-primary .badge {
color: #337ab7;
background-color: #fff;
}
.btn-success {
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success:focus,
.btn-success.focus {
color: #fff;
background-color: #449d44;
border-color: #255625;
}
.btn-success:hover {
color: #fff;
background-color: #449d44;
border-color: #398439;
}
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
color: #fff;
background-color: #449d44;
border-color: #398439;
}
.btn-success:active:hover,
.btn-success.active:hover,
.open > .dropdown-toggle.btn-success:hover,
.btn-success:active:focus,
.btn-success.active:focus,
.open > .dropdown-toggle.btn-success:focus,
.btn-success:active.focus,
.btn-success.active.focus,
.open > .dropdown-toggle.btn-success.focus {
color: #fff;
background-color: #398439;
border-color: #255625;
}
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
background-image: none;
}
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled.focus,
.btn-success[disabled].focus,
fieldset[disabled] .btn-success.focus {
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success .badge {
color: #5cb85c;
background-color: #fff;
}
.btn-info {
color: #fff;
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info:focus,
.btn-info.focus {
color: #fff;
background-color: #31b0d5;
border-color: #1b6d85;
}
.btn-info:hover {
color: #fff;
background-color: #31b0d5;
border-color: #269abc;
}
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
color: #fff;
background-color: #31b0d5;
border-color: #269abc;
}
.btn-info:active:hover,
.btn-info.active:hover,
.open > .dropdown-toggle.btn-info:hover,
.btn-info:active:focus,
.btn-info.active:focus,
.open > .dropdown-toggle.btn-info:focus,
.btn-info:active.focus,
.btn-info.active.focus,
.open > .dropdown-toggle.btn-info.focus {
color: #fff;
background-color: #269abc;
border-color: #1b6d85;
}
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
background-image: none;
}
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled.focus,
.btn-info[disabled].focus,
fieldset[disabled] .btn-info.focus {
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info .badge {
color: #5bc0de;
background-color: #fff;
}
.btn-warning {
color: #fff;
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning:focus,
.btn-warning.focus {
color: #fff;
background-color: #ec971f;
border-color: #985f0d;
}
.btn-warning:hover {
color: #fff;
background-color: #ec971f;
border-color: #d58512;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
color: #fff;
background-color: #ec971f;
border-color: #d58512;
}
.btn-warning:active:hover,
.btn-warning.active:hover,
.open > .dropdown-toggle.btn-warning:hover,
.btn-warning:active:focus,
.btn-warning.active:focus,
.open > .dropdown-toggle.btn-warning:focus,
.btn-warning:active.focus,
.btn-warning.active.focus,
.open > .dropdown-toggle.btn-warning.focus {
color: #fff;
background-color: #d58512;
border-color: #985f0d;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
background-image: none;
}
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled.focus,
.btn-warning[disabled].focus,
fieldset[disabled] .btn-warning.focus {
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning .badge {
color: #f0ad4e;
background-color: #fff;
}
.btn-danger {
color: #fff;
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger:focus,
.btn-danger.focus {
color: #fff;
background-color: #c9302c;
border-color: #761c19;
}
.btn-danger:hover {
color: #fff;
background-color: #c9302c;
border-color: #ac2925;
}
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
color: #fff;
background-color: #c9302c;
border-color: #ac2925;
}
.btn-danger:active:hover,
.btn-danger.active:hover,
.open > .dropdown-toggle.btn-danger:hover,
.btn-danger:active:focus,
.btn-danger.active:focus,
.open > .dropdown-toggle.btn-danger:focus,
.btn-danger:active.focus,
.btn-danger.active.focus,
.open > .dropdown-toggle.btn-danger.focus {
color: #fff;
background-color: #ac2925;
border-color: #761c19;
}
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
background-image: none;
}
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled.focus,
.btn-danger[disabled].focus,
fieldset[disabled] .btn-danger.focus {
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger .badge {
color: #d9534f;
background-color: #fff;
}
.btn-link {
font-weight: normal;
color: #337ab7;
border-radius: 0;
}
.btn-link,
.btn-link:active,
.btn-link.active,
.btn-link[disabled],
fieldset[disabled] .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:active {
border-color: transparent;
}
.btn-link:hover,
.btn-link:focus {
color: #23527c;
text-decoration: underline;
background-color: transparent;
}
.btn-link[disabled]:hover,
fieldset[disabled] .btn-link:hover,
.btn-link[disabled]:focus,
fieldset[disabled] .btn-link:focus {
color: #777;
text-decoration: none;
}
.btn-lg,
.btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
.btn-sm,
.btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-xs,
.btn-group-xs > .btn {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-block {
display: block;
width: 100%;
}
.btn-block + .btn-block {
margin-top: 5px;
}
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
width: 100%;
}
.fade {
opacity: 0;
-webkit-transition: opacity .15s linear;
-o-transition: opacity .15s linear;
transition: opacity .15s linear;
}
.fade.in {
opacity: 1;
}
.collapse {
display: none;
}
.collapse.in {
display: block;
}
tr.collapse.in {
display: table-row;
}
tbody.collapse.in {
display: table-row-group;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height, visibility;
-o-transition-property: height, visibility;
transition-property: height, visibility;
}
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px dashed;
border-top: 4px solid \9;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
}
.dropup,
.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, .15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
color: #262626;
text-decoration: none;
background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #fff;
text-decoration: none;
background-color: #337ab7;
outline: 0;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #777;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-menu-right {
right: 0;
left: auto;
}
.dropdown-menu-left {
right: auto;
left: 0;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.42857143;
color: #777;
white-space: nowrap;
}
.dropdown-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
content: "";
border-top: 0;
border-bottom: 4px dashed;
border-bottom: 4px solid \9;
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 2px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
right: 0;
left: auto;
}
.navbar-right .dropdown-menu-left {
right: auto;
left: 0;
}
}
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.btn-group > .btn,
.btn-group-vertical > .btn {
position: relative;
float: left;
}
.btn-group > .btn:hover,
.btn-group-vertical > .btn:hover,
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus,
.btn-group > .btn:active,
.btn-group-vertical > .btn:active,
.btn-group > .btn.active,
.btn-group-vertical > .btn.active {
z-index: 2;
}
.btn-group .btn + .btn,
.btn-group .btn + .btn-group,
.btn-group .btn-group + .btn,
.btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.btn-toolbar {
margin-left: -5px;
}
.btn-toolbar .btn,
.btn-toolbar .btn-group,
.btn-toolbar .input-group {
float: left;
}
.btn-toolbar > .btn,
.btn-toolbar > .btn-group,
.btn-toolbar > .input-group {
margin-left: 5px;
}
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.btn-group > .btn:first-child {
margin-left: 0;
}
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group > .btn-group {
float: left;
}
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group > .btn + .dropdown-toggle {
padding-right: 8px;
padding-left: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-right: 12px;
padding-left: 12px;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
.btn-group.open .dropdown-toggle.btn-link {
-webkit-box-shadow: none;
box-shadow: none;
}
.btn .caret {
margin-left: 0;
}
.btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.btn-group-vertical > .btn,
.btn-group-vertical > .btn-group,
.btn-group-vertical > .btn-group > .btn {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.btn-group-vertical > .btn-group > .btn {
float: none;
}
.btn-group-vertical > .btn + .btn,
.btn-group-vertical > .btn + .btn-group,
.btn-group-vertical > .btn-group + .btn,
.btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn:last-child:not(:first-child) {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.btn-group-justified > .btn,
.btn-group-justified > .btn-group {
display: table-cell;
float: none;
width: 1%;
}
.btn-group-justified > .btn-group .btn {
width: 100%;
}
.btn-group-justified > .btn-group .dropdown-menu {
left: auto;
}
[data-toggle="buttons"] > .btn input[type="radio"],
[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
[data-toggle="buttons"] > .btn input[type="checkbox"],
[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group[class*="col-"] {
float: none;
padding-right: 0;
padding-left: 0;
}
.input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 100%;
margin-bottom: 0;
}
.input-group .form-control:focus {
z-index: 3;
}
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
select.input-group-lg > .form-control,
select.input-group-lg > .input-group-addon,
select.input-group-lg > .input-group-btn > .btn {
height: 46px;
line-height: 46px;
}
textarea.input-group-lg > .form-control,
textarea.input-group-lg > .input-group-addon,
textarea.input-group-lg > .input-group-btn > .btn,
select[multiple].input-group-lg > .form-control,
select[multiple].input-group-lg > .input-group-addon,
select[multiple].input-group-lg > .input-group-btn > .btn {
height: auto;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-group-sm > .form-control,
select.input-group-sm > .input-group-addon,
select.input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.input-group-sm > .form-control,
textarea.input-group-sm > .input-group-addon,
textarea.input-group-sm > .input-group-btn > .btn,
select[multiple].input-group-sm > .form-control,
select[multiple].input-group-sm > .input-group-addon,
select[multiple].input-group-sm > .input-group-btn > .btn {
height: auto;
}
.input-group-addon,
.input-group-btn,
.input-group .form-control {
display: table-cell;
}
.input-group-addon:not(:first-child):not(:last-child),
.input-group-btn:not(:first-child):not(:last-child),
.input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.input-group-addon,
.input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555;
text-align: center;
background-color: #eee;
border: 1px solid #ccc;
border-radius: 4px;
}
.input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.input-group-addon.input-lg {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.input-group-addon input[type="radio"],
.input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child),
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.input-group-addon:last-child {
border-left: 0;
}
.input-group-btn {
position: relative;
font-size: 0;
white-space: nowrap;
}
.input-group-btn > .btn {
position: relative;
}
.input-group-btn > .btn + .btn {
margin-left: -1px;
}
.input-group-btn > .btn:hover,
.input-group-btn > .btn:focus,
.input-group-btn > .btn:active {
z-index: 2;
}
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group {
margin-right: -1px;
}
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group {
z-index: 2;
margin-left: -1px;
}
.nav {
padding-left: 0;
margin-bottom: 0;
list-style: none;
}
.nav > li {
position: relative;
display: block;
}
.nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.nav > li > a:hover,
.nav > li > a:focus {
text-decoration: none;
background-color: #eee;
}
.nav > li.disabled > a {
color: #777;
}
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #777;
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
}
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #eee;
border-color: #337ab7;
}
.nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.nav > li > a > img {
max-width: none;
}
.nav-tabs {
border-bottom: 1px solid #ddd;
}
.nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.nav-tabs > li > a {
margin-right: 2px;
line-height: 1.42857143;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.nav-tabs > li > a:hover {
border-color: #eee #eee #ddd;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
color: #555;
cursor: default;
background-color: #fff;
border: 1px solid #ddd;
border-bottom-color: transparent;
}
.nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.nav-tabs.nav-justified > li {
float: none;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 5px;
text-align: center;
}
.nav-tabs.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #ddd;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #ddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #fff;
}
}
.nav-pills > li {
float: left;
}
.nav-pills > li > a {
border-radius: 4px;
}
.nav-pills > li + li {
margin-left: 2px;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
color: #fff;
background-color: #337ab7;
}
.nav-stacked > li {
float: none;
}
.nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.nav-justified {
width: 100%;
}
.nav-justified > li {
float: none;
}
.nav-justified > li > a {
margin-bottom: 5px;
text-align: center;
}
.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs-justified {
border-bottom: 0;
}
.nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border: 1px solid #ddd;
}
@media (min-width: 768px) {
.nav-tabs-justified > li > a {
border-bottom: 1px solid #ddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border-bottom-color: #fff;
}
}
.tab-content > .tab-pane {
display: none;
}
.tab-content > .active {
display: block;
}
.nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.navbar {
position: relative;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
@media (min-width: 768px) {
.navbar-header {
float: left;
}
}
.navbar-collapse {
padding-right: 15px;
padding-left: 15px;
overflow-x: visible;
-webkit-overflow-scrolling: touch;
border-top: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
border-top: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.navbar-collapse.in {
overflow-y: visible;
}
.navbar-fixed-top .navbar-collapse,
.navbar-static-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
padding-right: 0;
padding-left: 0;
}
}
.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
max-height: 340px;
}
@media (max-device-width: 480px) and (orientation: landscape) {
.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
max-height: 200px;
}
}
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.navbar-static-top {
z-index: 1000;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.navbar-static-top {
border-radius: 0;
}
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
}
@media (min-width: 768px) {
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
border-width: 1px 0 0;
}
.navbar-brand {
float: left;
height: 50px;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
}
.navbar-brand:hover,
.navbar-brand:focus {
text-decoration: none;
}
.navbar-brand > img {
display: block;
}
@media (min-width: 768px) {
.navbar > .container .navbar-brand,
.navbar > .container-fluid .navbar-brand {
margin-left: -15px;
}
}
.navbar-toggle {
position: relative;
float: right;
padding: 9px 10px;
margin-top: 8px;
margin-right: 15px;
margin-bottom: 8px;
background-color: transparent;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navbar-toggle:focus {
outline: 0;
}
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.navbar-toggle {
display: none;
}
}
.navbar-nav {
margin: 7.5px -15px;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar-nav .open .dropdown-menu > li > a,
.navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.navbar-nav {
float: left;
margin: 0;
}
.navbar-nav > li {
float: left;
}
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
.navbar-form {
padding: 10px 15px;
margin-top: 8px;
margin-right: -15px;
margin-bottom: 8px;
margin-left: -15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
}
@media (min-width: 768px) {
.navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.navbar-form .form-control-static {
display: inline-block;
}
.navbar-form .input-group {
display: inline-table;
vertical-align: middle;
}
.navbar-form .input-group .input-group-addon,
.navbar-form .input-group .input-group-btn,
.navbar-form .input-group .form-control {
width: auto;
}
.navbar-form .input-group > .form-control {
width: 100%;
}
.navbar-form .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio,
.navbar-form .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio label,
.navbar-form .checkbox label {
padding-left: 0;
}
.navbar-form .radio input[type="radio"],
.navbar-form .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0;
}
.navbar-form .has-feedback .form-control-feedback {
top: 0;
}
}
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
.navbar-form .form-group:last-child {
margin-bottom: 0;
}
}
@media (min-width: 768px) {
.navbar-form {
width: auto;
padding-top: 0;
padding-bottom: 0;
margin-right: 0;
margin-left: 0;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
margin-bottom: 0;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.navbar-btn {
margin-top: 8px;
margin-bottom: 8px;
}
.navbar-btn.btn-sm {
margin-top: 10px;
margin-bottom: 10px;
}
.navbar-btn.btn-xs {
margin-top: 14px;
margin-bottom: 14px;
}
.navbar-text {
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.navbar-text {
float: left;
margin-right: 15px;
margin-left: 15px;
}
}
@media (min-width: 768px) {
.navbar-left {
float: left !important;
}
.navbar-right {
float: right !important;
margin-right: -15px;
}
.navbar-right ~ .navbar-right {
margin-right: 0;
}
}
.navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7;
}
.navbar-default .navbar-brand {
color: #777;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.navbar-default .navbar-text {
color: #777;
}
.navbar-default .navbar-nav > li > a {
color: #777;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #333;
background-color: transparent;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #ccc;
background-color: transparent;
}
.navbar-default .navbar-toggle {
border-color: #ddd;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #ddd;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #888;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #e7e7e7;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #555;
background-color: #e7e7e7;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333;
background-color: transparent;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #ccc;
background-color: transparent;
}
}
.navbar-default .navbar-link {
color: #777;
}
.navbar-default .navbar-link:hover {
color: #333;
}
.navbar-default .btn-link {
color: #777;
}
.navbar-default .btn-link:hover,
.navbar-default .btn-link:focus {
color: #333;
}
.navbar-default .btn-link[disabled]:hover,
fieldset[disabled] .navbar-default .btn-link:hover,
.navbar-default .btn-link[disabled]:focus,
fieldset[disabled] .navbar-default .btn-link:focus {
color: #ccc;
}
.navbar-inverse {
background-color: #222;
border-color: #080808;
}
.navbar-inverse .navbar-brand {
color: #9d9d9d;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #fff;
background-color: transparent;
}
.navbar-inverse .navbar-text {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav > li > a {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
color: #fff;
background-color: transparent;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #fff;
background-color: #080808;
}
.navbar-inverse .navbar-nav > .disabled > a,
.navbar-inverse .navbar-nav > .disabled > a:hover,
.navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444;
background-color: transparent;
}
.navbar-inverse .navbar-toggle {
border-color: #333;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #333;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #fff;
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border-color: #101010;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
color: #fff;
background-color: #080808;
}
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #fff;
background-color: transparent;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #fff;
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444;
background-color: transparent;
}
}
.navbar-inverse .navbar-link {
color: #9d9d9d;
}
.navbar-inverse .navbar-link:hover {
color: #fff;
}
.navbar-inverse .btn-link {
color: #9d9d9d;
}
.navbar-inverse .btn-link:hover,
.navbar-inverse .btn-link:focus {
color: #fff;
}
.navbar-inverse .btn-link[disabled]:hover,
fieldset[disabled] .navbar-inverse .btn-link:hover,
.navbar-inverse .btn-link[disabled]:focus,
fieldset[disabled] .navbar-inverse .btn-link:focus {
color: #444;
}
.breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb > li + li:before {
padding: 0 5px;
color: #ccc;
content: "/\00a0";
}
.breadcrumb > .active {
color: #777;
}
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.pagination > li {
display: inline;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
margin-left: -1px;
line-height: 1.42857143;
color: #337ab7;
text-decoration: none;
background-color: #fff;
border: 1px solid #ddd;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
z-index: 2;
color: #23527c;
background-color: #eee;
border-color: #ddd;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
z-index: 3;
color: #fff;
cursor: default;
background-color: #337ab7;
border-color: #337ab7;
}
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
color: #777;
cursor: not-allowed;
background-color: #fff;
border-color: #ddd;
}
.pagination-lg > li > a,
.pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
}
.pagination-lg > li:first-child > a,
.pagination-lg > li:first-child > span {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
.pagination-lg > li:last-child > a,
.pagination-lg > li:last-child > span {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
.pagination-sm > li > a,
.pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
}
.pagination-sm > li:first-child > a,
.pagination-sm > li:first-child > span {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.pagination-sm > li:last-child > a,
.pagination-sm > li:last-child > span {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.pager {
padding-left: 0;
margin: 20px 0;
text-align: center;
list-style: none;
}
.pager li {
display: inline;
}
.pager li > a,
.pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 15px;
}
.pager li > a:hover,
.pager li > a:focus {
text-decoration: none;
background-color: #eee;
}
.pager .next > a,
.pager .next > span {
float: right;
}
.pager .previous > a,
.pager .previous > span {
float: left;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
color: #777;
cursor: not-allowed;
background-color: #fff;
}
.label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
a.label:hover,
a.label:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
.label:empty {
display: none;
}
.btn .label {
position: relative;
top: -1px;
}
.label-default {
background-color: #777;
}
.label-default[href]:hover,
.label-default[href]:focus {
background-color: #5e5e5e;
}
.label-primary {
background-color: #337ab7;
}
.label-primary[href]:hover,
.label-primary[href]:focus {
background-color: #286090;
}
.label-success {
background-color: #5cb85c;
}
.label-success[href]:hover,
.label-success[href]:focus {
background-color: #449d44;
}
.label-info {
background-color: #5bc0de;
}
.label-info[href]:hover,
.label-info[href]:focus {
background-color: #31b0d5;
}
.label-warning {
background-color: #f0ad4e;
}
.label-warning[href]:hover,
.label-warning[href]:focus {
background-color: #ec971f;
}
.label-danger {
background-color: #d9534f;
}
.label-danger[href]:hover,
.label-danger[href]:focus {
background-color: #c9302c;
}
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: middle;
background-color: #777;
border-radius: 10px;
}
.badge:empty {
display: none;
}
.btn .badge {
position: relative;
top: -1px;
}
.btn-xs .badge,
.btn-group-xs > .btn .badge {
top: 0;
padding: 1px 5px;
}
a.badge:hover,
a.badge:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #337ab7;
background-color: #fff;
}
.list-group-item > .badge {
float: right;
}
.list-group-item > .badge + .badge {
margin-right: 5px;
}
.nav-pills > li > a > .badge {
margin-left: 3px;
}
.jumbotron {
padding-top: 30px;
padding-bottom: 30px;
margin-bottom: 30px;
color: inherit;
background-color: #eee;
}
.jumbotron h1,
.jumbotron .h1 {
color: inherit;
}
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200;
}
.jumbotron > hr {
border-top-color: #d5d5d5;
}
.container .jumbotron,
.container-fluid .jumbotron {
padding-right: 15px;
padding-left: 15px;
border-radius: 6px;
}
.jumbotron .container {
max-width: 100%;
}
@media screen and (min-width: 768px) {
.jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .jumbotron,
.container-fluid .jumbotron {
padding-right: 60px;
padding-left: 60px;
}
.jumbotron h1,
.jumbotron .h1 {
font-size: 63px;
}
}
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: border .2s ease-in-out;
-o-transition: border .2s ease-in-out;
transition: border .2s ease-in-out;
}
.thumbnail > img,
.thumbnail a > img {
margin-right: auto;
margin-left: auto;
}
a.thumbnail:hover,
a.thumbnail:focus,
a.thumbnail.active {
border-color: #337ab7;
}
.thumbnail .caption {
padding: 9px;
color: #333;
}
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: bold;
}
.alert > p,
.alert > ul {
margin-bottom: 0;
}
.alert > p + p {
margin-top: 5px;
}
.alert-dismissable,
.alert-dismissible {
padding-right: 35px;
}
.alert-dismissable .close,
.alert-dismissible .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.alert-success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #2b542c;
}
.alert-info {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #245269;
}
.alert-warning {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.alert-warning hr {
border-top-color: #f7e1b5;
}
.alert-warning .alert-link {
color: #66512c;
}
.alert-danger {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.alert-danger hr {
border-top-color: #e4b9c0;
}
.alert-danger .alert-link {
color: #843534;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-o-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.progress {
height: 20px;
margin-bottom: 20px;
overflow: hidden;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
}
.progress-bar {
float: left;
width: 0;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #fff;
text-align: center;
background-color: #337ab7;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
-webkit-transition: width .6s ease;
-o-transition: width .6s ease;
transition: width .6s ease;
}
.progress-striped .progress-bar,
.progress-bar-striped {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-webkit-background-size: 40px 40px;
background-size: 40px 40px;
}
.progress.active .progress-bar,
.progress-bar.active {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.progress-bar-success {
background-color: #5cb85c;
}
.progress-striped .progress-bar-success {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.progress-bar-info {
background-color: #5bc0de;
}
.progress-striped .progress-bar-info {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.progress-bar-warning {
background-color: #f0ad4e;
}
.progress-striped .progress-bar-warning {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.progress-bar-danger {
background-color: #d9534f;
}
.progress-striped .progress-bar-danger {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.media {
margin-top: 15px;
}
.media:first-child {
margin-top: 0;
}
.media,
.media-body {
overflow: hidden;
zoom: 1;
}
.media-body {
width: 10000px;
}
.media-object {
display: block;
}
.media-object.img-thumbnail {
max-width: none;
}
.media-right,
.media > .pull-right {
padding-left: 10px;
}
.media-left,
.media > .pull-left {
padding-right: 10px;
}
.media-left,
.media-right,
.media-body {
display: table-cell;
vertical-align: top;
}
.media-middle {
vertical-align: middle;
}
.media-bottom {
vertical-align: bottom;
}
.media-heading {
margin-top: 0;
margin-bottom: 5px;
}
.media-list {
padding-left: 0;
list-style: none;
}
.list-group {
padding-left: 0;
margin-bottom: 20px;
}
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #fff;
border: 1px solid #ddd;
}
.list-group-item:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
a.list-group-item,
button.list-group-item {
color: #555;
}
a.list-group-item .list-group-item-heading,
button.list-group-item .list-group-item-heading {
color: #333;
}
a.list-group-item:hover,
button.list-group-item:hover,
a.list-group-item:focus,
button.list-group-item:focus {
color: #555;
text-decoration: none;
background-color: #f5f5f5;
}
button.list-group-item {
width: 100%;
text-align: left;
}
.list-group-item.disabled,
.list-group-item.disabled:hover,
.list-group-item.disabled:focus {
color: #777;
cursor: not-allowed;
background-color: #eee;
}
.list-group-item.disabled .list-group-item-heading,
.list-group-item.disabled:hover .list-group-item-heading,
.list-group-item.disabled:focus .list-group-item-heading {
color: inherit;
}
.list-group-item.disabled .list-group-item-text,
.list-group-item.disabled:hover .list-group-item-text,
.list-group-item.disabled:focus .list-group-item-text {
color: #777;
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
z-index: 2;
color: #fff;
background-color: #337ab7;
border-color: #337ab7;
}
.list-group-item.active .list-group-item-heading,
.list-group-item.active:hover .list-group-item-heading,
.list-group-item.active:focus .list-group-item-heading,
.list-group-item.active .list-group-item-heading > small,
.list-group-item.active:hover .list-group-item-heading > small,
.list-group-item.active:focus .list-group-item-heading > small,
.list-group-item.active .list-group-item-heading > .small,
.list-group-item.active:hover .list-group-item-heading > .small,
.list-group-item.active:focus .list-group-item-heading > .small {
color: inherit;
}
.list-group-item.active .list-group-item-text,
.list-group-item.active:hover .list-group-item-text,
.list-group-item.active:focus .list-group-item-text {
color: #c7ddef;
}
.list-group-item-success {
color: #3c763d;
background-color: #dff0d8;
}
a.list-group-item-success,
button.list-group-item-success {
color: #3c763d;
}
a.list-group-item-success .list-group-item-heading,
button.list-group-item-success .list-group-item-heading {
color: inherit;
}
a.list-group-item-success:hover,
button.list-group-item-success:hover,
a.list-group-item-success:focus,
button.list-group-item-success:focus {
color: #3c763d;
background-color: #d0e9c6;
}
a.list-group-item-success.active,
button.list-group-item-success.active,
a.list-group-item-success.active:hover,
button.list-group-item-success.active:hover,
a.list-group-item-success.active:focus,
button.list-group-item-success.active:focus {
color: #fff;
background-color: #3c763d;
border-color: #3c763d;
}
.list-group-item-info {
color: #31708f;
background-color: #d9edf7;
}
a.list-group-item-info,
button.list-group-item-info {
color: #31708f;
}
a.list-group-item-info .list-group-item-heading,
button.list-group-item-info .list-group-item-heading {
color: inherit;
}
a.list-group-item-info:hover,
button.list-group-item-info:hover,
a.list-group-item-info:focus,
button.list-group-item-info:focus {
color: #31708f;
background-color: #c4e3f3;
}
a.list-group-item-info.active,
button.list-group-item-info.active,
a.list-group-item-info.active:hover,
button.list-group-item-info.active:hover,
a.list-group-item-info.active:focus,
button.list-group-item-info.active:focus {
color: #fff;
background-color: #31708f;
border-color: #31708f;
}
.list-group-item-warning {
color: #8a6d3b;
background-color: #fcf8e3;
}
a.list-group-item-warning,
button.list-group-item-warning {
color: #8a6d3b;
}
a.list-group-item-warning .list-group-item-heading,
button.list-group-item-warning .list-group-item-heading {
color: inherit;
}
a.list-group-item-warning:hover,
button.list-group-item-warning:hover,
a.list-group-item-warning:focus,
button.list-group-item-warning:focus {
color: #8a6d3b;
background-color: #faf2cc;
}
a.list-group-item-warning.active,
button.list-group-item-warning.active,
a.list-group-item-warning.active:hover,
button.list-group-item-warning.active:hover,
a.list-group-item-warning.active:focus,
button.list-group-item-warning.active:focus {
color: #fff;
background-color: #8a6d3b;
border-color: #8a6d3b;
}
.list-group-item-danger {
color: #a94442;
background-color: #f2dede;
}
a.list-group-item-danger,
button.list-group-item-danger {
color: #a94442;
}
a.list-group-item-danger .list-group-item-heading,
button.list-group-item-danger .list-group-item-heading {
color: inherit;
}
a.list-group-item-danger:hover,
button.list-group-item-danger:hover,
a.list-group-item-danger:focus,
button.list-group-item-danger:focus {
color: #a94442;
background-color: #ebcccc;
}
a.list-group-item-danger.active,
button.list-group-item-danger.active,
a.list-group-item-danger.active:hover,
button.list-group-item-danger.active:hover,
a.list-group-item-danger.active:focus,
button.list-group-item-danger.active:focus {
color: #fff;
background-color: #a94442;
border-color: #a94442;
}
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.panel {
margin-bottom: 20px;
background-color: #fff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}
.panel-body {
padding: 15px;
}
.panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel-heading > .dropdown .dropdown-toggle {
color: inherit;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}
.panel-title > a,
.panel-title > small,
.panel-title > .small,
.panel-title > small > a,
.panel-title > .small > a {
color: inherit;
}
.panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .list-group,
.panel > .panel-collapse > .list-group {
margin-bottom: 0;
}
.panel > .list-group .list-group-item,
.panel > .panel-collapse > .list-group .list-group-item {
border-width: 1px 0;
border-radius: 0;
}
.panel > .list-group:first-child .list-group-item:first-child,
.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
border-top: 0;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel > .list-group:last-child .list-group-item:last-child,
.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
border-bottom: 0;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.list-group + .panel-footer {
border-top-width: 0;
}
.panel > .table,
.panel > .table-responsive > .table,
.panel > .panel-collapse > .table {
margin-bottom: 0;
}
.panel > .table caption,
.panel > .table-responsive > .table caption,
.panel > .panel-collapse > .table caption {
padding-right: 15px;
padding-left: 15px;
}
.panel > .table:first-child,
.panel > .table-responsive:first-child > .table:first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
border-top-left-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
border-top-right-radius: 3px;
}
.panel > .table:last-child,
.panel > .table-responsive:last-child > .table:last-child {
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
border-bottom-left-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
border-bottom-right-radius: 3px;
}
.panel > .panel-body + .table,
.panel > .panel-body + .table-responsive,
.panel > .table + .panel-body,
.panel > .table-responsive + .panel-body {
border-top: 1px solid #ddd;
}
.panel > .table > tbody:first-child > tr:first-child th,
.panel > .table > tbody:first-child > tr:first-child td {
border-top: 0;
}
.panel > .table-bordered,
.panel > .table-responsive > .table-bordered {
border: 0;
}
.panel > .table-bordered > thead > tr > th:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
.panel > .table-bordered > tbody > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
.panel > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-bordered > thead > tr > td:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
.panel > .table-bordered > tbody > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
.panel > .table-bordered > tfoot > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.panel > .table-bordered > thead > tr > th:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
.panel > .table-bordered > tbody > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
.panel > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-bordered > thead > tr > td:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
.panel > .table-bordered > tbody > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
.panel > .table-bordered > tfoot > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.panel > .table-bordered > thead > tr:first-child > td,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
.panel > .table-bordered > tbody > tr:first-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
.panel > .table-bordered > thead > tr:first-child > th,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
.panel > .table-bordered > tbody > tr:first-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
border-bottom: 0;
}
.panel > .table-bordered > tbody > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
.panel > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-bordered > tbody > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
.panel > .table-bordered > tfoot > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
border-bottom: 0;
}
.panel > .table-responsive {
margin-bottom: 0;
border: 0;
}
.panel-group {
margin-bottom: 20px;
}
.panel-group .panel {
margin-bottom: 0;
border-radius: 4px;
}
.panel-group .panel + .panel {
margin-top: 5px;
}
.panel-group .panel-heading {
border-bottom: 0;
}
.panel-group .panel-heading + .panel-collapse > .panel-body,
.panel-group .panel-heading + .panel-collapse > .list-group {
border-top: 1px solid #ddd;
}
.panel-group .panel-footer {
border-top: 0;
}
.panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #ddd;
}
.panel-default {
border-color: #ddd;
}
.panel-default > .panel-heading {
color: #333;
background-color: #f5f5f5;
border-color: #ddd;
}
.panel-default > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #ddd;
}
.panel-default > .panel-heading .badge {
color: #f5f5f5;
background-color: #333;
}
.panel-default > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #ddd;
}
.panel-primary {
border-color: #337ab7;
}
.panel-primary > .panel-heading {
color: #fff;
background-color: #337ab7;
border-color: #337ab7;
}
.panel-primary > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #337ab7;
}
.panel-primary > .panel-heading .badge {
color: #337ab7;
background-color: #fff;
}
.panel-primary > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #337ab7;
}
.panel-success {
border-color: #d6e9c6;
}
.panel-success > .panel-heading {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.panel-success > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #d6e9c6;
}
.panel-success > .panel-heading .badge {
color: #dff0d8;
background-color: #3c763d;
}
.panel-success > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #d6e9c6;
}
.panel-info {
border-color: #bce8f1;
}
.panel-info > .panel-heading {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
.panel-info > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #bce8f1;
}
.panel-info > .panel-heading .badge {
color: #d9edf7;
background-color: #31708f;
}
.panel-info > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #bce8f1;
}
.panel-warning {
border-color: #faebcc;
}
.panel-warning > .panel-heading {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.panel-warning > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #faebcc;
}
.panel-warning > .panel-heading .badge {
color: #fcf8e3;
background-color: #8a6d3b;
}
.panel-warning > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #faebcc;
}
.panel-danger {
border-color: #ebccd1;
}
.panel-danger > .panel-heading {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.panel-danger > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #ebccd1;
}
.panel-danger > .panel-heading .badge {
color: #f2dede;
background-color: #a94442;
}
.panel-danger > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #ebccd1;
}
.embed-responsive {
position: relative;
display: block;
height: 0;
padding: 0;
overflow: hidden;
}
.embed-responsive .embed-responsive-item,
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}
.embed-responsive-16by9 {
padding-bottom: 56.25%;
}
.embed-responsive-4by3 {
padding-bottom: 75%;
}
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
}
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, .15);
}
.well-lg {
padding: 24px;
border-radius: 6px;
}
.well-sm {
padding: 9px;
border-radius: 3px;
}
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
filter: alpha(opacity=20);
opacity: .2;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
filter: alpha(opacity=50);
opacity: .5;
}
button.close {
-webkit-appearance: none;
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
}
.modal-open {
overflow: hidden;
}
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
display: none;
overflow: hidden;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.modal.fade .modal-dialog {
-webkit-transition: -webkit-transform .3s ease-out;
-o-transition: -o-transform .3s ease-out;
transition: transform .3s ease-out;
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
-o-transform: translate(0, -25%);
transform: translate(0, -25%);
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
-o-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal-dialog {
position: relative;
width: auto;
margin: 10px;
}
.modal-content {
position: relative;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #999;
border: 1px solid rgba(0, 0, 0, .2);
border-radius: 6px;
outline: 0;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000;
}
.modal-backdrop.fade {
filter: alpha(opacity=0);
opacity: 0;
}
.modal-backdrop.in {
filter: alpha(opacity=50);
opacity: .5;
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.42857143;
}
.modal-body {
position: relative;
padding: 15px;
}
.modal-footer {
padding: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer .btn + .btn {
margin-bottom: 0;
margin-left: 5px;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
.modal-scrollbar-measure {
position: absolute;
top: -9999px;
width: 50px;
height: 50px;
overflow: scroll;
}
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
}
.modal-sm {
width: 300px;
}
}
@media (min-width: 992px) {
.modal-lg {
width: 900px;
}
}
.tooltip {
position: absolute;
z-index: 1070;
display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
letter-spacing: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
white-space: normal;
filter: alpha(opacity=0);
opacity: 0;
line-break: auto;
}
.tooltip.in {
filter: alpha(opacity=90);
opacity: .9;
}
.tooltip.top {
padding: 5px 0;
margin-top: -3px;
}
.tooltip.right {
padding: 0 5px;
margin-left: 3px;
}
.tooltip.bottom {
padding: 5px 0;
margin-top: 3px;
}
.tooltip.left {
padding: 0 5px;
margin-left: -3px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #fff;
text-align: center;
background-color: #000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.top-left .tooltip-arrow {
right: 5px;
bottom: 0;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
left: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
right: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
left: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1060;
display: none;
max-width: 276px;
padding: 1px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: normal;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
letter-spacing: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
white-space: normal;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, .2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
line-break: auto;
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
padding: 8px 14px;
margin: 0;
font-size: 14px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover > .arrow,
.popover > .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover > .arrow {
border-width: 11px;
}
.popover > .arrow:after {
content: "";
border-width: 10px;
}
.popover.top > .arrow {
bottom: -11px;
left: 50%;
margin-left: -11px;
border-top-color: #999;
border-top-color: rgba(0, 0, 0, .25);
border-bottom-width: 0;
}
.popover.top > .arrow:after {
bottom: 1px;
margin-left: -10px;
content: " ";
border-top-color: #fff;
border-bottom-width: 0;
}
.popover.right > .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-right-color: #999;
border-right-color: rgba(0, 0, 0, .25);
border-left-width: 0;
}
.popover.right > .arrow:after {
bottom: -10px;
left: 1px;
content: " ";
border-right-color: #fff;
border-left-width: 0;
}
.popover.bottom > .arrow {
top: -11px;
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999;
border-bottom-color: rgba(0, 0, 0, .25);
}
.popover.bottom > .arrow:after {
top: 1px;
margin-left: -10px;
content: " ";
border-top-width: 0;
border-bottom-color: #fff;
}
.popover.left > .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999;
border-left-color: rgba(0, 0, 0, .25);
}
.popover.left > .arrow:after {
right: 1px;
bottom: -10px;
content: " ";
border-right-width: 0;
border-left-color: #fff;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
width: 100%;
overflow: hidden;
}
.carousel-inner > .item {
position: relative;
display: none;
-webkit-transition: .6s ease-in-out left;
-o-transition: .6s ease-in-out left;
transition: .6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
line-height: 1;
}
@media all and (transform-3d), (-webkit-transform-3d) {
.carousel-inner > .item {
-webkit-transition: -webkit-transform .6s ease-in-out;
-o-transition: -o-transform .6s ease-in-out;
transition: transform .6s ease-in-out;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 1000px;
perspective: 1000px;
}
.carousel-inner > .item.next,
.carousel-inner > .item.active.right {
left: 0;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
}
.carousel-inner > .item.prev,
.carousel-inner > .item.active.left {
left: 0;
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
.carousel-inner > .item.next.left,
.carousel-inner > .item.prev.right,
.carousel-inner > .item.active {
left: 0;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 15%;
font-size: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
background-color: rgba(0, 0, 0, 0);
filter: alpha(opacity=50);
opacity: .5;
}
.carousel-control.left {
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001)));
background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
background-repeat: repeat-x;
}
.carousel-control.right {
right: 0;
left: auto;
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5)));
background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
background-repeat: repeat-x;
}
.carousel-control:hover,
.carousel-control:focus {
color: #fff;
text-decoration: none;
filter: alpha(opacity=90);
outline: 0;
opacity: .9;
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
margin-top: -10px;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 50%;
margin-left: -10px;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
margin-right: -10px;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
font-family: serif;
line-height: 1;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
padding-left: 0;
margin-left: -30%;
text-align: center;
list-style: none;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
cursor: pointer;
background-color: #000 \9;
background-color: rgba(0, 0, 0, 0);
border: 1px solid #fff;
border-radius: 10px;
}
.carousel-indicators .active {
width: 12px;
height: 12px;
margin: 0;
background-color: #fff;
}
.carousel-caption {
position: absolute;
right: 15%;
bottom: 20px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -10px;
font-size: 30px;
}
.carousel-control .glyphicon-chevron-left,
.carousel-control .icon-prev {
margin-left: -10px;
}
.carousel-control .glyphicon-chevron-right,
.carousel-control .icon-next {
margin-right: -10px;
}
.carousel-caption {
right: 20%;
left: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after,
.dl-horizontal dd:before,
.dl-horizontal dd:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after,
.form-horizontal .form-group:before,
.form-horizontal .form-group:after,
.btn-toolbar:before,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after,
.nav:before,
.nav:after,
.navbar:before,
.navbar:after,
.navbar-header:before,
.navbar-header:after,
.navbar-collapse:before,
.navbar-collapse:after,
.pager:before,
.pager:after,
.panel-body:before,
.panel-body:after,
.modal-header:before,
.modal-header:after,
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.clearfix:after,
.dl-horizontal dd:after,
.container:after,
.container-fluid:after,
.row:after,
.form-horizontal .form-group:after,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:after,
.nav:after,
.navbar:after,
.navbar-header:after,
.navbar-collapse:after,
.pager:after,
.panel-body:after,
.modal-header:after,
.modal-footer:after {
clear: both;
}
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {
display: none !important;
}
.visible-xs-block,
.visible-xs-inline,
.visible-xs-inline-block,
.visible-sm-block,
.visible-sm-inline,
.visible-sm-inline-block,
.visible-md-block,
.visible-md-inline,
.visible-md-inline-block,
.visible-lg-block,
.visible-lg-inline,
.visible-lg-inline-block {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
table.visible-xs {
display: table !important;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (max-width: 767px) {
.visible-xs-block {
display: block !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline {
display: inline !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline-block {
display: inline-block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
table.visible-sm {
display: table !important;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-block {
display: block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline {
display: inline !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline-block {
display: inline-block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
table.visible-md {
display: table !important;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-block {
display: block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline {
display: inline !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline-block {
display: inline-block !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
table.visible-lg {
display: table !important;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg-block {
display: block !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline {
display: inline !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline-block {
display: inline-block !important;
}
}
@media (max-width: 767px) {
.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg {
display: none !important;
}
}
.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
table.visible-print {
display: table !important;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
}
.visible-print-block {
display: none !important;
}
@media print {
.visible-print-block {
display: block !important;
}
}
.visible-print-inline {
display: none !important;
}
@media print {
.visible-print-inline {
display: inline !important;
}
}
.visible-print-inline-block {
display: none !important;
}
@media print {
.visible-print-inline-block {
display: inline-block !important;
}
}
@media print {
.hidden-print {
display: none !important;
}
}
/*# sourceMappingURL=bootstrap.css.map */
| Java |
"""
File: foursquares.py
Draws squares in the corners of a turtle window.
One square is black, another is gray, and the
remaining two are in random colors.
"""
from turtlegraphics import Turtle
import random
def drawSquare(turtle, x, y, length):
turtle.up()
turtle.move(x, y)
turtle.setDirection(270)
turtle.down()
for count in xrange(4):
turtle.move(length)
turtle.turn(90)
def main():
turtle = Turtle()
#turtle.setWidth(1)
# Length of square
length = 40
# Relative distances to corners from origin
width = turtle.getWidth() / 2
height = turtle.getHeight() / 2
# Black
turtle.setColor(0, 0, 0)
# Upper left corner
drawSquare(turtle, -width, height, length)
# Gray
turtle.setColor(127, 127, 127)
# Lower left corner
drawSquare(turtle, -width, length - height, length)
# First random color
turtle.setColor(random.randint(0, 255),
random.randint(0, 255),
random.randint(0, 255))
# Upper right corner
drawSquare(turtle, width - length, height, length)
# Second random color
turtle.setColor(random.randint(0, 255),
random.randint(0, 255),
random.randint(0, 255))
# Lower right corner
drawSquare(turtle, width - length,
length - height, length)
main()
| Java |
Puppet::Type.type(:foreman_architecture).provide(:rest) do
confine :true => begin
begin
require 'oauth'
require 'json'
require 'puppet_x/theforeman/architecture'
true
rescue LoadError
false
end
end
mk_resource_methods
def initialize(value={})
super(value)
end
def self.architectures
PuppetX::TheForeman::Resources::Architectures.new(nil)
end
def self.instances
arch_config = architectures.read
arch_config['results'].collect do |s|
arch_hash = {
:name => s['name'],
:id => s['id'],
:ensure => :present
}
new(arch_hash)
end
end
def self.prefetch(resources)
architectures = instances
resources.keys.each do |architecture|
if provider = architectures.find { |a| a.name == architecture }
resources[architecture].provider = provider
end
end
end
def exists?
@property_hash[:ensure] == :present
end
def create
arch_hash = {
'name' => resource[:name]
}
self.class.architectures.create(arch_hash)
end
def destroy
self.class.architectures.delete(id)
end
def name=(value)
self.class.architectures.update(id, { :name => value })
end
def id
@property_hash[:id]
end
end
| Java |
\hypertarget{classCircleRANSACParameters}{\section{Circle\-R\-A\-N\-S\-A\-C\-Parameters Class Reference}
\label{classCircleRANSACParameters}\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
}
Parameters obtained from the input .xml file used for R\-A\-N\-S\-A\-C to fit a 2\-D circle model.
{\ttfamily \#include $<$input\-Params.\-h$>$}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hyperlink{classCircleRANSACParameters_ab7c999366414eec5819cdd11a291b291}{Circle\-R\-A\-N\-S\-A\-C\-Parameters} ()
\item
\hyperlink{classCircleRANSACParameters_a15eed89c8fcf974340393a3a9765cc55}{$\sim$\-Circle\-R\-A\-N\-S\-A\-C\-Parameters} ()
\item
int \hyperlink{classCircleRANSACParameters_acdba773dd709e12ab2d7d0d4597932c5}{get\-Max\-Iterations} ()
\item
void \hyperlink{classCircleRANSACParameters_a880cf54ef4625e5873fd0b13e2031cf4}{set\-Max\-Iterations} (int input\-Max\-Iterations)
\item
float \hyperlink{classCircleRANSACParameters_a5eb539b967eb5efd77f209560a4a2a1d}{get\-Distance\-Threshold} ()
\item
void \hyperlink{classCircleRANSACParameters_ad700d0826e837161eeadf79543b31082}{set\-Distance\-Threshold} (float input\-Distance\-Threshold)
\item
float \hyperlink{classCircleRANSACParameters_a3b7da386121b9b4b8ca209388fa6b8cf}{get\-Select\-Within\-Distance\-Value} ()
\item
void \hyperlink{classCircleRANSACParameters_ac0f13163b3bfa93ef90cf3dfbe2df3aa}{set\-Select\-Within\-Distance\-Value} (float input\-Select\-Within\-Distance\-Value)
\item
void \hyperlink{classCircleRANSACParameters_a38f926e6d09bfdb1b64c347f7bd7a0b5}{print\-Parameters} ()
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item
int \hyperlink{classCircleRANSACParameters_a32cb281a19a165fc4042f31e8ae5bb40}{\-\_\-\-Max\-Iterations}
\item
float \hyperlink{classCircleRANSACParameters_a1002458dc1b6751e3188b1e1de076ac0}{\-\_\-\-Distance\-Threshold}
\item
float \hyperlink{classCircleRANSACParameters_a5d030b3d671442a82f571daf2d5f3d4a}{\-\_\-\-Select\-Within\-Distance\-Value}
\end{DoxyCompactItemize}
\subsection{Detailed Description}
Parameters obtained from the input .xml file used for R\-A\-N\-S\-A\-C to fit a 2\-D circle model.
\subsection{Constructor \& Destructor Documentation}
\hypertarget{classCircleRANSACParameters_ab7c999366414eec5819cdd11a291b291}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{Circle\-R\-A\-N\-S\-A\-C\-Parameters}]{\setlength{\rightskip}{0pt plus 5cm}Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::\-Circle\-R\-A\-N\-S\-A\-C\-Parameters (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_ab7c999366414eec5819cdd11a291b291}
\hypertarget{classCircleRANSACParameters_a15eed89c8fcf974340393a3a9765cc55}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!$\sim$\-Circle\-R\-A\-N\-S\-A\-C\-Parameters@{$\sim$\-Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\index{$\sim$\-Circle\-R\-A\-N\-S\-A\-C\-Parameters@{$\sim$\-Circle\-R\-A\-N\-S\-A\-C\-Parameters}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{$\sim$\-Circle\-R\-A\-N\-S\-A\-C\-Parameters}]{\setlength{\rightskip}{0pt plus 5cm}Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::$\sim$\-Circle\-R\-A\-N\-S\-A\-C\-Parameters (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_a15eed89c8fcf974340393a3a9765cc55}
\subsection{Member Function Documentation}
\hypertarget{classCircleRANSACParameters_a5eb539b967eb5efd77f209560a4a2a1d}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!get\-Distance\-Threshold@{get\-Distance\-Threshold}}
\index{get\-Distance\-Threshold@{get\-Distance\-Threshold}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{get\-Distance\-Threshold}]{\setlength{\rightskip}{0pt plus 5cm}float Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::get\-Distance\-Threshold (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_a5eb539b967eb5efd77f209560a4a2a1d}
\hypertarget{classCircleRANSACParameters_acdba773dd709e12ab2d7d0d4597932c5}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!get\-Max\-Iterations@{get\-Max\-Iterations}}
\index{get\-Max\-Iterations@{get\-Max\-Iterations}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{get\-Max\-Iterations}]{\setlength{\rightskip}{0pt plus 5cm}int Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::get\-Max\-Iterations (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_acdba773dd709e12ab2d7d0d4597932c5}
\hypertarget{classCircleRANSACParameters_a3b7da386121b9b4b8ca209388fa6b8cf}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!get\-Select\-Within\-Distance\-Value@{get\-Select\-Within\-Distance\-Value}}
\index{get\-Select\-Within\-Distance\-Value@{get\-Select\-Within\-Distance\-Value}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{get\-Select\-Within\-Distance\-Value}]{\setlength{\rightskip}{0pt plus 5cm}float Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::get\-Select\-Within\-Distance\-Value (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_a3b7da386121b9b4b8ca209388fa6b8cf}
\hypertarget{classCircleRANSACParameters_a38f926e6d09bfdb1b64c347f7bd7a0b5}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!print\-Parameters@{print\-Parameters}}
\index{print\-Parameters@{print\-Parameters}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{print\-Parameters}]{\setlength{\rightskip}{0pt plus 5cm}void Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::print\-Parameters (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_a38f926e6d09bfdb1b64c347f7bd7a0b5}
\hypertarget{classCircleRANSACParameters_ad700d0826e837161eeadf79543b31082}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!set\-Distance\-Threshold@{set\-Distance\-Threshold}}
\index{set\-Distance\-Threshold@{set\-Distance\-Threshold}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{set\-Distance\-Threshold}]{\setlength{\rightskip}{0pt plus 5cm}void Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::set\-Distance\-Threshold (
\begin{DoxyParamCaption}
\item[{float}]{input\-Distance\-Threshold}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_ad700d0826e837161eeadf79543b31082}
\hypertarget{classCircleRANSACParameters_a880cf54ef4625e5873fd0b13e2031cf4}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!set\-Max\-Iterations@{set\-Max\-Iterations}}
\index{set\-Max\-Iterations@{set\-Max\-Iterations}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{set\-Max\-Iterations}]{\setlength{\rightskip}{0pt plus 5cm}void Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::set\-Max\-Iterations (
\begin{DoxyParamCaption}
\item[{int}]{input\-Max\-Iterations}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_a880cf54ef4625e5873fd0b13e2031cf4}
\hypertarget{classCircleRANSACParameters_ac0f13163b3bfa93ef90cf3dfbe2df3aa}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!set\-Select\-Within\-Distance\-Value@{set\-Select\-Within\-Distance\-Value}}
\index{set\-Select\-Within\-Distance\-Value@{set\-Select\-Within\-Distance\-Value}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{set\-Select\-Within\-Distance\-Value}]{\setlength{\rightskip}{0pt plus 5cm}void Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::set\-Select\-Within\-Distance\-Value (
\begin{DoxyParamCaption}
\item[{float}]{input\-Select\-Within\-Distance\-Value}
\end{DoxyParamCaption}
)}}\label{classCircleRANSACParameters_ac0f13163b3bfa93ef90cf3dfbe2df3aa}
\subsection{Member Data Documentation}
\hypertarget{classCircleRANSACParameters_a1002458dc1b6751e3188b1e1de076ac0}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!\-\_\-\-Distance\-Threshold@{\-\_\-\-Distance\-Threshold}}
\index{\-\_\-\-Distance\-Threshold@{\-\_\-\-Distance\-Threshold}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{\-\_\-\-Distance\-Threshold}]{\setlength{\rightskip}{0pt plus 5cm}float Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::\-\_\-\-Distance\-Threshold\hspace{0.3cm}{\ttfamily [private]}}}\label{classCircleRANSACParameters_a1002458dc1b6751e3188b1e1de076ac0}
\hypertarget{classCircleRANSACParameters_a32cb281a19a165fc4042f31e8ae5bb40}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!\-\_\-\-Max\-Iterations@{\-\_\-\-Max\-Iterations}}
\index{\-\_\-\-Max\-Iterations@{\-\_\-\-Max\-Iterations}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{\-\_\-\-Max\-Iterations}]{\setlength{\rightskip}{0pt plus 5cm}int Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::\-\_\-\-Max\-Iterations\hspace{0.3cm}{\ttfamily [private]}}}\label{classCircleRANSACParameters_a32cb281a19a165fc4042f31e8ae5bb40}
\hypertarget{classCircleRANSACParameters_a5d030b3d671442a82f571daf2d5f3d4a}{\index{Circle\-R\-A\-N\-S\-A\-C\-Parameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}!\-\_\-\-Select\-Within\-Distance\-Value@{\-\_\-\-Select\-Within\-Distance\-Value}}
\index{\-\_\-\-Select\-Within\-Distance\-Value@{\-\_\-\-Select\-Within\-Distance\-Value}!CircleRANSACParameters@{Circle\-R\-A\-N\-S\-A\-C\-Parameters}}
\subsubsection[{\-\_\-\-Select\-Within\-Distance\-Value}]{\setlength{\rightskip}{0pt plus 5cm}float Circle\-R\-A\-N\-S\-A\-C\-Parameters\-::\-\_\-\-Select\-Within\-Distance\-Value\hspace{0.3cm}{\ttfamily [private]}}}\label{classCircleRANSACParameters_a5d030b3d671442a82f571daf2d5f3d4a}
The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item
\hyperlink{inputParams_8h}{input\-Params.\-h}\item
\hyperlink{inputParams_8cpp}{input\-Params.\-cpp}\end{DoxyCompactItemize}
| Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.