code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
/* * Copyright © 2014 Felix Höfling * Copyright © 2008-2012 Peter Colberg * * This file is part of HALMD. * * HALMD 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 <algorithm> #include <boost/algorithm/string/find_iterator.hpp> #include <boost/algorithm/string/finder.hpp> #include <boost/any.hpp> #include <boost/type_traits/is_arithmetic.hpp> #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/matrix_proxy.hpp> #include <boost/numeric/ublas/symmetric.hpp> #include <boost/numeric/ublas/vector.hpp> #include <boost/program_options.hpp> #include <boost/program_options/cmdline.hpp> #include <boost/range/iterator_range.hpp> // boost::copy_range #include <boost/utility/enable_if.hpp> #include <luaponte/luaponte.hpp> #include <luaponte/adopt_policy.hpp> #include <luaponte/operator.hpp> // luaponte::tostring #include <luaponte/return_reference_to_policy.hpp> #include <luaponte/shared_ptr_converter.hpp> #include <sstream> #include <stdint.h> #include <halmd/config.hpp> #include <halmd/numeric/cast.hpp> #include <halmd/utility/lua/ublas.hpp> #include <halmd/utility/lua/vector_converter.hpp> #include <halmd/utility/program_options.hpp> namespace po = boost::program_options; namespace ublas = boost::numeric::ublas; using namespace boost::algorithm; // first_finder, make_split_iterator, split_iterator using namespace std; namespace std { /** * Ensure arithmetic option value is exactly representable as Lua number. * * Note that floating-point promotion from float to double (which is the * default for lua_Number) is exact, refer to ISO/IEC 14882:1998, 4.6.1. * “An rvalue of type float can be converted to an rvalue of type double. * The value is unchanged.” */ template <typename T> static typename boost::enable_if<boost::is_arithmetic<T>, void>::type validate(boost::any& v, vector<string> const& values, T*, int) { po::validators::check_first_occurrence(v); string s(po::validators::get_single_string(values)); try { T value = boost::lexical_cast<T>(s); halmd::checked_narrowing_cast<lua_Number>(value); v = boost::any(value); } catch (exception const&) { throw po::invalid_option_value(s); } } /** * Read Boost uBLAS vector from input stream * * A vector is represented as a comma-delimited string, e.g. 1,2,3,4 */ template <typename T> void validate(boost::any& v, vector<string> const& values, ublas::vector<T>*, int) { po::validators::check_first_occurrence(v); string s(po::validators::get_single_string(values)); ublas::vector<T> value; vector<T> element; for (split_iterator<string::iterator> i = make_split_iterator(s, first_finder(",", is_equal())); i != split_iterator<string::iterator>(); ++i) { boost::any v; vector<string> values; values.push_back(boost::copy_range<string>(*i)); validate(v, values, (T*)0, 0); element.push_back(boost::any_cast<T>(v)); } value.resize(element.size()); copy(element.begin(), element.end(), value.begin()); v = value; } /** * Read Boost uBLAS matrix from input stream * * A matrix is represented as colon-delimited rows with each row as a * comma-delimited string, e.g. 11,12,13:21,22,23:31,32,33 */ template <typename T> void validate(boost::any& v, vector<string> const& values, ublas::matrix<T>*, int) { po::validators::check_first_occurrence(v); string s(po::validators::get_single_string(values)); ublas::matrix<T> value; vector<ublas::vector<T> > row; for (split_iterator<string::iterator> i = make_split_iterator(s, first_finder(":", is_equal())); i != split_iterator<string::iterator>(); ++i) { boost::any v; vector<string> values; values.push_back(boost::copy_range<string>(*i)); validate(v, values, (ublas::vector<T>*)0, 0); row.push_back(boost::any_cast<ublas::vector<T> >(v)); } if (!row.empty()) { if (row.front().size() == 1) { ublas::symmetric_matrix<T, ublas::lower> m(row.size(), row.size()); for (size_t i = 0; i < row.size(); ++i) { if (!(row[i].size() == i + 1)) { throw po::invalid_option_value(s); } copy(row[i].begin(), row[i].end(), ublas::row(m, i).begin()); } value = m; } else if (row.back().size() == 1) { ublas::symmetric_matrix<T, ublas::upper> m(row.size(), row.size()); for (size_t i = 0; i < row.size(); ++i) { if (!(row[i].size() == (m.size2() - i))) { throw po::invalid_option_value(s); } copy(row[i].begin(), row[i].end(), ublas::row(m, i).begin()); } value = m; } else { value.resize(row.size(), row.front().size()); for (size_t i = 0; i < row.size(); ++i) { if (!(row[i].size() == value.size2())) { throw po::invalid_option_value(s); } ublas::row(value, i) = row[i]; } } } v = value; } /** * Write Boost uBLAS vector to output stream */ template <typename T> ostream& operator<<(ostream& os, ublas::vector<T> const& value) { for (size_t i = 0; i < value.size(); ++i) { if (i > 0) { os << ','; } os << value(i); } return os; } /** * Write Boost uBLAS matrix to output stream */ template <typename T> ostream& operator<<(ostream& os, ublas::matrix<T> const& value) { for (size_t i = 0; i < value.size1(); ++i) { if (i > 0) { os << ':'; } ublas::vector<T> const& row = ublas::matrix_row<ublas::matrix<T> const>(value, i); os << row; } return os; } /** * Write STL vector to output stream */ template <typename T> static ostream& operator<<(ostream& os, vector<T> const& value) { typename vector<T>::const_iterator i = value.begin(); if (i != value.end()) { os << *i; for (++i; i != value.end(); ++i) { os << " " << *i; } } return os; } } // namespace std namespace halmd { template <typename T> static po::typed_value<T>* default_value(po::typed_value<T>* semantic, T const& value) { return semantic->default_value(value); } // boost::program_options uses boost::lexical_cast to format default values for // output, which messes up with rounding of floating-point numbers, e.g., 0.1 // becomes "0.10000000000000001". To resolve the issue, we specialise the // template for T=float,double and let std::ostringstream convert the value. template <> po::typed_value<float>* default_value(po::typed_value<float>* semantic, float const& value) { std::ostringstream ss; ss << value; return semantic->default_value(value, ss.str()); } template <> po::typed_value<double>* default_value(po::typed_value<double>* semantic, double const& value) { std::ostringstream ss; ss << value; return semantic->default_value(value, ss.str()); } template <typename T> static po::typed_value<T>* default_value_textual(po::typed_value<T>* semantic, T const& value, string const& textual) { return semantic->default_value(value, textual); } template <typename T> static po::typed_value<T>* implicit_value(po::typed_value<T>* semantic, T const& value) { return semantic->implicit_value(value); } template <typename T> static po::typed_value<T>* implicit_value_textual(po::typed_value<T>* semantic, T const& value, string const& textual) { return semantic->implicit_value(value, textual); } template <typename T> static void notify(luaponte::object const& functor, T const& value) { luaponte::object args(luaponte::from_stack(functor.interpreter(), -1)); try { luaponte::call_function<void>(functor, args, value); } catch (luaponte::error const& e) { string error(lua_tostring(e.state(), -1)); lua_pop(e.state(), 1); throw runtime_error(error); } } template <typename T> static po::typed_value<T>* notifier(po::typed_value<T>* semantic, luaponte::object const& functor) { return semantic->notifier([=](T const& value) { notify(functor, value); }); } template <typename T> struct typed_value_wrapper : po::typed_value<T>, luaponte::wrap_base { typed_value_wrapper() : po::typed_value<T>(0) {} }; template <> struct typed_value_wrapper<bool> : po::typed_value<bool>, luaponte::wrap_base { typed_value_wrapper() : po::typed_value<bool>(0) { default_value(false); zero_tokens(); } }; struct untyped_value_wrapper : po::untyped_value, luaponte::wrap_base { untyped_value_wrapper() : po::untyped_value(true) {} // zero tokens }; template <typename T> static accumulating_value<T>* accum_default_value(accumulating_value<T>* semantic, T const& value) { return semantic->default_value(value); } template <typename T> static accumulating_value<T>* accum_default_value_textual(accumulating_value<T>* semantic, T const& value, string const& textual) { return semantic->default_value(value, textual); } template <typename T> struct accum_value_wrapper : accumulating_value<T>, luaponte::wrap_base { accum_value_wrapper() : accumulating_value<T>(0) {} }; static void add_option(po::options_description& self, boost::shared_ptr<po::option_description> desc) { self.add(desc); } static void add_options(po::options_description& self, po::options_description const& desc) { self.add(desc); } static po::command_line_parser& disallow_guessing(po::command_line_parser& parser) { using namespace boost::program_options::command_line_style; return parser.style(default_style & ~allow_guessing); } static pair<string, string> split_argument(string const& arg) { size_t pos = arg.find('='); if (pos != string::npos) { return make_pair(arg.substr(0, pos), arg.substr(pos + 1)); } return make_pair(arg, string()); } static po::command_line_parser& group_parser(po::command_line_parser& parser) { return parser.extra_parser(&split_argument); } static void variables_map_store(po::variables_map& vm, po::parsed_options const& options) { po::store(options, vm); } struct scoped_push { lua_State* const L; scoped_push(luaponte::object const& object) : L(object.interpreter()) { object.push(L); } ~scoped_push() { lua_pop(L, 1); } }; static luaponte::object variables_map_notify(lua_State* L, po::variables_map& vm, luaponte::object const& args) { scoped_push p(args); po::notify(vm); return args; } template <typename T> static void typed_value(lua_State* L, char const* name, char const* value, char const* multi_value) { using namespace luaponte; module(L, "libhalmd") [ namespace_("program_options") [ namespace_(value) [ class_<po::typed_value<T>, typed_value_wrapper<T>, po::value_semantic>(name) .def(constructor<>()) .def("default_value", &default_value<T>, return_reference_to(_1)) .def("default_value", &default_value_textual<T>, return_reference_to(_1)) .def("implicit_value", &implicit_value<T>, return_reference_to(_1)) .def("implicit_value", &implicit_value_textual<T>, return_reference_to(_1)) .def("notifier", &notifier<T>, return_reference_to(_1)) .def("required", &po::typed_value<T>::required, return_reference_to(_1)) ] , namespace_(multi_value) [ class_<po::typed_value<vector<T> >, typed_value_wrapper<vector<T> >, po::value_semantic>(name) .def(constructor<>()) .def("default_value", &default_value<vector <T> >, return_reference_to(_1)) .def("default_value", &default_value_textual<vector <T> >, return_reference_to(_1)) .def("implicit_value", &implicit_value<vector <T> >, return_reference_to(_1)) .def("implicit_value", &implicit_value_textual<vector <T> >, return_reference_to(_1)) .def("notifier", &notifier<vector<T> >, return_reference_to(_1)) .def("required", &po::typed_value<vector<T> >::required, return_reference_to(_1)) .def("composing", &po::typed_value<vector<T> >::composing, return_reference_to(_1)) .def("multitoken", &po::typed_value<vector<T> >::multitoken, return_reference_to(_1)) ] ] ]; } HALMD_LUA_API int luaopen_libhalmd_utility_lua_program_options(lua_State* L) { using namespace luaponte; module(L, "libhalmd") [ namespace_("program_options") [ class_<po::value_semantic>("value_semantic") .property("name", &po::value_semantic::name) .property("min_tokens", &po::value_semantic::min_tokens) .property("max_tokens", &po::value_semantic::max_tokens) .property("is_composing", &po::value_semantic::is_composing) .property("is_required", &po::value_semantic::is_required) , class_<po::untyped_value, untyped_value_wrapper, po::value_semantic>("untyped_value") .def(constructor<>()) , class_<accumulating_value<int>, accum_value_wrapper<int>, po::value_semantic>("accum_value") .def(constructor<>()) .def("default_value", &accum_default_value<int>, return_reference_to(_1)) .def("default_value", &accum_default_value_textual<int>, return_reference_to(_1)) .def("notifier", &notifier<int>, return_reference_to(_1)) .def("required", &po::typed_value<int>::required, return_reference_to(_1)) , class_<po::option_description, boost::shared_ptr<po::option_description> >("option_description") .def(constructor<char const*, po::value_semantic*>(), adopt(_3)) .def(constructor<char const*, po::value_semantic*, char const*>(), adopt(_3)) .def("key", &po::option_description::key) .property("description", &po::option_description::description) .property("long_name", &po::option_description::long_name) .property("semantic", &po::option_description::semantic) .property("format_name", &po::option_description::format_name) .property("format_parameter", &po::option_description::format_parameter) , class_<po::options_description>("options_description") .def(constructor<>()) .def(constructor<unsigned int>()) .def(constructor<unsigned int, unsigned int>()) .def(constructor<string>()) .def(constructor<string, unsigned int>()) .def(constructor<string, unsigned int, unsigned int>()) .def(tostring(const_self)) .def("add", &add_option) .def("add", &add_options) .property("options", &po::options_description::options) , class_<po::positional_options_description>("positional_options_description") .def(constructor<>()) .def("add", &po::positional_options_description::add) , class_<po::command_line_parser>("command_line_parser") .def(constructor<vector<string> const&>()) .def("options", &po::command_line_parser::options, return_reference_to(_1)) .def("positional", &po::command_line_parser::positional, return_reference_to(_1)) .def("allow_unregistered", &po::command_line_parser::allow_unregistered, return_reference_to(_1)) .def("disallow_guessing", &disallow_guessing, return_reference_to(_1)) .def("group_parser", &group_parser, return_reference_to(_1)) .def("run", &po::command_line_parser::run) , class_<po::parsed_options>("parsed_options") , class_<po::variables_map>("variables_map") .def(constructor<>()) .def("store", &variables_map_store) .def("notify", &variables_map_notify) .def("count", &po::variables_map::count) ] ]; typed_value<bool >(L, "boolean", "value" , "multi_value" ); typed_value<string >(L, "string" , "value" , "multi_value" ); typed_value<int32_t >(L, "int32" , "value" , "multi_value" ); typed_value<int64_t >(L, "int64" , "value" , "multi_value" ); typed_value<uint32_t >(L, "uint32" , "value" , "multi_value" ); typed_value<uint64_t >(L, "uint64" , "value" , "multi_value" ); typed_value<float >(L, "float32", "value" , "multi_value" ); typed_value<double >(L, "float64", "value" , "multi_value" ); typed_value<ublas::vector<int32_t> >(L, "int32" , "value_vector", "multi_value_vector"); typed_value<ublas::vector<int64_t> >(L, "int64" , "value_vector", "multi_value_vector"); typed_value<ublas::vector<uint32_t> >(L, "uint32" , "value_vector", "multi_value_vector"); typed_value<ublas::vector<uint64_t> >(L, "uint64" , "value_vector", "multi_value_vector"); typed_value<ublas::vector<float> >(L, "float32", "value_vector", "multi_value_vector"); typed_value<ublas::vector<double> >(L, "float64", "value_vector", "multi_value_vector"); typed_value<ublas::matrix<int32_t> >(L, "int32" , "value_matrix", "multi_value_matrix"); typed_value<ublas::matrix<int64_t> >(L, "int64" , "value_matrix", "multi_value_matrix"); typed_value<ublas::matrix<uint32_t> >(L, "uint32" , "value_matrix", "multi_value_matrix"); typed_value<ublas::matrix<uint64_t> >(L, "uint64" , "value_matrix", "multi_value_matrix"); typed_value<ublas::matrix<float> >(L, "float32", "value_matrix", "multi_value_matrix"); typed_value<ublas::matrix<double> >(L, "float64", "value_matrix", "multi_value_matrix"); return 0; } } // namespace halmd
the-nic/halmd
halmd/utility/lua/program_options.cpp
C++
gpl-3.0
18,975
# Copyright (C) 2013-2018 The ESPResSo project # Copyright (C) 2012 Olaf Lenz # # This file is part of ESPResSo. # # ESPResSo 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. # # ESPResSo 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/>. # # Check whether all features used in the code are defined # import sys import os sys.path.append(os.path.join(sys.path[0], '..', 'config')) import featuredefs if len(sys.argv) != 2: print("Usage: %s FILE" % sys.argv[0]) exit(2) fdefs = featuredefs.defs(sys.argv[1])
mkuron/espresso
maintainer/check_features.py
Python
gpl-3.0
1,020
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content="Bitergia" > <link rel="shortcut icon" href="../../assets/ico/favicon.png"> <title></title> <!-- Bootstrap core CSS --> <link href="./css/bootstrap.min.css" rel="stylesheet"> <link href="./css/jasny-bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="./css/custom.css" rel="stylesheet"> <!-- icons --> <link rel="stylesheet" href="./css/awesome/css/font-awesome.min.css"> <!-- Type ahead style --> <link href="./css/typeahead.css" rel="stylesheet"> <!-- custom --> <!-- <link rel="stylesheet" href="VizGrimoireJS/custom.css">--> <link rel="stylesheet" type="text/css" id="theme" href="./css/vizgrimoire.css"> </head> <body> <div id="Navbar"></div> <div class="container-fluid"> <div class="row"><span class="SectionBreadcrumb col-md-12"></span></div> <!-- Section HTML will be placed here, do not modify manually --> <!-- REPLACE SECTION HTML --> <div class="row"> <div class="col-md-12"> <div class="wellmin"> <div class="FilterItemData" data-filter="domains"></div> </div> </div> </div> <div class="row"> <div class="FilterDSBlock" data-filter="domains" data-data-source="scm" data-metrics="scm_commits,scm_authors,scm_files"></div> <div class="FilterDSBlock" data-filter="domains" data-data-source="scr" data-metrics="scr_submitted:scr_merged:scr_abandoned,scr_new"></div> <div class="FilterDSBlock" data-filter="domains" data-data-source="its" data-metrics="its_closed:its_opened,its_closers:its_openers,its_changers"></div> <div class="FilterDSBlock" data-filter="domains" data-data-source="mls" data-metrics="mls_sent,mls_senders"></div> <div class="FilterDSBlock" data-filter="domains" data-data-source="irc" data-metrics="irc_sent,irc_senders"></div> <div class="FilterDSBlock" data-filter="domains" data-data-source="qaforums" data-metrics="qaforums_qsent,qsenders,asenders"></div> </div> <!-- END SECTION HTML--> <footer> <div id="Footer"></div> </footer> </div> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="./lib/jquery-1.11.1.min.js"></script> <script src="./lib/jquery.tablesorter.min.js"></script> <script src="./lib/bootstrap-3.1.1.min.js"></script> <script src="./lib/jasny-bootstrap-3.1.3.min.js"></script> <script src="./lib/vizgrimoire.min.js"></script> <script src="./lib/timezones.js"></script> <script src="./lib/filter_panel.js"></script> <script src="./lib/events.js"></script> <script src="./lib/project_comparison.js"></script> <script src="./lib/typeahead.jquery.js"></script> <script src="./lib/search.js"></script> <script type="text/javascript"> $(document).ready(function() { $('.collapse').on('shown.bs.collapse', function(){ $(this).parent().find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"); }).on('hidden.bs.collapse', function(){ $(this).parent().find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"); }); }); </script> <!-- Piwik code will be included here--> <!-- Piwik --> <!-- End Piwik Code --> <!-- End of Piwik code --> </body> </html>
Bitergia/inktank-ceph-dashboard
browser/domain.html
HTML
gpl-3.0
3,671
{% extends "account/base.html" %} {% load i18n %} {% block head_title %}{% trans "Account" %}{% endblock %} {% block content %} <div class="container"> <div class="row"> <div class="box"> <div class="col-lg-12"> <hr> <h2 class="intro-text text-center">{% trans "E-mail Addresses" %}</h2> <hr> <div class="form-group col-md-12"> <div class="jumbotron text-center"> {% if user.emailaddress_set.all %} <p>{% trans 'The following e-mail addresses are associated with your account:' %}</p> <form action="{% url 'account_email' %}" class="email_list" method="post"> {% csrf_token %} <fieldset class="blockLabels"> {% for emailaddress in user.emailaddress_set.all %} <div class="ctrlHolder"> <label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}"> <input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary %}checked="checked"{%endif %} value="{{emailaddress.email}}"/> {{ emailaddress.email }} {% if emailaddress.verified %} <span class="verified">{% trans "Verified" %}</span> {% else %} <span class="unverified">{% trans "Unverified" %}</span> {% endif %} {% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %} </label> </div> {% endfor %} <div class="buttonHolder"> <button class="btn btn-default btn-lg" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button> <button class="btn btn-default btn-lg" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button> <button class="btn btn-default btn-lg" type="submit" name="action_remove" >{% trans 'Remove' %}</button> </div> </fieldset> </form> {% else %} <p><strong>{% trans 'Warning:'%}</strong> {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}</p> {% endif %} <hr /> <h3>{% trans "Add E-mail Address" %}</h3> <form method="post" action="{% url 'account_email' %}" class="add_email"> {% csrf_token %} <div class="input-group"> <span class="input-group-addon">{% trans "email" %}</span> <input class="form-control" id="id_email" type="email" size="30" name="email"> </div> <button name="action_add" class="btn btn-default btn-lg" type="submit">{% trans "Add E-mail" %}</button> </form> </div> </div> <div class="clearfix"></div> </div> </div> </div> </div> {% endblock %} {% block extra_body %} <script type="text/javascript"> (function() { var message = "{% trans 'Do you really want to remove the selected e-mail address?' %}"; var actions = document.getElementsByName('action_remove'); if (actions.length) { actions[0].addEventListener("click", function(e) { if (! confirm(message)) { e.preventDefault(); } }); } })(); </script> {% endblock %}
avaika/avaikame
project/templates/account/email.html
HTML
gpl-3.0
3,666
/* * * This file is part of Tulip (www.tulip-software.org) * * Authors: David Auber and the Tulip development Team * from LaBRI, University of Bordeaux * * Tulip 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. * * Tulip 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. * */ #ifndef GLCOMPLEXPOLYGON_H #define GLCOMPLEXPOLYGON_H #ifdef WIN32 #include <windows.h> #endif #if defined(__APPLE__) #include <OpenGL/gl.h> #include <OpenGL/glu.h> #else #include <GL/gl.h> #include <GL/glu.h> #endif #ifndef CALLBACK #define CALLBACK #endif #include <vector> #include <map> #include <set> #include <tulip/Color.h> #include <tulip/Coord.h> #include <tulip/tulipconf.h> #include <tulip/GlSimpleEntity.h> namespace tlp { typedef struct { GLdouble x, y, z, r, g, b, a; } VERTEX; void CALLBACK beginCallback(GLenum which, GLvoid *polygonData); void CALLBACK errorCallback(GLenum errorCode); void CALLBACK endCallback(GLvoid *polygonData); void CALLBACK vertexCallback(GLvoid *vertex, GLvoid *polygonData); void CALLBACK combineCallback(GLdouble coords[3], VERTEX *d[4], GLfloat w[4], VERTEX** dataOut, GLvoid *polygonData); /** * @ingroup OpenGL * @brief Class to create a complex polygon (concave polygon or polygon with hole) * If you want to create a complex polygon you have 4 constructors : * Constructors with vector of coords : to create a complex polygon without hole * - In this case you have two constructor : with and without outline color * - You can create a polygon like this : * \code * vector <Coord> coords; * coords.push_back(Coord(0,0,0)); * coords.push_back(Coord(10,0,0)); * coords.push_back(Coord(10,10,0)); * coords.push_back(Coord(0,10,0)); * GlComplexPolygon *complexPolygon=new GlComplexPolygon(coords,Color(255,0,0,255)); * layer->addGlEntity(complexPolygon,"complexPolygon"); * \endcode * * Constructors with vector of vector of Coords : to create a complex polygon with hole * - In this case you have two constructor : with and without outline color * - The first vector of coords is the polygon and others vector are holes * - You can create a polygon with hole like this : * \code * vector <vector <Coord> > coords; * vector <Coord> polygon; * vector <Coord> hole; * polygon.push_back(Coord(0,0,0)); * polygon.push_back(Coord(10,0,0)); * polygon.push_back(Coord(10,10,0)); * polygon.push_back(Coord(0,10,0)); * hole.push_back(Coord(4,4,0)); * hole.push_back(Coord(6,4,0)); * hole.push_back(Coord(6,6,0)); * hole.push_back(Coord(4,6,0)); * coords.push_back(polygon); * coords.push_back(hole); * GlComplexPolygon *complexPolygon=new GlComplexPolygon(coords,Color(255,0,0,255)); * layer->addGlEntity(complexPolygon,"complexPolygon"); * \endcode * * In constructors you can specify the polygon border style : polygonEdgesType parameter (0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) * You can also specify the texture name if you want to create a textured complex polygon * * In complex polygon you can add a smooth border : see activateQuadBorder(..) function * And you can specify the texture zoom : see setTextureZoom(...) function */ class TLP_GL_SCOPE GlComplexPolygon : public GlSimpleEntity { friend void CALLBACK beginCallback(GLenum which, GLvoid *polygonData); friend void CALLBACK errorCallback(GLenum errorCode); friend void CALLBACK endCallback(GLvoid *polygonData); friend void CALLBACK vertexCallback(GLvoid *vertex, GLvoid *polygonData); friend void CALLBACK combineCallback(GLdouble coords[3], VERTEX *d[4], GLfloat w[4], VERTEX** dataOut, GLvoid *polygonData); public: /** * @brief Default constructor * @warning don't use this constructor if you want to create a complex polygon, see others constructors */ GlComplexPolygon() {} /** * @brief Constructor with a vector of coords, a fill color, a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want */ GlComplexPolygon(const std::vector<Coord> &coords,Color fcolor,int polygonEdgesType=0,const std::string &textureName = ""); /** * @brief Constructor with a vector of coords, a fill color, an outline color, a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want */ GlComplexPolygon(const std::vector<Coord> &coords,Color fcolor,Color ocolor,int polygonEdgesType=0,const std::string &textureName = ""); /** * @brief Constructor with a vector of vector of coords (the first vector of coord is the polygon and others vectors are holes in polygon), a fill color, a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want */ GlComplexPolygon(const std::vector<std::vector<Coord> >&coords,Color fcolor,int polygonEdgesType=0,const std::string &textureName = ""); /** * @brief Constructor with a vector of vector of coords (the first vector of coord is the polygon and others vectors are holes in polygon), a fill color, an outline color a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want */ GlComplexPolygon(const std::vector<std::vector<Coord> >&coords,Color fcolor,Color ocolor,int polygonEdgesType=0,const std::string &textureName = ""); virtual ~GlComplexPolygon() {} /** * @brief Draw the complex polygon */ virtual void draw(float lod,Camera *camera); /** * @brief Set if the polygon is outlined or not */ void setOutlineMode(const bool); /** * @brief Set size of outline */ void setOutlineSize(double size); /** * @brief Get fill color of GlComplexPolygon */ Color getFillColor() const { return fillColor; } /** * @brief Set fill color of GlComplexPolygon */ void setFillColor(const Color &color) { fillColor=color; } /** * @brief Get outline color of GlComplexPolygon */ Color getOutlineColor() const { return outlineColor; } /** * @brief Set outline color of GlComplexPolygon */ void setOutlineColor(const Color &color) { outlineColor=color; } /** * @brief Get the texture zoom factor */ float getTextureZoom() { return textureZoom; } /** * @brief Set the texture zoom factor * * By default if you have a polygon with a size bigger than (1,1,0) the texture will be repeated * If you want to don't have this texture repeat you have to modify texture zoom * For example if you have a polygon with coords ((0,0,0),(5,0,0),(5,5,0),(0,5,0)) you can set texture zoom to 5. to don't have texture repeat */ void setTextureZoom(float zoom) { textureZoom=zoom; runTesselation(); } /** * @brief Get the textureName */ std::string getTextureName(); /** * @brief Set the textureName */ void setTextureName(const std::string &name); /** * @brief Draw a thick (textured) border around the polygon. * * The graphic card must support geometry shader to make this feature to work. * The position parameter determines the way the border is drawn (depending on the polygon points ordering): * - 0 : the border is drawn outside (or inside) the polygon * - 1 : the border is centered on the polygon outline * - 2 : the border is drawn inside (or outside) the polygon * * The texCoordFactor parameter determines the way the texture is applied : if < 1, the texture will be expanded and > 1, the texture will be compressed * The polygonId parameter determines on which contour of the polygon, the border will be applied */ void activateQuadBorder(const float borderWidth, const Color &color, const std::string &texture = "", const int position = 1, const float texCoordFactor = 1.f, const int polygonId = 0); /** * @brief Desactivate the textured quad border */ void desactivateQuadBorder(const int polygonId = 0); /** * @brief Translate entity */ virtual void translate(const Coord& mouvement); /** * @brief Function to export data and type outString (in XML format) */ virtual void getXML(std::string &outString); /** * @brief Function to export data in outString (in XML format) */ virtual void getXMLOnlyData(std::string &outString); /** * @brief Function to set data with inString (in XML format) */ virtual void setWithXML(const std::string &inString, unsigned int &currentPosition); const std::vector<std::vector<Coord> > &getPolygonSides() const { return points; } protected: /** * @brief Add a new point in polygon */ virtual void addPoint(const Coord& point); /** * @brief Begin a new hole in the polygon */ virtual void beginNewHole(); void runTesselation(); void createPolygon(const std::vector<Coord> &coords,int polygonEdgesType); void startPrimitive(GLenum primitive); void endPrimitive(); void addVertex(const Coord &vertexCoord, const Vec2f &vertexTexCoord); VERTEX *allocateNewVertex(); std::vector<std::vector<Coord> > points; std::vector<std::vector<GLfloat> > pointsIdx; std::set<GLenum> primitivesSet; std::map<GLenum, std::vector<Coord> > verticesMap; std::map<GLenum, std::vector<Vec2f> > texCoordsMap; std::map<GLenum, std::vector<int> >startIndicesMap; std::map<GLenum, std::vector<int> >verticesCountMap; std::vector<VERTEX *> allocatedVertices; GLenum currentPrimitive; int nbPrimitiveVertices; int currentVector; bool outlined; Color fillColor; Color outlineColor; double outlineSize; std::string textureName; float textureZoom; std::vector<bool> quadBorderActivated; std::vector<float> quadBorderWidth; std::vector<Color> quadBorderColor; std::vector<std::string> quadBorderTexture; std::vector<int> quadBorderPosition; std::vector<float> quadBorderTexFactor; }; } #endif
jukkes/TulipProject
library/tulip-ogl/include/tulip/GlComplexPolygon.h
C
gpl-3.0
10,336
#include<cstdio> inline int calc(int n, int m){ int upper = (m-n)/4, lower = 0; if(m > 2*n){ lower = m - 2*n; if(lower % 3 == 0)lower /= 3; else lower = lower/3 + 1; } return upper - lower + 1; } int main(){ int t, n, m; scanf("%d", &t); while(t--){ scanf("%d %d", &n, &m); printf("%d\n", calc(n, m)); } }
tadvent/OnlineJudgeSolutions-Cpp
HDOJ/2566_统计硬币/2566_统计硬币/main.cpp
C++
gpl-3.0
380
from pycddb.dataset import Dataset from lingpy import Wordlist, csv2list from lingpy.compare.partial import _get_slices def prepare(ds): errs = 0 wl = Wordlist(ds.raw('bds.tsv')) W = {} for k in wl: value = wl[k, 'value'] tokens = wl[k, 'tokens'] doc = wl[k, 'doculect'] if value: morphemes = [] for a, b in _get_slices(wl[k, 'tokens']): ipa = ''.join(tokens[a:b]) morphemes += [ipa] ipa = ' '.join(morphemes) clpa = ds.transform(ipa, 'CLPA') struc = ds.transform(ipa, 'Structure') try: assert len(clpa.split(' ')) == len(struc.split(' ')) except: errs += 1 print(errs, clpa, struc) if '«' in clpa: errs += 1 print(errs, ipa, clpa, struc) W[k] = [doc, wl[k, 'concept'], wl[k, 'concepticon_id'], value, clpa, struc, wl[k, 'partial_ids']] W[0] = ['doculect', 'concept', 'concepticon_id', 'value', 'segments', 'structure', 'cogids'] ds.write_wordlist(Wordlist(W)) def inventories(ds): data = csv2list(ds.raw('inv.tsv')) header = data[0] invs = {l: [] for l in ds.languages} for i, line in enumerate(data[1:]): stype, sis, ipa, struc = line[1:5] if len(struc.split()) != len(ipa.split()): print(i+2, 'warn', struc, ' | ', ipa) for l, n in zip(header[5:], line[5:]): if n: note = '' if 'X' else n invs[l] += [[sis, ipa, struc, stype, note]] ds.write_inventories(invs)
digling/cddb
datasets/Allen2007/__init__.py
Python
gpl-3.0
1,690
<?php // content="text/plain; charset=utf-8" /* ** Copyright 2010-2014 Erik Landsness ** This file is part of 360 Feedback. ** ** 360 Feedback 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 any later version. ** ** 360 Feedback 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 360 Feedback. If not, see <http://www.gnu.org/licenses/>. */ require ('config.php'); require_once ('jpgraph/jpgraph.php'); require_once ('jpgraph/jpgraph_radar.php'); // Some data to plot $data = array($_GET['en'], $_GET['cr'], $_GET['tb'], $_GET['st'], $_GET['pr'], $_GET['co']); // Create the graph and the plot $graph = new RadarGraph(800,600); $graph->SetScale('lin',0,20); //$graph->yscale->ticks->Set(10); $graph->axis->HideLine(); $graph->axis->HideTicks(); $graph->axis->HideLabels(); $graph->axis->Hide(); // Add a drop shadow to the graph $graph->SetShadow(); // Create the titles for the axis //$titles = array('Performer', 'Drifter', 'Pleaser', 'Avoider', // 'Commander', 'Attacker'); //$graph->SetTitles($titles); // Add grid lines //$graph->grid->Show(); //$graph->grid->SetLineStyle('solid'); //$graph->grid->SetColor('black'); $plot = new RadarPlot($data); $plot->SetFillColor('forestgreen'); //$plot->SetColor('forestgreen'); //$plot->SetLineWeight(3); // Add the middle labels $txt=new Text("Entrepreneur"); $txt->SetPos(405,200,"center","middle"); $txt->SetFont(FF_ARIAL,FS_NORMAL,14); $txt->SetColor("white"); $graph->AddText($txt); $txt2=new Text("Creator"); $txt2->SetPos(301,279,"center","middle"); $txt2->SetFont(FF_ARIAL,FS_NORMAL,14); $txt2->SetColor("white"); $txt2->SetAngle(59.5); $graph->AddText($txt2); $txt3=new Text("Team Builder"); $txt3->SetPos(312,308,"center","middle"); $txt3->SetFont(FF_ARIAL,FS_NORMAL,14); $txt3->SetColor("white"); $txt3->SetAngle(-59.5); $graph->AddText($txt3); $txt4=new Text("Stabilizer"); $txt4->SetPos(400,420,"center","middle"); $txt4->SetFont(FF_ARIAL,FS_NORMAL,14); $txt4->SetColor("white"); $graph->AddText($txt4); $txt5=new Text("Competitor"); $txt5->SetPos(498,210,"center","middle"); $txt5->SetFont(FF_ARIAL,FS_NORMAL,14); $txt5->SetColor("white"); $txt5->SetAngle(-59.5); $graph->AddText($txt5); $txt6=new Text("Producer"); $txt6->SetPos(500,402,"center","middle"); $txt6->SetFont(FF_ARIAL,FS_NORMAL,14); $txt6->SetColor("white"); $txt6->SetAngle(59.5); $graph->AddText($txt6); //Add bg image $graph->SetBackgroundImage("images/goodchartbg.png",BGIMG_FILLFRAME); // Add the plot and display the graph $graph->Add($plot); $graph->Stroke(); ?>
elandsness/360review
drawgoodgraph.php
PHP
gpl-3.0
2,960
 namespace cmdr.TsiLib.Enums { public enum DeckSize { Micro = 0, Small = 1, Essential = 2, Full = 3, Advanced = 4 } }
TakTraum/cmdr
cmdr/cmdr.TsiLib/Enums/DeckSize.cs
C#
gpl-3.0
191
/* * Copyright appNativa Inc. All Rights Reserved. * * This file is part of the Real-time Application Rendering Engine (RARE). * * RARE 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 com.appnativa.rare.ui; import com.appnativa.rare.ui.RenderableDataItem.HorizontalAlign; import com.appnativa.rare.ui.RenderableDataItem.IconPosition; import com.appnativa.rare.ui.RenderableDataItem.Orientation; import com.appnativa.rare.ui.RenderableDataItem.VerticalAlign; import com.appnativa.rare.ui.painter.iPlatformComponentPainter; import java.util.Map; /** * Interface for components that can be used as renderers * * @author Don DeCoteau */ public interface iRenderingComponent { /** * Sets the component's background color * * @param bg the background color */ public void setBackground(UIColor bg); /** * Sets the component's border * * @param b the border */ public void setBorder(iPlatformBorder b); /** * Sets the component painter for the renderer * * @param cp the component painter for the renderer */ public void setComponentPainter(iPlatformComponentPainter cp); /** * Sets whether the component is enabled * @param enabled true for enabled; false otherwise */ public void setEnabled(boolean enabled); /** * Sets the widget's font * @param font the font for the item */ public void setFont(UIFont font); /** * Sets the component's foreground color * * @param fg the foreground color */ public void setForeground(UIColor fg); /** * Sets the component's icon * * @param icon the component's icon */ public void setIcon(iPlatformIcon icon); /** * Sets the icon position * * @param position the icon position */ public void setIconPosition(IconPosition position); /** * Sets rendering options * * @param options the rendering option */ public void setOptions(Map<String, Object> options); /** * Dispose of the renderer */ void dispose(); /** * Set the alignment for the content * * @param ha the horizontal alignment * @param va the vertical alignment */ void setAlignment(HorizontalAlign ha, VerticalAlign va); /** * Sets the margin for the renderer's content * * @param insets the insets; */ void setMargin(UIInsets insets); /** * Sets the orientation for the content * @param o the orientation */ void setOrientation(Orientation o); /** * Sets whether text is wrapped or not * @param wrap */ void setWordWrap(boolean wrap); /** * Get the component for the renderer * @return the component for the renderer */ iPlatformComponent getComponent(); /** * Removes the render visual elements (text, background, border ,icon) */ void clearRenderer(); void setScaleIcon(boolean scale, float scaleFactor); }
appnativa/rare
source/rare/core/com/appnativa/rare/ui/iRenderingComponent.java
Java
gpl-3.0
3,606
/* test_main.c * * Copyright (C) 2006-2017 wolfSSL Inc. * * This file is part of wolfSSL. * * wolfSSL 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. * * wolfSSL 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-1335, USA */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <wolfssl/wolfcrypt/settings.h> #include <wolfcrypt/test/test.h> #include <stdio.h> typedef struct func_args { int argc; char** argv; int return_code; } func_args; static func_args args = { 0 } ; void main(void) { int test_num = 0; do { printf("\nCrypt Test %d:\n", test_num); wolfcrypt_test(&args); printf("Crypt Test %d: Return code %d\n", test_num, args.return_code); test_num++; } while(args.return_code == 0); } /* SAMPLE OUTPUT: Crypt Test 0: SHA test passed! SHA-256 test passed! SHA-384 test passed! SHA-512 test passed! HMAC-SHA test passed! HMAC-SHA256 test passed! HMAC-SHA384 test passed! HMAC-SHA512 test passed! GMAC test passed! Chacha test passed! POLY1305 test passed! ChaCha20-Poly1305 AEAD test passed! AES test passed! AES-GCM test passed! AES-CCM test passed! RANDOM test passed! RSA test passed! ECC test passed! CURVE25519 test passed! ED25519 test passed! Crypt Test 0: Return code 0 */
yashdsaraf/bb-bot
wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/test_main.c
C
gpl-3.0
1,891
<?php /** * webtrees json-ld: online genealogy json-ld-module. * Copyright (C) 2015 webtrees development team * 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/>. */ namespace bmhm\WebtreesModules\jsonld; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\GedcomRecord; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Media; use Fisharebest\Webtrees\Note; use Fisharebest\Webtrees\Repository; use Fisharebest\Webtrees\Source; /** * Various static function used for JsonLD-output. */ class JsonLDTools { /** * Serialize an object into json. Empty values are stripped * by unsetting the fields. * @param Person $jsonldobject the person (or any other object) to jsonize. * @return GedcomRecord|Individual|Family|Source|Repository|Media|Note the uncluttered object, no null values. */ public static function jsonize($jsonldobject) { if (empty($jsonldobject) || (!is_object($jsonldobject))) { return new Person(true); } /* create a new object, so we don't modify the original one. */ /** @var GedcomRecord|Individual|Family|Source|Repository|Media|Note $returnobj */ $returnobj = clone $jsonldobject; $returnobj = static::emptyObject($returnobj); /* strip empty key/value-pairs */ $returnobj = (object) array_filter((array) $returnobj); return $returnobj; } /** * Unset empty fields from object. * @param GedcomRecord|Individual|Family|Source|Repository|Media|Note|ImageObject|JsonLD_Place $obj * @return ImageObject|Family|GedcomRecord|Individual|Media|Note|Repository|Source|JsonLD_Place */ private static function emptyObject(&$obj) { if (is_array($obj)) { /* * arrays cannot be modified this easily, * a new one is passed for readability. */ $newarray = array(); foreach ($obj as $key => $value) { array_push($newarray, static::emptyObject($value)); } return $newarray; } elseif (is_string($obj) || (is_int($obj))) { /* this is just fine */ return $obj; } $returnobj = clone $obj; foreach (get_object_vars($returnobj) as $key => $value) { if (is_object($value)) { static::emptyObject($returnobj->$key); $value = static::emptyObject($returnobj->$key); } if (is_array($value)) { $returnobj->$key = static::emptyObject($returnobj->$key); } if (empty($value)) { unset($returnobj->{$key}); } } return $returnobj; } /** * For a given person object (re-)set the fields with sane * values from a gedcom-record. * @return Person * @var Individual $individual * @var Person $person */ public static function fillPersonFromRecord($person, $individual) { /* check if record exists */ if (empty($individual)) { return $person; } $person->name = $individual->getAllNames()[$individual->getPrimaryName()]['fullNN']; $person->givenName = $individual->getAllNames()[$individual->getPrimaryName()]['givn']; $person->familyName = $individual->getAllNames()[$individual->getPrimaryName()]['surn']; // $person->familyName = $record->getAllNames()[$record->getPrimaryName()]['surname']; $person->gender = $individual->sex(); $person->setId($individual->url()); /* Dates */ // XXX: match beginning and end of string, doesn't seem to work. $birthdate = $individual->getBirthDate()->display(false, '%Y-%m-%d', false); if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $birthdate) === 1) { $person->birthDate = strip_tags($birthdate); } elseif (preg_match('/between/', $birthdate)) { $person->birthDate = strip_tags($individual->getBirthDate()->maximumDate()->format('%Y') . '/' . $individual->getBirthDate()->maximumDate()->format('%Y')); } $deathDate = $individual->getDeathDate()->display(false, '%Y-%m-%d', false); if (preg_match('/[0-9]{4}-[0-9][0-9]-[0-9][0-9]/', $deathDate) === 1) { $person->deathDate = strip_tags($deathDate); } elseif (preg_match('/between/', $deathDate)) { $person->deathDate = strip_tags($individual->getDeathDate()->maximumDate()->format('%Y') . '/' . $individual->getDeathDate()->maximumDate()); } /* add highlighted image */ if ($individual->findHighlightedMediaFile()) { $person->image = static::createMediaObject($individual->findHighlightedMediaFile()); $person->image = static::emptyObject($person->image); } // TODO: Get place object. if ($individual->getBirthPlace()->url()) { $person->birthPlace = new JsonLD_Place(); $person->birthPlace->name = $individual->getBirthPlace(); $person->birthPlace->setId($individual->getBirthPlace()); $person->birthPlace = static::emptyObject($person->birthPlace); } if ($individual->getDeathPlace()->url()) { $person->deathPlace = new JsonLD_Place(); $person->deathPlace->name = $individual->getDeathPlace(); $person->deathPlace->setId($individual->getDeathPlace()); $person->deathPlace = static::emptyObject($person->deathPlace); } /* * TODO: Add spouse, etc. */ return $person; } /** * @param Media $media * @return ImageObject */ private static function createMediaObject($media) { $imageObject = new ImageObject(); if (empty($media)) { return $imageObject; } $imageObject->contentUrl = WT_BASE_URL . $media->getHtmlUrlDirect(); $imageObject->name = $media->getAllNames()[$media->getPrimaryName()]['fullNN']; // [0]=width [1]=height [2]=filetype ['mime']=mimetype $imageObject->width = $media->getImageAttributes()[0]; $imageObject->height = $media->getImageAttributes()[1]; $imageObject->description = strip_tags($media->getFullName()); $imageObject->thumbnailUrl = WT_BASE_URL . $media->getHtmlUrlDirect('thumb'); $imageObject->setId($media->getAbsoluteLinkUrl()); $imageObject->thumbnail = new ImageObject(); $imageObject->thumbnail->contentUrl = WT_BASE_URL . $media->getHtmlUrlDirect('thumb'); $imageObject->thumbnail->width = $media->getImageAttributes('thumb')[0]; $imageObject->thumbnail->height = $media->getImageAttributes('thumb')[1]; $imageObject->thumbnail->setId($media->getAbsoluteLinkUrl()); $imageObject->thumbnail = static::emptyObject($imageObject->thumbnail); return $imageObject; } /** * Adds parents to a person, taken from the supplied record. * @return Person * @var GedcomRecord|Individual $record the person's gedcom record. * @var Person $person the person where parents should be added to. */ public static function addParentsFromRecord($person, $record) { if (empty($record)) { return $person; } if (empty($record->primaryChildFamily())) { return $person; } $parentFamily = $record->primaryChildFamily(); if (!$parentFamily) { /* No family, no parents to be added */ return $person; } $husbandInd = $parentFamily->husband(); if ($husbandInd && $husbandInd->canShow()) { Auth::checkIndividualAccess($husbandInd); $husband = new Person(); $husband = static::fillPersonFromRecord($husband, $husbandInd); $person->addParent($husband); } $wifeInd = $parentFamily->wife(); if ($wifeInd && $wifeInd->canShow()) { Auth::checkIndividualAccess($wifeInd); $wife = new Person(); $wife = static::fillPersonFromRecord($wife, $wifeInd); $person->addParent($wife); } return $person; } /** * @param Person $person * @param Individual $record * @return mixed */ public static function addChildrenFromRecord($person, $record) { if (empty($record)) { return $person; } if (empty($record->spouseFamilies())) { return $person; } /** @var Individual[] $children */ $children = array(); /* we need a unique array first */ foreach ($record->spouseFamilies() as $fam) { foreach ($fam->children() as $child) { $children[$child->getXref()] = $child; } } foreach ($children as $child) { if (!$child->canShow()) { continue; } Auth::checkIndividualAccess($child); $childPerson = new Person(); $childPerson = static::fillPersonFromRecord($childPerson, $child); $person->addChild($childPerson); } return $person; } }
bmhm/webtrees-jsonld
src/jsonld/JsonLDTools.php
PHP
gpl-3.0
9,887
/* * Copyright (C) 2010-2014 JPEXS, All rights reserved. * * This 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.0 of the License, or (at your option) any later version. * * This 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 this library. */ package com.jpexs.decompiler.flash.action.swf4; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.ActionGraphSource; import com.jpexs.decompiler.flash.action.ActionList; import com.jpexs.decompiler.flash.action.parser.ActionParseException; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.graph.GraphSource; import com.jpexs.helpers.Helper; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.List; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; public class ActionJump extends Action { private int offset; public String identifier; public boolean isContinue = false; public boolean isBreak = false; public int getJumpOffset() { return offset; } public final void setJumpOffset(int offset) { this.offset = offset; } public ActionJump(int offset) { super(0x99, 2); setJumpOffset(offset); } public ActionJump(int actionLength, SWFInputStream sis) throws IOException { super(0x99, actionLength); setJumpOffset(sis.readSI16("offset")); } @Override public void getRef(Set<Long> refs) { refs.add(getAddress() + getTotalActionLength() + offset); } @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); try { sos.writeSI16(offset); sos.close(); } catch (IOException e) { throw new Error("This should never happen.", e); } return surroundWithAction(baos.toByteArray(), version); } @Override public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) { long address = getAddress() + getTotalActionLength() + offset; String ofsStr = Helper.formatAddress(address); return "Jump loc" + ofsStr; } public ActionJump(FlasmLexer lexer) throws IOException, ActionParseException { super(0x99, 2); identifier = lexIdentifier(lexer); } @Override public String toString() { return "Jump " + offset; } @Override public boolean isJump() { return true; } @Override public List<Integer> getBranches(GraphSource code) { List<Integer> ret = super.getBranches(code); int version = ((ActionGraphSource) code).version; int length = getBytesLength(version); int ofs = code.adr2pos(getAddress() + length + offset); if (ofs == -1) { ofs = code.adr2pos(getAddress() + length); Logger.getLogger(ActionJump.class.getName()).log(Level.SEVERE, "Invalid jump to ofs" + Helper.formatAddress(getAddress() + length + offset) + " from ofs" + Helper.formatAddress(getAddress())); } ret.add(ofs); return ret; } }
realmaster42/jpexs-decompiler
libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java
Java
gpl-3.0
3,865
<h3>Publicaciones relacionadas</h3> <p><b>Análisis Publicados</b></p> <ul> <li><a href="http://www.trcimplan.gob.mx/blog/torreon-municipio-competitivo-segun-datos-del-imco.html">Torre&oacute;n, municipio competitivo seg&uacute;n datos del IMCO</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/la-laguna-recupera-competitividad.html">La Laguna recupera competitividad</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/el-corredor-economico-del-norte-y-su-fortaleza-nacional.html">El Corredor Econ&oacute;mico del Norte y su fortaleza nacional</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/torreon-aumenta-su-competitividad-aerea.html">Torre&oacute;n aumenta su competitividad a&eacute;rea</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/balance-2015-repunte-de-la-competitividad-en-la-laguna.html">Balance 2015: repunte de la competitividad en La Laguna</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/balance-economico-2017.html">Balance Econ&oacute;mico de La Laguna en el 2017</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/implicaciones-de-la-reforma-fiscal-de-estados-unidos-en-la-zml.html">Implicaciones de la Reforma Fiscal de Estados Unidos en la ZML</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/se-mantiene-el-mercado-laboral-pero-sube-la-inflacion-en-la-laguna.html">Se mantiene el mercado laboral, pero sube la inflaci&oacute;n en La Laguna</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/evolucion-del-mercado-hipotecario-en-torreon-2015-12.html">Evoluci&oacute;n del mercado hipotecario en Torre&oacute;n (diciembre 2015)</a></li> <li><a href="http://www.trcimplan.gob.mx/blog/balance-del-tercer-trimestre-en-la-economia-de-la-laguna.html">Balance del tercer trimestre en la econom&iacute;a de La Laguna</a></li> </ul> <p><b>Sistema Metropolitano de Indicadores</b></p> <ul> <li><a href="http://www.trcimplan.gob.mx/indicadores-gomez-palacio/economia-cartera-hipotecaria-vencida.html">Cartera Hipotecaria Vencida en G&oacute;mez Palacio</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-gomez-palacio/economia-crecimiento-del-salario-promedio.html">Crecimiento del Salario Promedio en G&oacute;mez Palacio</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-gomez-palacio/economia-sectores-que-han-presentado-alto-crecimiento.html">Sectores que Han Presentado Alto Crecimiento en G&oacute;mez Palacio</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-gomez-palacio/economia-ciudad-fronteriza-o-portuaria.html">Ciudad Fronteriza o Portuaria en G&oacute;mez Palacio</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-gomez-palacio/economia-tamano-del-mercado-hipotecario.html">Tama&ntilde;o del Mercado Hipotecario en G&oacute;mez Palacio</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-gomez-palacio/economia-crecimiento-del-pib-estatal.html">Crecimiento del PIB Estatal en G&oacute;mez Palacio</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-gomez-palacio/economia-credito-a-las-empresas.html">Cr&eacute;dito a las Empresas en G&oacute;mez Palacio</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-matamoros/economia-crecimiento-del-pib-estatal.html">Crecimiento del PIB Estatal en Matamoros</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-la-laguna/economia-sectores-que-han-presentado-alto-crecimiento.html">Sectores que Han Presentado Alto Crecimiento en La Laguna</a></li> <li><a href="http://www.trcimplan.gob.mx/indicadores-torreon/economia-sectores-que-han-presentado-alto-crecimiento.html">Sectores que Han Presentado Alto Crecimiento en Torre&oacute;n</a></li> </ul> <p><b>Plan Estratégico Torreón</b></p> <ul> <li><a href="http://www.trcimplan.gob.mx/proyectos/salud-laguna.html">Salud Laguna</a></li> </ul> <p><b>Sala de Prensa</b></p> <ul> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2016-09-07-indice-de-competitividad-urbana.html">&Iacute;ndice de Competitividad Urbana 2016</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2018-11-29-imco-2018.html">Posici&oacute;n de La Laguna en el &Iacute;ndice de Competitividad Urbana 2018</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2020-04-15-comunicado-conferencias-virtuales.html">El IMPLAN Torre&oacute;n y su Consejo Juvenil: Visi&oacute;n Metr&oacute;poli, presentar&aacute;n Conferencias Virtuales</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2020-02-27-segunda-sesion-consejo-2020.html">Presentan en Segunda Sesi&oacute;n de Consejo el &ldquo;Programa Parcial de Desarrollo Urbano para la Zona Norte de Torre&oacute;n&rdquo;</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2020-02-17-comunicado-enoe.html">Disminuye la tasa de desempleo en la Zona Metropolitana de La Laguna (ZML), al cuarto trimestre de 2019</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2020-02-06-comunicado-conferencia-imeplan.html">Postura sobre la creaci&oacute;n de un Instituto Metropolitano de Planeaci&oacute;n.</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2020-01-30-primer-sesion-consejo-2020.html">Primer Sesi&oacute;n de Consejo 2020. Se renueva el Consejo Directivo del IMPLAN.</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2019-09-26-novena-sesion-consejo.html">Novena Sesi&oacute;n de Consejo Implan. Presentan Resultados del Conversatorio y del Concurso &ldquo;Manos a la Cebra&rdquo;.</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2019-09-26-seminario-identidad-lagunera.html">Consejo Visi&oacute;n Metr&oacute;poli presenta Seminario de Identidad Lagunera</a></li> <li><a href="http://www.trcimplan.gob.mx/sala-prensa/2019-09-24-manos-a-la-cebra-reporte.html">Manos a la Cebra</a></li> </ul>
TRCIMPLAN/trcimplan.github.io
include/extra/indicadores-gomez-palacio/economia-diversificacion-economica.html
HTML
gpl-3.0
5,812
-- @description Nudge selected items volume up by 1 db -- @version 1.0 -- @author me2beats -- @changelog -- + init local db = 1 local r = reaper; function nothing() end; function bla() r.defer(nothing) end local items = r.CountSelectedMediaItems(0) if items > 0 then db = tonumber(db) if db then r.Undo_BeginBlock(); r.PreventUIRefresh(111) for j = 0, items-1 do local it = r.GetSelectedMediaItem(0, j) it_vol = r.GetMediaItemInfo_Value(it, 'D_VOL') r.SetMediaItemInfo_Value(it, 'D_VOL', it_vol*10^(0.05*db)) r.UpdateItemInProject(it) end r.PreventUIRefresh(-111); r.Undo_EndBlock('Nudge sel items volume up by 1 db', -1) else bla() end else bla() end
me2beats/reapack
Items/me2beats_Nudge selected items volume up by 1 db.lua
Lua
gpl-3.0
710
/** * */ define([ 'jquery', 'Magento_Ui/js/modal/alert', 'Magento_Ui/js/modal/confirm', 'mage/translate' ], function ($, alert, confirmation, $t) { 'use strict'; var confirmModal = function (title, msg,onOkay,onCancel) { var emptyFunc = function (){ }; title = title | 'Confirmation Question Dialog'; onOkay = typeof onOkay === 'function' ? onOkay : emptyFunc; onCancel = typeof onCancel === 'function' ? onCancel : emptyFunc; var modal = confirmation({ title: title, content: msg, actions: { confirm: onOkay, cancel: onCancel, always: emptyFunc }, autoOpen : true, clickableOverlay : false }); }; return function (config, element) { var alertModal = function(title, message) { alert({ title: $.mage.__("!"+title), content: $.mage.__(message), autoOpen: true, clickableOverlay: false, focus: "", actions: { always: function(){ } } }); }; $(element).click(function(){ console.log(config); var url = config.url+'&zip=1'; var reload = config['update-svg-url']; var returnUri = window.location.href; reload += '&return-uri=' + encodeURIComponent(returnUri); if(url != '#') { $.ajax({ url: url, type: 'GET', beforeSend: function() { $('body').trigger('processStart'); }, success : function(_res) { $('body').trigger('processStop'); if(typeof _res === 'object') { var res = _res; } else { res = $.parseJSON(_res); } var data = res.data; if(res.status === 'success') { window.location.href = data.baseUrl + '' + data.file; } else { if(res.message) { var msg = res.message; }else{ msg = 'Cant zip design , the source SVG file missing.'; } if(res.errorCode && res.errorCode === 15) { msg += '<br /><strong>We need create it again from Design Editor . Press "<span style="color: #0fa7ff">OK</span>" then just wait , all done automatically !.</strong>'; confirmModal('Error',$t(msg), function () { window.location.href = reload; }); }else{ alertModal('Error', $t(msg)); } } }, error: function(xhr, ajaxOptions, thrownError){ $('body').trigger('processStop'); // alertModal('error', thrownError); if(xhr.responseJSON && xhr.responseJSON.message) { var msg = xhr.responseJSON.message; }else{ msg = 'Cant zip design , the source SVG file missing.'; } if(xhr.responseJSON && xhr.responseJSON.errorCode && xhr.responseJSON.errorCode === 15) { msg += '<br /><strong>We need create it again from Design Editor . Press "<span style="color: #0fa7ff">OK</span>" then just wait , all done automatically !.</strong>'; confirmModal('Error',$t(msg), function () { window.location.href = reload; }); }else{ alertModal('Error', $t(msg)); } } }); } else { alertModal('error', 'can\'t zip design'); } }); }; });
magebay99/magento2-product-designer-tools
app/code/PDP/Integration/view/adminhtml/web/js/pdp.js
JavaScript
gpl-3.0
4,000
/** * Attempts to try a function repeatedly until either success or max number of tries has been reached. * * @param {Function} toTry The function to try repeatedly. Thrown errors cause a retry. This function returns a Promise. * @param {number} max The maximum number of function retries. * @param {number} delay The base delay in ms. This doubles after every attempt. * @param {Function} [predicate] A function to filter errors against. It receives error objects * and must return true if the error is to be retried. * @return {Promise} Rejects when toTry has failed max times. Resolves if successful once. */ function exponentialBackoff(toTry, max, delay, predicate) { return toTry().catch((err) => { if (max <= 0) { return Promise.reject(err); } if (predicate == null || predicate(err)) { // This delays the Promise by delay. return new Promise((resolve) => setTimeout(resolve, delay)) .then(() => { return exponentialBackoff(toTry, --max, delay * 2); }); } else { return Promise.reject(err); } }); } module.exports = exponentialBackoff;
coe-google-apps-support/DriveTransfer
local_modules/shared/util/exponential-backoff.js
JavaScript
gpl-3.0
1,132
/* * ExifProcessingException.java * * This class is public domain software - that is, you can do whatever you want * with it, and include it software that is licensed under the GNU or the * BSD license, or whatever other licence you choose, including proprietary * closed source licenses. I do ask that you leave this header in tact. * * If you make modifications to this code that you think would benefit the * wider community, please send me a copy and I'll post it on my site. * * If you make use of this code, I'd appreciate hearing about it. * drew@drewnoakes.com * Latest version of this software kept at * http://drewnoakes.com/ * * Created on 29 April 2002, 00:33 */ package com.drewChanged.metadata.iptc; import com.drewChanged.metadata.MetadataException; /** * The exception type raised during reading of Iptc data in the instance of * unexpected data conditions. * @author Drew Noakes http://drewnoakes.com */ public class IptcProcessingException extends MetadataException { /** * Constructs an instance of <code>ExifProcessingException</code> with the * specified detail message. * @param message the detail message */ public IptcProcessingException(String message) { super(message); } /** * Constructs an instance of <code>IptcProcessingException</code> with the * specified detail message and inner exception. * @param message the detail message * @param cause an inner exception */ public IptcProcessingException(String message, Throwable cause) { super(message, cause); } }
aripollak/PictureMap
libs/src/com/drewChanged/metadata/iptc/IptcProcessingException.java
Java
gpl-3.0
1,665
/*******************************************************************************/ /* */ /* X r d C o n f i g . c c */ /* */ /* (c) 2011 by the Board of Trustees of the Leland Stanford, Jr., University */ /* Produced by Andrew Hanushevsky for Stanford University under contract */ /* DE-AC02-76-SFO0515 with the Deprtment of Energy */ /* */ /* This file is part of the XRootD software suite. */ /* */ /* XRootD 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. */ /* */ /* XRootD 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 XRootD in a file called COPYING.LESSER (LGPL license) and file */ /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ /* */ /* The copyright holder's institutional names and contributor's names may not */ /* be used to endorse or promote products derived from this software without */ /* specific prior written permission of the institution or contributor. */ /******************************************************************************/ /* The default port number comes from: 1) The command line option, 2) The config file, 3) The /etc/services file for service corresponding to the program name. */ #include <unistd.h> #include <ctype.h> #include <pwd.h> #include <string.h> #include <stdio.h> #include <sys/param.h> #include <sys/resource.h> #include <sys/types.h> #include <sys/stat.h> #include "XrdVersion.hh" #include "Xrd/XrdConfig.hh" #include "Xrd/XrdInfo.hh" #include "Xrd/XrdLink.hh" #include "Xrd/XrdPoll.hh" #include "Xrd/XrdStats.hh" #include "XrdNet/XrdNetAddr.hh" #include "XrdNet/XrdNetIF.hh" #include "XrdNet/XrdNetSecurity.hh" #include "XrdNet/XrdNetUtils.hh" #include "XrdOuc/XrdOuca2x.hh" #include "XrdOuc/XrdOucEnv.hh" #include "XrdOuc/XrdOucSiteName.hh" #include "XrdOuc/XrdOucStream.hh" #include "XrdOuc/XrdOucUtils.hh" #include "XrdSys/XrdSysHeaders.hh" #include "XrdSys/XrdSysTimer.hh" #include "XrdSys/XrdSysUtils.hh" #ifdef __linux__ #include <netinet/tcp.h> #endif #ifdef __APPLE__ #include <AvailabilityMacros.h> #endif /******************************************************************************/ /* S t a t i c O b j e c t s */ /******************************************************************************/ const char *XrdConfig::TraceID = "Config"; namespace XrdNetSocketCFG { extern int ka_Idle; extern int ka_Itvl; extern int ka_Icnt; }; /******************************************************************************/ /* d e f i n e s */ /******************************************************************************/ #define TS_Xeq(x,m) if (!strcmp(x,var)) return m(eDest, Config); #ifndef S_IAMB #define S_IAMB 0x1FF #endif /******************************************************************************/ /* L o c a l C l a s s e s */ /******************************************************************************/ /******************************************************************************/ /* X r d C o n f i g P r o t */ /******************************************************************************/ class XrdConfigProt { public: XrdConfigProt *Next; char *proname; char *libpath; char *parms; int port; int wanopt; XrdConfigProt(char *pn, char *ln, char *pp, int np=-1, int wo=0) {Next = 0; proname = pn; libpath = ln; parms = pp; port=np; wanopt = wo; } ~XrdConfigProt() {free(proname); if (libpath) free(libpath); if (parms) free(parms); } }; /******************************************************************************/ /* C o n s t r u c t o r */ /******************************************************************************/ XrdConfig::XrdConfig() : Log(&Logger, "Xrd"), Trace(&Log), Sched(&Log, &Trace), BuffPool(&Log, &Trace) { // Preset all variables with common defaults // PortTCP = -1; PortUDP = -1; PortWAN = 0; ConfigFN = 0; myInsName= 0; mySitName= 0; AdminPath= strdup("/tmp"); AdminMode= 0700; Police = 0; Net_Blen = 0; // Accept OS default (leave Linux autotune in effect) Net_Opts = XRDNET_KEEPALIVE; Wan_Blen = 1024*1024; // Default window size 1M Wan_Opts = XRDNET_KEEPALIVE; repDest[0] = 0; repDest[1] = 0; repInt = 600; repOpts = 0; ppNet = 0; NetTCPlep = -1; NetADM = 0; coreV = 1; memset(NetTCP, 0, sizeof(NetTCP)); Firstcp = Lastcp = 0; ProtInfo.eDest = &Log; // Stable -> Error Message/Logging Handler ProtInfo.NetTCP = 0; // Stable -> Network Object ProtInfo.BPool = &BuffPool; // Stable -> Buffer Pool Manager ProtInfo.Sched = &Sched; // Stable -> System Scheduler ProtInfo.ConfigFN= 0; // We will fill this in later ProtInfo.Stats = 0; // We will fill this in later ProtInfo.Trace = &Trace; // Stable -> Trace Information ProtInfo.AdmPath = AdminPath; // Stable -> The admin path ProtInfo.AdmMode = AdminMode; // Stable -> The admin path mode ProtInfo.Reserved= 0; // Use to be the Thread Manager ProtInfo.Format = XrdFORMATB; ProtInfo.WANPort = 0; ProtInfo.WANWSize = 0; ProtInfo.WSize = 0; ProtInfo.ConnMax = -1; // Max connections (fd limit) ProtInfo.readWait = 3*1000; // Wait time for data before we reschedule ProtInfo.idleWait = 0; // Seconds connection may remain idle (0=off) ProtInfo.hailWait =30*1000; // Wait time for data before we drop connection ProtInfo.DebugON = 0; // 1 if started with -d ProtInfo.argc = 0; ProtInfo.argv = 0; XrdNetAddr::SetCache(3*60*60); // Cache address resolutions for 3 hours } /******************************************************************************/ /* C o n f i g u r e */ /******************************************************************************/ int XrdConfig::Configure(int argc, char **argv) { /* Function: Establish configuration at start up time. Input: None. Output: 0 upon success or !0 otherwise. */ const char *xrdInst="XRDINSTANCE="; int retc, NoGo = 0, clPort = -1, optbg = 0; const char *temp; char c, buff[512], *dfltProt, *libProt = 0, *logfn = 0; uid_t myUid = 0; gid_t myGid = 0; extern char *optarg; extern int optind, opterr; int pipeFD[2] = {-1, -1}; const char *pidFN = 0; static const int myMaxc = 80; char *myArgv[myMaxc], argBuff[myMaxc*3+8]; char *argbP = argBuff, *argbE = argbP+sizeof(argBuff)-4; char *ifList = 0; int myArgc = 1, bindArg = 1; bool ipV4 = false, ipV6 = false, pureLFN = false; // Obtain the protocol name we will be using // retc = strlen(argv[0]); while(retc--) if (argv[0][retc] == '/') break; myProg = dfltProt = &argv[0][retc+1]; // Setup the initial required protocol. The program name matches the protocol // name but may be arbitrarily suffixed. We need to ignore this suffix. So we // look for it here and it it exists we duplicate argv[0] (yes, loosing some // bytes - sorry valgrind) without the suffix. // if (*dfltProt != '.' ) {char *p = dfltProt; while (*p && *p != '.') p++; if (*p == '.') {*p = '\0'; dfltProt = strdup(dfltProt); *p = '.';} } myArgv[0] = argv[0]; // Process the options. Note that we cannot passthrough long options or // options that take arguments because getopt permutes the arguments. // opterr = 0; if (argc > 1 && '-' == *argv[1]) while ((c = getopt(argc,argv,":bc:dhHI:k:l:L:n:p:P:R:s:S:vz")) && ((unsigned char)c != 0xff)) { switch(c) { case 'b': optbg = 1; break; case 'c': if (ConfigFN) free(ConfigFN); ConfigFN = strdup(optarg); break; case 'd': Trace.What |= TRACE_ALL; ProtInfo.DebugON = 1; XrdOucEnv::Export("XRDDEBUG", "1"); break; case 'h': Usage(0); break; case 'H': Usage(-1); break; case 'I': if (!strcmp("v4", optarg)) {ipV4 = true; ipV6 = false;} else if (!strcmp("v6", optarg)) {ipV4 = false; ipV6 = true;} else {Log.Emsg("Config", "Invalid -I argument -",optarg); Usage(1); } break; case 'k': if (!(bindArg = Log.logger()->ParseKeep(optarg))) {Log.Emsg("Config","Invalid -k argument -",optarg); Usage(1); } break; case 'l': if ((pureLFN = *optarg == '=')) optarg++; if (!*optarg) {Log.Emsg("Config", "Logfile name not specified."); Usage(1); } if (logfn) free(logfn); logfn = strdup(optarg); break; case 'L': if (!*optarg) {Log.Emsg("Config", "Protocol library path not specified."); Usage(1); } if (libProt) free(libProt); libProt = strdup(optarg); break; case 'n': myInsName = (!strcmp(optarg,"anon")||!strcmp(optarg,"default") ? 0 : optarg); break; case 'p': if ((clPort = yport(&Log, "tcp", optarg)) < 0) Usage(1); break; case 'P': dfltProt = optarg; break; case 'R': if (!(getUG(optarg, myUid, myGid))) Usage(1); break; case 's': pidFN = optarg; break; case 'S': mySitName = optarg; break; case ':': buff[0] = '-'; buff[1] = optopt; buff[2] = 0; Log.Emsg("Config", buff, "parameter not specified."); Usage(1); break; case 'v': cerr <<XrdVSTRING <<endl; _exit(0); break; case 'z': Log.logger()->setHiRes(); break; default: if (optopt == '-' && *(argv[optind]+1) == '-') {Log.Emsg("Config", "Long options are not supported."); Usage(1); } if (myArgc >= myMaxc || argbP >= argbE) {Log.Emsg("Config", "Too many command line arguments."); Usage(1); } myArgv[myArgc++] = argbP; *argbP++ = '-'; *argbP++ = optopt; *argbP++ = 0; break; } } // The first thing we must do is to set the correct networking mode // if (ipV4) XrdNetAddr::SetIPV4(); else if (ipV6) XrdNetAddr::SetIPV6(); // Set the site name if we have one // if (mySitName) mySitName = XrdOucSiteName::Set(mySitName, 63); // Drop into non-privileged state if so requested // if (myGid && setegid(myGid)) {Log.Emsg("Config", errno, "set effective gid"); exit(17);} if (myUid && seteuid(myUid)) {Log.Emsg("Config", errno, "set effective uid"); exit(17);} // Pass over any parameters // if (argc-optind+2 >= myMaxc) {Log.Emsg("Config", "Too many command line arguments."); Usage(1); } for ( ; optind < argc; optind++) myArgv[myArgc++] = argv[optind]; myArgv[myArgc] = 0; ProtInfo.argc = myArgc; ProtInfo.argv = myArgv; // Resolve background/foreground issues // if (optbg) { #ifdef WIN32 XrdOucUtils::Undercover(&Log, !logfn); #else if (pipe( pipeFD ) == -1) {Log.Emsg("Config", errno, "create a pipe"); exit(17);} XrdOucUtils::Undercover(Log, !logfn, pipeFD); #endif } // Bind the log file if we have one // if (logfn) {char *lP; if (!pureLFN && !(logfn = XrdOucUtils::subLogfn(Log,myInsName,logfn))) _exit(16); Log.logger()->AddMsg(XrdBANNER); if (Log.logger()->Bind(logfn, bindArg)) exit(19); if ((lP = rindex(logfn,'/'))) {*(lP+1) = '\0'; lP = logfn;} else lP = (char *)"./"; XrdOucEnv::Export("XRDLOGDIR", lP); } // Get the full host name. In theory, we should always get some kind of name. // We must define myIPAddr here because we may need to run in v4 mode and // that doesn't get set until after the options are scanned. // static XrdNetAddr *myIPAddr = new XrdNetAddr((int)0); if (!(myName = myIPAddr->Name(0, &temp))) {Log.Emsg("Config", "Unable to determine host name; ", (temp ? temp : "reason unknown"), "; execution terminated."); _exit(16); } // Verify that we have a real name. We've had problems with people setting up // bad /etc/hosts files that can cause connection failures if "allow" is used. // Otherwise, determine our domain name. // if (!myIPAddr->isRegistered()) {Log.Emsg("Config",myName,"does not appear to be registered in the DNS."); Log.Emsg("Config","Verify that the '/etc/hosts' file is correct and " "this machine is registered in DNS."); Log.Emsg("Config", "Execution continues but connection failures may occur."); myDomain = 0; } else if (!(myDomain = index(myName, '.'))) Log.Say("Config warning: this hostname, ", myName, ", is registered without a domain qualification."); // Get our IP address and FQN // ProtInfo.myName = myName; ProtInfo.myAddr = myIPAddr->SockAddr(); ProtInfo.myInst = XrdOucUtils::InstName(myInsName); ProtInfo.myProg = myProg; // Set the Environmental variable to hold the instance name // XRDINSTANCE=<pgm> <instance name>@<host name> // XrdOucEnv::Export("XRDINSTANCE") // sprintf(buff,"%s%s %s@%s", xrdInst, myProg, ProtInfo.myInst, myName); myInstance = strdup(buff); putenv(myInstance); // XrdOucEnv::Export("XRDINSTANCE",...) myInstance += strlen(xrdInst); XrdOucEnv::Export("XRDHOST", myName); XrdOucEnv::Export("XRDNAME", ProtInfo.myInst); XrdOucEnv::Export("XRDPROG", myProg); XrdNetIF::SetMsgs(&Log); // Put out the herald // strcpy(buff, "Starting on "); retc = strlen(buff); XrdSysUtils::FmtUname(buff+retc, sizeof(buff)-retc); Log.Say(0, buff); Log.Say(XrdBANNER); // Setup the initial required protocol. // Firstcp = Lastcp = new XrdConfigProt(strdup(dfltProt), libProt, 0); // Let start it up! // Log.Say("++++++ ", myInstance, " initialization started."); // Process the configuration file, if one is present // if (ConfigFN && *ConfigFN) {Log.Say("Config using configuration file ", ConfigFN); ProtInfo.ConfigFN = ConfigFN; setCFG(); NoGo = ConfigProc(); } if (clPort >= 0) PortTCP = clPort; if (ProtInfo.DebugON) {Trace.What = TRACE_ALL; XrdSysThread::setDebug(&Log); } // Export the network interface list at this point // if (ppNet && XrdNetIF::GetIF(ifList, 0, true)) XrdOucEnv::Export("XRDIFADDRS",ifList); // Configure network routing // if (!XrdInet::netIF.SetIF(myIPAddr, ifList)) {Log.Emsg("Config", "Unable to determine interface addresses!"); NoGo = 1; } // Now initialize the default protocl // if (!NoGo) NoGo = Setup(dfltProt); // If we hae a net name change the working directory // if (myInsName) XrdOucUtils::makeHome(Log, myInsName); // if we call this it means that the daemon has forked and we are // in the child process #ifndef WIN32 if (optbg) { if (pidFN && !XrdOucUtils::PidFile(Log, pidFN ) ) NoGo = 1; int status = NoGo ? 1 : 0; if(write( pipeFD[1], &status, sizeof( status ) )) {}; close( pipeFD[1]); } #endif // Establish a pid/manifest file for auto-collection // if (!NoGo) Manifest(pidFN); // All done, close the stream and return the return code. // temp = (NoGo ? " initialization failed." : " initialization completed."); sprintf(buff, "%s:%d", myInstance, PortTCP); Log.Say("------ ", buff, temp); if (logfn) {strcat(buff, " running "); retc = strlen(buff); XrdSysUtils::FmtUname(buff+retc, sizeof(buff)-retc); Log.logger()->AddMsg(buff); free(logfn); } return NoGo; } /******************************************************************************/ /* C o n f i g X e q */ /******************************************************************************/ int XrdConfig::ConfigXeq(char *var, XrdOucStream &Config, XrdSysError *eDest) { int dynamic; // Determine whether is is dynamic or not // if (eDest) dynamic = 1; else {dynamic = 0; eDest = &Log;} // Process common items // TS_Xeq("buffers", xbuf); TS_Xeq("network", xnet); TS_Xeq("sched", xsched); TS_Xeq("trace", xtrace); // Process items that can only be processed once // if (!dynamic) { TS_Xeq("adminpath", xapath); TS_Xeq("allow", xallow); TS_Xeq("port", xport); TS_Xeq("protocol", xprot); TS_Xeq("report", xrep); TS_Xeq("sitename", xsit); TS_Xeq("timeout", xtmo); } // No match found, complain. // eDest->Say("Config warning: ignoring unknown xrd directive '",var,"'."); Config.Echo(); return 0; } /******************************************************************************/ /* P r i v a t e F u n c t i o n s */ /******************************************************************************/ /******************************************************************************/ /* A S o c k e t */ /******************************************************************************/ int XrdConfig::ASocket(const char *path, const char *fname, mode_t mode) { char xpath[MAXPATHLEN+8], sokpath[108]; int plen = strlen(path), flen = strlen(fname); int rc; // Make sure we can fit everything in our buffer // if ((plen + flen + 3) > (int)sizeof(sokpath)) {Log.Emsg("Config", "admin path", path, "too long"); return 1; } // Create the directory path // strcpy(xpath, path); if ((rc = XrdOucUtils::makePath(xpath, mode))) {Log.Emsg("Config", rc, "create admin path", xpath); return 1; } // *!*!* At this point we do not yet support the admin path for xrd. // sp we comment out all of the following code. /* // Construct the actual socket name // if (sokpath[plen-1] != '/') sokpath[plen++] = '/'; strcpy(&sokpath[plen], fname); // Create an admin network // NetADM = new XrdInet(&Log); if (myDomain) NetADM->setDomain(myDomain); // Bind the netwok to the named socket // if (!NetADM->Bind(sokpath)) return 1; // Set the mode and return // chmod(sokpath, mode); // This may fail on some platforms */ return 0; } /******************************************************************************/ /* C o n f i g P r o c */ /******************************************************************************/ int XrdConfig::ConfigProc() { char *var; int cfgFD, retc, NoGo = 0; XrdOucEnv myEnv; XrdOucStream Config(&Log, myInstance, &myEnv, "=====> "); // Try to open the configuration file. // if ( (cfgFD = open(ConfigFN, O_RDONLY, 0)) < 0) {Log.Emsg("Config", errno, "open config file", ConfigFN); return 1; } Config.Attach(cfgFD); // Now start reading records until eof. // while((var = Config.GetMyFirstWord())) if (!strncmp(var, "xrd.", 4) || !strcmp (var, "all.adminpath") || !strcmp (var, "all.sitename" )) if (ConfigXeq(var+4, Config)) {Config.Echo(); NoGo = 1;} // Now check if any errors occured during file i/o // if ((retc = Config.LastError())) NoGo = Log.Emsg("Config", retc, "read config file", ConfigFN); Config.Close(); // Return final return code // return NoGo; } /******************************************************************************/ /* g e t U G */ /******************************************************************************/ int XrdConfig::getUG(char *parm, uid_t &newUid, gid_t &newGid) { struct passwd *pp; // Get the userid entry // if (!(*parm)) {Log.Emsg("Config", "-R user not specified."); return 0;} if (isdigit(*parm)) {if (!(newUid = atol(parm))) {Log.Emsg("Config", "-R", parm, "is invalid"); return 0;} pp = getpwuid(newUid); } else pp = getpwnam(parm); // Make sure it is valid and acceptable // if (!pp) {Log.Emsg("Config", errno, "retrieve -R user password entry"); return 0; } if (!(newUid = pp->pw_uid)) {Log.Emsg("Config", "-R", parm, "is still unacceptably a superuser!"); return 0; } newGid = pp->pw_gid; return 1; } /******************************************************************************/ /* M a n i f e s t */ /******************************************************************************/ void XrdConfig::Manifest(const char *pidfn) { const char *Slash; char envBuff[8192], pwdBuff[1024], manBuff[1024], *pidP, *sP, *xP; int envFD, envLen; // Get the current working directory // if (!getcwd(pwdBuff, sizeof(pwdBuff))) {Log.Emsg("Config", "Unable to get current working directory!"); return; } // Prepare for symlinks // strcpy(envBuff, ProtInfo.AdmPath); envLen = strlen(envBuff); if (envBuff[envLen-1] != '/') {envBuff[envLen] = '/'; envLen++;} strcpy(envBuff+envLen, ".xrd/"); xP = envBuff+envLen+5; // Create a symlink to the configuration file // if ((sP = getenv("XRDCONFIGFN"))) {sprintf(xP, "=/conf/%s.cf", myProg); XrdOucUtils::ReLink(envBuff, sP); } // Create a symlink to where core files will be found // sprintf(xP, "=/core/%s", myProg); XrdOucUtils::ReLink(envBuff, pwdBuff); // Create a symlink to where log files will be found // if ((sP = getenv("XRDLOGDIR"))) {sprintf(xP, "=/logs/%s", myProg); XrdOucUtils::ReLink(envBuff, sP); } // Create a symlink to out proc information (Linux only) // #ifdef __linux__ sprintf(xP, "=/proc/%s", myProg); sprintf(manBuff, "/proc/%d", getpid()); XrdOucUtils::ReLink(envBuff, manBuff); #endif // Create environment string // envLen = snprintf(envBuff, sizeof(envBuff), "pid=%d&host=%s&inst=%s&ver=%s" "&cfgfn=%s&cwd=%s&apath=%s&logfn=%s\n", static_cast<int>(getpid()), ProtInfo.myName, ProtInfo.myInst, XrdVSTRING, (getenv("XRDCONFIGFN") ? getenv("XRDCONFIGFN") : ""), pwdBuff, ProtInfo.AdmPath, Log.logger()->xlogFN()); // Find out where we should write this // if (pidfn && (Slash = rindex(pidfn, '/'))) {strncpy(manBuff, pidfn, Slash-pidfn); pidP = manBuff+(Slash-pidfn);} else {strcpy(manBuff, "/tmp"); pidP = manBuff+4;} // Construct the pid file name for ourselves // snprintf(pidP, sizeof(manBuff)-(pidP-manBuff), "/%s.%s.env", ProtInfo.myProg, ProtInfo.myInst); // Open the file // if ((envFD = open(manBuff, O_WRONLY|O_CREAT|O_TRUNC, 0664)) < 0) {Log.Emsg("Config", errno, "create envfile", manBuff); return; } // Write out environmental information // if (write(envFD, envBuff, envLen) < 0) Log.Emsg("Config", errno, "write to envfile", manBuff); // All done // close(envFD); } /******************************************************************************/ /* s e t C F G */ /******************************************************************************/ void XrdConfig::setCFG() { char cwdBuff[1024], *cfnP = cwdBuff; int n; // If the config file is absolute, export it as is // if (*ConfigFN == '/') {XrdOucEnv::Export("XRDCONFIGFN", ConfigFN); return; } // Prefix current working directory to the config file // if (!getcwd(cwdBuff, sizeof(cwdBuff)-strlen(ConfigFN)-2)) cfnP = ConfigFN; else {n = strlen(cwdBuff); if (cwdBuff[n-1] != '/') cwdBuff[n++] = '/'; strcpy(cwdBuff+n, ConfigFN); } // Export result // XrdOucEnv::Export("XRDCONFIGFN", cfnP); } /******************************************************************************/ /* s e t F D L */ /******************************************************************************/ int XrdConfig::setFDL() { struct rlimit rlim; char buff[100]; // Get the resource limit // if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) return Log.Emsg("Config", errno, "get FD limit"); // Set the limit to the maximum allowed // rlim.rlim_cur = rlim.rlim_max; #if (defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_5)) if (rlim.rlim_cur == RLIM_INFINITY || rlim.rlim_cur > OPEN_MAX) rlim.rlim_cur = OPEN_MAX; #endif if (setrlimit(RLIMIT_NOFILE, &rlim) < 0) return Log.Emsg("Config", errno,"set FD limit"); // Obtain the actual limit now // if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) return Log.Emsg("Config", errno, "get FD limit"); // Establish operating limit // ProtInfo.ConnMax = rlim.rlim_cur; sprintf(buff, "%d", ProtInfo.ConnMax); Log.Say("Config maximum number of connections restricted to ", buff); // Set core limit and but Solaris // #if !defined( __solaris__ ) && defined(RLIMIT_CORE) if (coreV >= 0) {if (getrlimit(RLIMIT_CORE, &rlim) < 0) Log.Emsg("Config", errno, "get core limit"); else {rlim.rlim_cur = (coreV ? rlim.rlim_max : 0); if (setrlimit(RLIMIT_CORE, &rlim) < 0) Log.Emsg("Config", errno,"set core limit"); } } #endif // We try to set the thread limit here but only if we can // #if defined(__linux__) && defined(RLIMIT_NPROC) // Get the resource limit // if (getrlimit(RLIMIT_NPROC, &rlim) < 0) return Log.Emsg("Config", errno, "get thread limit"); // Set the limit to the maximum allowed // int nthr = static_cast<int>(rlim.rlim_max); rlim.rlim_cur = (rlim.rlim_max < 4096 ? rlim.rlim_max : 4096); if (setrlimit(RLIMIT_NPROC, &rlim) < 0) return Log.Emsg("Config", errno,"set thread limit"); // Obtain the actual limit now // if (getrlimit(RLIMIT_NPROC, &rlim) < 0) return Log.Emsg("Config", errno, "get thread limit"); // Establish operating limit // nthr = static_cast<int>(rlim.rlim_cur); if (nthr < 4096) {sprintf(buff, "%d", static_cast<int>(rlim.rlim_cur)); Log.Say("Config maximum number of threads restricted to ", buff); } #endif return 0; } /******************************************************************************/ /* S e t u p */ /******************************************************************************/ int XrdConfig::Setup(char *dfltp) { XrdInet *NetWAN; XrdConfigProt *cp; int i, wsz, arbNet; // Establish the FD limit // if (setFDL()) return 1; // Special handling for Linux sendfile() // #if defined(__linux__) && defined(TCP_CORK) { int sokFD, setON = 1; if ((sokFD = socket(PF_INET, SOCK_STREAM, 0)) >= 0) {setsockopt(sokFD, XrdNetUtils::ProtoID("tcp"), TCP_NODELAY, &setON, sizeof(setON)); if (setsockopt(sokFD, SOL_TCP, TCP_CORK, &setON, sizeof(setON)) < 0) XrdLink::sfOK = 0; close(sokFD); } } #endif // Indicate how sendfile is being handled // TRACE(NET,"sendfile " <<(XrdLink::sfOK ? "enabled." : "disabled!")); // Initialize the buffer manager // BuffPool.Init(); // Start the scheduler // Sched.Start(); // Setup the link and socket polling infrastructure // XrdLink::Init(&Log, &Trace, &Sched); XrdPoll::Init(&Log, &Trace, &Sched); if (!XrdLink::Setup(ProtInfo.ConnMax, ProtInfo.idleWait) || !XrdPoll::Setup(ProtInfo.ConnMax)) return 1; // Modify the AdminPath to account for any instance name. Note that there is // a negligible memory leak under ceratin path combinations. Not enough to // warrant a lot of logic to get around. // if (myInsName) ProtInfo.AdmPath = XrdOucUtils::genPath(AdminPath,myInsName); else ProtInfo.AdmPath = AdminPath; XrdOucEnv::Export("XRDADMINPATH", ProtInfo.AdmPath); AdminPath = XrdOucUtils::genPath(AdminPath, myInsName, ".xrd"); // Setup admin connection now // if (ASocket(AdminPath, "admin", (mode_t)AdminMode)) return 1; // Determine the default port number (only for xrootd) if not specified. // if (PortTCP < 0) {if ((PortTCP = XrdNetUtils::ServPort(dfltp))) PortUDP = PortTCP; else PortTCP = -1; } // We now go through all of the protocols and get each respective port number. // XrdProtLoad::Init(&Log, &Trace); cp = Firstcp; while(cp) {ProtInfo.Port = (cp->port < 0 ? PortTCP : cp->port); XrdOucEnv::Export("XRDPORT", ProtInfo.Port); if ((cp->port = XrdProtLoad::Port(cp->libpath, cp->proname, cp->parms, &ProtInfo)) < 0) return 1; cp = cp->Next; } // Allocate the statistics object. This is akward since we only know part // of the current configuration. The object will figure this out later. // ProtInfo.Stats = new XrdStats(&Log, &Sched, &BuffPool, ProtInfo.myName, Firstcp->port, ProtInfo.myInst, ProtInfo.myProg, mySitName); // Allocate a WAN port number of we need to // if (PortWAN && (NetWAN = new XrdInet(&Log, &Trace, Police))) {if (Wan_Opts || Wan_Blen) NetWAN->setDefaults(Wan_Opts, Wan_Blen); if (myDomain) NetWAN->setDomain(myDomain); if (NetWAN->Bind((PortWAN > 0 ? PortWAN : 0), "tcp")) return 1; PortWAN = NetWAN->Port(); wsz = NetWAN->WSize(); Wan_Blen = (wsz < Wan_Blen || !Wan_Blen ? wsz : Wan_Blen); TRACE(NET,"WAN port " <<PortWAN <<" wsz=" <<Wan_Blen <<" (" <<wsz <<')'); NetTCP[XrdProtLoad::ProtoMax] = NetWAN; } else {PortWAN = 0; Wan_Blen = 0;} // Load the protocols. For each new protocol port number, create a new // network object to handle the port dependent communications part. All // port issues will have been resolved at this point. // arbNet = XrdProtLoad::ProtoMax; while((cp = Firstcp)) {if (!(cp->port)) i = arbNet; else for (i = 0; i < XrdProtLoad::ProtoMax && NetTCP[i]; i++) {if (cp->port == NetTCP[i]->Port()) break;} if (i >= XrdProtLoad::ProtoMax || !NetTCP[i]) {NetTCP[++NetTCPlep] = new XrdInet(&Log, &Trace, Police); if (Net_Opts || Net_Blen) NetTCP[NetTCPlep]->setDefaults(Net_Opts, Net_Blen); if (myDomain) NetTCP[NetTCPlep]->setDomain(myDomain); if (NetTCP[NetTCPlep]->Bind(cp->port, "tcp")) return 1; ProtInfo.Port = NetTCP[NetTCPlep]->Port(); ProtInfo.NetTCP = NetTCP[NetTCPlep]; wsz = NetTCP[NetTCPlep]->WSize(); ProtInfo.WSize = (wsz < Net_Blen || !Net_Blen ? wsz : Net_Blen); TRACE(NET,"LCL port " <<ProtInfo.Port <<" wsz=" <<ProtInfo.WSize <<" (" <<wsz <<')'); if (cp->wanopt) {ProtInfo.WANPort = PortWAN; ProtInfo.WANWSize= Wan_Blen; } else ProtInfo.WANPort = ProtInfo.WANWSize = 0; if (!(cp->port)) arbNet = NetTCPlep; if (!NetTCPlep) XrdLink::Init(NetTCP[0]); XrdOucEnv::Export("XRDPORT", ProtInfo.Port); } if (!XrdProtLoad::Load(cp->libpath,cp->proname,cp->parms,&ProtInfo)) return 1; Firstcp = cp->Next; delete cp; } // Leave the env port number to be the first used port number. This may // or may not be the same as the default port number. // ProtInfo.Port = NetTCP[0]->Port(); PortTCP = ProtInfo.Port; XrdOucEnv::Export("XRDPORT", PortTCP); // Now check if we have to setup automatic reporting // if (repDest[0] != 0 && repOpts) ProtInfo.Stats->Report(repDest, repInt, repOpts); // All done // return 0; } /******************************************************************************/ /* U s a g e */ /******************************************************************************/ void XrdConfig::Usage(int rc) { extern const char *XrdLicense; if (rc < 0) cerr <<XrdLicense; else cerr <<"\nUsage: " <<myProg <<" [-b] [-c <cfn>] [-d] [-h] [-H] [-I {v4|v6}]\n" "[-k {n|sz|sig}] [-l [=]<fn>] [-n name] [-p <port>] [-P <prot>] [-L <libprot>]\n" "[-R] [-s pidfile] [-S site] [-v] [-z] [<prot_options>]" <<endl; _exit(rc > 0 ? rc : 0); } /******************************************************************************/ /* x a p a t h */ /******************************************************************************/ /* Function: xapath Purpose: To parse the directive: adminpath <path> [group] <path> the path of the FIFO to use for admin requests. group allows group access to the admin path Note: A named socket is created <path>/<name>/.xrd/admin Output: 0 upon success or !0 upon failure. */ int XrdConfig::xapath(XrdSysError *eDest, XrdOucStream &Config) { char *pval, *val; mode_t mode = S_IRWXU; // Get the path // pval = Config.GetWord(); if (!pval || !pval[0]) {eDest->Emsg("Config", "adminpath not specified"); return 1;} // Make sure it's an absolute path // if (*pval != '/') {eDest->Emsg("Config", "adminpath not absolute"); return 1;} // Record the path // if (AdminPath) free(AdminPath); AdminPath = strdup(pval); // Get the optional access rights // if ((val = Config.GetWord()) && val[0]) {if (!strcmp("group", val)) mode |= S_IRWXG; else {eDest->Emsg("Config", "invalid admin path modifier -", val); return 1; } } AdminMode = ProtInfo.AdmMode = mode; return 0; } /******************************************************************************/ /* x a l l o w */ /******************************************************************************/ /* Function: xallow Purpose: To parse the directive: allow {host | netgroup} <name> <name> The dns name of the host that is allowed to connect or the netgroup name the host must be a member of. For DNS names, a single asterisk may be specified anywhere in the name. Output: 0 upon success or !0 upon failure. */ int XrdConfig::xallow(XrdSysError *eDest, XrdOucStream &Config) { char *val; int ishost; if (!(val = Config.GetWord())) {eDest->Emsg("Config", "allow type not specified"); return 1;} if (!strcmp(val, "host")) ishost = 1; else if (!strcmp(val, "netgroup")) ishost = 0; else {eDest->Emsg("Config", "invalid allow type -", val); return 1; } if (!(val = Config.GetWord())) {eDest->Emsg("Config", "allow target name not specified"); return 1;} if (!Police) Police = new XrdNetSecurity(); if (ishost) Police->AddHost(val); else Police->AddNetGroup(val); return 0; } /******************************************************************************/ /* x b u f */ /******************************************************************************/ /* Function: xbuf Purpose: To parse the directive: buffers <memsz> [<rint>] <memsz> maximum amount of memory devoted to buffers <rint> minimum buffer reshape interval in seconds Output: 0 upon success or !0 upon failure. */ int XrdConfig::xbuf(XrdSysError *eDest, XrdOucStream &Config) { int bint = -1; long long blim; char *val; if (!(val = Config.GetWord())) {eDest->Emsg("Config", "buffer memory limit not specified"); return 1;} if (XrdOuca2x::a2sz(*eDest,"buffer limit value",val,&blim, (long long)1024*1024)) return 1; if ((val = Config.GetWord())) if (XrdOuca2x::a2tm(*eDest,"reshape interval", val, &bint, 300)) return 1; BuffPool.Set((int)blim, bint); return 0; } /******************************************************************************/ /* x n e t */ /******************************************************************************/ /* Function: xnet Purpose: To parse directive: network [wan] [[no]keepalive] [buffsz <blen>] [kaparms parms] [cache <ct>] [[no]dnr] [routes <rtype> [use <ifn1>,<ifn2>]] <rtype>: split | common | local wan parameters apply only to the wan port keepalive do [not] set the socket keepalive option. kaparms keepalive paramters as specfied by parms. <blen> is the socket's send/rcv buffer size. <ct> Seconds to cache address to name resolutions. [no]dnr do [not] perform a reverse DNS lookup if not needed. routes specifies the network configuration (see reference) Output: 0 upon success or !0 upon failure. */ int XrdConfig::xnet(XrdSysError *eDest, XrdOucStream &Config) { char *val; int i, n, V_keep = -1, V_nodnr = 0, V_iswan = 0, V_blen = -1, V_ct = -1; long long llp; struct netopts {const char *opname; int hasarg; int opval; int *oploc; const char *etxt;} ntopts[] = { {"keepalive", 0, 1, &V_keep, "option"}, {"nokeepalive",0, 0, &V_keep, "option"}, {"kaparms", 4, 0, &V_keep, "option"}, {"buffsz", 1, 0, &V_blen, "network buffsz"}, {"cache", 2, 0, &V_ct, "cache time"}, {"dnr", 0, 0, &V_nodnr, "option"}, {"nodnr", 0, 1, &V_nodnr, "option"}, {"routes", 3, 1, 0, "routes"}, {"wan", 0, 1, &V_iswan, "option"} }; int numopts = sizeof(ntopts)/sizeof(struct netopts); if (!(val = Config.GetWord())) {eDest->Emsg("Config", "net option not specified"); return 1;} while (val) {for (i = 0; i < numopts; i++) if (!strcmp(val, ntopts[i].opname)) {if (!ntopts[i].hasarg) *ntopts[i].oploc = ntopts[i].opval; else {if (!(val = Config.GetWord())) {eDest->Emsg("Config", "network", ntopts[i].opname, "argument missing"); return 1; } if (ntopts[i].hasarg == 4) {if (xnkap(eDest, val)) return 1; break; } if (ntopts[i].hasarg == 3) { if (!strcmp(val, "split")) XrdNetIF::Routing(XrdNetIF::netSplit); else if (!strcmp(val, "common")) XrdNetIF::Routing(XrdNetIF::netCommon); else if (!strcmp(val, "local")) XrdNetIF::Routing(XrdNetIF::netLocal); else {eDest->Emsg("Config","Invalid routes argument -",val); return 1; } if (!(val = Config.GetWord())|| !(*val)) break; if (strcmp(val, "use")) continue; if (!(val = Config.GetWord())|| !(*val)) {eDest->Emsg("Config", "network routes i/f names " "not specified."); return 1; } if (!XrdNetIF::SetIFNames(val)) return 1; ppNet = 1; break; } if (ntopts[i].hasarg == 2) {if (XrdOuca2x::a2tm(*eDest,ntopts[i].etxt,val,&n,0)) return 1; *ntopts[i].oploc = n; } else { if (XrdOuca2x::a2sz(*eDest,ntopts[i].etxt,val,&llp,0)) return 1; *ntopts[i].oploc = (int)llp; } } break; } if (i >= numopts) eDest->Say("Config warning: ignoring invalid net option '",val,"'."); else if (!val) break; val = Config.GetWord(); } if (V_iswan) {if (V_blen >= 0) Wan_Blen = V_blen; if (V_keep >= 0) Wan_Opts = (V_keep ? XRDNET_KEEPALIVE : 0); Wan_Opts |= (V_nodnr ? XRDNET_NORLKUP : 0); if (!PortWAN) PortWAN = -1; } else { if (V_blen >= 0) Net_Blen = V_blen; if (V_keep >= 0) Net_Opts = (V_keep ? XRDNET_KEEPALIVE : 0); Net_Opts |= (V_nodnr ? XRDNET_NORLKUP : 0); } if (V_ct >= 0) XrdNetAddr::SetCache(V_ct); return 0; } /******************************************************************************/ /* x n k a p */ /******************************************************************************/ /* Function: xnkap Purpose: To parse the directive: kaparms idle[,itvl[,cnt]] idle Seconds the connection needs to remain idle before TCP should start sending keepalive probes. itvl Seconds between individual keepalive probes. icnt Maximum number of keepalive probes TCP should send before dropping the connection, */ int XrdConfig::xnkap(XrdSysError *eDest, char *val) { char *karg, *comma; int knum; // Get the first parameter, idle seconds // karg = val; if ((comma = index(val, ','))) {val = comma+1; *comma = 0;} else val = 0; if (XrdOuca2x::a2tm(*eDest,"kaparms idle", karg, &knum, 0)) return 1; XrdNetSocketCFG::ka_Idle = knum; // Get the second parameter, interval seconds // if (!(karg = val)) return 0; if ((comma = index(val, ','))) {val = comma+1; *comma = 0;} else val = 0; if (XrdOuca2x::a2tm(*eDest,"kaparms interval", karg, &knum, 0)) return 1; XrdNetSocketCFG::ka_Itvl = knum; // Get the third parameter, count // if (!val) return 0; if (XrdOuca2x::a2i(*eDest,"kaparms count", val, &knum, 0)) return 1; XrdNetSocketCFG::ka_Icnt = knum; // All done // return 0; } /******************************************************************************/ /* x p o r t */ /******************************************************************************/ /* Function: xport Purpose: To parse the directive: port [wan] <tcpnum> [if [<hlst>] [named <nlst>]] wan apply this to the wan port <tcpnum> number of the tcp port for incomming requests <hlst> list of applicable host patterns <nlst> list of applicable instance names. Output: 0 upon success or !0 upon failure. */ int XrdConfig::xport(XrdSysError *eDest, XrdOucStream &Config) { int rc, iswan = 0, pnum = 0; char *val, cport[32]; do {if (!(val = Config.GetWord())) {eDest->Emsg("Config", "tcp port not specified"); return 1;} if (strcmp("wan", val) || iswan) break; iswan = 1; } while(1); strncpy(cport, val, sizeof(cport)-1); cport[sizeof(cport)-1] = '\0'; if ((val = Config.GetWord()) && !strcmp("if", val)) if ((rc = XrdOucUtils::doIf(eDest,Config, "port directive", myName, ProtInfo.myInst, myProg)) <= 0) {if (!rc) Config.noEcho(); return (rc < 0);} if ((pnum = yport(eDest, "tcp", cport)) < 0) return 1; if (iswan) PortWAN = pnum; else PortTCP = PortUDP = pnum; return 0; } /******************************************************************************/ int XrdConfig::yport(XrdSysError *eDest, const char *ptype, const char *val) { int pnum; if (!strcmp("any", val)) return 0; const char *invp = (*ptype == 't' ? "tcp port" : "udp port" ); const char *invs = (*ptype == 't' ? "Unable to find tcp service" : "Unable to find udp service" ); if (isdigit(*val)) {if (XrdOuca2x::a2i(*eDest,invp,val,&pnum,1,65535)) return 0;} else if (!(pnum = XrdNetUtils::ServPort(val, (*ptype != 't')))) {eDest->Emsg("Config", invs, val); return -1; } return pnum; } /******************************************************************************/ /* x p r o t */ /******************************************************************************/ /* Function: xprot Purpose: To parse the directive: protocol [wan] <name>[:<port>] <loc> [<parm>] wan The protocol is WAN optimized <name> The name of the protocol (e.g., rootd) <port> Port binding for the protocol, if not the default. <loc> The shared library in which it is located. <parm> A one line parameter to be passed to the protocol. Output: 0 upon success or !0 upon failure. */ int XrdConfig::xprot(XrdSysError *eDest, XrdOucStream &Config) { XrdConfigProt *cpp; char *val, *parms, *lib, proname[64], buff[1024]; int vlen, bleft = sizeof(buff), portnum = -1, wanopt = 0; do {if (!(val = Config.GetWord())) {eDest->Emsg("Config", "protocol name not specified"); return 1;} if (wanopt || strcmp("wan", val)) break; wanopt = 1; } while(1); if (strlen(val) > sizeof(proname)-1) {eDest->Emsg("Config", "protocol name is too long"); return 1;} strcpy(proname, val); if (!(val = Config.GetWord())) {eDest->Emsg("Config", "protocol library not specified"); return 1;} if (strcmp("*", val)) lib = strdup(val); else lib = 0; parms = buff; while((val = Config.GetWord())) {vlen = strlen(val); bleft -= (vlen+1); if (bleft <= 0) {eDest->Emsg("Config", "Too many parms for protocol", proname); return 1; } *parms = ' '; parms++; strcpy(parms, val); parms += vlen; } if (parms != buff) parms = strdup(buff+1); else parms = 0; if ((val = index(proname, ':'))) {if ((portnum = yport(&Log, "tcp", val+1)) < 0) return 1; else *val = '\0'; } if (wanopt && !PortWAN) PortWAN = 1; if ((cpp = Firstcp)) do {if (!strcmp(proname, cpp->proname)) {if (cpp->libpath) free(cpp->libpath); if (cpp->parms) free(cpp->parms); cpp->libpath = lib; cpp->parms = parms; cpp->wanopt = wanopt; return 0; } } while((cpp = cpp->Next)); if (lib) {cpp = new XrdConfigProt(strdup(proname), lib, parms, portnum, wanopt); if (Lastcp) Lastcp->Next = cpp; else Firstcp = cpp; Lastcp = cpp; } return 0; } /******************************************************************************/ /* x r e p */ /******************************************************************************/ /* Function: xrep Purpose: To parse the directive: report <dest1>[,<dest2>] [every <sec>] <opts> <dest1> where a UDP based report is to be sent. It may be a <host:port> or a local named UDP pipe (i.e., "/..."). <dest2> A secondary destination. <sec> the reporting interval. The default is 10 minutes. <opts> What to report. "all" is the default. Output: 0 upon success or !0 upon failure. */ int XrdConfig::xrep(XrdSysError *eDest, XrdOucStream &Config) { static struct repopts {const char *opname; int opval;} rpopts[] = { {"all", XRD_STATS_ALL}, {"buff", XRD_STATS_BUFF}, {"info", XRD_STATS_INFO}, {"link", XRD_STATS_LINK}, {"poll", XRD_STATS_POLL}, {"process", XRD_STATS_PROC}, {"protocols",XRD_STATS_PROT}, {"prot", XRD_STATS_PROT}, {"sched", XRD_STATS_SCHD}, {"sgen", XRD_STATS_SGEN}, {"sync", XRD_STATS_SYNC}, {"syncwp", XRD_STATS_SYNCA} }; int i, neg, numopts = sizeof(rpopts)/sizeof(struct repopts); char *val, *cp; if (!(val = Config.GetWord())) {eDest->Emsg("Config", "report parameters not specified"); return 1;} // Cleanup to start anew // if (repDest[0]) {free(repDest[0]); repDest[0] = 0;} if (repDest[1]) {free(repDest[1]); repDest[1] = 0;} repOpts = 0; repInt = 600; // Decode the destination // if ((cp = (char *)index(val, ','))) {if (!*(cp+1)) {eDest->Emsg("Config","malformed report destination -",val); return 1;} else { repDest[1] = cp+1; *cp = '\0';} } repDest[0] = val; for (i = 0; i < 2; i++) {if (!(val = repDest[i])) break; if (*val != '/' && (!(cp = index(val, (int)':')) || !atoi(cp+1))) {eDest->Emsg("Config","report dest port missing or invalid in",val); return 1; } repDest[i] = strdup(val); } // Make sure dests differ // if (repDest[0] && repDest[1] && !strcmp(repDest[0], repDest[1])) {eDest->Emsg("Config", "Warning, report dests are identical."); free(repDest[1]); repDest[1] = 0; } // Get optional "every" // if (!(val = Config.GetWord())) {repOpts = XRD_STATS_ALL; return 0;} if (!strcmp("every", val)) {if (!(val = Config.GetWord())) {eDest->Emsg("Config", "report every value not specified"); return 1;} if (XrdOuca2x::a2tm(*eDest,"report every",val,&repInt,1)) return 1; val = Config.GetWord(); } // Get reporting options // while(val) {if (!strcmp(val, "off")) repOpts = 0; else {if ((neg = (val[0] == '-' && val[1]))) val++; for (i = 0; i < numopts; i++) {if (!strcmp(val, rpopts[i].opname)) {if (neg) repOpts &= ~rpopts[i].opval; else repOpts |= rpopts[i].opval; break; } } if (i >= numopts) eDest->Say("Config warning: ignoring invalid report option '",val,"'."); } val = Config.GetWord(); } // All done // if (!(repOpts & XRD_STATS_ALL)) repOpts = XRD_STATS_ALL & ~XRD_STATS_INFO; return 0; } /******************************************************************************/ /* x s c h e d */ /******************************************************************************/ /* Function: xsched Purpose: To parse directive: sched [mint <mint>] [maxt <maxt>] [avlt <at>] [idle <idle>] [stksz <qnt>] [core <cv>] <mint> is the minimum number of threads that we need. Once this number of threads is created, it does not decrease. <maxt> maximum number of threads that may be created. The actual number of threads will vary between <mint> and <maxt>. <avlt> Are the number of threads that must be available for immediate dispatch. These threads are never bound to a connection (i.e., made stickied). Any available threads above <ft> will be allowed to stick to a connection. <cv> asis - leave current value alone. max - set value to maximum allowed (hard limit). off - turn off core files. <idle> The time (in time spec) between checks for underused threads. Those found will be terminated. Default is 780. <qnt> The thread stack size in bytes or K, M, or G. Output: 0 upon success or 1 upon failure. */ int XrdConfig::xsched(XrdSysError *eDest, XrdOucStream &Config) { char *val; long long lpp; int i, ppp; int V_mint = -1, V_maxt = -1, V_idle = -1, V_avlt = -1; struct schedopts {const char *opname; int minv; int *oploc; const char *opmsg;} scopts[] = { {"stksz", 0, 0, "sched stksz"}, {"mint", 1, &V_mint, "sched mint"}, {"maxt", 1, &V_maxt, "sched maxt"}, {"avlt", 1, &V_avlt, "sched avlt"}, {"core", 1, 0, "sched core"}, {"idle", 0, &V_idle, "sched idle"} }; int numopts = sizeof(scopts)/sizeof(struct schedopts); if (!(val = Config.GetWord())) {eDest->Emsg("Config", "sched option not specified"); return 1;} while (val) {for (i = 0; i < numopts; i++) if (!strcmp(val, scopts[i].opname)) {if (!(val = Config.GetWord())) {eDest->Emsg("Config", "sched", scopts[i].opname, "value not specified"); return 1; } if (*scopts[i].opname == 'i') {if (XrdOuca2x::a2tm(*eDest, scopts[i].opmsg, val, &ppp, scopts[i].minv)) return 1; } else if (*scopts[i].opname == 'c') { if (!strcmp("asis", val)) coreV = -1; else if (!strcmp("max", val)) coreV = 1; else if (!strcmp("off", val)) coreV = 0; else {eDest->Emsg("Config","invalid sched core value -",val); return 1; } } else if (*scopts[i].opname == 's') {if (XrdOuca2x::a2sz(*eDest, scopts[i].opmsg, val, &lpp, scopts[i].minv)) return 1; XrdSysThread::setStackSize((size_t)lpp); break; } else if (XrdOuca2x::a2i(*eDest, scopts[i].opmsg, val, &ppp,scopts[i].minv)) return 1; *scopts[i].oploc = ppp; break; } if (i >= numopts) eDest->Say("Config warning: ignoring invalid sched option '",val,"'."); val = Config.GetWord(); } // Make sure specified quantities are consistent // if (V_maxt > 0) {if (V_mint > 0 && V_mint > V_maxt) {eDest->Emsg("Config", "sched mint must be less than maxt"); return 1; } if (V_avlt > 0 && V_avlt > V_maxt) {eDest->Emsg("Config", "sched avlt must be less than maxt"); return 1; } } // Establish scheduler options // Sched.setParms(V_mint, V_maxt, V_avlt, V_idle); return 0; } /******************************************************************************/ /* x s i t */ /******************************************************************************/ /* Function: xsit Purpose: To parse directive: sitename <name> <name> is the 1- to 15-character site name to be included in monitoring information. This can also come from the command line -N option. The first such name is used. Output: 0 upon success or 1 upon failure. */ int XrdConfig::xsit(XrdSysError *eDest, XrdOucStream &Config) { char *val; if (!(val = Config.GetWord())) {eDest->Emsg("Config", "sitename value not specified"); return 1;} if (mySitName) eDest->Emsg("Config", "sitename already specified, using '", mySitName, "'."); else mySitName = XrdOucSiteName::Set(val, 63); return 0; } /******************************************************************************/ /* x t m o */ /******************************************************************************/ /* Function: xtmo Purpose: To parse directive: timeout [read <msd>] [hail <msh>] [idle <msi>] [kill <msk>] <msd> is the maximum number of seconds to wait for pending data to arrive before we reschedule the link (default is 5 seconds). <msh> is the maximum number of seconds to wait for the initial data after a connection (default is 30 seconds) <msi> is the minimum number of seconds a connection may remain idle before it is closed (default is 5400 = 90 minutes) <msk> is the minimum number of seconds to wait after killing a connection for it to end (default is 3 seconds) Output: 0 upon success or 1 upon failure. */ int XrdConfig::xtmo(XrdSysError *eDest, XrdOucStream &Config) { char *val; int i, ppp, rc; int V_read = -1, V_idle = -1, V_hail = -1, V_kill = -1; struct tmoopts { const char *opname; int istime; int minv; int *oploc; const char *etxt;} tmopts[] = { {"read", 1, 1, &V_read, "timeout read"}, {"hail", 1, 1, &V_hail, "timeout hail"}, {"idle", 1, 0, &V_idle, "timeout idle"}, {"kill", 1, 0, &V_kill, "timeout kill"} }; int numopts = sizeof(tmopts)/sizeof(struct tmoopts); if (!(val = Config.GetWord())) {eDest->Emsg("Config", "timeout option not specified"); return 1;} while (val) {for (i = 0; i < numopts; i++) if (!strcmp(val, tmopts[i].opname)) {if (!(val = Config.GetWord())) {eDest->Emsg("Config","timeout", tmopts[i].opname, "value not specified"); return 1; } rc = (tmopts[i].istime ? XrdOuca2x::a2tm(*eDest,tmopts[i].etxt,val,&ppp, tmopts[i].minv) : XrdOuca2x::a2i (*eDest,tmopts[i].etxt,val,&ppp, tmopts[i].minv)); if (rc) return 1; *tmopts[i].oploc = ppp; break; } if (i >= numopts) eDest->Say("Config warning: ignoring invalid timeout option '",val,"'."); val = Config.GetWord(); } // Set values and return // if (V_read > 0) ProtInfo.readWait = V_read*1000; if (V_hail >= 0) ProtInfo.hailWait = V_hail*1000; if (V_idle >= 0) ProtInfo.idleWait = V_idle; XrdLink::setKWT(V_read, V_kill); return 0; } /******************************************************************************/ /* x t r a c e */ /******************************************************************************/ /* Function: xtrace Purpose: To parse the directive: trace <events> <events> the blank separated list of events to trace. Trace directives are cummalative. Output: 0 upon success or 1 upon failure. */ int XrdConfig::xtrace(XrdSysError *eDest, XrdOucStream &Config) { char *val; static struct traceopts {const char *opname; int opval;} tropts[] = { {"all", TRACE_ALL}, {"off", TRACE_NONE}, {"none", TRACE_NONE}, {"conn", TRACE_CONN}, {"debug", TRACE_DEBUG}, {"mem", TRACE_MEM}, {"net", TRACE_NET}, {"poll", TRACE_POLL}, {"protocol", TRACE_PROT}, {"sched", TRACE_SCHED} }; int i, neg, trval = 0, numopts = sizeof(tropts)/sizeof(struct traceopts); if (!(val = Config.GetWord())) {eDest->Emsg("Config", "trace option not specified"); return 1;} while (val) {if (!strcmp(val, "off")) trval = 0; else {if ((neg = (val[0] == '-' && val[1]))) val++; for (i = 0; i < numopts; i++) {if (!strcmp(val, tropts[i].opname)) {if (neg) if (tropts[i].opval) trval &= ~tropts[i].opval; else trval = TRACE_ALL; else if (tropts[i].opval) trval |= tropts[i].opval; else trval = TRACE_NONE; break; } } if (i >= numopts) eDest->Say("Config warning: ignoring invalid trace option '",val,"'."); } val = Config.GetWord(); } Trace.What = trval; return 0; }
adevress/xrootd
src/Xrd/XrdConfig.cc
C++
gpl-3.0
64,206
LEEME Para aprender sobre el rst ( reStructuredText ), mirar aquí, por ejemplo: http://es.wikieducator.org/Usuario:Lmorillas/modulo_lenguajes_de_marcas/ligeros/rst Instalar este proyecto 1) El entorno * Esto está hecho en Python * No es necesario, pero si recomendable, tener conocimientos de Python * Se necesita tener instalado un entorno virtual para Python ( ver → http://rukbottoland.com/tutoriales/tutorial-de-python-virtualenvwrapper/ ). Por convenio, solemos usar ~/Proyectos/Python/ como directorio base para este tipo de proyectos. 2) Clonar el proyecto * mkdir -p ~/Proyectos/Python/ * cd ~/Proyectos/Python/ * git clone https://github.com/equipote/j19j.git 3) Creación del entorno virtual para este proyecto * mkvirtualenv -a ~/Proyectos/Python/j19j --no-site-packages j19j * Tras crear el entorno, automagicamente nos quedaremos dentro de él. 4) Instalación de requisitos * pip install -r requerimientos.txt 5) Actualizar submodulos: * git submodule add https://github.com/getpelican/pelican-themes temas * git submodule add https://github.com/getpelican/pelican-plugins plugins * git submodule update --init --recursive 6) Creación del directorio de salida (si no existe) * mkdir output 7) Generación de las páginas estáticas * make html 8) Ver las páginas estáticas make serve
equipote/j19j
doc/Install.md
Markdown
gpl-3.0
1,436
<?php namespace ApacheSolrForTypo3\Solr\Tests\Unit; /*************************************************************** * Copyright notice * * (c) 2016 Markus Friedrich <markus.friedrich@dkd.de> * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is * free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script 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. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ use ApacheSolrForTypo3\Solr\ConnectionManager; use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository; use ApacheSolrForTypo3\Solr\System\Configuration\ConfigurationManager; use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; use ApacheSolrForTypo3\Solr\System\Logging\SolrLogManager; use ApacheSolrForTypo3\Solr\System\Records\Pages\PagesRepository; use ApacheSolrForTypo3\Solr\System\Records\SystemLanguage\SystemLanguageRepository; use ApacheSolrForTypo3\Solr\System\Solr\Node; use ApacheSolrForTypo3\Solr\System\Solr\Parser\SchemaParser; use ApacheSolrForTypo3\Solr\System\Solr\Parser\StopWordParser; use ApacheSolrForTypo3\Solr\System\Solr\Parser\SynonymParser; use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection; use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\EventDispatcher\EventDispatcher; use TYPO3\CMS\Core\TypoScript\TemplateService; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; use UnexpectedValueException; /** * PHP Unit test for connection manager * * @author Markus Friedrich <markus.friedrich@dkd.de> */ class ConnectionManagerTest extends UnitTest { /** * Connection manager * * @var ConnectionManager */ protected $connectionManager; /** * @var SolrLogManager */ protected $logManagerMock; /** * @var SystemLanguageRepository */ protected $languageRepositoryMock; /** * @var PagesRepository */ protected $pageRepositoryMock; /** * @var SiteRepository */ protected $siteRepositoryMock; /** * @var ConfigurationManager */ protected $configurationManager; /** * Set up the connection manager test * * @return void */ public function setUp(): void { $TSFE = $this->getDumbMock(TypoScriptFrontendController::class); $GLOBALS['TSFE'] = $TSFE; /** @var $GLOBALS ['TSFE']->tmpl \TYPO3\CMS\Core\TypoScript\TemplateService */ $GLOBALS['TSFE']->tmpl = $this->getDumbMock(TemplateService::class, ['linkData']); $GLOBALS['TSFE']->tmpl->getFileName_backPath = Environment::getPublicPath() . '/'; $GLOBALS['TSFE']->tmpl->setup['config.']['typolinkEnableLinksAcrossDomains'] = 0; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['solr.']['host'] = 'localhost'; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['solr.']['port'] = '8999'; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['solr.']['path'] = '/solr/core_en/'; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['solr.']['scheme'] = 'http'; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['targetPage'] = 25; $GLOBALS['TSFE']->tmpl->setup['config.']['tx_realurl_enable'] = '0'; $this->logManagerMock = $this->getDumbMock(SolrLogManager::class); $this->languageRepositoryMock = $this->getDumbMock(SystemLanguageRepository::class); $this->pageRepositoryMock = $this->getDumbMock(PagesRepository::class); $this->siteRepositoryMock = $this->getDumbMock(SiteRepository::class); $this->configurationManager = new ConfigurationManager(); $this->connectionManager = $this->getMockBuilder(ConnectionManager::class) ->setConstructorArgs([ $this->languageRepositoryMock, $this->pageRepositoryMock, $this->siteRepositoryMock ]) ->onlyMethods(['getSolrConnectionForNodes']) ->getMock(); } /** * Provides data for the connection test * * @return array */ public function connectDataProvider(): array { return [ ['host' => 'localhost', 'port' => '', 'path' => '', 'scheme' => '', 'expectsException' => true, 'expectedConnectionString' => null], ['host' => '127.0.0.1', 'port' => 8181, 'path' => '/solr/core_de/', 'scheme' => 'https', 'expectsException' => false, 'expectedConnectionString' => 'https://127.0.0.1:8181/solr/core_de/'] ]; } /** * Tests the connect * * @dataProvider connectDataProvider * @test * * @param string $host * @param string $port * @param string $path * @param string $scheme * @param bool $expectsException * @param string $expectedConnectionString * @return void */ public function canConnect($host, $port, $path, $scheme, $expectsException, $expectedConnectionString) { $self = $this; $this->connectionManager->expects($this->once())->method('getSolrConnectionForNodes')->will( $this->returnCallback(function($readNode, $writeNode) use ($self) { $readNode = Node::fromArray($readNode); $writeNode = Node::fromArray($writeNode); /* @var TypoScriptConfiguration $typoScriptConfigurationMock */ $typoScriptConfigurationMock = $self->getDumbMock(TypoScriptConfiguration::class); /* @var SynonymParser $synonymsParserMock */ $synonymsParserMock = $self->getDumbMock(SynonymParser::class); /* @var StopWordParser $stopWordParserMock */ $stopWordParserMock = $self->getDumbMock(StopWordParser::class); /* @var SchemaParser $schemaParserMock */ $schemaParserMock = $self->getDumbMock(SchemaParser::class); /* @var EventDispatcher $eventDispatcher */ $eventDispatcher = $self->getDumbMock(EventDispatcher::class); return new SolrConnection( $readNode, $writeNode, $typoScriptConfigurationMock, $synonymsParserMock, $stopWordParserMock, $schemaParserMock, $self->logManagerMock, $this->getDumbMock(ClientInterface::class), $this->getDumbMock(RequestFactoryInterface::class), $this->getDumbMock(StreamFactoryInterface::class), $this->getDumbMock(EventDispatcherInterface::class) ); }) ); $exceptionOccurred = false; try { $readNode = ['host' => $host, 'port' => $port, 'path' => $path, 'scheme' => $scheme]; $configuration['read'] = $readNode; $configuration['write'] = $readNode; $solrService = $this->connectionManager->getConnectionFromConfiguration($configuration); $this->assertEquals($expectedConnectionString, $solrService->getReadService()->__toString()); } catch (UnexpectedValueException $exception) { $exceptionOccurred = true; } $this->assertEquals($expectsException, $exceptionOccurred); } }
dkd-kaehm/ext-solr
Tests/Unit/ConnectionManagerTest.php
PHP
gpl-3.0
8,026
import re def analyzeLine(txtlines): outline = [] lcnt = -1 for line in txtlines: lcnt += 1 typ = None itmText = None spc = (len(line) -len(line.lstrip()))*' ' tls = line.lstrip() if tls.lower().startswith('<body'): itmText = '<BODY>' typ = 'object' elif tls.lower().startswith('<head'): itmText = '<HEAD>' typ = 'object' elif tls.lower().startswith('<table'): itmText = '<TABLE>' typ = 'function' elif tls.startswith('<!---'): itmText =tls[5:].replace('-->','') typ = 'heading' # Javascript elif tls.startswith('function '): itmText =tls[9:].rstrip() if itmText.endswith('{'): itmText = itmText[:-1] typ = 'function' elif tls.startswith('//---'): itmText =tls[5:] typ = 'heading' # CSS elif tls.startswith('/*---'): itmText =tls[5:].split('*/')[0] typ = 'heading' if itmText != None: outline.append([spc+itmText,typ,lcnt]) return outline
lucidlylogicole/scope
plugins/outline/lang/html.py
Python
gpl-3.0
1,217
# test driver to verify that new version of code works import opiniongame.config as og_cfg import opiniongame.IO as og_io import opiniongame.coupling as og_coupling import opiniongame.state as og_state import opiniongame.opinions as og_opinions import opiniongame.adjacency as og_adj import opiniongame.selection as og_select import opiniongame.potentials as og_pot import opiniongame.core as og_core import opiniongame.stopping as og_stop import numpy as np # # process command line # cmdline = og_cfg.CmdLineArguments() cmdline.printOut() # # load configuration # # TODO: add option to generate defaults and save to file # TODO: interpret args to get filename if specified on cmd line config = og_cfg.staticParameters() config.readFromFile('staticParameters.cfg') config.threshold = 0.01 config.printOut() # # seed PRNG: must do this before any random numbers are # ever sampled during default generation # print("SEEDING PRNG: "+str(config.startingseed)) np.random.seed(config.startingseed) state = og_state.WorldState.fromCmdlineArguments(cmdline, config) # # run # tau_list = np.arange(0.45, 0.9, 0.01) alpha_list = np.arange(0.05, 0.25, 0.01) numalphas = len(alpha_list) numtaus = len(tau_list) numvars = 3 resultMatrix = np.zeros((numalphas, numtaus, numvars)) for (i, alpha) in enumerate(alpha_list): config.learning_rate = alpha print("") for (j, tau) in enumerate(tau_list): print((alpha, tau)) # # functions for use by the simulation engine # ufuncs = og_cfg.UserFunctions(og_select.FastPairSelection, og_stop.totalChangeStop, og_pot.createTent(tau)) polarized = 0 notPolarized = 0 aveIters = 0 for k in range(100): state = og_core.run_until_convergence(config, state, ufuncs) results = og_opinions.isPolarized(state.history[-1], 0.05) for result in results: if result: polarized += 1 else: notPolarized += 1 aveIters += state.iterCount state.reset() state.initialOpinions = og_opinions.initialize_opinions(config.popSize, config.ntopics) # maybe you want to do Consensus and nonConsensus. Finding consensus is easier! # assuming pop_size = 20, ten people at 1, nine people at 0 and and one person # at 0.5 will be polarization, but, still ... resultMatrix[i][j][0] = polarized resultMatrix[i][j][1] = notPolarized resultMatrix[i][j][2] = aveIters/100.0 rdict = {} rdict['results'] = resultMatrix og_io.saveMatrix('output.mat', rdict)
mjsottile/PyOpinionGame
driver_alpha_tau_study.py
Python
gpl-3.0
2,715
package com.savemgo.mgo1; import java.util.Iterator; import java.util.LinkedList; import java.util.Queue; import java.sql.Connection; import java.sql.SQLException; import java.net.InetSocketAddress; import java.net.InetAddress; import java.util.Map; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.mina.core.session.IoSession; import com.savemgo.mgo1.handlers.*; public class PacketHandler { private static Logger logger = Logger.getLogger(PacketHandler.class); public PacketHandler() { super(); } public boolean handlePacket(IoSession session, Packet pktIn) { this.printPacket(pktIn, true); // For debugging purposes Queue<Packet> queue = new LinkedList<Packet>(); // Output queue Connection con = null; //Setup Lobby Id InetSocketAddress isa = (InetSocketAddress) session.getServiceAddress(); Globals.lobbyId = Globals.lobbies.get(isa.toString()); try { //Check there is a valid session for events requiring a login if(pktIn.cmd > 0x4000 && !Globals.hasSession(session)) { throw new MGOException(pktIn.cmd+1, 999, "Invalid Session"); } //Grab database connection con = DBPool.getConnection(); // Packet Handlers switch (pktIn.cmd) { case 0x0005: // Client Ping queue.add(new Packet(0x0005)); break; case 0x0003: // Client Disconnect //Handled by ServerHandler.sessionClosed() break; /** General Lobby Server Packets */ case 0x2005: // Client Request Lobby Listing queue.add(new Packet(0x2002)); // Lobby listing Start MainLobby.handleGetLobbyListing(session, pktIn, queue, con); queue.add(new Packet(0x2004)); // Lobby listing EOF break; case 0x2008: // Client Request News Listing queue.add(new Packet(0x2009)); // News listing Start MainLobby.handleGetNewsListing(session, pktIn, queue, con); queue.add(new Packet(0x200b)); // News listing EOF break; /** Authentication Server packets */ case 0x3001:// Client Requests hash salt queue.add(new Packet(0x3002, Globals.staticAuthSalt)); break; case 0x3003: // Click Login or session verification if (pktIn.payload.length == 32) { Auth.handleLogin(session, pktIn, queue, con); } else { Auth.handleSessionCheck(session, pktIn, queue, con); } break; case 0x3040: // Client Player info request Auth.handlePlayerInfo(session, pktIn, queue, con); break; case 0x3042: queue.add(new Packet(0x3043, new byte[4])); queue.add(new Packet(0x3045, new byte[4])); break; /** Regional Lobby Player-related packets */ case 0x4100: // Client requests User Settings & Lobby Stats LobbyPlayer.getUserSettings(session, pktIn, queue, con); LobbyPlayer.getLobbyStats(session, pktIn, queue, con); break; case 0x4102: // Client requests Personal Stats LobbyPlayer.getPersonalStats(session, pktIn, queue, con); break; case 0x4110: // Client sends updated User Settings LobbyPlayer.handleUserSettings(session, pktIn, queue, con); break; case 0x4500: // Client adds player to a friend/black list LobbyPlayer.addToList(session,pktIn,queue,con); break; case 0x4510: // Client removes player from friends/black list LobbyPlayer.removeFromList(session,pktIn,queue,con); break; case 0x4580: // Client requests friend/black list queue.add(new Packet(0x4581)); LobbyPlayer.getFBList(session, pktIn, queue, con); queue.add(new Packet(0x4583)); break; case 0x4600: // Client searches a player // TODO: Find this out break; case 0x4700: LobbyPlayer.handleConnectionInfo(session,pktIn,queue,con); break; /** Lobby Game related requests */ case 0x4112: // Client requests "sorted" game list queue.add(new Packet(0x4113, new byte[4])); LobbyGame.getGameList(session, pktIn, queue, con, 0x4114); queue.add(new Packet(0x4115, new byte[4])); break; case 0x4300: // Client requests a game list queue.add(new Packet(0x4301, new byte[4])); LobbyGame.getGameList(session, pktIn, queue, con, 0x4302); queue.add(new Packet(0x4303, new byte[4])); break; case 0x4312: // Client requests game info LobbyGame.getGameInfo(session, pktIn, queue, con); break; case 0x4304: //Client requests last create game settings LobbyGame.getPastGameSettings(session, pktIn, queue, con); break; case 0x4310: // Client sends game settings to create a game LobbyGame.handleCreateGame(session,pktIn,queue,con); break; case 0x4316: // Client says its ready to host queue.add(new Packet(0x4317)); break; case 0x4320: //Client requests host connection information LobbyGame.getHostInformation(session,pktIn,queue,con); break; case 0x4322: queue.add(new Packet(0x4323,new byte[4])); break; /** Regional Lobby Host Related Packets */ case 0x4340: //Player attempting to join LobbyHost.handleJoinAttempt(session,pktIn,queue,con); break; case 0x4342: //Player just quit/dc'd LobbyHost.handlePlayerQuit(session,pktIn,queue,con); break; case 0x4344: //Host sends information about team player just joined LobbyHost.handleTeamJoin(session,pktIn,queue,con); break; case 0x4346: //Host kicked this user LobbyHost.handleKick(session,pktIn,queue,con); break; case 0x4380: //Host is quitting the game LobbyHost.handleHostQuit(session,pktIn,queue,con); break; case 0x4394: queue.add(new Packet(0x4395,new byte[0])); break; case 0x4390: //Host sends stats information LobbyHost.handleStats(session,pktIn,queue,con); break; case 0x4392:// Game tells us what round it is moving to(single byte) LobbyHost.handleNewRound(session,pktIn,queue,con); break; case 0x4398: //Host sends player ping information LobbyHost.handlePingInformation(session,pktIn,queue,con); break; default: logger.error(String.format( "Couldn't handle command 0x%02x (%d), not implemented", pktIn.cmd, pktIn.cmd)); try { con.close(); } catch(Exception e) {} return false; } } catch(MGOException e) { //Check if this exception is informational or has a real cause. if(e.hasCause()) { // e.getException().printStackTrace(); if(e.getMessage()!=null) { logger.error(e.getMessage(), e.getException()); } else { logger.error("MGOException", e.getException()); } } else { if(e.getMessage()!=null) logger.info(e.getMessage()); } //Send error out queue.add(new Packet(e.getCommand(), e.getPayload())); } catch(Exception e) { e.printStackTrace(); } finally { //Done processing close the connection try{ con.close(); }catch(Exception ee) {} } // Loop over output queue and write to wire Iterator<Packet> iterator = queue.iterator(); while (iterator.hasNext()) { Packet pktOut = (Packet) iterator.next(); session.write(pktOut); this.printPacket(pktOut, false); } return true; } /** * Prints the supplied packet, if LogLevel is DEBUG */ protected void printPacket(Packet pktIn, boolean recv) { if (logger.getEffectiveLevel() == Level.DEBUG) { logger.debug(String.format(((recv) ? "Received" : "Sending") + " command 0x%02x (%d)", pktIn.cmd, pktIn.cmd)); String tempString = ""; int debugWidth = 16; if (pktIn.payload.length > 0) { for (int i = 0; i < pktIn.payload.length; i++) { tempString += String.format("%02x ", pktIn.payload[i]); if (i % debugWidth == debugWidth - 1) tempString += "\n"; } logger.debug(String.format("\n\n%s\n\n", tempString)); } } } }
curi0us/mgops
src/com/savemgo/mgo1/PacketHandler.java
Java
gpl-3.0
7,598
#ifndef CAMASS_EXPLORGROUP_HPP #define CAMASS_EXPLORGROUP_HPP #include "src/organizations/VisionGroup.hpp" #include "../roles/Explor.hpp" #include "../roles/ReprExplor.hpp" class ExplorGroup : public VisionGroup { public: ExplorGroup(long idManager); char const *getName() {return "EXPLOR-GROUP";}; }; #endif //CAMASS_EXPLORGROUP_HPP
schlog/camass_v2
configurations/agentOrganization/src/organizations/federation/groups/ExplorGroup.hpp
C++
gpl-3.0
350
<?php namespace Tangram\IO; use Tangram\Question\StrictConfirmationQuestion; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\Question; class ConsoleIO extends BaseIO { /** @var InputInterface */ protected $input; /** @var OutputInterface */ protected $output; /** @var HelperSet */ protected $helperSet; /** @var string */ protected $lastMessage; /** @var string */ protected $lastMessageErr; /** @var float */ private $startTime; /** @var array<int, int> */ private $verbosityMap; /** * Constructor. * * @param InputInterface $input The input instance * @param OutputInterface $output The output instance * @param HelperSet $helperSet The helperSet instance */ public function __construct(InputInterface $input, OutputInterface $output, HelperSet $helperSet) { $this->input = $input; $this->output = $output; $this->helperSet = $helperSet; $this->verbosityMap = array( self::QUIET => OutputInterface::VERBOSITY_QUIET, self::NORMAL => OutputInterface::VERBOSITY_NORMAL, self::VERBOSE => OutputInterface::VERBOSITY_VERBOSE, self::VERY_VERBOSE => OutputInterface::VERBOSITY_VERY_VERBOSE, self::DEBUG => OutputInterface::VERBOSITY_DEBUG, ); } /** * @param float $startTime */ public function enableDebugging($startTime) { $this->startTime = $startTime; } /** * {@inheritDoc} */ public function isInteractive() { return $this->input->isInteractive(); } /** * {@inheritDoc} */ public function isDecorated() { return $this->output->isDecorated(); } /** * {@inheritDoc} */ public function isVerbose() { return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE; } /** * {@inheritDoc} */ public function isVeryVerbose() { return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE; } /** * {@inheritDoc} */ public function isDebug() { return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG; } /** * {@inheritDoc} */ public function write($messages, $newline = true, $verbosity = self::NORMAL) { $this->doWrite($messages, $newline, false, $verbosity); } /** * {@inheritDoc} */ public function writeError($messages, $newline = true, $verbosity = self::NORMAL) { $this->doWrite($messages, $newline, true, $verbosity); } /** * @param array|string $messages * @param bool $newline * @param bool $stderr * @param int $verbosity */ private function doWrite($messages, $newline, $stderr, $verbosity) { $sfVerbosity = $this->verbosityMap[$verbosity]; if ($sfVerbosity > $this->output->getVerbosity()) { return; } // hack to keep our usage BC with symfony<2.8 versions // this removes the quiet output but there is no way around it // see https://github.com/composer/composer/pull/4913 if (OutputInterface::VERBOSITY_QUIET === 0) { $sfVerbosity = OutputInterface::OUTPUT_NORMAL; } if (null !== $this->startTime) { $memoryUsage = memory_get_usage() / 1024 / 1024; $timeSpent = microtime(true) - $this->startTime; $messages = array_map(function ($message) use ($memoryUsage, $timeSpent) { return sprintf('[%.1fMB/%.2fs] %s', $memoryUsage, $timeSpent, $message); }, (array) $messages); } if (true === $stderr && $this->output instanceof ConsoleOutputInterface) { $this->output->getErrorOutput()->write($messages, $newline, $sfVerbosity); $this->lastMessageErr = implode($newline ? "\n" : '', (array) $messages); return; } $this->output->write($messages, $newline, $sfVerbosity); $this->lastMessage = implode($newline ? "\n" : '', (array) $messages); } /** * {@inheritDoc} */ public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { $this->doOverwrite($messages, $newline, $size, false, $verbosity); } /** * {@inheritDoc} */ public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { $this->doOverwrite($messages, $newline, $size, true, $verbosity); } /** * @param array|string $messages * @param bool $newline * @param int|null $size * @param bool $stderr * @param int $verbosity */ private function doOverwrite($messages, $newline, $size, $stderr, $verbosity) { // messages can be an array, let's convert it to string anyway $messages = implode($newline ? "\n" : '', (array) $messages); // since overwrite is supposed to overwrite last message... if (!isset($size)) { // removing possible formatting of lastMessage with strip_tags $size = strlen(strip_tags($stderr ? $this->lastMessageErr : $this->lastMessage)); } // ...let's fill its length with backspaces $this->doWrite(str_repeat("\x08", $size), false, $stderr, $verbosity); // write the new message $this->doWrite($messages, false, $stderr, $verbosity); // In cmd.exe on Win8.1 (possibly 10?), the line can not be cleared, so we need to // track the length of previous output and fill it with spaces to make sure the line is cleared. // See https://github.com/composer/composer/pull/5836 for more details $fill = $size - strlen(strip_tags($messages)); if ($fill > 0) { // whitespace whatever has left $this->doWrite(str_repeat(' ', $fill), false, $stderr, $verbosity); // move the cursor back $this->doWrite(str_repeat("\x08", $fill), false, $stderr, $verbosity); } if ($newline) { $this->doWrite('', true, $stderr, $verbosity); } if ($stderr) { $this->lastMessageErr = $messages; } else { $this->lastMessage = $messages; } } /** * {@inheritDoc} */ public function ask($question, $default = null) { /** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */ $helper = $this->helperSet->get('question'); $question = new Question($question, $default); return $helper->ask($this->input, $this->getErrorOutput(), $question); } /** * {@inheritDoc} */ public function askConfirmation($question, $default = true) { /** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */ $helper = $this->helperSet->get('question'); $question = new StrictConfirmationQuestion($question, $default); return $helper->ask($this->input, $this->getErrorOutput(), $question); } /** * {@inheritDoc} */ public function askAndValidate($question, $validator, $attempts = null, $default = null) { /** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */ $helper = $this->helperSet->get('question'); $question = new Question($question, $default); $question->setValidator($validator); $question->setMaxAttempts($attempts); return $helper->ask($this->input, $this->getErrorOutput(), $question); } /** * {@inheritDoc} */ public function askAndHideAnswer($question) { $this->writeError($question, false); return \Seld\CliPrompt\CliPrompt::hiddenPrompt(true); } /** * {@inheritDoc} */ public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false) { /** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */ $helper = $this->helperSet->get('question'); $question = new ChoiceQuestion($question, $choices, $default); $question->setMaxAttempts($attempts ?: null); // IOInterface requires false, and Question requires null or int $question->setErrorMessage($errorMessage); $question->setMultiselect($multiselect); return $helper->ask($this->input, $this->getErrorOutput(), $question); } /** * @return OutputInterface */ private function getErrorOutput() { if ($this->output instanceof ConsoleOutputInterface) { return $this->output->getErrorOutput(); } return $this->output; } }
nxlib/tangram
src/Tangram/IO/ConsoleIO.php
PHP
gpl-3.0
9,106
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../')) import pyrotrfid # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'pyrotrfid' copyright = u'GLP3' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = pyrotrfid.__version__ # The full version, including alpha/beta/rc tags. release = pyrotrfid.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'rtd' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. html_theme_path = ["themes"] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". html_title = None # A shorter title for the navigation bar. Default is the same as html_title. html_short_title = project + " v" + release # The name of an image file (relative to this directory) to place at the top # of the sidebar. html_logo = 'logo.png' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. html_favicon = 'logo.ico' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {'**': 'links.html'} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. html_show_sphinx = False # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. html_show_copyright = False # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'pyrotrfiddoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [('index', 'pyrotrfid.tex', u'pyrotrfid Documentation', u'', 'manual')] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [('index', 'pyrotrfid', u'pyrotrfid Documentation', [u''], 1)] # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'python': ('http://docs.python.org/', None)}
xapple/pyrotrfid
doc/conf.py
Python
gpl-3.0
7,241
function PrepareGenrePage() { /*var json = [ { "title": "Now Playing", "section": "nowplaying-movie-list-tube" }, { "title": "Upcoming", "section": "upcoming-movie-list-tube" }, { "title": "Previous", "section": "previous-movie-list-tube" }, { "title": "Recently Viewed", "section": "recent-container-tube" } ]; $(".nav-bar-container").append(GetNavBar(json));*/ var name = GetEntityName(document.location.href, "genre"); name = new Util().toPascalCase(name); $(".movies").append("<div class=\"movie-details\" style=\"margin-left: 0px\"><div class=\"tube-tilte\" style=\"width: 200px\">" + name + " Movies</div></div>"); $(".movies").append("<div class=\"movie-list\"></div>"); $(".movies").append("<div class=\"upcoming-movie-list\"></div>"); $(".movies").append("<div class=\"previous-movie-list\"></div>"); $(".movies").append("<div class=\"recent-container\"><div class=\"tube-tilte\">Recent</div></div>"); /*$(".movies").append(GetTubeControl(name + " Movies", "genre-name")); $(".movies").append(GetTubeControl("Now Playing", "nowplaying-movie-list", "nowplaying-movies-pager")); $(".movies").append(GetTubeControl("Upcoming Releases", "upcoming-movie-list", "upcoming-movies-pager")); $(".movies").append(GetTubeControl("Previous Movies", "previous-movie-list", "previous-movies-pager")); $(".movies").append(GetTubeControl("Recently Viewed", "recent-container", "recent-pager")); $(".section-title").each(function () { new Util().AppendLoadImage($(this)); });*/ var apiPath = "/api/GenreMovies?type=" + name; CallHandler(apiPath, PopulateMovies); LoadRecentVisits(); TrackRecentGenreVisit(name); } var TrackRecentGenreVisit = function (name) { var src = $(".review-list").find("img").attr("src"); RecentlyViewedCookies.add({ name: name, type: 'genre', url: "/genre/" + name.replace(' ', '-'), src: src }); }
viren85/moviemirchi
MvcWebRole1/Content/pages/mm.genre.js
JavaScript
gpl-3.0
2,008
require 'test_helper' class FingerbankClientTest < ActiveSupport::TestCase test "truth" do assert_kind_of Class, FingerbankClient end test 'download valid database' do client = FingerbankClient.new assert client.update assert File.exist? 'fingerbank.sqlite' assert (File.stat("fingerbank.sqlite").size > 0) end test 'lookup device in local' do client = FingerbankClient.new device = client.lookup(:user_agent => "A/4.4.4/samsung/SAMSUNG-SGH-I337/MSM8960/AT&T") assert device assert_equal device.name, "Galaxy S4" assert device.has_parent? "Generic Android" end test 'lookup device in upstream' do client = FingerbankClient.new device = client.lookup(:user_agent => "iphone") assert device assert_equal device.name, "Apple iPhone" assert device.has_parent?("Apple iPod, iPhone or iPad") end end
julsemaan/fingerbank_client
test/fingerbank_client_test.rb
Ruby
gpl-3.0
874
--[[ * ReaScript Name: Export markers as YouTube timecode for video description * Screenshot: http://i.imgur.com/KFoTA3a.gif * Author: X-Raym * Author URI: http://www.extremraym.com/ * Repository: GitHub > X-Raym > REAPER-ReaScripts * Repository URI: https://github.com/X-Raym/REAPER-ReaScripts * Licence: GPL v3 * Forum Thread: Scripts: Regions and Markers (various) * Forum Thread URI: http://forum.cockos.com/showthread.php?t=175819 * REAPER: 5.0 * Version: 1.1.2 --]] --[[ * Changelog: * v1.1.2 (2021-31-12) # Remove leading ":" * v1.1.1 (2020-12-09) + Output marker at timecode 0 * v1.1 (2017-01-03) # New format + Don't consider marker before project time 0 + Don't output hour if no markers is over one hour * v1.0 (2016-11-10) + Initial Release --]] -- USER CONFIG AREA --------------------------------------------------------- console = true -- true/false: display debug messages in the console ----------------------------------------------------- END OF USER CONFIG AREA -- Display a message in the console for debugging function Msg(value) if console then reaper.ShowConsoleMsg(tostring(value) .. "\n") end end -- Main function function main() -- LOOP THROUGH REGIONS i=0 repeat iRetval, bIsrgnOut, iPosOut, iRgnendOut, sNameOut, iMarkrgnindexnumberOut, iColorOur = reaper.EnumProjectMarkers3(0,i) if iRetval >= 1 then if bIsrgnOut == false then -- ACTION ON MARKERS HERE abs_pos = tonumber( reaper.format_timestr_pos( math.floor( iPosOut ), "", 3 ) ) if abs_pos and abs_pos >= 0 then pos = reaper.format_timestr_pos( math.floor( iPosOut ), "", 5 ) pos = pos:sub(2, -4) marker = {} marker.name = sNameOut marker.pos = pos table.insert( markers, marker ) if abs_pos >= 3600 then hour = true end end end i = i+1 end until iRetval == 0 for i, marker in ipairs( markers ) do local pos = "" if hour then pos = marker.pos else pos = marker.pos:sub(3) end Msg(pos .. " - " .. marker.name) end end -- INIT --------------------------------------------------------------------- total, num_markers, num_regions = reaper.CountProjectMarkers( -1 ) if num_markers > 0 then reaper.PreventUIRefresh(1) reaper.Undo_BeginBlock() -- Begining of the undo block. Leave it at the top of your main function. reaper.ClearConsole() markers = {} main() reaper.Undo_EndBlock("Export markers as YouTube timecode for video description", -1) -- End of the undo block. Leave it at the bottom of your main function. reaper.UpdateArrange() reaper.PreventUIRefresh(-1) end
X-Raym/REAPER-ReaScripts
Regions/X-Raym_Export markers as YouTube timecode for video description.lua
Lua
gpl-3.0
2,839
# # Check source code for pep8 warning # some files are excluded from this check # pep8 . --exclude constants/countries.py
stoic1979/MoboScrap
check_pep8.sh
Shell
gpl-3.0
123
--- title: Mencari Gambar Terbuka Dengan Mesin Pencari Bersumber Terbuka, Mediachain! date: 2017-03-27 17:54:00 +07:00 tags: - Mediachain - Open Source - Search Engine - Mesin Pencari Bersumber Terbuka - Sumber Terbuka - Mesin Pencari - Lisensi Terbuka author: ccid comments: true img: "/uploads/1-IgI1_DB26LdXeoHxbvHv-Q.png" --- ![1-IgI1_DB26LdXeoHxbvHv-Q.png](/uploads/1-IgI1_DB26LdXeoHxbvHv-Q.png){: .img-responsive .center-block }{: width="500"} [Mediachain](http://www.mediachain.io/) adalah mesin pencari gambar bersumber terbuka yang dikembangkan oleh [Mediachain Labs](http://www.mediachainlabs.com/) untuk yang mampu menampilkan sumber gambar, dan atribusi lengkap dari gambar yang ditemukan oleh pengguna. Proyek ini dibiayai oleh Union Square Ventures, dan Andreessen Horowitz untuk membangun mensin pencari dengan bahasa Universal, dan dapat dikembangkan oleh pihak lain. Maka dari itu Media Chain Labs membagikan beberapa kode Mediachain di akun [Github mereka](http://github.com/mediachain). Selain itu Mediachain Labs juga mengajak pengguna untuk berinteraksi melalui kanal pembicaraan mereka di [Slack](http://slack.mediachain.io/), dan selalu memberikan kabar terbaru untuk para pengembang melalui [medium](https://blog.mediachain.io/mediachain-developer-update-v-a7f6006ad953#.2r04gtmtp). ![Mediachain.jpg](/uploads/Mediachain.jpg){: .img-responsive .center-block }{: width="900"} Mediachain Labs menawarkan fitur mesin pencari yang dapat menampilkan hasil pencarian dari situs-situs pusat gambar terbuka seperti: * pexels.com * dp.la * gettyimages.com * stock.tookapic.com * unsplash.com * pixabay.com * kaboompix.com * lifeofpix.com * skitterphoto.com * snapwiresnaps.tumblr.com * freenaturestocks.com * negativespace.co * jaymantri.com * jeshoots.com * splitshire.com * stokpic.com * gratisography.com * picography.co * startupstockphotos.com * littlevisuals.co * spacex.com * creativevix.com * photos.oliur.com * photos.uncoated.uk * tinyography.com * splashofrain.com * commons.wikimedia.org Segera kunjungi [images.mediachain.io](http://images.mediachain.io/), dan rasakan manfaat gambar-gambar terbuka!
CreativeCommonsIndonesia/CCID
_posts/2017-03-27-mencari-gambar-terbuka-dengan-mesin-pencari-bersumber-terbuka-mediachain.markdown
Markdown
gpl-3.0
2,134
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim: set et sw=4 fenc=utf-8: # # Copyright 2016 INVITE Communications Co., Ltd. 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, 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/>. # """AGI script that renders speech to text using Google Cloud Speech API using the REST API.""" # [START import_libraries] from __future__ import print_function #db_insert = ("INSERT INTO `%s` (`id`, `%s`) VALUES ('%s', '%s')") db_update = ("UPDATE `{0}` SET `{1}` = '{2}' WHERE id = {3}") db_int = ("UPDATE `{0}` SET `{1}` = `{1}` + {2} WHERE id = {3}") #data_insert(db_update % (newTable, 'billsec', '%s' % (billsec), warlist)) data = { 'table': 'tableName', 'field': 'billsec', 'value' : 10, 'id' : 1121 } print(db_update.format(1,2,3,'カタカナ'))
invitecomm/asterisk-ivr
pigeonhole/junk.py
Python
gpl-3.0
1,356
/* * Twittnuker - Twitter client for Android * * Copyright 2013-2017 vanita5 <mail@vanit.as> * * This program incorporates a modified version of * Twidere - Twitter client for Android * * Copyright 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.vanita5.microblog.library.mastodon.annotation; import android.support.annotation.StringDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Created by mariotaku on 2017/4/19. */ @StringDef({StatusVisibility.DIRECT, StatusVisibility.PRIVATE, StatusVisibility.UNLISTED, StatusVisibility.PUBLIC}) @Retention(RetentionPolicy.SOURCE) public @interface StatusVisibility { String DIRECT = "direct"; String PRIVATE = "private"; String UNLISTED = "unlisted"; String PUBLIC = "public"; }
vanita5/twittnuker
twittnuker.component.common/src/main/java/de/vanita5/microblog/library/mastodon/annotation/StatusVisibility.java
Java
gpl-3.0
1,417
var express = require('express'); var router = express.Router(); var conn = require('../objs/SqlConnection.js'); router.use(function timeLog(req, res, next) { console.log('Time: ', Date.now()); next(); }); router.get('/getByUserGroup', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } if(params.userGroupId != '-1'){ var query = `SELECT m.id, m.title, m.content, DATE_FORMAT(m.creation_date, '%d/%m/%Y') as date, m.last_update FROM messages m WHERE m.user_class_groups_id = ?` ; var p = [params.userGroupId]; } else{ var query = `SELECT m.id, m.title, m.content, DATE_FORMAT(m.creation_date, '%d/%m/%Y') as date, m.last_update FROM messages_all m WHERE m.user_id = ?` ; var p = [params.userId]; } connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); router.get('/getByUserId', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } var query = `( SELECT m.id, m.title, m.content, DATE_FORMAT(m.creation_date, '%d/%m/%Y') as date FROM messages m INNER JOIN users_class_groups uc ON m.user_class_groups_id = uc.id WHERE uc.class_group_id IN ( SELECT uc.class_group_id FROM users_class_groups uc WHERE uc.users_id = ? ) ) UNION ( SELECT ma.id, ma.title, ma.content, DATE_FORMAT(ma.creation_date, '%d/%m/%Y') as date FROM messages_all ma INNER JOIN ( SELECT * FROM users WHERE rols_id = 3 ) as u ON ma.user_id = u.id INNER JOIN users_class_groups ucg ON u.id = ucg.users_id WHERE ucg.class_group_id IN ( SELECT uc.class_group_id FROM users_class_groups uc WHERE uc.users_id = ? ) )` ; var p = [params.userId, params.userId]; connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); router.get('/create', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } var query = `INSERT INTO messages ( title, content, user_class_groups_id ) VALUES ( ?, ?, ? )`; var p = [params.title, params.content, params.user_class_groups_id]; connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); router.get('/edit', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } var query = `UPDATE messages SET title = ?, content = ? WHERE id = ?`; var p = [params.title,params.content,params.id]; connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); router.get('/delete', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } var query = `DELETE FROM messages WHERE id = ?`; var p = [params.id]; connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); router.get('/getByUser', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } var query = `SELECT m.id, m.title, m.content, DATE_FORMAT(m.creation_date, '%d/%m/%Y') as date, m.last_update FROM messages_all m WHERE m.user_id = ?` ; var p = [params.userId]; connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); router.get('/createAll', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } var query = `INSERT INTO messages_all ( title, content, user_id ) VALUES ( ?, ?, ? )`; var p = [params.title, params.content, params.user_id]; connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); router.get('/editAll', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } var query = `UPDATE messages_all SET title = ?, content = ? WHERE id = ?`; var p = [params.title,params.content,params.id]; connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); router.get('/deleteAll', function(req, res) { var buf = Buffer.from(req.query.data, 'base64'); var params = JSON.parse(buf); var data = { status:"OK", data:{} }; var connection = new conn.SqlConnection().connection; connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } var query = `DELETE FROM messages_all WHERE id = ?`; var p = [params.id]; connection.query(query, p , function(err, rows) { if (err) { console.error('error query: ' + query + err.stack); data.status = "false"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); return; } data.data = rows; data.status = "true"; var jData = JSON.stringify(data); res.send(new Buffer(jData).toString('base64')); connection.end(); }); }); }); module.exports = router;
JuanMreno/gestoraulapp
routes/messages.js
JavaScript
gpl-3.0
11,343
# -*- encoding: utf-8 -*- '''Dependencies: The ``scoretools`` package should not import ``instrumenttools`` at top level. ''' from abjad.tools import systemtools systemtools.ImportManager.import_structured_package( __path__[0], globals(), ) _documentation_section = 'core'
andrewyoung1991/abjad
abjad/tools/scoretools/__init__.py
Python
gpl-3.0
278
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (11.0.13) on Tue Jan 11 19:22:07 UYT 2022 --> <title>Uses of Package nzilbb.editpath (nzilbb.ag 1.0.5 API)</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="dc.created" content="2022-01-11"> <link rel="stylesheet" type="text/css" href="../../javadoc.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../script.js"></script> <script type="text/javascript" src="../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../jquery/jquery-3.5.1.js"></script> <script type="text/javascript" src="../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package nzilbb.editpath (nzilbb.ag 1.0.5 API)"; } } catch(err) { } //--> var pathtoroot = "../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</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-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </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> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <main role="main"> <div class="header"> <h1 title="Uses of Package nzilbb.editpath" class="title">Uses of Package<br>nzilbb.editpath</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary"> <caption><span>Packages that use <a href="package-summary.html">nzilbb.editpath</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colFirst" scope="row"><a href="#nzilbb.editpath">nzilbb.editpath</a></th> <td class="colLast"> <div class="block">Implementation of Wagner-Fischer algorithm to determine the minimum edit path.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="#nzilbb.encoding.comparator">nzilbb.encoding.comparator</a></th> <td class="colLast"> <div class="block">Comparators for helping <a href="EditComparator.html" title="interface in nzilbb.editpath"><code>EditComparator</code></a> map elements of one encoding to elements of another.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a id="nzilbb.editpath"> <!-- --> </a> <table class="useSummary"> <caption><span>Classes in <a href="package-summary.html">nzilbb.editpath</a> used by <a href="package-summary.html">nzilbb.editpath</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colFirst" scope="row"><a href="class-use/DefaultEditComparator.html#nzilbb.editpath">DefaultEditComparator</a></th> <td class="colLast"> <div class="block">Default implementation of IEditComparator, for which any from/to pair for which equals() is not true is given an edit distance of <a href="DefaultEditComparator.html#getChangeDistance()"><code>DefaultEditComparator.getChangeDistance()</code></a>.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="class-use/EditComparator.html#nzilbb.editpath">EditComparator</a></th> <td class="colLast"> <div class="block">Interface for comparators between elements.</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="class-use/EditStep.html#nzilbb.editpath">EditStep</a></th> <td class="colLast"> <div class="block">Represents a single step in editing one sequency into another.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="class-use/EditStep.StepOperation.html#nzilbb.editpath">EditStep.StepOperation</a></th> <td class="colLast"> <div class="block">Enumeration for representing the operation represented by a step</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="class-use/MinimumEditPath.html#nzilbb.editpath">MinimumEditPath</a></th> <td class="colLast"> <div class="block">Implementation of the <a href="https://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorithm"> Wagner-Fischer algorithm</a> to determine the minimum edit path (or distance) between two sequences.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a id="nzilbb.encoding.comparator"> <!-- --> </a> <table class="useSummary"> <caption><span>Classes in <a href="package-summary.html">nzilbb.editpath</a> used by <a href="../encoding/comparator/package-summary.html">nzilbb.encoding.comparator</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colFirst" scope="row"><a href="class-use/EditComparator.html#nzilbb.encoding.comparator">EditComparator</a></th> <td class="colLast"> <div class="block">Interface for comparators between elements.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="class-use/EditStep.html#nzilbb.encoding.comparator">EditStep</a></th> <td class="colLast"> <div class="block">Represents a single step in editing one sequency into another.</div> </td> </tr> </tbody> </table> </li> </ul> </div> </main> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</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-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../allclasses.html">All&nbsp;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> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> <p class="legalCopy"><small><a rel='license' href='http://creativecommons.org/licenses/by-sa/2.0/'><img alt='CC-BY-SA Creative Commons Licence ' src='/ag/images/cc-by-sa.svg' title='This work is licensed under a Creative Commons Attribution-ShareAlike 2.0 Generic License' /></a><a rel='author' href='https://www.canterbury.ac.nz/nzilbb/'><img src='/ag/images/nzilbb.svg' alt='Te Kāhui Roro Reo | The New Zealand Institute of Language, Brain and Behaviour' title='🄯 2022 NZILBB'></a></small></p> </footer> </body> </html>
nzilbb/ag
docs/apidocs/nzilbb/editpath/package-use.html
HTML
gpl-3.0
9,098
/* * Created by Phil Nash on 19th December 2014 * Copyright 2014 Two Blue Cubes Ltd. All rights reserved. * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED #define TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED // Don't #include any Catch headers here - we can assume they are already // included before this header. // This is not good practice in general but is necessary in this case so this // file can be distributed as a single header that works with the main // Catch single header. #include <cstring> #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif namespace Catch { struct TeamCityReporter : StreamingReporterBase { TeamCityReporter( ReporterConfig const& _config ) : StreamingReporterBase( _config ), m_headerPrintedForThisSection( false ) {} static std::string escape( std::string const& str ) { std::string escaped = str; replaceInPlace( escaped, "|", "||" ); replaceInPlace( escaped, "'", "|'" ); replaceInPlace( escaped, "\n", "|n" ); replaceInPlace( escaped, "\r", "|r" ); replaceInPlace( escaped, "[", "|[" ); replaceInPlace( escaped, "]", "|]" ); return escaped; } virtual ~TeamCityReporter(); static std::string getDescription() { return "Reports test results as TeamCity service messages"; } virtual ReporterPreferences getPreferences() const { ReporterPreferences prefs; prefs.shouldRedirectStdOut = true; return prefs; } virtual void skipTest( TestCaseInfo const& testInfo ) { stream << "##teamcity[testIgnored name='" << escape( testInfo.name ) << "'"; if( testInfo.isHidden() ) stream << " message='hidden test'"; else stream << " message='test skipped because it didn|'t match the test spec'"; stream << "]\n"; } virtual void noMatchingTestCases( std::string const& /* spec */ ) {} virtual void testGroupStarting( GroupInfo const& groupInfo ) { StreamingReporterBase::testGroupStarting( groupInfo ); stream << "##teamcity[testSuiteStarted name='" << escape( groupInfo.name ) << "']\n"; } virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { StreamingReporterBase::testGroupEnded( testGroupStats ); stream << "##teamcity[testSuiteFinished name='" << escape( testGroupStats.groupInfo.name ) << "']\n"; } virtual void assertionStarting( AssertionInfo const& ) { } virtual bool assertionEnded( AssertionStats const& assertionStats ) { AssertionResult const& result = assertionStats.assertionResult; if( !result.isOk() ) { std::ostringstream msg; if( !m_headerPrintedForThisSection ) printSectionHeader( msg ); m_headerPrintedForThisSection = true; msg << result.getSourceInfo() << "\n"; switch( result.getResultType() ) { case ResultWas::ExpressionFailed: msg << "expression failed"; break; case ResultWas::ThrewException: msg << "unexpected exception"; break; case ResultWas::FatalErrorCondition: msg << "fatal error condition"; break; case ResultWas::DidntThrowException: msg << "no exception was thrown where one was expected"; break; case ResultWas::ExplicitFailure: msg << "explicit failure"; break; // We shouldn't get here because of the isOk() test case ResultWas::Ok: case ResultWas::Info: case ResultWas::Warning: // These cases are here to prevent compiler warnings case ResultWas::Unknown: case ResultWas::FailureBit: case ResultWas::Exception: CATCH_NOT_IMPLEMENTED; } if( assertionStats.infoMessages.size() == 1 ) msg << " with message:"; if( assertionStats.infoMessages.size() > 1 ) msg << " with messages:"; for( std::vector<MessageInfo>::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); it != itEnd; ++it ) msg << "\n \"" << it->message << "\""; if( result.hasExpression() ) { msg << "\n " << result.getExpressionInMacro() << "\n" "with expansion:\n" << " " << result.getExpandedExpression() << "\n"; } stream << "##teamcity[testFailed" << " name='" << escape( currentTestCaseInfo->name )<< "'" << " message='" << escape( msg.str() ) << "'" << "]\n"; } return true; } virtual void sectionStarting( SectionInfo const& sectionInfo ) { m_headerPrintedForThisSection = false; StreamingReporterBase::sectionStarting( sectionInfo ); } virtual void testCaseStarting( TestCaseInfo const& testInfo ) { StreamingReporterBase::testCaseStarting( testInfo ); stream << "##teamcity[testStarted name='" << escape( testInfo.name ) << "']\n"; } virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { StreamingReporterBase::testCaseEnded( testCaseStats ); if( !testCaseStats.stdOut.empty() ) stream << "##teamcity[testStdOut name='" << escape( testCaseStats.testInfo.name ) << "' out='" << escape( testCaseStats.stdOut ) << "']\n"; if( !testCaseStats.stdErr.empty() ) stream << "##teamcity[testStdErr name='" << escape( testCaseStats.testInfo.name ) << "' out='" << escape( testCaseStats.stdErr ) << "']\n"; stream << "##teamcity[testFinished name='" << escape( testCaseStats.testInfo.name ) << "']\n"; } private: void printSectionHeader( std::ostream& os ) { assert( !m_sectionStack.empty() ); if( m_sectionStack.size() > 1 ) { os << getLineOfChars<'-'>() << "\n"; std::vector<SectionInfo>::const_iterator it = m_sectionStack.begin()+1, // Skip first section (test case) itEnd = m_sectionStack.end(); for( ; it != itEnd; ++it ) printHeaderString( os, it->name ); os << getLineOfChars<'-'>() << "\n"; } SourceLineInfo lineInfo = m_sectionStack.front().lineInfo; if( !lineInfo.empty() ) os << lineInfo << "\n"; os << getLineOfChars<'.'>() << "\n\n"; } // if string has a : in first line will set indent to follow it on // subsequent lines void printHeaderString( std::ostream& os, std::string const& _string, std::size_t indent = 0 ) { std::size_t i = _string.find( ": " ); if( i != std::string::npos ) i+=2; else i = 0; os << Text( _string, TextAttributes() .setIndent( indent+i) .setInitialIndent( indent ) ) << "\n"; } private: bool m_headerPrintedForThisSection; }; #ifdef CATCH_IMPL TeamCityReporter::~TeamCityReporter() {} #endif INTERNAL_CATCH_REGISTER_REPORTER( "teamcity", TeamCityReporter ) } // end namespace Catch #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
xaizek/dit
tests/Catch/reporters/catch_reporter_teamcity.hpp
C++
gpl-3.0
8,600
# splineAnalysis splineAnalysis is a MATLAB package used to analyze particle trajectories confined to curvilinear structures. # Introduction The motion of biomolecular complexes at the subcellular level takes place in a highly hetergeneous environment. Early versions of this code were written to analyze trajectories confined to curvilinear structures, where traditional 2D mean-square-displacement analysis underestimates rates of diffusion. The current package is a cleaned up version of the original code, restructured to allow other researchers (with a little MATLAB experience) to use this tool. # User Guide The best place to start is by running a basic script [generateTestData.m](https://github.com/berl/splineAnalysis/blob/master/generateTestData.m) analyzing some artificial data of 5 diffusing trajectories confined to a sinusoid. This script illustrates a few things: - How your trajectory data needs to be formulated before analysis. The format we've chosen to use (after Crocker and Grier) is described in more detail in [splineAnalysis2016.m](https://github.com/berl/splineAnalysis/blob/master/splineanalysis2016.m). - Several analysis parameters are combined into the splineParam struct, and the values shown in [generateTestData.m](https://github.com/berl/splineAnalysis/blob/master/generateTestData.m) are chosen to illustrate how the code works on the example data. ## Analysis Parameters in `splineParam` - `myParam.thetaRange = pi/4` The angle range searched forward along the trajectory curve. - `myParam.nTrajShapePoints = 10` The trajectory is spatially divided into this many clusters to provide starting points for the spline curve - `myParam.minTrajLength = 100` A filter in [preshape2016.m](https://github.com/berl/splineAnalysis/blob/master/preshape2016.m) throws out trajectories shorter than this. - `myParam.nSplineCurvePoints = 10000` This sets the number of points in the resampled spline curve. - `myParam.noPlots = true` The intial version of this code included a lot of automatically-saved plots. They're still in the code but may or may not be useful for a given data set. See also the notes below about `interactiveMode`. - `myParam.thetaMax = .2*pi` This is the largest angle acceptable between spline guide points. - `myParam.radiusFactor = 3` The initial search radius is this the average transverse trajectory width multiplied by this factor. - `myParam.radiusRatio = 2` The secondary search is the initial radius multiplied by this factor. These parameter values work well for the example dataset (and for our original experimental data), but may be different for other data sets. ## InteractiveMode During our data analysis, we utilized an interactive mode with several automatically-generated and saved figures and an option to manually classify analyzed trajectories by mouseclick or keyboard. See [splineAnalysis2016.m](https://github.com/berl/splineAnalysis/blob/master/splineanalysis2016.m) around `line 415` for details. ## Project Status Although this project is currently not an active area of development, I will entertain pull requests, suggestions and questions. ## Publication B.R. Long and T.Q. Vu 'Spatial structure and diffusive dynamics from single-particle trajectories using spline analysis' Biophys J. 2010 Apr 21;98(8):1712-21.
berl/splineAnalysis
README.md
Markdown
gpl-3.0
3,321
/* * Imperium * * $Id: cmd_general2.c,v 1.2 2000/05/18 06:50:02 marisa Exp $ * * 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. * * Feel free to modify and use these sources however you wish, so long * as you preserve this copyright notice. * * $Log: cmd_general2.c,v $ * Revision 1.2 2000/05/18 06:50:02 marisa * More autoconf * * Revision 1.1.1.1 2000/05/17 19:15:04 marisa * First CVS checkin * * Revision 4.0 2000/05/16 06:30:49 marisa * patch20: New check-in * * Revision 3.5.1.3 1997/09/03 18:59:08 marisag * patch20: Check in changes before distribution * * Revision 3.5.1.2 1997/03/14 07:24:15 marisag * patch20: N/A * * Revision 3.5.1.1 1997/03/11 20:03:06 marisag * patch20: Fix empty revision. * */ #include "../config.h" #include <stdio.h> #ifdef HAVE_STRING_H #include <string.h> #else #include <strings.h> #endif #include "../Include/Imperium.h" #include "../Include/Request.h" #include "../Include/ImpFeMess.h" #include "Scan.h" #include "ImpPrivate.h" static const char rcsid[] = "$Id: cmd_general2.c,v 1.2 2000/05/18 06:50:02 marisa Exp $"; /* * doDischarge1 - adds up the number of military in the planets for * cmd_discharge */ void doDischarge1(IMP, Planet_t *pl) { if ((readPlQuan(IS, pl, it_civilians) > 25) && (readPlQuan(IS, pl, it_military) > 5)) { IS->is_ULONG1 += readPlQuan(IS, pl, it_military); } } /* * doDischarge2 - does the actual discharges for cmd_discharge */ void doDischarge2(IMP, register Planet_t *pl) { register ULONG plNum; register USHORT discharged; if ((readPlQuan(IS, pl, it_civilians) > 25) && (readPlQuan(IS, pl, it_military) > 5)) { plNum = pl->pl_number; server(IS, rt_lockPlanet, plNum); pl = &IS->is_request.rq_u.ru_planet; if (pl->pl_btu < 3) { server(IS, rt_unlockPlanet, plNum); userP(IS, "Insufficient BTUs on ", pl, " to discharge anyone\n"); return; } pl->pl_btu -= 3; discharged = umin(127 - readPlQuan(IS, pl, it_civilians), readPlQuan(IS, pl, it_military) * IS->is_USHORT1 / 100); writePlQuan(IS, pl, it_military, readPlQuan(IS, pl, it_military) - discharged); writePlQuan(IS, pl, it_civilians, readPlQuan(IS, pl, it_civilians) + discharged); server(IS, rt_unlockPlanet, plNum); if (discharged) { IS->is_ULONG1 += discharged; userN(IS, discharged); userP(IS, " military released from active service on ", pl, "\n"); fePlDirty(IS, plNum); } } } /* * cmd_discharge - Allows a player to discharge military from a planet. * Note that only grunts can be discharged, not officers */ BOOL cmd_discharge(IMP) { PlanetScan_t ps; ULONG wanted; if (reqPlanets(IS, &ps, "Enter planets to discharge on") && doSkipBlanks(IS) && reqNumber(IS, &wanted, "Total number to discharge")) { IS->is_ULONG1 = 0; (void) scanPlanets(IS, &ps, doDischarge1); IS->is_USHORT1 = wanted * 100 / IS->is_ULONG1; if (IS->is_USHORT1 > 50) { IS->is_USHORT1 = 50; } IS->is_ULONG1 = 0; (void) scanPlanets(IS, &ps, doDischarge2); if (IS->is_ULONG1 == 0) { err(IS, "nobody signed up for early retirement - how " "flattering!"); } else { userN(IS, IS->is_ULONG1); user(IS, " military discharged\n"); } return TRUE; } return FALSE; } /* * cmd_power - builds up and displays a power report */ void cmd_power(IMP) { PowerHead_t ph; PowerData_t pd[PLAYER_MAX]; PowerData_t temp; register Planet_t *rpl; register Ship_t *rsh; register World_t *rw; register PowerData_t *d; char *ptr; register USHORT i, j; register ULONG plNum; USHORT play; ULONG shipNumber, lastItem; BOOL needRecalc, aborted, powAll; char prog[85]; needRecalc = FALSE; aborted = FALSE; powAll = FALSE; rpl = &IS->is_request.rq_u.ru_planet; rsh = &IS->is_request.rq_u.ru_ship; rw = &IS->is_request.rq_u.ru_world; ptr = IS->is_textInPos; if (*ptr != '\0') { *skipWord(IS) = '\0'; if (strcmp(ptr, "force") == 0) { if ((IS->is_player.p_status == ps_deity) || IS->is_world.w_nonDeityPower) { if ((IS->is_player.p_status == ps_active) || (IS->is_player.p_status == ps_deity)) { needRecalc = TRUE; } else { err(IS, "You must be an active player to use the 'force' " "option"); } } else { err(IS, "Only a deity can force a new power report - option " "ignored"); } } else if (strcmp(ptr, "all") == 0) { powAll = TRUE; } else { err(IS, "Unknown option to 'power'"); } } /* check if another user is already updating the report */ if (needRecalc) { server(IS, rt_readWorld, 0); if (rw->w_doingPower) { user(IS, "Another player is already updating the report, please " "wait for them to finish\n"); return; } } if (!needRecalc) { /* read any existing power report */ server(IS, rt_readPower, 1); if (IS->is_request.rq_whichUnit == 0) { err(IS, "power report not available"); return; } else { ph = IS->is_request.rq_u.ru_powerHead; i = 0; server(IS, rt_readPower, 1); while(IS->is_request.rq_whichUnit) { /* just in case we have a garbage file! */ if (i < PLAYER_MAX) { pd[i] = IS->is_request.rq_u.ru_powerData; i++; } server(IS, rt_readPower, 1); } if (i != ph.ph_playerCount) { err(IS, "power report invalid"); return; } else { if (!IS->is_world.w_doingPower) { if ((IS->is_player.p_status == ps_active) || (IS->is_player.p_status == ps_deity)) { if ((ph.ph_lastTime < IS->is_request.rq_time - IS->is_world.w_secondsPerITU * 48) && ((IS->is_player.p_status == ps_deity) || IS->is_world.w_nonDeityPower) && ask(IS, "Power report is stale. Recompute? ")) { needRecalc = TRUE; } } } } } } if (needRecalc) { server(IS, rt_lockWorld, 0); rw->w_doingPower = TRUE; server(IS, rt_unlockWorld, 0); user(IS, "Recalculating power report\n"); if (IS->is_player.p_feMode == 0) { user(IS, " (CTRL-C to abort)\n"); } /* initialize the slots for the various players */ for (play = 0; play < IS->is_world.w_currPlayers; play++) { server(IS, rt_readPlayer, play); d = &pd[play]; d->pd_player = play; d->pd_plan = 0; d->pd_civ = 0; d->pd_mil = 0; d->pd_shell = 0; d->pd_gun = 0; d->pd_plane = 0; d->pd_bar = 0; d->pd_effic = 0; d->pd_ship = 0; d->pd_tons = 0; d->pd_money = IS->is_request.rq_u.ru_player.p_money; } /* add up the contents of all of the planets in the world */ plNum = 0; lastItem = 0; while ((plNum < IS->is_world.w_planetNext) && !aborted) { if (IS->is_player.p_feMode == 0) { if ((plNum - lastItem) > 25) { userC(IS, '*'); uFlush(IS); lastItem = plNum; } } else { if ((plNum - lastItem) > 200) { sprintf(prog, "!Examining planet %u", plNum); uPrompt(IS, prog); lastItem = plNum; } } /* do NOT update the planet */ server(IS, rt_readPlanet, plNum); if (rpl->pl_owner != NO_OWNER) { d = &pd[rpl->pl_owner]; d->pd_plan++; d->pd_civ += (readPlQuan(IS, rpl, it_civilians) + readPlQuan(IS, rpl, it_civilians)); d->pd_mil += (readPlQuan(IS, rpl, it_military) + readPlQuan(IS, rpl, it_military)); d->pd_shell += readPlQuan(IS, rpl, it_missiles); d->pd_gun += readPlQuan(IS, rpl, it_weapons); d->pd_plane += readPlQuan(IS, rpl, it_planes); d->pd_bar += readPlQuan(IS, rpl, it_bars); d->pd_effic += rpl->pl_efficiency; } plNum++; aborted = clGotCtrlC(IS); /* If aborted, then turn off the flag */ if (aborted) { server(IS, rt_lockWorld, 0); rw->w_doingPower = FALSE; server(IS, rt_unlockWorld, 0); } } /* add in the contents of all of the ships */ if ((IS->is_world.w_shipNext != 0) && !aborted) { shipNumber = 0; lastItem = 0; while ((shipNumber < IS->is_world.w_shipNext) && !aborted) { if ((shipNumber - lastItem) > 15) { if (IS->is_player.p_feMode == 0) { userC(IS, '$'); uFlush(IS); } else { sprintf(prog, "!Examining ship %u", shipNumber); uPrompt(IS, prog); } lastItem = shipNumber; } server(IS, rt_readShip, shipNumber); if (rsh->sh_owner != NO_OWNER) { d = &pd[rsh->sh_owner]; d->pd_ship++; d->pd_tons += IS->is_world.w_shipCost[rsh->sh_type]; d->pd_civ += (rsh->sh_items[it_civilians] + rsh->sh_items[it_civilians]); d->pd_mil += (rsh->sh_items[it_military] + rsh->sh_items[it_military]); d->pd_shell += rsh->sh_items[it_missiles]; d->pd_gun += rsh->sh_items[it_weapons]; d->pd_plane += rsh->sh_items[it_planes]; d->pd_bar += rsh->sh_items[it_bars]; } shipNumber++; aborted = clGotCtrlC(IS); /* If aborted, then turn off the flag */ if (aborted) { server(IS, rt_lockWorld, 0); rw->w_doingPower = FALSE; server(IS, rt_unlockWorld, 0); } } } userNL(IS); if (!aborted) { /* calculate the power for each player based on the stats */ for (play = 1; play < IS->is_world.w_currPlayers; play++) { d = &pd[play]; d->pd_power = (d->pd_effic + d->pd_gun) / 3 + (d->pd_civ + d->pd_mil + d->pd_shell + d->pd_tons) / 10 + d->pd_money / 100 + d->pd_plane + d->pd_ship + d->pd_bar * 5; } /* if enough players, sort them by power */ if (IS->is_world.w_currPlayers > 2) { for (i = IS->is_world.w_currPlayers - 2; i >= 1; i--) { for (j = 1; j <= i; j++) { if (pd[j].pd_power < pd[j + 1].pd_power) { temp = pd[j]; pd[j] = pd[j + 1]; pd[j + 1] = temp; } } } } ph.ph_lastTime = IS->is_request.rq_time; ph.ph_playerCount = IS->is_world.w_currPlayers; for (i = 1; i < ph.ph_playerCount; i++) { d = &pd[i]; server(IS, rt_readPlayer, d->pd_player); if ((IS->is_player.p_status == ps_deity) && (IS->is_request.rq_u.ru_player.p_planetCount != d->pd_plan)) { user3(IS, "NOTE: Player ", &IS->is_request.rq_u.ru_player.p_name[0], " has "); userN(IS, d->pd_plan); userN3(IS, " planets, but player record shows ", IS->is_request.rq_u.ru_player.p_planetCount, " planets!\n"); } } /* try to write the resulting power file */ IS->is_request.rq_u.ru_powerHead = ph; server(IS, rt_writePower, 1); if (IS->is_request.rq_whichUnit == 0) { err(IS, "error writing power file"); aborted = TRUE; /* aborted, turn off the flag */ server(IS, rt_lockWorld, 0); rw->w_doingPower = FALSE; server(IS, rt_unlockWorld, 0); } else { i = 0; while (i < IS->is_world.w_currPlayers) { IS->is_request.rq_u.ru_powerData = pd[i]; i++; server(IS, rt_writePower, 1); if (IS->is_request.rq_whichUnit == 0) { err(IS, "error writing power file"); aborted = TRUE; i = IS->is_world.w_currPlayers; /* aborted, turn off the flag */ server(IS, rt_lockWorld, 0); rw->w_doingPower = FALSE; server(IS, rt_unlockWorld, 0); } } if (!aborted) { server(IS, rt_writePower, 0); /* done - turn off the flag */ server(IS, rt_lockWorld, 0); rw->w_doingPower = FALSE; server(IS, rt_unlockWorld, 0); user(IS, "Power report updated\n\n"); } } } } if (!aborted) { user(IS, "Imperium power report as of "); uTime(IS, ph.ph_lastTime); user(IS, ":\n"); user(IS, " plan civ mil sh gun pl bar % ship $ pow player\n" ); dash(IS, 75); for (i = 1; i < ph.ph_playerCount; i++) { d = &pd[i]; server(IS, rt_readPlayer, d->pd_player); if ((IS->is_request.rq_u.ru_player.p_status == ps_active) || (powAll == TRUE)) { fePowerReport(IS); userF(IS, d->pd_plan, 5); userF(IS, d->pd_civ, 7); userF(IS, d->pd_mil, 7); userF(IS, d->pd_shell, 6); userF(IS, d->pd_gun, 5); userF(IS, d->pd_plane, 5); userF(IS, d->pd_bar, 5); /* prevent a division by zero error */ if (d->pd_plan) { userF(IS, d->pd_effic / d->pd_plan, 4); } else { userF(IS, 0, 4); } userF(IS, d->pd_ship, 4); userF(IS, d->pd_money, 8); userF(IS, d->pd_power, 6); user3(IS, " ", &IS->is_request.rq_u.ru_player.p_name[0], "\n"); } } userNL(IS); } } /* * cmd_grant - allows one player to give a planet to another player */ BOOL cmd_grant(IMP) { register Planet_t *rpl; register Player_t *rp; USHORT who; ULONG plNum; Planet_t savePl; UBYTE race; if (reqPlanet(IS, &plNum, "Planet to grant? ") && doSkipBlanks(IS) && reqPlayer(IS, &who, "Player to grant it to? ")) { server(IS, rt_readPlanet, plNum); rpl = &IS->is_request.rq_u.ru_planet; rp = &IS->is_request.rq_u.ru_player; if (rpl->pl_owner != IS->is_player.p_number) { err(IS, "you don't own that planet"); } else if (rpl->pl_btu < 2) { err(IS, "not enough BTUs on that planet to grant it to someone " "else"); } else { server(IS, rt_lockPlanet, plNum); rpl->pl_btu -= 2; updatePlanet(IS); server(IS, rt_unlockPlanet, plNum); if (rpl->pl_owner != IS->is_player.p_number) { err(IS, "planet lost during update"); } else { server(IS, rt_readPlayer, who); if (rp->p_status != ps_active) { err(IS, "that player is not active"); } else { server(IS, rt_lockPlayer, who); rp->p_planetCount++; race = rp->p_race; server(IS, rt_unlockPlayer, who); server(IS, rt_lockPlanet, plNum); memset(&rpl->pl_checkpoint[0], '\0', PLAN_PSWD_LEN * sizeof(char)); /* see about relations */ if (rpl->pl_transfer != pt_hostile) { rpl->pl_lastOwner = rpl->pl_owner; rpl->pl_transfer = pt_trade; } rpl->pl_owner = who; savePl = *rpl; server(IS, rt_unlockPlanet, plNum); server(IS, rt_lockWorld, 0); IS->is_request.rq_u.ru_world.w_race[IS->is_player.p_race].r_planetCount--; IS->is_request.rq_u.ru_world.w_race[race].r_planetCount++; server(IS, rt_unlockWorld, 0); IS->is_world.w_race[IS->is_player.p_race].r_planetCount = IS->is_request.rq_u.ru_world.w_race[IS->is_player.p_race].r_planetCount; IS->is_world.w_race[race].r_planetCount = IS->is_request.rq_u.ru_world.w_race[race].r_planetCount; userP(IS, "Planet ", &savePl, " granted to "); user2(IS, &rp->p_name[0], ".\n"); server(IS, rt_lockPlayer, IS->is_player.p_number); rp->p_planetCount--; IS->is_player.p_planetCount = rp->p_planetCount; server(IS, rt_unlockPlayer, IS->is_player.p_number); if (IS->is_player.p_planetCount == 0) { user(IS, "You have just given away your last " "planet!!\n"); } user(IS, &IS->is_player.p_name[0]); userP(IS, " has granted you planet ", &savePl, "."); notify(IS, who); news(IS, n_grant_planet, IS->is_player.p_number, who); } } } return TRUE; } return FALSE; } /* * doDump - part of cmd_dump */ void doDump(IMP, register Planet_t *pl) { register ItemType_t it; /* we put all the contsant stuff up here */ user(IS, FE_PLDUMP); /* indicate that this is a planet dump */ userX(IS, pl->pl_number, 8); userX(IS, pl->pl_row, 4); userX(IS, pl->pl_col, 4); userX(IS, pl->pl_techLevel, 8); userX(IS, pl->pl_resLevel, 8); userX(IS, pl->pl_lastUpdate, 8); if (pl->pl_plagueStage > 1) { userX(IS, pl->pl_plagueStage, 1); } else { userX(IS, 0, 1); } if (pl->pl_transfer == pt_hostile) { userX(IS, 1, 1); } else { userX(IS, 0, 1); } userX(IS, pl->pl_class, 1); userX(IS, pl->pl_mobility, 4); userX(IS, pl->pl_efficiency, 2); userX(IS, pl->pl_minerals, 2); userX(IS, pl->pl_gold, 2); userX(IS, pl->pl_polution, 2); userX(IS, pl->pl_gas, 2); userX(IS, pl->pl_water, 2); userX(IS, pl->pl_size, 1); userX(IS, pl->pl_btu, 4); if (pl->pl_checkpoint[0] != '\0') { if (strchr(&pl->pl_checkpoint[0], '!') == NULL) { userX(IS, 1, 1); } else { userX(IS, 2, 1); } } else { userX(IS, 0, 1); } /* if the player is a diety, print extra info */ if (IS->is_player.p_status == ps_deity) { userC(IS, '*'); /* indicates a deity block follows */ userX(IS, pl->pl_owner, 2); userX(IS, pl->pl_lastOwner, 2); userX(IS, pl->pl_plagueStage, 2); userX(IS, pl->pl_plagueTime, 2); } /* now add on the variable length stuff */ userC(IS, '@'); /* indicate start of variable length */ for (it = IT_FIRST; it <= IT_LAST; it++) { userX(IS, readPlQuan(IS, pl, it), 4); } for (it = PPROD_FIRST; it <= PPROD_LAST; it++) { userX(IS, pl->pl_prod[it], 4); userX(IS, pl->pl_workPer[it], 2); } userNL(IS); } /* * cmd_dump - allows a user to dump out mucho info on planets they own in * a compact ASCII hexidecimal format for use with front ends or * other kinds of map builders */ void cmd_dump(IMP) { PlanetScan_t ps; if (reqPlanets(IS, &ps, "Planets to dump? ")) { uTime(IS, IS->is_request.rq_time); userNL(IS); (void) scanPlanets(IS, &ps, doDump); } } /* * cmd_name - allows a player to name ships or planets that they own */ void cmd_name(IMP) { register Ship_t *rsh; register Planet_t *rpl; ULONG itemNum; BOOL isShip; if (reqPlanetOrShip(IS, &itemNum, &isShip, "Name which planet or ship")) { rsh = &IS->is_request.rq_u.ru_ship; rpl = &IS->is_request.rq_u.ru_planet; (void) skipBlanks(IS); if (isShip) { server(IS, rt_readShip, itemNum); if (rsh->sh_owner != IS->is_player.p_number) { user(IS, "You don't own that ship!\n"); } else { if (rpl->pl_name[0] != '\0') { user3(IS, "Current planet name: ", &rpl->pl_name[0], "\n"); } uPrompt(IS, "Enter new ship name"); if (clReadUser(IS)) { if (*IS->is_textInPos != '\0') { server(IS, rt_lockShip, itemNum); if (strcmp(&IS->is_textIn[0], "none") == 0) { rsh->sh_name[0] = '\0'; } else { IS->is_textIn[SHIP_NAME_LEN - 1] = '\0'; strncpy(&rsh->sh_name[0], &IS->is_textIn[0], (SHIP_NAME_LEN - 1) * sizeof(char)); } server(IS, rt_unlockShip, itemNum); feShDirty(IS, itemNum); } } } } else { server(IS, rt_readPlanet, itemNum); if (rpl->pl_owner != IS->is_player.p_number) { user(IS, "You don't control that planet!\n"); } else { if (rpl->pl_name[0] != '\0') { user3(IS, "Current planet name: ", &rpl->pl_name[0], "\n"); } uPrompt(IS, "Enter new planet name"); if (clReadUser(IS)) { if (*IS->is_textInPos != '\0') { server(IS, rt_lockPlanet, itemNum); if (strcmp(&IS->is_textIn[0], "none") == 0) { rpl->pl_name[0] = '\0'; } else { IS->is_textIn[PLAN_NAME_LEN - 1] = '\0'; strncpy(&rpl->pl_name[0], &IS->is_textIn[0], (PLAN_NAME_LEN - 1) * sizeof(char)); } server(IS, rt_unlockPlanet, itemNum); fePlDirty(IS, itemNum); } } } } } } /* * doPlate - does the actual plating for cmd_plate * Convention: the planet and ship are in the request as a pair. */ void doPlate(IMP) { register PlanetShipPair_t *rp; register USHORT maxArm, present, loaded; ULONG plNum, shipNumber; ULONG amount, maxLoad, amountOrig; char buf[256]; rp = &IS->is_request.rq_u.ru_planetShipPair; plNum = rp->p_p.pl_number; shipNumber = rp->p_sh.sh_number; maxArm = IS->is_world.w_shipCargoLim[rp->p_sh.sh_type]; present = rp->p_p.pl_prod[pp_hull]; loaded = rp->p_sh.sh_cargo; if ((present == 0) && (maxArm != loaded)) { userP(IS, "No armor plating on planet #", &rp->p_p, "\n"); } else if (rp->p_p.pl_btu < 2) { userP(IS, "Not enough BTUs on planet #", &rp->p_p, "\n"); } else if ((present != 0) && ((maxArm == loaded) || (maxArm - loaded < IS->is_world.w_armourWeight))) { user(IS, "There is no room for any additional armor plating\n"); } else if ((present != 0) && (maxArm != loaded)) { maxLoad = umin((maxArm - loaded) / IS->is_world.w_armourWeight, present); *IS->is_textInPos = '\0'; userN(IS, present); user(IS, " units of plating"); userN2(IS, " here, ", rp->p_sh.sh_armourLeft); userN3(IS, " already installed, add how many (max ", maxLoad, ")"); getPrompt(IS, &buf[0]); if (!reqPosRange(IS, &amount, maxLoad, &buf[0])) { amount = 0; } if (amount != 0) { amountOrig = amount; server2(IS, rt_lockPlanetShipPair, plNum, shipNumber); present = rp->p_p.pl_prod[pp_hull]; if (amount > present) { amount = present; } loaded = rp->p_sh.sh_cargo; if (amount > maxArm - loaded) { amount = maxArm - loaded; } rp->p_p.pl_prod[pp_hull] -= amount; if (rp->p_p.pl_btu >= 2) { rp->p_p.pl_btu -= 2; } else { rp->p_p.pl_btu = 0; } rp->p_sh.sh_cargo += (amount * IS->is_world.w_armourWeight); rp->p_sh.sh_armourLeft += amount; /* if the planet is infected, infect the ship */ if (((rp->p_p.pl_plagueStage == 2) || (rp->p_p.pl_plagueStage == 3)) && (rp->p_sh.sh_plagueStage == 0)) { rp->p_sh.sh_plagueStage = 1; rp->p_sh.sh_plagueTime = impRandom(IS, IS->is_world.w_plagueOneRand) + IS->is_world.w_plagueOneBase; } server2(IS, rt_unlockPlanetShipPair, plNum, shipNumber); if (amount != amountOrig) { userN3(IS, "Events have prevented you from adding more than ", amount, " units.\n"); } } } } /* * cmd_plate - allows a player to put armor onto a ship */ BOOL cmd_plate(IMP) { register Ship_t *rsh; register Planet_t *rpl; register PlanetShipPair_t *rpp; Ship_t saveShip; Planet_t savePl; ULONG shipNumber, plNum=NO_ITEM; BOOL aborting; /* get the ship number */ if (reqShip(IS, &shipNumber, "Ship to plate")) { /* set up the pointers */ rsh = &IS->is_request.rq_u.ru_ship; rpl = &IS->is_request.rq_u.ru_planet; rpp = &IS->is_request.rq_u.ru_planetShipPair; (void) skipBlanks(IS); aborting = FALSE; /* abort if they entered an invalid number to plate */ if (!aborting) { /* read the ship in */ server(IS, rt_readShip, shipNumber); /* make sure they own it */ if (rsh->sh_owner != IS->is_player.p_number) { err(IS, "you don't own that ship"); } else { /* make sure the ship is on a planet */ if (rsh->sh_planet == NO_ITEM) { err(IS, "ship is not on a planet"); aborting = TRUE; } else if (rsh->sh_type == st_m) { err(IS, "ship is a miner"); aborting = TRUE; } else { /* update the ship */ server(IS, rt_lockShip, shipNumber); updateShip(IS); server(IS, rt_unlockShip, shipNumber); /* store the updated ship */ saveShip = *rsh; /* find out which planet in the sector we are on */ plNum = whichPlanet(IS, saveShip.sh_row, saveShip.sh_col); if (plNum != NO_ITEM) { /* update the planet, if needed */ accessPlanet(IS, plNum); /* save the planet for later use */ savePl = *rpl; /* verify that the player owns the planet or the */ /* planet is unowned */ if (rpl->pl_owner != IS->is_player.p_number) { if (rpl->pl_owner != NO_OWNER) { /* someone else owns it, so look for a */ /* checkpoint code */ if (rpl->pl_checkpoint[0] == '\0') { userP(IS, "Planet ", rpl, " is owned by " "someone else\n"); aborting = TRUE; } else { /* there is a code, so see if the plyr */ /* knows it */ if (!verifyCheckPoint(IS, rpl, cpt_access)) { /* they didn't */ aborting = TRUE; } } } else { /* see if this planet is a "home" planet */ if (isHomePlanet(IS, rpl->pl_number) != NO_RACE) { if (IS->is_player.p_race != rpl->pl_ownRace) { err(IS, "that planet is the home " "planet of another race"); aborting = TRUE; } } } } } else { /* somehow the ship thinks it is on one planet, */ /* when the planet is located somewhere else */ err(IS, "invalid planet in cmd_plate"); aborting = TRUE; } } /* is everything still hunky dorey? */ if (!aborting) { /* fill in the planetShipPair struct */ rpp->p_sh = saveShip; rpp->p_p = savePl; doPlate(IS); fePlDirty(IS, plNum); feShDirty(IS, shipNumber); } } return TRUE; } return FALSE; } return FALSE; }
fstltna/Imperium
Library/cmd_general2.c
C
gpl-3.0
34,295
/* * Zlib (RFC1950 / RFC1951) compression for PuTTY. * * There will no doubt be criticism of my decision to reimplement * Zlib compression from scratch instead of using the existing zlib * code. People will cry `reinventing the wheel'; they'll claim * that the `fundamental basis of OSS' is code reuse; they'll want * to see a really good reason for me having chosen not to use the * existing code. * * Well, here are my reasons. Firstly, I don't want to link the * whole of zlib into the PuTTY binary; PuTTY is justifiably proud * of its small size and I think zlib contains a lot of unnecessary * baggage for the kind of compression that SSH requires. * * Secondly, I also don't like the alternative of using zlib.dll. * Another thing PuTTY is justifiably proud of is its ease of * installation, and the last thing I want to do is to start * mandating DLLs. Not only that, but there are two _kinds_ of * zlib.dll kicking around, one with C calling conventions on the * exported functions and another with WINAPI conventions, and * there would be a significant danger of getting the wrong one. * * Thirdly, there seems to be a difference of opinion on the IETF * secsh mailing list about the correct way to round off a * compressed packet and start the next. In particular, there's * some talk of switching to a mechanism zlib isn't currently * capable of supporting (see below for an explanation). Given that * sort of uncertainty, I thought it might be better to have code * that will support even the zlib-incompatible worst case. * * Fourthly, it's a _second implementation_. Second implementations * are fundamentally a Good Thing in standardisation efforts. The * difference of opinion mentioned above has arisen _precisely_ * because there has been only one zlib implementation and * everybody has used it. I don't intend that this should happen * again. */ #include <stdlib.h> #include <assert.h> #ifdef ZLIB_STANDALONE /* * This module also makes a handy zlib decoding tool for when * you're picking apart Zip files or PDFs or PNGs. If you compile * it with ZLIB_STANDALONE defined, it builds on its own and * becomes a command-line utility. * * Therefore, here I provide a self-contained implementation of the * macros required from the rest of the PuTTY sources. */ #define snew(type) ( (type *) malloc(sizeof(type)) ) #define snewn(n, type) ( (type *) malloc((n) * sizeof(type)) ) #define sresize(x, n, type) ( (type *) realloc((x), (n) * sizeof(type)) ) #define sfree(x) ( free((x)) ) #else #include "ssh.h" #endif #ifndef FALSE #define FALSE 0 #define TRUE (!FALSE) #endif /* ---------------------------------------------------------------------- * Basic LZ77 code. This bit is designed modularly, so it could be * ripped out and used in a different LZ77 compressor. Go to it, * and good luck :-) */ struct LZ77InternalContext; struct LZ77Context { struct LZ77InternalContext *ictx; void *userdata; void (*literal) (struct LZ77Context * ctx, unsigned char c); void (*match) (struct LZ77Context * ctx, int distance, int len); }; /* * Initialise the private fields of an LZ77Context. It's up to the * user to initialise the public fields. */ static int lz77_init(struct LZ77Context *ctx); /* * Supply data to be compressed. Will update the private fields of * the LZ77Context, and will call literal() and match() to output. * If `compress' is FALSE, it will never emit a match, but will * instead call literal() for everything. */ static void lz77_compress(struct LZ77Context *ctx, unsigned char *data, int len, int compress); /* * Modifiable parameters. */ #define WINSIZE 32768 /* window size. Must be power of 2! */ #define HASHMAX 2039 /* one more than max hash value */ #define MAXMATCH 32 /* how many matches we track */ #define HASHCHARS 3 /* how many chars make a hash */ /* * This compressor takes a less slapdash approach than the * gzip/zlib one. Rather than allowing our hash chains to fall into * disuse near the far end, we keep them doubly linked so we can * _find_ the far end, and then every time we add a new byte to the * window (thus rolling round by one and removing the previous * byte), we can carefully remove the hash chain entry. */ #define INVALID -1 /* invalid hash _and_ invalid offset */ struct WindowEntry { short next, prev; /* array indices within the window */ short hashval; }; struct HashEntry { short first; /* window index of first in chain */ }; struct Match { int distance, len; }; struct LZ77InternalContext { struct WindowEntry win[WINSIZE]; unsigned char data[WINSIZE]; int winpos; struct HashEntry hashtab[HASHMAX]; unsigned char pending[HASHCHARS]; int npending; }; static int lz77_hash(unsigned char *data) { return (257 * data[0] + 263 * data[1] + 269 * data[2]) % HASHMAX; } static int lz77_init(struct LZ77Context *ctx) { struct LZ77InternalContext *st; int i; st = snew(struct LZ77InternalContext); if (!st) return 0; ctx->ictx = st; for (i = 0; i < WINSIZE; i++) st->win[i].next = st->win[i].prev = st->win[i].hashval = INVALID; for (i = 0; i < HASHMAX; i++) st->hashtab[i].first = INVALID; st->winpos = 0; st->npending = 0; return 1; } static void lz77_advance(struct LZ77InternalContext *st, unsigned char c, int hash) { int off; /* * Remove the hash entry at winpos from the tail of its chain, * or empty the chain if it's the only thing on the chain. */ if (st->win[st->winpos].prev != INVALID) { st->win[st->win[st->winpos].prev].next = INVALID; } else if (st->win[st->winpos].hashval != INVALID) { st->hashtab[st->win[st->winpos].hashval].first = INVALID; } /* * Create a new entry at winpos and add it to the head of its * hash chain. */ st->win[st->winpos].hashval = hash; st->win[st->winpos].prev = INVALID; off = st->win[st->winpos].next = st->hashtab[hash].first; st->hashtab[hash].first = st->winpos; if (off != INVALID) st->win[off].prev = st->winpos; st->data[st->winpos] = c; /* * Advance the window pointer. */ st->winpos = (st->winpos + 1) & (WINSIZE - 1); } #define CHARAT(k) ( (k)<0 ? st->data[(st->winpos+k)&(WINSIZE-1)] : data[k] ) static void lz77_compress(struct LZ77Context *ctx, unsigned char *data, int len, int compress) { struct LZ77InternalContext *st = ctx->ictx; int i, hash, distance, off, nmatch, matchlen, advance; struct Match defermatch, matches[MAXMATCH]; int deferchr; /* * Add any pending characters from last time to the window. (We * might not be able to.) */ for (i = 0; i < st->npending; i++) { unsigned char foo[HASHCHARS]; int j; if (len + st->npending - i < HASHCHARS) { /* Update the pending array. */ for (j = i; j < st->npending; j++) st->pending[j - i] = st->pending[j]; break; } for (j = 0; j < HASHCHARS; j++) foo[j] = (i + j < st->npending ? st->pending[i + j] : data[i + j - st->npending]); lz77_advance(st, foo[0], lz77_hash(foo)); } st->npending -= i; defermatch.distance = 0; /* appease compiler */ defermatch.len = 0; deferchr = '\0'; while (len > 0) { /* Don't even look for a match, if we're not compressing. */ if (compress && len >= HASHCHARS) { /* * Hash the next few characters. */ hash = lz77_hash(data); /* * Look the hash up in the corresponding hash chain and see * what we can find. */ nmatch = 0; for (off = st->hashtab[hash].first; off != INVALID; off = st->win[off].next) { /* distance = 1 if off == st->winpos-1 */ /* distance = WINSIZE if off == st->winpos */ distance = WINSIZE - (off + WINSIZE - st->winpos) % WINSIZE; for (i = 0; i < HASHCHARS; i++) if (CHARAT(i) != CHARAT(i - distance)) break; if (i == HASHCHARS) { matches[nmatch].distance = distance; matches[nmatch].len = 3; if (++nmatch >= MAXMATCH) break; } } } else { nmatch = 0; hash = INVALID; } if (nmatch > 0) { /* * We've now filled up matches[] with nmatch potential * matches. Follow them down to find the longest. (We * assume here that it's always worth favouring a * longer match over a shorter one.) */ matchlen = HASHCHARS; while (matchlen < len) { int j; for (i = j = 0; i < nmatch; i++) { if (CHARAT(matchlen) == CHARAT(matchlen - matches[i].distance)) { matches[j++] = matches[i]; } } if (j == 0) break; matchlen++; nmatch = j; } /* * We've now got all the longest matches. We favour the * shorter distances, which means we go with matches[0]. * So see if we want to defer it or throw it away. */ matches[0].len = matchlen; if (defermatch.len > 0) { if (matches[0].len > defermatch.len + 1) { /* We have a better match. Emit the deferred char, * and defer this match. */ ctx->literal(ctx, (unsigned char) deferchr); defermatch = matches[0]; deferchr = data[0]; advance = 1; } else { /* We don't have a better match. Do the deferred one. */ ctx->match(ctx, defermatch.distance, defermatch.len); advance = defermatch.len - 1; defermatch.len = 0; } } else { /* There was no deferred match. Defer this one. */ defermatch = matches[0]; deferchr = data[0]; advance = 1; } } else { /* * We found no matches. Emit the deferred match, if * any; otherwise emit a literal. */ if (defermatch.len > 0) { ctx->match(ctx, defermatch.distance, defermatch.len); advance = defermatch.len - 1; defermatch.len = 0; } else { ctx->literal(ctx, data[0]); advance = 1; } } /* * Now advance the position by `advance' characters, * keeping the window and hash chains consistent. */ while (advance > 0) { if (len >= HASHCHARS) { lz77_advance(st, *data, lz77_hash(data)); } else { st->pending[st->npending++] = *data; } data++; len--; advance--; } } } /* ---------------------------------------------------------------------- * Zlib compression. We always use the static Huffman tree option. * Mostly this is because it's hard to scan a block in advance to * work out better trees; dynamic trees are great when you're * compressing a large file under no significant time constraint, * but when you're compressing little bits in real time, things get * hairier. * * I suppose it's possible that I could compute Huffman trees based * on the frequencies in the _previous_ block, as a sort of * heuristic, but I'm not confident that the gain would balance out * having to transmit the trees. */ struct Outbuf { unsigned char *outbuf; int outlen, outsize; unsigned long outbits; int noutbits; int firstblock; int comp_disabled; }; static void outbits(struct Outbuf *out, unsigned long bits, int nbits) { assert(out->noutbits + nbits <= 32); out->outbits |= bits << out->noutbits; out->noutbits += nbits; while (out->noutbits >= 8) { if (out->outlen >= out->outsize) { out->outsize = out->outlen + 64; out->outbuf = sresize(out->outbuf, out->outsize, unsigned char); } out->outbuf[out->outlen++] = (unsigned char) (out->outbits & 0xFF); out->outbits >>= 8; out->noutbits -= 8; } } static const unsigned char mirrorbytes[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, }; typedef struct { short code, extrabits; int min, max; } coderecord; static const coderecord lencodes[] = { {257, 0, 3, 3}, {258, 0, 4, 4}, {259, 0, 5, 5}, {260, 0, 6, 6}, {261, 0, 7, 7}, {262, 0, 8, 8}, {263, 0, 9, 9}, {264, 0, 10, 10}, {265, 1, 11, 12}, {266, 1, 13, 14}, {267, 1, 15, 16}, {268, 1, 17, 18}, {269, 2, 19, 22}, {270, 2, 23, 26}, {271, 2, 27, 30}, {272, 2, 31, 34}, {273, 3, 35, 42}, {274, 3, 43, 50}, {275, 3, 51, 58}, {276, 3, 59, 66}, {277, 4, 67, 82}, {278, 4, 83, 98}, {279, 4, 99, 114}, {280, 4, 115, 130}, {281, 5, 131, 162}, {282, 5, 163, 194}, {283, 5, 195, 226}, {284, 5, 227, 257}, {285, 0, 258, 258}, }; static const coderecord distcodes[] = { {0, 0, 1, 1}, {1, 0, 2, 2}, {2, 0, 3, 3}, {3, 0, 4, 4}, {4, 1, 5, 6}, {5, 1, 7, 8}, {6, 2, 9, 12}, {7, 2, 13, 16}, {8, 3, 17, 24}, {9, 3, 25, 32}, {10, 4, 33, 48}, {11, 4, 49, 64}, {12, 5, 65, 96}, {13, 5, 97, 128}, {14, 6, 129, 192}, {15, 6, 193, 256}, {16, 7, 257, 384}, {17, 7, 385, 512}, {18, 8, 513, 768}, {19, 8, 769, 1024}, {20, 9, 1025, 1536}, {21, 9, 1537, 2048}, {22, 10, 2049, 3072}, {23, 10, 3073, 4096}, {24, 11, 4097, 6144}, {25, 11, 6145, 8192}, {26, 12, 8193, 12288}, {27, 12, 12289, 16384}, {28, 13, 16385, 24576}, {29, 13, 24577, 32768}, }; static void zlib_literal(struct LZ77Context *ectx, unsigned char c) { struct Outbuf *out = (struct Outbuf *) ectx->userdata; if (out->comp_disabled) { /* * We're in an uncompressed block, so just output the byte. */ outbits(out, c, 8); return; } if (c <= 143) { /* 0 through 143 are 8 bits long starting at 00110000. */ outbits(out, mirrorbytes[0x30 + c], 8); } else { /* 144 through 255 are 9 bits long starting at 110010000. */ outbits(out, 1 + 2 * mirrorbytes[0x90 - 144 + c], 9); } } static void zlib_match(struct LZ77Context *ectx, int distance, int len) { const coderecord *d, *l; int i, j, k; struct Outbuf *out = (struct Outbuf *) ectx->userdata; assert(!out->comp_disabled); while (len > 0) { int thislen; /* * We can transmit matches of lengths 3 through 258 * inclusive. So if len exceeds 258, we must transmit in * several steps, with 258 or less in each step. * * Specifically: if len >= 261, we can transmit 258 and be * sure of having at least 3 left for the next step. And if * len <= 258, we can just transmit len. But if len == 259 * or 260, we must transmit len-3. */ thislen = (len > 260 ? 258 : len <= 258 ? len : len - 3); len -= thislen; /* * Binary-search to find which length code we're * transmitting. */ i = -1; j = sizeof(lencodes) / sizeof(*lencodes); while (1) { assert(j - i >= 2); k = (j + i) / 2; if (thislen < lencodes[k].min) j = k; else if (thislen > lencodes[k].max) i = k; else { l = &lencodes[k]; break; /* found it! */ } } /* * Transmit the length code. 256-279 are seven bits * starting at 0000000; 280-287 are eight bits starting at * 11000000. */ if (l->code <= 279) { outbits(out, mirrorbytes[(l->code - 256) * 2], 7); } else { outbits(out, mirrorbytes[0xc0 - 280 + l->code], 8); } /* * Transmit the extra bits. */ if (l->extrabits) outbits(out, thislen - l->min, l->extrabits); /* * Binary-search to find which distance code we're * transmitting. */ i = -1; j = sizeof(distcodes) / sizeof(*distcodes); while (1) { assert(j - i >= 2); k = (j + i) / 2; if (distance < distcodes[k].min) j = k; else if (distance > distcodes[k].max) i = k; else { d = &distcodes[k]; break; /* found it! */ } } /* * Transmit the distance code. Five bits starting at 00000. */ outbits(out, mirrorbytes[d->code * 8], 5); /* * Transmit the extra bits. */ if (d->extrabits) outbits(out, distance - d->min, d->extrabits); } } void *zlib_compress_init(void) { struct Outbuf *out; struct LZ77Context *ectx = snew(struct LZ77Context); lz77_init(ectx); ectx->literal = zlib_literal; ectx->match = zlib_match; out = snew(struct Outbuf); out->outbits = out->noutbits = 0; out->firstblock = 1; out->comp_disabled = FALSE; ectx->userdata = out; return ectx; } void zlib_compress_cleanup(void *handle) { struct LZ77Context *ectx = (struct LZ77Context *)handle; sfree(ectx->userdata); sfree(ectx->ictx); sfree(ectx); } /* * Turn off actual LZ77 analysis for one block, to facilitate * construction of a precise-length IGNORE packet. Returns the * length adjustment (which is only valid for packets < 65536 * bytes, but that seems reasonable enough). */ static int zlib_disable_compression(void *handle) { struct LZ77Context *ectx = (struct LZ77Context *)handle; struct Outbuf *out = (struct Outbuf *) ectx->userdata; int n; out->comp_disabled = TRUE; n = 0; /* * If this is the first block, we will start by outputting two * header bytes, and then three bits to begin an uncompressed * block. This will cost three bytes (because we will start on * a byte boundary, this is certain). */ if (out->firstblock) { n = 3; } else { /* * Otherwise, we will output seven bits to close the * previous static block, and _then_ three bits to begin an * uncompressed block, and then flush the current byte. * This may cost two bytes or three, depending on noutbits. */ n += (out->noutbits + 10) / 8; } /* * Now we output four bytes for the length / ~length pair in * the uncompressed block. */ n += 4; return n; } int zlib_compress_block(void *handle, unsigned char *block, int len, unsigned char **outblock, int *outlen) { struct LZ77Context *ectx = (struct LZ77Context *)handle; struct Outbuf *out = (struct Outbuf *) ectx->userdata; int in_block; out->outbuf = NULL; out->outlen = out->outsize = 0; /* * If this is the first block, output the Zlib (RFC1950) header * bytes 78 9C. (Deflate compression, 32K window size, default * algorithm.) */ if (out->firstblock) { outbits(out, 0x9C78, 16); out->firstblock = 0; in_block = FALSE; } else in_block = TRUE; if (out->comp_disabled) { if (in_block) outbits(out, 0, 7); /* close static block */ while (len > 0) { int blen = (len < 65535 ? len : 65535); /* * Start a Deflate (RFC1951) uncompressed block. We * transmit a zero bit (BFINAL=0), followed by two more * zero bits (BTYPE=00). Of course these are in the * wrong order (00 0), not that it matters. */ outbits(out, 0, 3); /* * Output zero bits to align to a byte boundary. */ if (out->noutbits) outbits(out, 0, 8 - out->noutbits); /* * Output the block length, and then its one's * complement. They're little-endian, so all we need to * do is pass them straight to outbits() with bit count * 16. */ outbits(out, blen, 16); outbits(out, blen ^ 0xFFFF, 16); /* * Do the `compression': we need to pass the data to * lz77_compress so that it will be taken into account * for subsequent (distance,length) pairs. But * lz77_compress is passed FALSE, which means it won't * actually find (or even look for) any matches; so * every character will be passed straight to * zlib_literal which will spot out->comp_disabled and * emit in the uncompressed format. */ lz77_compress(ectx, block, blen, FALSE); len -= blen; block += blen; } outbits(out, 2, 3); /* open new block */ } else { if (!in_block) { /* * Start a Deflate (RFC1951) fixed-trees block. We * transmit a zero bit (BFINAL=0), followed by a zero * bit and a one bit (BTYPE=01). Of course these are in * the wrong order (01 0). */ outbits(out, 2, 3); } /* * Do the compression. */ lz77_compress(ectx, block, len, TRUE); /* * End the block (by transmitting code 256, which is * 0000000 in fixed-tree mode), and transmit some empty * blocks to ensure we have emitted the byte containing the * last piece of genuine data. There are three ways we can * do this: * * - Minimal flush. Output end-of-block and then open a * new static block. This takes 9 bits, which is * guaranteed to flush out the last genuine code in the * closed block; but allegedly zlib can't handle it. * * - Zlib partial flush. Output EOB, open and close an * empty static block, and _then_ open the new block. * This is the best zlib can handle. * * - Zlib sync flush. Output EOB, then an empty * _uncompressed_ block (000, then sync to byte * boundary, then send bytes 00 00 FF FF). Then open the * new block. * * For the moment, we will use Zlib partial flush. */ outbits(out, 0, 7); /* close block */ outbits(out, 2, 3 + 7); /* empty static block */ outbits(out, 2, 3); /* open new block */ } out->comp_disabled = FALSE; *outblock = out->outbuf; *outlen = out->outlen; return 1; } /* ---------------------------------------------------------------------- * Zlib decompression. Of course, even though our compressor always * uses static trees, our _decompressor_ has to be capable of * handling dynamic trees if it sees them. */ /* * The way we work the Huffman decode is to have a table lookup on * the first N bits of the input stream (in the order they arrive, * of course, i.e. the first bit of the Huffman code is in bit 0). * Each table entry lists the number of bits to consume, plus * either an output code or a pointer to a secondary table. */ struct zlib_table; struct zlib_tableentry; struct zlib_tableentry { unsigned char nbits; short code; struct zlib_table *nexttable; }; struct zlib_table { int mask; /* mask applied to input bit stream */ struct zlib_tableentry *table; }; #define MAXCODELEN 16 #define MAXSYMS 288 /* * Build a single-level decode table for elements * [minlength,maxlength) of the provided code/length tables, and * recurse to build subtables. */ static struct zlib_table *zlib_mkonetab(int *codes, unsigned char *lengths, int nsyms, int pfx, int pfxbits, int bits) { struct zlib_table *tab = snew(struct zlib_table); int pfxmask = (1 << pfxbits) - 1; int nbits, i, j, code; tab->table = snewn(1 << bits, struct zlib_tableentry); tab->mask = (1 << bits) - 1; for (code = 0; code <= tab->mask; code++) { tab->table[code].code = -1; tab->table[code].nbits = 0; tab->table[code].nexttable = NULL; } for (i = 0; i < nsyms; i++) { if (lengths[i] <= pfxbits || (codes[i] & pfxmask) != pfx) continue; code = (codes[i] >> pfxbits) & tab->mask; for (j = code; j <= tab->mask; j += 1 << (lengths[i] - pfxbits)) { tab->table[j].code = i; nbits = lengths[i] - pfxbits; if (tab->table[j].nbits < nbits) tab->table[j].nbits = nbits; } } for (code = 0; code <= tab->mask; code++) { if (tab->table[code].nbits <= bits) continue; /* Generate a subtable. */ tab->table[code].code = -1; nbits = tab->table[code].nbits - bits; if (nbits > 7) nbits = 7; tab->table[code].nbits = bits; tab->table[code].nexttable = zlib_mkonetab(codes, lengths, nsyms, pfx | (code << pfxbits), pfxbits + bits, nbits); } return tab; } /* * Build a decode table, given a set of Huffman tree lengths. */ static struct zlib_table *zlib_mktable(unsigned char *lengths, int nlengths) { int count[MAXCODELEN], startcode[MAXCODELEN], codes[MAXSYMS]; int code, maxlen; int i, j; /* Count the codes of each length. */ maxlen = 0; for (i = 1; i < MAXCODELEN; i++) count[i] = 0; for (i = 0; i < nlengths; i++) { count[lengths[i]]++; if (maxlen < lengths[i]) maxlen = lengths[i]; } /* Determine the starting code for each length block. */ code = 0; for (i = 1; i < MAXCODELEN; i++) { startcode[i] = code; code += count[i]; code <<= 1; } /* Determine the code for each symbol. Mirrored, of course. */ for (i = 0; i < nlengths; i++) { code = startcode[lengths[i]]++; codes[i] = 0; for (j = 0; j < lengths[i]; j++) { codes[i] = (codes[i] << 1) | (code & 1); code >>= 1; } } /* * Now we have the complete list of Huffman codes. Build a * table. */ return zlib_mkonetab(codes, lengths, nlengths, 0, 0, maxlen < 9 ? maxlen : 9); } static int zlib_freetable(struct zlib_table **ztab) { struct zlib_table *tab; int code; if (ztab == NULL) return -1; if (*ztab == NULL) return 0; tab = *ztab; for (code = 0; code <= tab->mask; code++) if (tab->table[code].nexttable != NULL) zlib_freetable(&tab->table[code].nexttable); sfree(tab->table); tab->table = NULL; sfree(tab); *ztab = NULL; return (0); } struct zlib_decompress_ctx { struct zlib_table *staticlentable, *staticdisttable; struct zlib_table *currlentable, *currdisttable, *lenlentable; enum { START, OUTSIDEBLK, TREES_HDR, TREES_LENLEN, TREES_LEN, TREES_LENREP, INBLK, GOTLENSYM, GOTLEN, GOTDISTSYM, UNCOMP_LEN, UNCOMP_NLEN, UNCOMP_DATA } state; int sym, hlit, hdist, hclen, lenptr, lenextrabits, lenaddon, len, lenrep; int uncomplen; unsigned char lenlen[19]; unsigned char lengths[286 + 32]; unsigned long bits; int nbits; unsigned char window[WINSIZE]; int winpos; unsigned char *outblk; int outlen, outsize; }; void *zlib_decompress_init(void) { struct zlib_decompress_ctx *dctx = snew(struct zlib_decompress_ctx); unsigned char lengths[288]; memset(lengths, 8, 144); memset(lengths + 144, 9, 256 - 144); memset(lengths + 256, 7, 280 - 256); memset(lengths + 280, 8, 288 - 280); dctx->staticlentable = zlib_mktable(lengths, 288); memset(lengths, 5, 32); dctx->staticdisttable = zlib_mktable(lengths, 32); dctx->state = START; /* even before header */ dctx->currlentable = dctx->currdisttable = dctx->lenlentable = NULL; dctx->bits = 0; dctx->nbits = 0; dctx->winpos = 0; return dctx; } void zlib_decompress_cleanup(void *handle) { struct zlib_decompress_ctx *dctx = (struct zlib_decompress_ctx *)handle; if (dctx->currlentable && dctx->currlentable != dctx->staticlentable) zlib_freetable(&dctx->currlentable); if (dctx->currdisttable && dctx->currdisttable != dctx->staticdisttable) zlib_freetable(&dctx->currdisttable); if (dctx->lenlentable) zlib_freetable(&dctx->lenlentable); zlib_freetable(&dctx->staticlentable); zlib_freetable(&dctx->staticdisttable); sfree(dctx); } static int zlib_huflookup(unsigned long *bitsp, int *nbitsp, struct zlib_table *tab) { unsigned long bits = *bitsp; int nbits = *nbitsp; while (1) { struct zlib_tableentry *ent; ent = &tab->table[bits & tab->mask]; if (ent->nbits > nbits) return -1; /* not enough data */ bits >>= ent->nbits; nbits -= ent->nbits; if (ent->code == -1) tab = ent->nexttable; else { *bitsp = bits; *nbitsp = nbits; return ent->code; } if (!tab) { /* * There was a missing entry in the table, presumably * due to an invalid Huffman table description, and the * subsequent data has attempted to use the missing * entry. Return a decoding failure. */ return -2; } } } static void zlib_emit_char(struct zlib_decompress_ctx *dctx, int c) { dctx->window[dctx->winpos] = c; dctx->winpos = (dctx->winpos + 1) & (WINSIZE - 1); if (dctx->outlen >= dctx->outsize) { dctx->outsize = dctx->outlen + 512; dctx->outblk = sresize(dctx->outblk, dctx->outsize, unsigned char); } dctx->outblk[dctx->outlen++] = c; } #define EATBITS(n) ( dctx->nbits -= (n), dctx->bits >>= (n) ) int zlib_decompress_block(void *handle, unsigned char *block, int len, unsigned char **outblock, int *outlen) { struct zlib_decompress_ctx *dctx = (struct zlib_decompress_ctx *)handle; const coderecord *rec; int code, blktype, rep, dist, nlen, header; static const unsigned char lenlenmap[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; dctx->outblk = snewn(256, unsigned char); dctx->outsize = 256; dctx->outlen = 0; while (len > 0 || dctx->nbits > 0) { while (dctx->nbits < 24 && len > 0) { dctx->bits |= (*block++) << dctx->nbits; dctx->nbits += 8; len--; } switch (dctx->state) { case START: /* Expect 16-bit zlib header. */ if (dctx->nbits < 16) goto finished; /* done all we can */ /* * The header is stored as a big-endian 16-bit integer, * in contrast to the general little-endian policy in * the rest of the format :-( */ header = (((dctx->bits & 0xFF00) >> 8) | ((dctx->bits & 0x00FF) << 8)); EATBITS(16); /* * Check the header: * * - bits 8-11 should be 1000 (Deflate/RFC1951) * - bits 12-15 should be at most 0111 (window size) * - bit 5 should be zero (no dictionary present) * - we don't care about bits 6-7 (compression rate) * - bits 0-4 should be set up to make the whole thing * a multiple of 31 (checksum). */ if ((header & 0x0F00) != 0x0800 || (header & 0xF000) > 0x7000 || (header & 0x0020) != 0x0000 || (header % 31) != 0) goto decode_error; dctx->state = OUTSIDEBLK; break; case OUTSIDEBLK: /* Expect 3-bit block header. */ if (dctx->nbits < 3) goto finished; /* done all we can */ EATBITS(1); blktype = dctx->bits & 3; EATBITS(2); if (blktype == 0) { int to_eat = dctx->nbits & 7; dctx->state = UNCOMP_LEN; EATBITS(to_eat); /* align to byte boundary */ } else if (blktype == 1) { dctx->currlentable = dctx->staticlentable; dctx->currdisttable = dctx->staticdisttable; dctx->state = INBLK; } else if (blktype == 2) { dctx->state = TREES_HDR; } break; case TREES_HDR: /* * Dynamic block header. Five bits of HLIT, five of * HDIST, four of HCLEN. */ if (dctx->nbits < 5 + 5 + 4) goto finished; /* done all we can */ dctx->hlit = 257 + (dctx->bits & 31); EATBITS(5); dctx->hdist = 1 + (dctx->bits & 31); EATBITS(5); dctx->hclen = 4 + (dctx->bits & 15); EATBITS(4); dctx->lenptr = 0; dctx->state = TREES_LENLEN; memset(dctx->lenlen, 0, sizeof(dctx->lenlen)); break; case TREES_LENLEN: if (dctx->nbits < 3) goto finished; while (dctx->lenptr < dctx->hclen && dctx->nbits >= 3) { dctx->lenlen[lenlenmap[dctx->lenptr++]] = (unsigned char) (dctx->bits & 7); EATBITS(3); } if (dctx->lenptr == dctx->hclen) { dctx->lenlentable = zlib_mktable(dctx->lenlen, 19); dctx->state = TREES_LEN; dctx->lenptr = 0; } break; case TREES_LEN: if (dctx->lenptr >= dctx->hlit + dctx->hdist) { dctx->currlentable = zlib_mktable(dctx->lengths, dctx->hlit); dctx->currdisttable = zlib_mktable(dctx->lengths + dctx->hlit, dctx->hdist); zlib_freetable(&dctx->lenlentable); dctx->lenlentable = NULL; dctx->state = INBLK; break; } code = zlib_huflookup(&dctx->bits, &dctx->nbits, dctx->lenlentable); if (code == -1) goto finished; if (code == -2) goto decode_error; if (code < 16) dctx->lengths[dctx->lenptr++] = code; else { dctx->lenextrabits = (code == 16 ? 2 : code == 17 ? 3 : 7); dctx->lenaddon = (code == 18 ? 11 : 3); dctx->lenrep = (code == 16 && dctx->lenptr > 0 ? dctx->lengths[dctx->lenptr - 1] : 0); dctx->state = TREES_LENREP; } break; case TREES_LENREP: if (dctx->nbits < dctx->lenextrabits) goto finished; rep = dctx->lenaddon + (dctx->bits & ((1 << dctx->lenextrabits) - 1)); EATBITS(dctx->lenextrabits); while (rep > 0 && dctx->lenptr < dctx->hlit + dctx->hdist) { dctx->lengths[dctx->lenptr] = dctx->lenrep; dctx->lenptr++; rep--; } dctx->state = TREES_LEN; break; case INBLK: code = zlib_huflookup(&dctx->bits, &dctx->nbits, dctx->currlentable); if (code == -1) goto finished; if (code == -2) goto decode_error; if (code < 256) zlib_emit_char(dctx, code); else if (code == 256) { dctx->state = OUTSIDEBLK; if (dctx->currlentable != dctx->staticlentable) { zlib_freetable(&dctx->currlentable); dctx->currlentable = NULL; } if (dctx->currdisttable != dctx->staticdisttable) { zlib_freetable(&dctx->currdisttable); dctx->currdisttable = NULL; } } else if (code < 286) { /* static tree can give >285; ignore */ dctx->state = GOTLENSYM; dctx->sym = code; } break; case GOTLENSYM: rec = &lencodes[dctx->sym - 257]; if (dctx->nbits < rec->extrabits) goto finished; dctx->len = rec->min + (dctx->bits & ((1 << rec->extrabits) - 1)); EATBITS(rec->extrabits); dctx->state = GOTLEN; break; case GOTLEN: code = zlib_huflookup(&dctx->bits, &dctx->nbits, dctx->currdisttable); if (code == -1) goto finished; if (code == -2) goto decode_error; dctx->state = GOTDISTSYM; dctx->sym = code; break; case GOTDISTSYM: rec = &distcodes[dctx->sym]; if (dctx->nbits < rec->extrabits) goto finished; dist = rec->min + (dctx->bits & ((1 << rec->extrabits) - 1)); EATBITS(rec->extrabits); dctx->state = INBLK; while (dctx->len--) zlib_emit_char(dctx, dctx->window[(dctx->winpos - dist) & (WINSIZE - 1)]); break; case UNCOMP_LEN: /* * Uncompressed block. We expect to see a 16-bit LEN. */ if (dctx->nbits < 16) goto finished; dctx->uncomplen = dctx->bits & 0xFFFF; EATBITS(16); dctx->state = UNCOMP_NLEN; break; case UNCOMP_NLEN: /* * Uncompressed block. We expect to see a 16-bit NLEN, * which should be the one's complement of the previous * LEN. */ if (dctx->nbits < 16) goto finished; nlen = dctx->bits & 0xFFFF; EATBITS(16); if (dctx->uncomplen == 0) dctx->state = OUTSIDEBLK; /* block is empty */ else dctx->state = UNCOMP_DATA; break; case UNCOMP_DATA: if (dctx->nbits < 8) goto finished; zlib_emit_char(dctx, dctx->bits & 0xFF); EATBITS(8); if (--dctx->uncomplen == 0) dctx->state = OUTSIDEBLK; /* end of uncompressed block */ break; } } finished: *outblock = dctx->outblk; *outlen = dctx->outlen; return 1; decode_error: sfree(dctx->outblk); *outblock = dctx->outblk = NULL; *outlen = 0; return 0; } #ifdef ZLIB_STANDALONE #include <stdio.h> #include <string.h> int main(int argc, char **argv) { unsigned char buf[16], *outbuf; int ret, outlen; void *handle; int noheader = FALSE, opts = TRUE; char *filename = NULL; FILE *fp; while (--argc) { char *p = *++argv; if (p[0] == '-' && opts) { if (!strcmp(p, "-d")) noheader = TRUE; else if (!strcmp(p, "--")) opts = FALSE; /* next thing is filename */ else { fprintf(stderr, "unknown command line option '%s'\n", p); return 1; } } else if (!filename) { filename = p; } else { fprintf(stderr, "can only handle one filename\n"); return 1; } } handle = zlib_decompress_init(); if (noheader) { /* * Provide missing zlib header if -d was specified. */ zlib_decompress_block(handle, "\x78\x9C", 2, &outbuf, &outlen); assert(outlen == 0); } if (filename) fp = fopen(filename, "rb"); else fp = stdin; if (!fp) { assert(filename); fprintf(stderr, "unable to open '%s'\n", filename); return 1; } while (1) { ret = fread(buf, 1, sizeof(buf), fp); if (ret <= 0) break; zlib_decompress_block(handle, buf, ret, &outbuf, &outlen); if (outbuf) { if (outlen) fwrite(outbuf, 1, outlen, stdout); sfree(outbuf); } else { fprintf(stderr, "decoding error\n"); return 1; } } zlib_decompress_cleanup(handle); if (filename) fclose(fp); return 0; } #else const struct ssh_compress ssh_zlib = { "zlib", zlib_compress_init, zlib_compress_cleanup, zlib_compress_block, zlib_decompress_init, zlib_decompress_cleanup, zlib_decompress_block, zlib_disable_compression, "zlib (RFC1950)" }; #endif
geocar/winback
putty/sshzlib.c
C
gpl-3.0
39,997
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.dialer.calllog; import static com.google.common.collect.Lists.newArrayList; import android.database.MatrixCursor; import android.provider.CallLog.Calls; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; import java.util.List; /** * Unit tests for {@link CallLogGroupBuilder} */ @SmallTest public class CallLogGroupBuilderTest extends AndroidTestCase { /** A phone number for testing. */ private static final String TEST_NUMBER1 = "14125551234"; /** A phone number for testing. */ private static final String TEST_NUMBER2 = "14125555555"; /** The object under test. */ private CallLogGroupBuilder mBuilder; /** Records the created groups. */ private FakeGroupCreator mFakeGroupCreator; /** Cursor to store the values. */ private MatrixCursor mCursor; @Override protected void setUp() throws Exception { super.setUp(); mFakeGroupCreator = new FakeGroupCreator(); mBuilder = new CallLogGroupBuilder(mFakeGroupCreator); createCursor(); } @Override protected void tearDown() throws Exception { mCursor = null; mBuilder = null; mFakeGroupCreator = null; super.tearDown(); } public void testAddGroups_NoCalls() { mBuilder.addGroups(mCursor); assertEquals(0, mFakeGroupCreator.groups.size()); } public void testAddGroups_OneCall() { addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); mBuilder.addGroups(mCursor); assertEquals(0, mFakeGroupCreator.groups.size()); } public void testAddGroups_TwoCallsNotMatching() { addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); addCallLogEntry(TEST_NUMBER2, Calls.INCOMING_TYPE); mBuilder.addGroups(mCursor); assertEquals(0, mFakeGroupCreator.groups.size()); } public void testAddGroups_ThreeCallsMatching() { addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); mBuilder.addGroups(mCursor); assertEquals(1, mFakeGroupCreator.groups.size()); assertGroupIs(0, 3, false, mFakeGroupCreator.groups.get(0)); } public void testAddGroups_MatchingIncomingAndOutgoing() { addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); addCallLogEntry(TEST_NUMBER1, Calls.OUTGOING_TYPE); addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); mBuilder.addGroups(mCursor); assertEquals(1, mFakeGroupCreator.groups.size()); assertGroupIs(0, 3, false, mFakeGroupCreator.groups.get(0)); } public void testAddGroups_Voicemail() { // Does not group with other types of calls, include voicemail themselves. assertCallsAreNotGrouped(Calls.VOICEMAIL_TYPE, Calls.MISSED_TYPE); //assertCallsAreNotGrouped(Calls.VOICEMAIL_TYPE, Calls.MISSED_TYPE, Calls.MISSED_TYPE); assertCallsAreNotGrouped(Calls.VOICEMAIL_TYPE, Calls.VOICEMAIL_TYPE); assertCallsAreNotGrouped(Calls.VOICEMAIL_TYPE, Calls.INCOMING_TYPE); assertCallsAreNotGrouped(Calls.VOICEMAIL_TYPE, Calls.OUTGOING_TYPE); } public void testAddGroups_Missed() { // Groups with one or more missed calls. assertCallsAreGrouped(Calls.MISSED_TYPE, Calls.MISSED_TYPE); assertCallsAreGrouped(Calls.MISSED_TYPE, Calls.MISSED_TYPE, Calls.MISSED_TYPE); // Does not group with other types of calls. assertCallsAreNotGrouped(Calls.MISSED_TYPE, Calls.VOICEMAIL_TYPE); assertCallsAreGrouped(Calls.MISSED_TYPE, Calls.INCOMING_TYPE); assertCallsAreGrouped(Calls.MISSED_TYPE, Calls.OUTGOING_TYPE); } public void testAddGroups_Incoming() { // Groups with one or more incoming or outgoing. assertCallsAreGrouped(Calls.INCOMING_TYPE, Calls.INCOMING_TYPE); assertCallsAreGrouped(Calls.INCOMING_TYPE, Calls.OUTGOING_TYPE); assertCallsAreGrouped(Calls.INCOMING_TYPE, Calls.INCOMING_TYPE, Calls.OUTGOING_TYPE); assertCallsAreGrouped(Calls.INCOMING_TYPE, Calls.OUTGOING_TYPE, Calls.INCOMING_TYPE); assertCallsAreGrouped(Calls.INCOMING_TYPE, Calls.MISSED_TYPE); // Does not group with voicemail and missed calls. assertCallsAreNotGrouped(Calls.INCOMING_TYPE, Calls.VOICEMAIL_TYPE); } public void testAddGroups_Outgoing() { // Groups with one or more incoming or outgoing. assertCallsAreGrouped(Calls.OUTGOING_TYPE, Calls.INCOMING_TYPE); assertCallsAreGrouped(Calls.OUTGOING_TYPE, Calls.OUTGOING_TYPE); assertCallsAreGrouped(Calls.OUTGOING_TYPE, Calls.INCOMING_TYPE, Calls.OUTGOING_TYPE); assertCallsAreGrouped(Calls.OUTGOING_TYPE, Calls.OUTGOING_TYPE, Calls.INCOMING_TYPE); assertCallsAreGrouped(Calls.INCOMING_TYPE, Calls.MISSED_TYPE); // Does not group with voicemail and missed calls. assertCallsAreNotGrouped(Calls.INCOMING_TYPE, Calls.VOICEMAIL_TYPE); } public void testAddGroups_Mixed() { addMultipleCallLogEntries(TEST_NUMBER1, Calls.VOICEMAIL_TYPE, // Stand-alone Calls.INCOMING_TYPE, // Group 1: 1-4 Calls.OUTGOING_TYPE, Calls.MISSED_TYPE, Calls.MISSED_TYPE, Calls.VOICEMAIL_TYPE, // Stand-alone Calls.INCOMING_TYPE, // Stand-alone Calls.VOICEMAIL_TYPE, // Stand-alone Calls.MISSED_TYPE, // Group 2: 8-10 Calls.MISSED_TYPE, Calls.OUTGOING_TYPE); mBuilder.addGroups(mCursor); assertEquals(2, mFakeGroupCreator.groups.size()); assertGroupIs(1, 4, false, mFakeGroupCreator.groups.get(0)); assertGroupIs(8, 3, false, mFakeGroupCreator.groups.get(1)); } public void testEqualPhoneNumbers() { // Identical. assertTrue(mBuilder.equalNumbers("6505555555", "6505555555")); assertTrue(mBuilder.equalNumbers("650 555 5555", "650 555 5555")); // Formatting. assertTrue(mBuilder.equalNumbers("6505555555", "650 555 5555")); assertTrue(mBuilder.equalNumbers("6505555555", "(650) 555-5555")); assertTrue(mBuilder.equalNumbers("650 555 5555", "(650) 555-5555")); // Short codes. assertTrue(mBuilder.equalNumbers("55555", "55555")); assertTrue(mBuilder.equalNumbers("55555", "555 55")); // Different numbers. assertFalse(mBuilder.equalNumbers("6505555555", "650555555")); assertFalse(mBuilder.equalNumbers("6505555555", "6505555551")); assertFalse(mBuilder.equalNumbers("650 555 5555", "650 555 555")); assertFalse(mBuilder.equalNumbers("650 555 5555", "650 555 5551")); assertFalse(mBuilder.equalNumbers("55555", "5555")); assertFalse(mBuilder.equalNumbers("55555", "55551")); // SIP addresses. assertTrue(mBuilder.equalNumbers("6505555555@host.com", "6505555555@host.com")); assertTrue(mBuilder.equalNumbers("6505555555@host.com", "6505555555@HOST.COM")); assertTrue(mBuilder.equalNumbers("user@host.com", "user@host.com")); assertTrue(mBuilder.equalNumbers("user@host.com", "user@HOST.COM")); assertFalse(mBuilder.equalNumbers("USER@host.com", "user@host.com")); assertFalse(mBuilder.equalNumbers("user@host.com", "user@host1.com")); // SIP address vs phone number. assertFalse(mBuilder.equalNumbers("6505555555@host.com", "6505555555")); assertFalse(mBuilder.equalNumbers("6505555555", "6505555555@host.com")); assertFalse(mBuilder.equalNumbers("user@host.com", "6505555555")); assertFalse(mBuilder.equalNumbers("6505555555", "user@host.com")); // Nulls. assertTrue(mBuilder.equalNumbers(null, null)); assertFalse(mBuilder.equalNumbers(null, "6505555555")); assertFalse(mBuilder.equalNumbers("6505555555", null)); assertFalse(mBuilder.equalNumbers(null, "6505555555@host.com")); assertFalse(mBuilder.equalNumbers("6505555555@host.com", null)); } public void testCompareSipAddresses() { // Identical. assertTrue(mBuilder.compareSipAddresses("6505555555@host.com", "6505555555@host.com")); assertTrue(mBuilder.compareSipAddresses("user@host.com", "user@host.com")); // Host is case insensitive. assertTrue(mBuilder.compareSipAddresses("6505555555@host.com", "6505555555@HOST.COM")); assertTrue(mBuilder.compareSipAddresses("user@host.com", "user@HOST.COM")); // Userinfo is case sensitive. assertFalse(mBuilder.compareSipAddresses("USER@host.com", "user@host.com")); // Different hosts. assertFalse(mBuilder.compareSipAddresses("user@host.com", "user@host1.com")); // Different users. assertFalse(mBuilder.compareSipAddresses("user1@host.com", "user@host.com")); // Nulls. assertTrue(mBuilder.compareSipAddresses(null, null)); assertFalse(mBuilder.compareSipAddresses(null, "6505555555@host.com")); assertFalse(mBuilder.compareSipAddresses("6505555555@host.com", null)); } /** Creates (or recreates) the cursor used to store the call log content for the tests. */ private void createCursor() { mCursor = new MatrixCursor(CallLogQuery._PROJECTION); } /** Clears the content of the {@link FakeGroupCreator} used in the tests. */ private void clearFakeGroupCreator() { mFakeGroupCreator.groups.clear(); } /** Asserts that calls of the given types are grouped together into a single group. */ private void assertCallsAreGrouped(int... types) { createCursor(); clearFakeGroupCreator(); addMultipleCallLogEntries(TEST_NUMBER1, types); mBuilder.addGroups(mCursor); assertEquals(1, mFakeGroupCreator.groups.size()); assertGroupIs(0, types.length, false, mFakeGroupCreator.groups.get(0)); } /** Asserts that calls of the given types are not grouped together at all. */ private void assertCallsAreNotGrouped(int... types) { createCursor(); clearFakeGroupCreator(); addMultipleCallLogEntries(TEST_NUMBER1, types); mBuilder.addGroups(mCursor); assertEquals(0, mFakeGroupCreator.groups.size()); } /** Adds a set of calls with the given types, all from the same number, in the old section. */ private void addMultipleCallLogEntries(String number, int... types) { for (int type : types) { addCallLogEntry(number, type); } } /** Adds a call log entry with the given number and type to the cursor. */ private void addCallLogEntry(String number, int type) { mCursor.moveToNext(); Object[] values = CallLogQueryTestUtils.createTestValues(); values[CallLogQuery.ID] = mCursor.getPosition(); values[CallLogQuery.NUMBER] = number; values[CallLogQuery.CALL_TYPE] = type; mCursor.addRow(values); } /** Adds a call log entry with a header to the cursor. */ private void addCallLogHeader(int section) { mCursor.moveToNext(); Object[] values = CallLogQueryTestUtils.createTestValues(); values[CallLogQuery.ID] = mCursor.getPosition(); mCursor.addRow(values); } /** Asserts that the group matches the given values. */ private void assertGroupIs(int cursorPosition, int size, boolean expanded, GroupSpec group) { assertEquals(cursorPosition, group.cursorPosition); assertEquals(size, group.size); assertEquals(expanded, group.expanded); } /** Defines an added group. Used by the {@link FakeGroupCreator}. */ private static class GroupSpec { /** The starting position of the group. */ public final int cursorPosition; /** The number of elements in the group. */ public final int size; /** Whether the group should be initially expanded. */ public final boolean expanded; public GroupSpec(int cursorPosition, int size, boolean expanded) { this.cursorPosition = cursorPosition; this.size = size; this.expanded = expanded; } } /** Fake implementation of a GroupCreator which stores the created groups in a member field. */ private static class FakeGroupCreator implements CallLogGroupBuilder.GroupCreator { /** The list of created groups. */ public final List<GroupSpec> groups = newArrayList(); @Override public void addGroup(int cursorPosition, int size, boolean expanded) { groups.add(new GroupSpec(cursorPosition, size, expanded)); } @Override public void setDayGroup(long rowId, int dayGroup) { //No-op } @Override public void clearDayGroups() { //No-op } } }
s20121035/rk3288_android5.1_repo
packages/apps/Dialer/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java
Java
gpl-3.0
13,603
#!/usr/bin/python # ======================================================================= # This file is part of MCLRE. # # MCLRE 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. # # MCLRE 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 MCLRE. If not, see <http://www.gnu.org/licenses/>. # # Copyright (C) 2015 Augusto Queiroz de Macedo <augustoqmacedo@gmail.com> # ======================================================================= """ MRBPR Runner """ from os import path from argparse import ArgumentParser import shlex import subprocess import multiprocessing import logging from run_rec_functions import read_experiment_atts from mrbpr.mrbpr_runner import create_meta_file, run ############################################################################## # GLOBAL VARIABLES ############################################################################## # Define the Logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(name)s : %(message)s', level=logging.INFO) LOGGER = logging.getLogger('mrbpr.run_rec_mrbpr') LOGGER.setLevel(logging.INFO) ############################################################################## # AUXILIAR FUNCTIONS ############################################################################## def get_mrbpr_confs(): """ Yield the MRBPR Models Configurations """ pass ############################################################################## # MAIN ############################################################################## if __name__ == '__main__': # ------------------------------------------------------------------------ # Define the argument parser PARSER = ArgumentParser(description="Script that runs the mrbpr event recommender algorithms for" \ " a given 'experiment_name' with data from a given 'region'") PARSER.add_argument("-e", "--experiment_name", type=str, required=True, help="The Experiment Name (e.g. recsys-15)") PARSER.add_argument("-r", "--region", type=str, required=True, help="The data Region (e.g. san_jose)") PARSER.add_argument("-a", "--algorithm", type=str, required=True, help="The algorithm name (used only to differenciate our proposed MRBPR to the others") ARGS = PARSER.parse_args() EXPERIMENT_NAME = ARGS.experiment_name REGION = ARGS.region ALGORITHM_NAME = ARGS.algorithm LOGGER.info(ALGORITHM_NAME) DATA_DIR = "data" PARTITIONED_DATA_DIR = path.join(DATA_DIR, "partitioned_data") PARTITIONED_REGION_DATA_DIR = path.join(PARTITIONED_DATA_DIR, REGION) EXPERIMENT_DIR = path.join(DATA_DIR, "experiments", EXPERIMENT_NAME) EXPERIMENT_REGION_DATA_DIR = path.join(EXPERIMENT_DIR, REGION) # LOGGER.info('Defining the MRBPR relation weights file...') subprocess.call(shlex.split("Rscript %s %s %s" % (path.join("src", "recommender_execution", "mrbpr", "mrbpr_relation_weights.R"), EXPERIMENT_NAME, ALGORITHM_NAME))) # ------------------------------------------------------------------------ # Reading and Defining the Experiment Attributes EXPERIMENT_ATTS = read_experiment_atts(EXPERIMENT_DIR) PARALLEL_RUNS = multiprocessing.cpu_count() - 1 TRAIN_RELATION_NAMES = EXPERIMENT_ATTS['%s_relation_names' % ALGORITHM_NAME.lower()] TRAIN_RELATION_FILES = ["%s_train.tsv" % name for name in TRAIN_RELATION_NAMES] PARTITIONS = reversed(EXPERIMENT_ATTS['partitions']) # ------------------------------------------------------------------------ # Reading and Defining the Experiment Attributes META_FILE = path.join(EXPERIMENT_DIR, "%s_meetup.meta" % ALGORITHM_NAME.lower()) LOGGER.info('Creating the META relations file...') create_meta_file(TRAIN_RELATION_NAMES, META_FILE, PARTITIONED_DATA_DIR) # ------------------------------------------------------------------------ # Fixed parameters # ------------------------------------------------------------------------ # Algorithm (0 - MRBPR) ALGORITHM = 0 # Size of the Ranked list of events per User RANK_SIZE = 100 # Save Parameters SAVE_MODEL = 0 # Hyper Parameters REGULARIZATION_PER_ENTITY = "" REGULARIZATION_PER_RELATION = "" RELATION_WEIGHTS_FILE = path.join(EXPERIMENT_DIR, "%s_relation_weights.txt" % ALGORITHM_NAME.lower()) # ------------------------------------------------------------------------ if ALGORITHM_NAME == "MRBPR": LEARN_RATES = [0.1] NUM_FACTORS = [300] NUM_ITERATIONS = [1500] elif ALGORITHM_NAME == "BPR-NET": LEARN_RATES = [0.1] NUM_FACTORS = [200] NUM_ITERATIONS = [600] else: LEARN_RATES = [0.1] NUM_FACTORS = [10] NUM_ITERATIONS = [10] MRBPR_BIN_PATH = path.join("src", "recommender_execution", "mrbpr", "mrbpr.bin") LOGGER.info("Start running MRBPR Process Scheduler!") run(PARTITIONED_REGION_DATA_DIR, EXPERIMENT_REGION_DATA_DIR, REGION, ALGORITHM, RANK_SIZE, SAVE_MODEL, META_FILE, REGULARIZATION_PER_ENTITY, REGULARIZATION_PER_RELATION, RELATION_WEIGHTS_FILE, TRAIN_RELATION_FILES, PARTITIONS, NUM_ITERATIONS, NUM_FACTORS, LEARN_RATES, MRBPR_BIN_PATH, PARALLEL_RUNS, ALGORITHM_NAME) LOGGER.info("DONE!")
augustoqm/MCLRE
src/recommender_execution/run_rec_mrbpr.py
Python
gpl-3.0
5,871
<?php // Heading $_['heading_title'] = 'Product Block'; // Text $_['text_module'] = 'Modules'; $_['text_success'] = 'Success: You have modified Block module!'; $_['text_edit'] = 'Edit Block Module'; // Entry $_['entry_status'] = 'Status'; $_['entry_category'] = 'Product category'; $_['entry_limit'] = 'Limit'; $_['entry_name'] = 'Block name'; // Error $_['error_permission'] = 'Warning: You do not have permission to modify category module!';
shanksimi/opencart.vn
upload/admin/language/english/module/block_product.php
PHP
gpl-3.0
481
/** * BACON (sdd.bacon@gmail.com) * * DateUtils - Provides an easy interface for getting/saving the current date. * * Copyright (c) 2010 * @author David Pizzuto, Seamus Reynolds, Matt Schoen, Michael Stark * All Rights Reserved * * @version 0.1, 04/02/10 * * http://code.google.com/p/bacon/ * * 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 bacon; import java.util.Date; import java.util.GregorianCalendar; public final class DateUtils { /** * NO ONE SHALL CREATE A DateUtils OBJECT */ private DateUtils() { } /** * Creates a Date object representing the current time. * * @return A Date object representing the current time. */ public static Date getCurrentDate() { GregorianCalendar currentDate = new GregorianCalendar(); return currentDate.getTime(); } /** * Creates a Date object at day/month/year * * @param year The year in YYYY form. * @param month The month in MM or M form (i.e. 11 or 4). Must be 0 based. * @param day The day in DD or D form (i.e. 21 or 6) * @return A date representing the given parameters. */ public static Date createDate(int year, int month, int day) { // GregorianCalendar expects month in 0 based form (January is 0). GregorianCalendar date = new GregorianCalendar(year, month, day); return date.getTime(); } /** * Creates a Date object at day/month/year. If a bad month is given, returns null. * * @param year The year in YYYY form. * @param month The month in String formate (either 'Jan' or 'April') * @param day The day in DD or D form (i.e. 21 or 6) * @return A date representing the given parameters, or null if a bad Month is given. */ public static Date createDate(int year, String month, int day) { int monthVal = DateUtils.monthStringToInteger(month); if (monthVal == -1) { return null; } return DateUtils.createDate(year, monthVal, day); } /** * Fetches the numerical month value based on the given String representation. * * @param month The month in String format (either 'Jan' or 'April') * @return The month's integer value, or 0 if bad input is given. */ public static int monthStringToInteger(String month) { if (month.equalsIgnoreCase("Jan") || month.equalsIgnoreCase("January")) { return 0; } if (month.equalsIgnoreCase("Feb") || month.equalsIgnoreCase("February")) { return 1; } if (month.equalsIgnoreCase("Mar") || month.equalsIgnoreCase("March")) { return 2; } if (month.equalsIgnoreCase("Apr") || month.equalsIgnoreCase("April")) { return 3; } if (month.equalsIgnoreCase("May")) { return 4; } if (month.equalsIgnoreCase("Jun") || month.equalsIgnoreCase("June")) { return 5; } if (month.equalsIgnoreCase("Jul") || month.equalsIgnoreCase("July")) { return 6; } if (month.equalsIgnoreCase("Aug") || month.equalsIgnoreCase("August")) { return 7; } if (month.equalsIgnoreCase("Sep") || month.equalsIgnoreCase("September")) { return 8; } if (month.equalsIgnoreCase("Oct") || month.equalsIgnoreCase("October")) { return 9; } if (month.equalsIgnoreCase("Nov") || month.equalsIgnoreCase("November")) { return 10; } if (month.equalsIgnoreCase("Dec") || month.equalsIgnoreCase("December")) { return 11; } return -1; } }
Ganon11/sdd-bacon
src/java/bacon/DateUtils.java
Java
gpl-3.0
4,148
<? include_once "LowLevel/dataCrypt.php"; include_once "UserControl/userControl.php"; include_once "LowLevel/userValidator.php"; include_once "MainWork/WorkPlace.php"; //Быстрый поиск по названию должности / профессии /*$sql ="SELECT `sName` FROM `Nd_factors` WHERE `sName` LIKE '%".DbConnect::ToBaseStr($_GET['term'])."%' ORDER BY `sName`;"; $result = DbConnect::GetSqlQuery($sql); if (mysql_num_rows($result) > 0) { while($vRow = mysql_fetch_array($result)) { $row['value']=$vRow[sName]; $aResult[] = $row; } } echo json_encode($aResult);*/ if ($_POST['sHeader']=='ps1') { $sqlPS1 = "SELECT * FROM Nd_pens WHERE sNum LIKE '1%' AND idParent = -1 ORDER BY id;"; $resultPS1 = DbConnect::GetSqlQuery($sqlPS1); $sHtml = ''; if (mysql_num_rows($resultPS1) > 0) { while ($vRowPS1 = mysql_fetch_array($resultPS1)) { $sHtml = $sHtml.'<div id="header_h1_'.$vRowPS1['id'].'" onclick="RoollClick(\'h1_'.$vRowPS1['id'].'\')" class="rollDown" title="'.$vRowPS1['sInfo'].'"><strong>'.$vRowPS1['sName'].'</strong></div> <div id="body_h1_'.$vRowPS1['id'].'" style="display:none;margin:10px; margin-left:30px;">'; $sqlPS11 = "SELECT * FROM Nd_pens WHERE idParent = ".$vRowPS1['id']." ORDER BY id;"; $resultPS11 = DbConnect::GetSqlQuery($sqlPS11); if (mysql_num_rows($resultPS11) > 0) { while ($vRowPS11 = mysql_fetch_array($resultPS11)) { $sStrong1 = ''; $sStrong2 = ''; if (strpos($vRowPS11['sNum'], '-') == '') {$sStrong1 = '<strong>'; $sStrong2 = '</strong>'; } $sHtml = $sHtml.'<label><input type="checkbox" name="pens1" value="'.$vRowPS11['id'].'" id="pens1_'.$vRowPS11['id'].'" />'.$sStrong1.$vRowPS11['sNum'].' '.$vRowPS11['sName'].$sStrong2.'</label><br />'; } } $sHtml = $sHtml.'</div>'; } } echo $sHtml; } if ($_POST['sHeader']=='ps2') { $sqlPS1 = "SELECT * FROM Nd_pens WHERE sNum LIKE '2%' AND idParent = -1 ORDER BY id;"; $resultPS1 = DbConnect::GetSqlQuery($sqlPS1); $sHtml = ''; if (mysql_num_rows($resultPS1) > 0) { while ($vRowPS1 = mysql_fetch_array($resultPS1)) { $sHtml = $sHtml.'<div id="header_h1_'.$vRowPS1['id'].'" onclick="RoollClick(\'h1_'.$vRowPS1['id'].'\')" class="rollDown" title="'.$vRowPS1['sInfo'].'"><strong>'.$vRowPS1['sName'].'</strong></div> <div id="body_h1_'.$vRowPS1['id'].'" style="display:none;margin:10px; margin-left:30px;">'; $sqlPS11 = "SELECT * FROM Nd_pens WHERE idParent = ".$vRowPS1['id']." ORDER BY id;"; $resultPS11 = DbConnect::GetSqlQuery($sqlPS11); if (mysql_num_rows($resultPS11) > 0) { while ($vRowPS11 = mysql_fetch_array($resultPS11)) { $sStrong1 = ''; $sStrong2 = ''; if (strpos($vRowPS11['sNum'], '-') == '') {$sStrong1 = '<strong>'; $sStrong2 = '</strong>'; } $sHtml = $sHtml.'<label><input type="checkbox" name="pens1" value="'.$vRowPS11['id'].'" id="pens1_'.$vRowPS11['id'].'" />'.$sStrong1.$vRowPS11['sNum'].' '.$vRowPS11['sName'].$sStrong2.'</label><br />'; } } $sHtml = $sHtml.'</div>'; } } echo $sHtml; } if ($_POST['sHeader']=='psFz') { $sHtml = ''; $sHtml = $sHtml.'<div id="header_hh1_1" onclick="RoollClick(\'hh1_1\')" class="rollDown" title="ГЛАВА VI. Порядок сохранения и конвертации (преобразования) ранее приобретенных прав. Статья 27. Сохранение права на досрочное назначение трудовой пенсии."><strong>Статья 27. Сохранение права на досрочное назначение трудовой пенсии</strong></div> <div id="body_hh1_1" style="display:none;margin:10px; margin-left:30px;">'; $sql1 = 'SELECT * FROM Nd_pensFz WHERE iState = 27 ORDER BY id'; $result1 = DbConnect::GetSqlQuery($sql1); if (mysql_num_rows($result1) > 0) { while ($vRow1 = mysql_fetch_array($result1)) { $sHtml = $sHtml.'<label><input type="checkbox" name="pensFz" value="'.$vRow1['id'].'" id="pensFz_'.$vRow1['id'].'" />'.$vRow1['sNum'].' '.$vRow1['sName'].'</label><br />'; } } $sHtml = $sHtml.'</div>'; $sHtml = $sHtml.'<div id="header_hh1_2" onclick="RoollClick(\'hh1_2\')" class="rollDown" title="ГЛАВА VI. Порядок сохранения и конвертации (преобразования) ранее приобретенных прав. Статья 28. Сохранение права на досрочное назначение трудовой пенсии отдельным категориям граждан."><strong>Статья 28. Сохранение права на досрочное назначение трудовой пенсии отдельным категориям граждан</strong></div> <div id="body_hh1_2" style="display:none;margin:10px; margin-left:30px;">'; $sql2 = 'SELECT * FROM Nd_pensFz WHERE iState = 28 ORDER BY id'; $result2 = DbConnect::GetSqlQuery($sql2); if (mysql_num_rows($result2) > 0) { while ($vRow2 = mysql_fetch_array($result2)) { $sHtml = $sHtml.'<label><input type="checkbox" name="pensFz" value="'.$vRow2['id'].'" id="pensFz_'.$vRow2['id'].'" />'.$vRow2['sNum'].' '.$vRow2['sName'].'</label><br />'; } } $sHtml = $sHtml.'</div>'; echo $sHtml; } //ицина первый том if ($_POST['sHeader']=='med1') { $sHtml = ''; $sHtml = $sHtml.'<div id="header_h1_1" onclick="RoollClick(\'h1_1\')" class="rollDown" title=""><strong>1. Химические факторы</strong></div><div id="body_h1_1" style="display:none;margin:10px; margin-left:30px;">'; $sHtml = $sHtml.'<div id="header_h2_1" onclick="RoollClick(\'h2_1\')" class="rollDown" title=""><strong>1.1 Химические вещества, обладающие выраженными особенностями действия на организм</strong></div><div id="body_h2_1" style="display:none;margin:10px; margin-left:30px;">'; $sql1 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "1.1%" AND sPer LIKE "";'; $result1 = DbConnect::GetSqlQuery($sql1); while ($vRow1 = mysql_fetch_array($result1)) { $sHtml = $sHtml.'<div id="header_h3_'.$vRow1['id'].'" onclick="RoollClick(\'h3_'.$vRow1['id'].'\')" class="rollDown" title=""><strong>'.$vRow1['sPunkt'].$vRow1['sName'].'</strong></div><div id="body_h3_'.$vRow1['id'].'" style="display:none;margin:10px; margin-left:30px;">'; $sql2 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "'.$vRow1['sPunkt'].'%" AND id <> '.$vRow1['id'].' AND sPunkt NOT LIKE "";'; $result2 = DbConnect::GetSqlQuery($sql2); while ($vRow2 = mysql_fetch_array($result2)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow2['id'].'" id="med1_'.$vRow2['id'].'" />'.$vRow2['sPunkt'].' '.$vRow2['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; } $sHtml = $sHtml.'</div>'; $sHtml = $sHtml.'<div id="header_h2_2" onclick="RoollClick(\'h2_2\')" class="rollDown" title=""><strong>1.2 Вещества и соединения, объединенные химической структурой</strong></div><div id="body_h2_2" style="display:none;margin:10px; margin-left:30px;">'; $sql4 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "1.2%" AND sPer LIKE "" AND length(sPunkt) < 8;'; $result4 = DbConnect::GetSqlQuery($sql4); while ($vRow4 = mysql_fetch_array($result4)) { $sHtml = $sHtml.'<div id="header_h3_'.$vRow4['id'].'" onclick="RoollClick(\'h3_'.$vRow4['id'].'\')" class="rollDown" title=""><strong>'.$vRow4['sPunkt'].$vRow4['sName'].':</strong></div><div id="body_h3_'.$vRow4['id'].'" style="display:none;margin:10px; margin-left:30px;">'; $sql5 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "'.$vRow4['sPunkt'].'%" AND sPer NOT LIKE "";'; $result5 = DbConnect::GetSqlQuery($sql5); while ($vRow5 = mysql_fetch_array($result5)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow5['id'].'" id="med1_'.$vRow5['id'].'" />'.$vRow5['sPunkt'].' '.$vRow5['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; } $sql3 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "1.2%" AND sPer NOT LIKE "" AND length(sPunkt) < 8;'; $result3 = DbConnect::GetSqlQuery($sql3); while ($vRow3 = mysql_fetch_array($result3)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow3['id'].'" id="med1_'.$vRow3['id'].'" />'.$vRow3['sPunkt'].' '.$vRow3['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; $sHtml = $sHtml.'<div id="header_h2_3" onclick="RoollClick(\'h2_3\')" class="rollDown" title=""><strong>1.3. Сложные химические смеси, композиции, химические вещества определенного назначения, включая:</strong></div><div id="body_h2_3" style="display:none;margin:10px; margin-left:30px;">'; $sql4 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "1.3%" AND sPer LIKE "" AND length(sPunkt) < 8;'; $result4 = DbConnect::GetSqlQuery($sql4); while ($vRow4 = mysql_fetch_array($result4)) { $sHtml = $sHtml.'<div id="header_h3_'.$vRow4['id'].'" onclick="RoollClick(\'h3_'.$vRow4['id'].'\')" class="rollDown" title=""><strong>'.$vRow4['sPunkt'].$vRow4['sName'].':</strong></div><div id="body_h3_'.$vRow4['id'].'" style="display:none;margin:10px; margin-left:30px;">'; $sql5 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "'.$vRow4['sPunkt'].'%" AND sPer NOT LIKE "";'; $result5 = DbConnect::GetSqlQuery($sql5); while ($vRow5 = mysql_fetch_array($result5)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow5['id'].'" id="med1_'.$vRow5['id'].'" />'.$vRow5['sPunkt'].' '.$vRow5['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; } $sql3 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "1.3%" AND sPer NOT LIKE "" AND length(sPunkt) < 8;'; $result3 = DbConnect::GetSqlQuery($sql3); while ($vRow3 = mysql_fetch_array($result3)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow3['id'].'" id="med1_'.$vRow3['id'].'" />'.$vRow3['sPunkt'].' '.$vRow3['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; $sHtml = $sHtml.'</div>'; $sHtml = $sHtml.'<div id="header_h1_2" onclick="RoollClick(\'h1_2\')" class="rollDown" title=""><strong>2. Биологические факторы</strong></div><div id="body_h1_2" style="display:none;margin:10px; margin-left:30px;">'; $sql8 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "2.%" AND sPer LIKE "" AND length(sPunkt) < 8;'; $result8 = DbConnect::GetSqlQuery($sql8); while ($vRow8 = mysql_fetch_array($result8)) { $sHtml = $sHtml.'<div id="header_h4_'.$vRow8['id'].'" onclick="RoollClick(\'h4_'.$vRow8['id'].'\')" class="rollDown" title=""><strong>'.$vRow8['sPunkt'].$vRow8['sName'].':</strong></div><div id="body_h4_'.$vRow8['id'].'" style="display:none;margin:10px; margin-left:30px;">'; $sql9 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "'.$vRow8['sPunkt'].'%" AND sPer NOT LIKE "";'; $result9 = DbConnect::GetSqlQuery($sql9); while ($vRow9 = mysql_fetch_array($result9)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow9['id'].'" id="med1_'.$vRow9['id'].'" />'.$vRow9['sPunkt'].' '.$vRow9['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; } $sql7 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "2.%" AND sPer NOT LIKE "" AND length(sPunkt) < 6;'; $result7 = DbConnect::GetSqlQuery($sql7); while ($vRow7 = mysql_fetch_array($result7)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow7['id'].'" id="med1_'.$vRow7['id'].'" />'.$vRow7['sPunkt'].' '.$vRow7['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; $sHtml = $sHtml.'<div id="header_h1_3" onclick="RoollClick(\'h1_3\')" class="rollDown" title=""><strong>3. Физические факторы</strong></div><div id="body_h1_3" style="display:none;margin:10px; margin-left:30px;">'; $sql8 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "3.%" AND sPer LIKE "" AND length(sPunkt) < 6;'; $result8 = DbConnect::GetSqlQuery($sql8); while ($vRow8 = mysql_fetch_array($result8)) { $sHtml = $sHtml.'<div id="header_h4_'.$vRow8['id'].'" onclick="RoollClick(\'h4_'.$vRow8['id'].'\')" class="rollDown" title=""><strong>'.$vRow8['sPunkt'].$vRow8['sName'].':</strong></div><div id="body_h4_'.$vRow8['id'].'" style="display:none;margin:10px; margin-left:30px;">'; $sql9 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "'.$vRow8['sPunkt'].'%" AND sPer NOT LIKE "";'; $result9 = DbConnect::GetSqlQuery($sql9); while ($vRow9 = mysql_fetch_array($result9)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow9['id'].'" id="med1_'.$vRow9['id'].'" />'.$vRow9['sPunkt'].' '.$vRow9['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; } $sql7 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "3.%" AND sPer NOT LIKE "" AND length(sPunkt) < 6;'; $result7 = DbConnect::GetSqlQuery($sql7); while ($vRow7 = mysql_fetch_array($result7)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow7['id'].'" id="med1_'.$vRow7['id'].'" />'.$vRow7['sPunkt'].' '.$vRow7['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; $sHtml = $sHtml.'<div id="header_h1_4" onclick="RoollClick(\'h1_4\')" class="rollDown" title=""><strong>4. Факторы трудового процесса</strong></div><div id="body_h1_4" style="display:none;margin:10px; margin-left:30px;">'; $sql8 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "4.%" AND sPer LIKE "" AND length(sPunkt) < 6;'; $result8 = DbConnect::GetSqlQuery($sql8); while ($vRow8 = mysql_fetch_array($result8)) { $sHtml = $sHtml.'<div id="header_h4_'.$vRow8['id'].'" onclick="RoollClick(\'h4_'.$vRow8['id'].'\')" class="rollDown" title=""><strong>'.$vRow8['sPunkt'].$vRow8['sName'].':</strong></div><div id="body_h4_'.$vRow8['id'].'" style="display:none;margin:10px; margin-left:30px;">'; $sql9 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "'.$vRow8['sPunkt'].'%" AND sPer NOT LIKE "";'; $result9 = DbConnect::GetSqlQuery($sql9); while ($vRow9 = mysql_fetch_array($result9)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow9['id'].'" id="med1_'.$vRow9['id'].'" />'.$vRow9['sPunkt'].' '.$vRow9['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; } $sql7 = 'SELECT * FROM Nd_med1 WHERE sPunkt LIKE "4.%" AND sPer NOT LIKE "" AND length(sPunkt) < 6;'; $result7 = DbConnect::GetSqlQuery($sql7); while ($vRow7 = mysql_fetch_array($result7)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med1" value="'.$vRow7['id'].'" id="med1_'.$vRow7['id'].'" />'.$vRow7['sPunkt'].' '.$vRow7['sName'].'</label><br />'; } $sHtml = $sHtml.'</div>'; echo $sHtml; } //Медицина второй том if ($_POST['sHeader']=='med2') { $sql7 = 'SELECT * FROM Nd_med2;'; $result7 = DbConnect::GetSqlQuery($sql7); while ($vRow7 = mysql_fetch_array($result7)) { $sHtml = $sHtml.'<label><input type="checkbox" name="med2" value="'.$vRow7['id'].'" id="med2_'.$vRow7['id'].'" />'.$vRow7['sPunkt'].' '.$vRow7['sName'].'</label><br />'; } echo $sHtml; } function GetFullNamePensFz($id) { $sql = 'SELECT * FROM Nd_pensFz WHERE id = '.$id; $result = DbConnect::GetSqlQuery($sql); $sRes = 'Федеральный закон №173 "О трудовых пенсиях в Российской Федерации" от 17.12.2001, '; if (mysql_num_rows($result) > 0) { while ($vRow = mysql_fetch_array($result)) { switch ($vRow['iState']) { case '27': $sRes = $sRes.'Глава VI. "Порядок сохранения и конвертации (преобразования) ранее приобретенных прав", Статья 27. "Сохранение права на досрочное назначение трудовой пенсии", '; break; case '28': $sRes = $sRes.'Глава VI. "Порядок сохранения и конвертации (преобразования) ранее приобретенных прав", Статья 28. "Сохранение права на досрочное назначение трудовой пенсии отдельным категориям граждан", '; break; } $sRes = $sRes.'п.п '.$vRow['sName'].'.'; } } return $sRes; } if (isset($_POST['prikaz']) && isset($_POST['id'])) { $sResult = ''; switch($_POST['prikaz']) { case 'pens': $sResult = WorkPlace::GetFullNamePens($_POST['id']); break; case 'pensFz': $sResult = GetFullNamePensFz($_POST['id']); break; } echo $sResult; } if (isset($_POST['prikaz'])) { if ($_POST['prikaz'] == 'med') { $sResult = WorkPlace::GetFullNameMed($_POST['idMed1'], $_POST['idMed2']); echo $sResult; } } ?>
arm2009/main
aj_warranty.php
PHP
gpl-3.0
17,683
# == Schema Information # # Table name: users # # id :integer not null, primary key # email :string default(""), not null # encrypted_password :string default(""), not null # reset_password_token :string # reset_password_sent_at :datetime # remember_created_at :datetime # sign_in_count :integer default(0), not null # current_sign_in_at :datetime # last_sign_in_at :datetime # current_sign_in_ip :inet # last_sign_in_ip :inet # authentication_token :string # string :string # created_at :datetime # updated_at :datetime # role :string # affiliation :string # class User < ActiveRecord::Base # https://github.com/gonzalo-bulnes/simple_token_authentication acts_as_token_authenticatable # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :registerable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable has_many :participants, dependent: :destroy has_many :image_sets, dependent: :destroy has_many :logs, dependent: :destroy belongs_to :default_participant, class_name: 'Participant' def admin? role == 'admin' end def to_s email end end
davidlawson/PsyPad-Server
app/models/user.rb
Ruby
gpl-3.0
1,407
GRANT ALL PRIVILEGES ON DATABASE dbsys TO userx; GRANT ALL ON ALL TABLES IN SCHEMA public TO userx; ALTER TABLE lineitem_y ENABLE ROW LEVEL SECURITY; CREATE POLICY tp_lineitem_y_userx ON lineitem_y1992h1 FOR ALL TO userx USING (l_suppkey = 1313);
MartinMlynarik/dbsys
SQL/scripts/Experiment-TablePartitioning/Pexp4/tpPolicyInit.sql
SQL
gpl-3.0
252
#!/usr/bin/python3 """ Written by: True Demon The non-racist Kali repository grabber for all operating systems. Git Kali uses Offensive Security's package repositories and their generous catalog of extremely handy penetration testing tools. This project is possible because of Offensive Security actually sticking to good practices and keeping their packages well-organized, so thanks OffSec! :) #TryHarder """ # TODO: Finish Install Script # TODO: Categorize tool searches # TODO: Categorization of repos is a big task to be done later # TODO: Include package management import argparse import packmgr as packager from utils import * # includes sys, os prog_info = "GIT Kali Project" __author__ = "True Demon" __winstall__ = "C:\\ProgramFiles\\GitKali\\" # Default package installation directory for Windows __linstall__ = "/usr/share" # Default package installation directory for Linux __install__ = "" # Used to store default install directory based on OS try: if os.name == 'posix': __install__ = __linstall__ if os.getuid(): print("You need to be root to install packages. Try again as sudo.") sys.exit() elif os.name == 'nt': __install__ = __winstall__ from ctypes import windll if not windll.shell32.IsUserAnAdmin(): print("You must be an administrator to install packages. Please run from an escalated cmd.") else: sys.stderr("Could not detect your privileges / operating system. " "This script only supports Linux (Posix) and Windows (nt) systems.") except OSError: sys.stderr("Unknown Operating System detected. You must have invented this one yourself! Teach me, Senpai!") exit() except ImportError as e: sys.stderr("Invalid or missing libraries: \n%s" % e) def search(search_word): # search function for valid packages to install found = [] with open('kali-packages.lst', 'r') as file: packages = file.readlines() for p in packages: if search_word in p.split()[0]: found.append(p.split()[0]) if not len(found): print(Symbol.fail + " Could not find any matching packages") return None print("Found packages: ") print(' '.join(found)) def check_install_dir(install_dir=__install__): if os.path.exists(install_dir): try: os.chdir(install_dir) if os.getcwd() != install_dir: print("Something went wrong. We can't get to your installation directory: %s" % install_dir) sys.exit() except OSError: print("Somehow, you broke it. Dunno how ya did it, but a bug report would be mighty handy to figure out how!") sys.exit(-1) def main(): parser = argparse.ArgumentParser(prog='gitkali.py', description='The apt-like Kali package installer for Linux', epilog=prog_info, formatter_class=argparse.RawTextHelpFormatter) parser._positionals.title = "Commands" parser.add_argument("command", choices=["search", "install", "update", "upgrade"], help="search : search package list for compatible packages\n" + "install : install specified package\n" + "update : update package lists\n" + "upgrade : upgrade kali packages\n\n" ) parser.add_argument("packages", action='store', metavar='package', nargs='*', help="package(s) to upgrade/install") parser.add_argument("-d", "--directory", action='store', default=__install__, help="Alternate installation directory") args = parser.parse_args() packages = [str(p) for p in args.packages] # Converts args.package(tuple) to list of strings for ease of use args.directory = os.path.abspath(args.directory) if args.command == 'search': packager.check_kali_packages() for p in packages: search(p) elif args.command == 'update': packager.get_updates() exit() elif args.command == 'upgrade': packager.upgrade(packages, args.directory) elif args.command == 'install': if len(packages) == 0 : print("No packages given") if '*' in packages: # NEVER EVER EVER EVER EEEEEEEVVVVVEEEEEEEEEEEERRRRRRRRRRR DO THIS!!! # TODO: EVENTUALLY...build a way for this to work safely... packager.install_all(args.directory) if args.directory != __install__: # Usually /usr/share/ check_install_dir(args.directory) # Check that the directory exists warn_non_standard_dir(args.directory) # Warn the user that this is not advised response = input("Do you wish to proceed?: [y/N]") # Confirm decision if response.upper() != 'Y': exit() packages_to_install = packager.get_local_packages(packages) # Returns a dictionary ex: {package_name: package_url} for p in packages_to_install: print("Proceeding with install: ", p) packager.install(p, packages_to_install[p], args.directory) # install(package_name, url, into directory) if __name__ == "__main__": main()
True-Demon/gitkali
gitkali.py
Python
gpl-3.0
5,391
<?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_Db * @subpackage Table * @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: Definition.php 23775 2011-03-01 17:25:24Z ralph $ */ /** * Class for SQL table interface. * * @category Zend * @package Zend_Db * @subpackage Table * @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_Db_Table_Definition { /** * @var array */ protected $_tableConfigs = array(); /** * __construct() * * @param array|Zend_Config $options */ public function __construct ($options = null) { if ($options instanceof Zend_Config) { $this->setConfig($options); } elseif (is_array($options)) { $this->setOptions($options); } } /** * setConfig() * * @param Zend_Config $config * @return Zend_Db_Table_Definition */ public function setConfig (Zend_Config $config) { $this->setOptions($config->toArray()); return $this; } /** * setOptions() * * @param array $options * @return Zend_Db_Table_Definition */ public function setOptions (Array $options) { foreach ($options as $optionName => $optionValue) { $this->setTableConfig($optionName, $optionValue); } return $this; } /** * @param string $tableName * @param array $tableConfig * @return Zend_Db_Table_Definition */ public function setTableConfig ($tableName, array $tableConfig) { // @todo logic here $tableConfig[Zend_Db_Table::DEFINITION_CONFIG_NAME] = $tableName; $tableConfig[Zend_Db_Table::DEFINITION] = $this; if (! isset($tableConfig[Zend_Db_Table::NAME])) { $tableConfig[Zend_Db_Table::NAME] = $tableName; } $this->_tableConfigs[$tableName] = $tableConfig; return $this; } /** * getTableConfig() * * @param string $tableName * @return array */ public function getTableConfig ($tableName) { return $this->_tableConfigs[$tableName]; } /** * removeTableConfig() * * @param string $tableName */ public function removeTableConfig ($tableName) { unset($this->_tableConfigs[$tableName]); } /** * hasTableConfig() * * @param string $tableName * @return bool */ public function hasTableConfig ($tableName) { return (isset($this->_tableConfigs[$tableName])); } }
abueldahab/medalyser
library/Zend/Db/Table/Definition.php
PHP
gpl-3.0
3,293
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0) on Fri Jun 15 11:07:08 CEST 2012 --> <TITLE> OMcomponentsKB </TITLE> <META NAME="date" CONTENT="2012-06-15"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="OMcomponentsKB"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/OMcomponentsKB.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMConnector.html" title="class in org.aslab.om.metacontrol.knowledge.components"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="OMcomponentsKB.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.aslab.om.metacontrol.knowledge.components</FONT> <BR> Class OMcomponentsKB</H2> <PRE> java.lang.Object <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html" title="class in org.aslab.om.ecl.knowledge">org.aslab.om.ecl.knowledge.KnowledgeBase</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.aslab.om.metacontrol.knowledge.components.OMcomponentsKB</B> </PRE> <HR> <DL> <DT><PRE>public class <B>OMcomponentsKB</B><DT>extends <A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html" title="class in org.aslab.om.ecl.knowledge">KnowledgeBase</A></DL> </PRE> <P> <!-- begin-UML-doc --> <p><b>container</b>&nbsp;for&nbsp;the&nbsp;knowledge&nbsp;at&nbsp;the&nbsp;components&nbsp;level:</p><p>it&nbsp;consists&nbsp;of&nbsp;types:</p><ul><li><p>component&nbsp;classes</p></li><li><p>quantity&nbsp;types</p></li></ul><p>parameter&nbsp;and&nbsp;port&nbsp;profiles&nbsp;are&nbsp;part&nbsp;of&nbsp;the&nbsp;definition&nbsp;of&nbsp;each&nbsp;component&nbsp;class</p><p></p> <!-- end-UML-doc --> <P> <P> <DL> <DT><B>Author:</B></DT> <DD>chcorbato</DD> </DL> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private &nbsp;java.util.Map&lt;java.lang.String,<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMConnector.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMConnector</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#connectors">connectors</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private &nbsp;java.util.Set&lt;<A HREF="../../../org.aslab.om.ecl/knowledge/StateAtom.html" title="class in org.aslab.om.ecl.knowledge">StateAtom</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#currentMission">currentMission</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private &nbsp;java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponent.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponent</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#estimatedState">estimatedState</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private &nbsp;java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponentClass</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#knowledge">knowledge</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contains the known classes of components</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMParameterProfile.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMParameterProfile</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#paramProfiles">paramProfiles</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp;<A NAME="fields_inherited_from_class_ecl.knowledge.KnowledgeBase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class org.aslab.om.ecl.knowledge.<A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html" title="class in org.aslab.om.ecl.knowledge">KnowledgeBase</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html#elements">elements</A>, <A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html#staticKnowledge">staticKnowledge</A></CODE></TD> </TR> </TABLE> &nbsp; <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#OMcomponentsKB()">OMcomponentsKB</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#addComponent(org.aslab.om.metacontrol.knowledge.components.OMComponent)">addComponent</A></B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponent.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponent</A>&nbsp;c)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#addComponentClass(org.aslab.om.metacontrol.knowledge.components.OMComponentClass)">addComponentClass</A></B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponentClass</A>&nbsp;c)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMConnector.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMConnector</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#addConnector(java.lang.String, java.lang.String, org.aslab.om.components_functions_metamodel.components.instantaneous_state.Port)">addConnector</A></B>(java.lang.String&nbsp;name, java.lang.String&nbsp;type, <A HREF="../../../components_functions_metamodel/components/instantaneous_state/Port.html" title="interface in org.aslab.om.components_functions_metamodel.components.instantaneous_state">Port</A>&nbsp;provider)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#addParameterProfile(org.aslab.om.metacontrol.knowledge.components.OMParameterProfile)">addParameterProfile</A></B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMParameterProfile.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMParameterProfile</A>&nbsp;p)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private &nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#addPortConnector(org.aslab.om.metacontrol.knowledge.components.OMPort)">addPortConnector</A></B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMPort.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMPort</A>&nbsp;p)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#addPortProfile(org.aslab.om.metacontrol.knowledge.components.OMPortProfile)">addPortProfile</A></B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMPortProfile.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMPortProfile</A>&nbsp;portp)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#deleteConnector(java.lang.String)">deleteConnector</A></B>(java.lang.String&nbsp;cname)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponentClass</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#getComponentClasses()">getComponentClasses</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMConnector.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMConnector</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#getConnector(java.lang.String)">getConnector</A></B>(java.lang.String&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.Set&lt;<A HREF="../../../components_functions_metamodel/components/instantaneous_state/Connector.html" title="interface in org.aslab.om.components_functions_metamodel.components.instantaneous_state">Connector</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#getConnectors()">getConnectors</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.Set&lt;<A HREF="../../../org.aslab.om.ecl/knowledge/StateAtom.html" title="class in org.aslab.om.ecl.knowledge">StateAtom</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#getEstimatedState()">getEstimatedState</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.Set&lt;<A HREF="../../../org.aslab.om.ecl/knowledge/StateAtom.html" title="class in org.aslab.om.ecl.knowledge">StateAtom</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#getMission()">getMission</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMParameterProfile.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMParameterProfile</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#getParamProfile(java.lang.String)">getParamProfile</A></B>(java.lang.String&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private &nbsp;java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponent.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponent</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#getSourceComponents(java.util.Set)">getSourceComponents</A></B>(java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponent.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponent</A>&gt;&nbsp;set)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponentClass</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#newComponentClass()">newComponentClass</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html#setCurrentMission(java.util.Set)">setCurrentMission</A></B>(java.util.Set&lt;<A HREF="../../../org.aslab.om.ecl/knowledge/StateAtom.html" title="class in org.aslab.om.ecl.knowledge">StateAtom</A>&gt;&nbsp;m)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_ecl.knowledge.KnowledgeBase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.aslab.om.ecl.knowledge.<A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html" title="class in org.aslab.om.ecl.knowledge">KnowledgeBase</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html#getElements()">getElements</A>, <A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html#setElements(java.util.Set)">setElements</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="currentMission"><!-- --></A><H3> currentMission</H3> <PRE> private java.util.Set&lt;<A HREF="../../../org.aslab.om.ecl/knowledge/StateAtom.html" title="class in org.aslab.om.ecl.knowledge">StateAtom</A>&gt; <B>currentMission</B></PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DL> </DL> </DL> <HR> <A NAME="paramProfiles"><!-- --></A><H3> paramProfiles</H3> <PRE> public java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMParameterProfile.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMParameterProfile</A>&gt; <B>paramProfiles</B></PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DL> </DL> </DL> <HR> <A NAME="estimatedState"><!-- --></A><H3> estimatedState</H3> <PRE> private java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponent.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponent</A>&gt; <B>estimatedState</B></PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DL> </DL> </DL> <HR> <A NAME="knowledge"><!-- --></A><H3> knowledge</H3> <PRE> private java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponentClass</A>&gt; <B>knowledge</B></PRE> <DL> <DD>contains the known classes of components <P> <DL> </DL> </DL> <HR> <A NAME="connectors"><!-- --></A><H3> connectors</H3> <PRE> private java.util.Map&lt;java.lang.String,<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMConnector.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMConnector</A>&gt; <B>connectors</B></PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DL> </DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="OMcomponentsKB()"><!-- --></A><H3> OMcomponentsKB</H3> <PRE> public <B>OMcomponentsKB</B>()</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="setCurrentMission(java.util.Set)"><!-- --></A><H3> setCurrentMission</H3> <PRE> public void <B>setCurrentMission</B>(java.util.Set&lt;<A HREF="../../../org.aslab.om.ecl/knowledge/StateAtom.html" title="class in org.aslab.om.ecl.knowledge">StateAtom</A>&gt;&nbsp;m)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getComponentClasses()"><!-- --></A><H3> getComponentClasses</H3> <PRE> public java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponentClass</A>&gt; <B>getComponentClasses</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getConnectors()"><!-- --></A><H3> getConnectors</H3> <PRE> public java.util.Set&lt;<A HREF="../../../components_functions_metamodel/components/instantaneous_state/Connector.html" title="interface in org.aslab.om.components_functions_metamodel.components.instantaneous_state">Connector</A>&gt; <B>getConnectors</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="newComponentClass()"><!-- --></A><H3> newComponentClass</H3> <PRE> public <A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponentClass</A> <B>newComponentClass</B>()</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="addParameterProfile(org.aslab.om.metacontrol.knowledge.components.OMParameterProfile)"><!-- --></A><H3> addParameterProfile</H3> <PRE> public void <B>addParameterProfile</B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMParameterProfile.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMParameterProfile</A>&nbsp;p)</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - </DL> </DD> </DL> <HR> <A NAME="getParamProfile(java.lang.String)"><!-- --></A><H3> getParamProfile</H3> <PRE> public <A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMParameterProfile.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMParameterProfile</A> <B>getParamProfile</B>(java.lang.String&nbsp;name)</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="addComponentClass(org.aslab.om.metacontrol.knowledge.components.OMComponentClass)"><!-- --></A><H3> addComponentClass</H3> <PRE> public void <B>addComponentClass</B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponentClass</A>&nbsp;c)</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>c</CODE> - </DL> </DD> </DL> <HR> <A NAME="addComponent(org.aslab.om.metacontrol.knowledge.components.OMComponent)"><!-- --></A><H3> addComponent</H3> <PRE> public void <B>addComponent</B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponent.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponent</A>&nbsp;c)</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>c</CODE> - </DL> </DD> </DL> <HR> <A NAME="addPortConnector(org.aslab.om.metacontrol.knowledge.components.OMPort)"><!-- --></A><H3> addPortConnector</H3> <PRE> private void <B>addPortConnector</B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMPort.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMPort</A>&nbsp;p)</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - </DL> </DD> </DL> <HR> <A NAME="getEstimatedState()"><!-- --></A><H3> getEstimatedState</H3> <PRE> public java.util.Set&lt;<A HREF="../../../org.aslab.om.ecl/knowledge/StateAtom.html" title="class in org.aslab.om.ecl.knowledge">StateAtom</A>&gt; <B>getEstimatedState</B>()</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html#getEstimatedState()">getEstimatedState</A></CODE> in class <CODE><A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html" title="class in org.aslab.om.ecl.knowledge">KnowledgeBase</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="addPortProfile(org.aslab.om.metacontrol.knowledge.components.OMPortProfile)"><!-- --></A><H3> addPortProfile</H3> <PRE> public void <B>addPortProfile</B>(<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMPortProfile.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMPortProfile</A>&nbsp;portp)</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>portp</CODE> - </DL> </DD> </DL> <HR> <A NAME="getSourceComponents(java.util.Set)"><!-- --></A><H3> getSourceComponents</H3> <PRE> private java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponent.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponent</A>&gt; <B>getSourceComponents</B>(java.util.Set&lt;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponent.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMComponent</A>&gt;&nbsp;set)</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>set</CODE> - <DT><B>Returns:</B><DD></DL> </DD> </DL> <HR> <A NAME="getMission()"><!-- --></A><H3> getMission</H3> <PRE> public java.util.Set&lt;<A HREF="../../../org.aslab.om.ecl/knowledge/StateAtom.html" title="class in org.aslab.om.ecl.knowledge">StateAtom</A>&gt; <B>getMission</B>()</PRE> <DL> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html#getMission()">getMission</A></CODE> in class <CODE><A HREF="../../../org.aslab.om.ecl/knowledge/KnowledgeBase.html" title="class in org.aslab.om.ecl.knowledge">KnowledgeBase</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="addConnector(java.lang.String, java.lang.String, org.aslab.om.components_functions_metamodel.components.instantaneous_state.Port)"><!-- --></A><H3> addConnector</H3> <PRE> public <A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMConnector.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMConnector</A> <B>addConnector</B>(java.lang.String&nbsp;name, java.lang.String&nbsp;type, <A HREF="../../../components_functions_metamodel/components/instantaneous_state/Port.html" title="interface in org.aslab.om.components_functions_metamodel.components.instantaneous_state">Port</A>&nbsp;provider)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="deleteConnector(java.lang.String)"><!-- --></A><H3> deleteConnector</H3> <PRE> public void <B>deleteConnector</B>(java.lang.String&nbsp;cname)</PRE> <DL> <DD><!-- begin-UML-doc --> <!-- end-UML-doc --> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>con</CODE> - </DL> </DD> </DL> <HR> <A NAME="getConnector(java.lang.String)"><!-- --></A><H3> getConnector</H3> <PRE> public <A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMConnector.html" title="class in org.aslab.om.metacontrol.knowledge.components">OMConnector</A> <B>getConnector</B>(java.lang.String&nbsp;name)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/OMcomponentsKB.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMComponentClass.html" title="class in org.aslab.om.metacontrol.knowledge.components"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../org.aslab.om.metacontrol/knowledge/components/OMConnector.html" title="class in org.aslab.om.metacontrol.knowledge.components"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org.aslab.om.metacontrol/knowledge/components/OMcomponentsKB.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="OMcomponentsKB.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
aslab/rct
higgs/branches/ros-fuerte/OM/versions/NamePerception_OM/OMJava/doc/metacontrol/knowledge/components/OMcomponentsKB.html
HTML
gpl-3.0
34,552
package biz.dealnote.messenger.api; import biz.dealnote.messenger.api.services.IAuthService; import io.reactivex.Single; /** * Created by Ruslan Kolbasa on 28.07.2017. * phoenix */ public interface IDirectLoginSeviceProvider { Single<IAuthService> provideAuthService(); }
PhoenixDevTeam/Phoenix-for-VK
app/src/main/java/biz/dealnote/messenger/api/IDirectLoginSeviceProvider.java
Java
gpl-3.0
280
/*global Ext*/ //<debug> console.log(new Date().toLocaleTimeString() + ": Log: Load: WPAKT.view.core.skeleton.Main"); //</debug> Ext.define("WPAKT.view.core.skeleton.Main", { extend: "Ext.container.Container" , alias: "widget.coreskeletonmain" , scrollable: "y" , layout: { type: "hbox" , align: "stretchmax" // Tell the layout to animate the x/width of the child items. , animate: true , animatePolicy: { x: true , width: true } }, // id: "main-view-detail-wrap", // reference: "mainContainerWrap", flex: 1, items: [ {xtype: "coreskeletontreemain"} , {xtype: "coreskeletoncardmain"} ], beforeLayout : function() { // We setup some minHeights dynamically to ensure we stretch to fill the height // of the viewport minus the top toolbar var me = this, height = Ext.Element.getViewportHeight() - 64, // offset by topmost toolbar height // We use itemId/getComponent instead of "reference" because the initial // layout occurs too early for the reference to be resolved navTree = me.query("coreskeletontreemain")[0]; me.minHeight = height; navTree.setStyle({ "min-height": height + "px" }); me.callParent(arguments); } });
Webcampak/ui
Sencha/App6.0/workspace/Dashboard/app/view/core/skeleton/Main.js
JavaScript
gpl-3.0
1,388
class System { static out = { println(obj?:any) { console.log(obj); }, print(obj:any) { console.log(obj); } }; static err = { println(obj?:any) { console.log(obj); }, print(obj:any) { console.log(obj); } }; static arraycopy(src:Number[], srcPos:number, dest:Number[], destPos:number, numElements:number):void { for (var i = 0; i < numElements; i++) { dest[destPos + i] = src[srcPos + i]; } } } var TSMap = Map; var TSSet = Set; interface Number { equals : (other:Number) => boolean; longValue() : number; floatValue() : number; intValue() : number; shortValue() : number; } Number.prototype.equals = function (other) { return this == other; }; interface String { equals : (other:String) => boolean; startsWith : (other:String) => boolean; endsWith : (other:String) => boolean; matches : (regEx:String) => boolean; //getBytes : () => number[]; isEmpty : () => boolean; } class StringUtils { static copyValueOf (data:string[], offset:number, count:number) : string { var result : string = ""; for(var i = offset; i < offset+count;i++) { result += data[i]; } return result; } } String.prototype.matches = function (regEx) { return this.match(regEx).length > 0; }; String.prototype.isEmpty = function () { return this.length == 0; }; String.prototype.equals = function (other) { return this == other; }; String.prototype.startsWith = function (other) { for (var i = 0; i < other.length; i++) { if (other.charAt(i) != this.charAt(i)) { return false; } } return true; }; String.prototype.endsWith = function (other) { for (var i = other.length - 1; i >= 0; i--) { if (other.charAt(i) != this.charAt(i)) { return false; } } return true; }; module java { export module lang { export class Double { public static parseDouble(val:string):number { return +val; } } export class Float { public static parseFloat(val:string):number { return +val; } } export class Integer { public static parseInt(val:string):number { return +val; } } export class Long { public static parseLong(val:string):number { return +val; } } export class Short { public static MIN_VALUE = -0x8000; public static MAX_VALUE = 0x7FFF; public static parseShort(val:string):number { return +val; } } export class Throwable { private message:string; private error:Error; constructor(message:string) { this.message = message; this.error = new Error(message); } printStackTrace() { console.error(this.error['stack']); } } export class Exception extends Throwable {} export class RuntimeException extends Exception {} export class IndexOutOfBoundsException extends Exception {} export class StringBuilder { buffer = ""; public length = 0; append(val:any):StringBuilder { this.buffer = this.buffer + val; length = this.buffer.length; return this; } toString():string { return this.buffer; } } } export module util { export class Random { public nextInt(max:number):number { return Math.random() * max; } } export class Arrays { static fill(data:Number[], begin:number, nbElem:number, param:number):void { var max = begin + nbElem; for (var i = begin; i < max; i++) { data[i] = param; } } } export class Collections { public static reverse<A>(p:List<A>):void { var temp = new List<A>(); for (var i = 0; i < p.size(); i++) { temp.add(p.get(i)); } p.clear(); for (var i = temp.size() - 1; i >= 0; i--) { p.add(temp.get(i)); } } public static sort<A>(p:List<A>):void { p.sort(); } } export class Collection<T> { add(val:T):void { throw new java.lang.Exception("Abstract implementation"); } addAll(vals:Collection<T>):void { throw new java.lang.Exception("Abstract implementation"); } remove(val:T):void { throw new java.lang.Exception("Abstract implementation"); } clear():void { throw new java.lang.Exception("Abstract implementation"); } isEmpty():boolean { throw new java.lang.Exception("Abstract implementation"); } size():number { throw new java.lang.Exception("Abstract implementation"); } contains(val:T):boolean { throw new java.lang.Exception("Abstract implementation"); } toArray(a:Array<T>):T[] { throw new java.lang.Exception("Abstract implementation"); } } export class List<T> extends Collection<T> { sort() { this.internalArray = this.internalArray.sort((a, b)=> { if (a == b) { return 0; } else { if (a < b) { return -1; } else { return 1; } } }); } private internalArray:Array<T> = []; addAll(vals:Collection<T>) { var tempArray = vals.toArray(null); for (var i = 0; i < tempArray.length; i++) { this.internalArray.push(tempArray[i]); } } clear() { this.internalArray = []; } public poll():T { return this.internalArray.shift(); } remove(val:T) { //TODO with filter } toArray(a:Array<T>):T[] { //TODO var result = new Array<T>(this.internalArray.length); this.internalArray.forEach((value:T, index:number, p1:T[])=> { result[index] = value; }); return result; } size():number { return this.internalArray.length; } add(val:T):void { this.internalArray.push(val); } get(index:number):T { return this.internalArray[index]; } contains(val:T):boolean { for (var i = 0; i < this.internalArray.length; i++) { if (this.internalArray[i] == val) { return true; } } return false; } isEmpty():boolean { return this.internalArray.length == 0; } } export class ArrayList<T> extends List<T> { } export class LinkedList<T> extends List<T> { } export class Map<K, V> { get(key:K):V { return this.internalMap.get(key); } put(key:K, value:V):void { this.internalMap.set(key, value); } containsKey(key:K):boolean { return this.internalMap.has(key); } remove(key:K):V { var tmp = this.internalMap.get(key); this.internalMap.delete(key); return tmp; } keySet():Set<K> { var result = new HashSet<K>(); this.internalMap.forEach((value:V, index:K, p1)=> { result.add(index); }); return result; } isEmpty():boolean { return this.internalMap.size == 0; } values():Set<V> { var result = new HashSet<V>(); this.internalMap.forEach((value:V, index:K, p1)=> { result.add(value); }); return result; } private internalMap = new TSMap<K,V>(); clear():void { this.internalMap = new TSMap<K,V>(); } } export class HashMap<K, V> extends Map<K,V> { } export class Set<T> extends Collection<T> { private internalSet = new TSSet<T>(); add(val:T) { this.internalSet.add(val); } clear() { this.internalSet = new TSSet<T>(); } contains(val:T):boolean { return this.internalSet.has(val); } addAll(vals:Collection<T>) { var tempArray = vals.toArray(null); for (var i = 0; i < tempArray.length; i++) { this.internalSet.add(tempArray[i]); } } remove(val:T) { this.internalSet.delete(val); } size():number { return this.internalSet.size; } isEmpty():boolean { return this.internalSet.size == 0; } toArray(other:Array<T>):T[] { var result = new Array<T>(this.internalSet.size); var i = 0; this.internalSet.forEach((value:T, index:T, origin)=> { result[i] = value; i++; }); return result; } } export class HashSet<T> extends Set<T> { } } } module org { export module junit { export class Assert { public static assertNotNull(p:any):void { if (p == null) { throw "Assert Error " + p + " must not be null"; } } public static assertNull(p:any):void { if (p != null) { throw "Assert Error " + p + " must be null"; } } public static assertEquals(p:any, p2:any):void { if(p.equals !== undefined) { if(!p.equals(p2)) { throw "Assert Error \n" + p + "\n must be equal to \n" + p2 + "\n"; } } else { if (p != p2) { throw "Assert Error \n" + p + "\n must be equal to \n" + p2 + "\n"; } } } public static assertNotEquals(p:any, p2:any):void { if(p.equals !== undefined) { if(p.equals(p2)) { throw "Assert Error \n" + p + "\n must not be equal to \n" + p2 + "\n"; } } else { if (p == p2) { throw "Assert Error \n" + p + "\n must not be equal to \n" + p2 + "\n"; } } } public static assertTrue(b:boolean):void { if (!b) { throw "Assert Error " + b + " must be true"; } } } } }
kevoree/java2go
org.kevoree.modeling.java2go/src/main/resources/java.ts
TypeScript
gpl-3.0
12,152
package dna.metrics.centrality; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.Map.Entry; import java.util.Queue; import java.util.Stack; import dna.graph.IElement; import dna.graph.edges.DirectedEdge; import dna.graph.edges.Edge; import dna.graph.edges.UndirectedEdge; import dna.graph.nodes.DirectedNode; import dna.graph.nodes.Node; import dna.graph.nodes.UndirectedNode; import dna.metrics.algorithms.IAfterEA; import dna.metrics.algorithms.IAfterER; import dna.metrics.algorithms.IAfterNA; import dna.metrics.algorithms.IAfterNR; import dna.series.data.distr.BinnedDoubleDistr; import dna.series.data.nodevaluelists.NodeValueList; import dna.updates.update.EdgeAddition; import dna.updates.update.EdgeRemoval; import dna.updates.update.NodeAddition; import dna.updates.update.NodeRemoval; public class BetweennessCentralityU extends BetweennessCentrality implements IAfterNA, IAfterNR, IAfterEA, IAfterER { Queue<Node>[] qLevel; Queue<Node>[] qALevel; HashMap<Node, Long> visited; long counter; protected HashMap<Node, HashMap<Node, HashSet<Node>>> parents; protected HashMap<Node, HashMap<Node, Integer>> distances; protected HashMap<Node, HashMap<Node, Integer>> spcs; protected HashMap<Node, HashMap<Node, Double>> accSums; public BetweennessCentralityU() { super("BetweennessCentralityU"); } @SuppressWarnings("unchecked") @Override public boolean init() { this.bCC = new NodeValueList("BC_Score", new double[this.g.getMaxNodeIndex() + 1]); this.binnedBC = new BinnedDoubleDistr("Normalized-BC", 0.01d); this.bCSum = 0d; this.sumShortestPaths = 0; // this.bC = new HashMap<Node, Double>(); this.parents = new HashMap<>(); this.distances = new HashMap<>(); this.spcs = new HashMap<>(); this.accSums = new HashMap<>(); int length = 1000; qALevel = new LinkedList[length]; qLevel = new LinkedList[length]; visited = new HashMap<Node, Long>(); counter = 0; for (int i = 0; i < qALevel.length; i++) { qALevel[i] = new LinkedList<Node>(); qLevel[i] = new LinkedList<Node>(); } for (IElement ie : g.getNodes()) { visited.put((Node) ie, counter); } Queue<Node> q = new LinkedList<Node>(); Stack<Node> s = new Stack<Node>(); for (IElement ie : g.getNodes()) { Node n = (Node) ie; // stage ONE s.clear(); q.clear(); HashMap<Node, HashSet<Node>> p = new HashMap<Node, HashSet<Node>>(); HashMap<Node, Integer> d = new HashMap<Node, Integer>(); HashMap<Node, Integer> spc = new HashMap<Node, Integer>(); HashMap<Node, Double> sums = new HashMap<Node, Double>(); for (IElement ieE : g.getNodes()) { Node t = (Node) ieE; if (t == n) { d.put(t, 0); spc.put(t, 1); } else { spc.put(t, 0); d.put(t, Integer.MAX_VALUE); } sums.put(t, 0d); p.put(t, new HashSet<Node>()); } q.add(n); if (DirectedNode.class.isAssignableFrom(this.g .getGraphDatastructures().getNodeType())) { // stage 2 while (!q.isEmpty()) { DirectedNode v = (DirectedNode) q.poll(); s.push(v); for (IElement iEdges : v.getOutgoingEdges()) { DirectedEdge edge = (DirectedEdge) iEdges; DirectedNode w = (DirectedNode) edge .getDifferingNode(v); if (d.get(w).equals(Integer.MAX_VALUE)) { q.add(w); d.put(w, d.get(v) + 1); } if (d.get(w).equals(d.get(v) + 1)) { spc.put(w, spc.get(w) + spc.get(v)); p.get(w).add(v); } } } } else if (UndirectedNode.class.isAssignableFrom(this.g .getGraphDatastructures().getNodeType())) { // stage 2 while (!q.isEmpty()) { UndirectedNode v = (UndirectedNode) q.poll(); s.push(v); for (IElement iEdges : v.getEdges()) { UndirectedEdge edge = (UndirectedEdge) iEdges; UndirectedNode w = (UndirectedNode) edge .getDifferingNode(v); if (d.get(w).equals(Integer.MAX_VALUE)) { q.add(w); d.put(w, d.get(v) + 1); } if (d.get(w).equals(d.get(v) + 1)) { spc.put(w, spc.get(w) + spc.get(v)); p.get(w).add(v); } } } } // stage 3 // stage 3 while (!s.isEmpty()) { Node w = s.pop(); for (Node parent : p.get(w)) { double sumForCurretConnection = spc.get(parent) * (1 + sums.get(w)) / spc.get(w); sums.put(parent, sums.get(parent) + sumForCurretConnection); } if (w != n) { double currentScore = this.bCC.getValue(w.getIndex()); // this.bC.get(w); // this.bC.put(w, currentScore + sums.get(w)); this.bCC.setValue(w.getIndex(), currentScore + sums.get(w)); this.bCSum += sums.get(w); } } parents.put(n, p); distances.put(n, d); spcs.put(n, spc); accSums.put(n, sums); } for (Entry<Node, HashMap<Node, Integer>> e : spcs.entrySet()) { sumShortestPaths += sumSPFromHM(e.getValue(), e.getKey()); } return true; } @Override public boolean applyAfterUpdate(EdgeRemoval er) { if (DirectedNode.class.isAssignableFrom(this.g.getGraphDatastructures() .getNodeType())) { DirectedEdge e = (DirectedEdge) er.getEdge(); DirectedNode src = e.getSrc(); DirectedNode dst = e.getDst(); for (IElement iE : g.getNodes()) { DirectedNode root = (DirectedNode) iE; HashMap<Node, Integer> d = distances.get(root); HashMap<Node, HashSet<Node>> p = parents.get(root); if (!p.get(dst).contains(src) || d.get(src).equals(Integer.MAX_VALUE) || d.get(dst).equals(Integer.MAX_VALUE)) { continue; } // case 1: more than one parent => no shortest path tree // change if (p.get(dst).size() > 1) { removeEdgeManyToMany(root, src, dst); // case 2: the lower node has only one parent } else if (p.get(dst).size() == 1) { removeEdgeOneToMany(root, src, dst); } } } else if (UndirectedNode.class.isAssignableFrom(this.g .getGraphDatastructures().getNodeType())) { UndirectedEdge e = (UndirectedEdge) er.getEdge(); Node n1 = e.getNode1(); Node n2 = e.getNode2(); for (IElement iE : g.getNodes()) { UndirectedNode root = (UndirectedNode) iE; HashMap<Node, Integer> d = distances.get(root); HashMap<Node, HashSet<Node>> p = parents.get(root); // Find the above Tree Element if (d.get(n1) > d.get(n2)) { n1 = n2; n2 = e.getDifferingNode(n1); } if (!p.get(n2).contains(n1) || d.get(n1).equals(Integer.MAX_VALUE) || d.get(n2).equals(Integer.MAX_VALUE)) { continue; } // case 1: more than one parent => no shortest path tree // change if (p.get(n2).size() > 1) { removeEdgeManyToMany(root, n1, n2); // case 2: the lower node has only one parent } else if (p.get(n2).size() == 1) { // recomp(g, root); removeEdgeOneToMany(root, n1, n2); } } } sumShortestPaths = 0; // reinit necessary! for (Entry<Node, HashMap<Node, Integer>> e : spcs.entrySet()) { sumShortestPaths += sumSPFromHM(e.getValue(), e.getKey()); } return true; } private boolean removeEdgeOneToMany(Node root, Node src, Node dst) { counter++; HashMap<Node, Integer> d = distances.get(root); HashMap<Node, HashSet<Node>> p = parents.get(root); HashMap<Node, Double> oldSums = accSums.get(root); HashMap<Node, Integer> oldSpc = spcs.get(root); // Queues and data structure for tree change HashSet<Node> uncertain = new HashSet<Node>(); // data structure for Updates HashMap<Node, Integer> newSpc = new HashMap<Node, Integer>(oldSpc); HashMap<Node, Double> newASums = new HashMap<Node, Double>(); HashMap<Node, HashSet<Node>> newParents = new HashMap<Node, HashSet<Node>>(); // set data structure for dst Node qLevel[d.get(dst)].add(dst); uncertain.add(dst); newASums.put(dst, 0d); newParents.put(dst, new HashSet<Node>()); visited.put(dst, counter); int max = d.get(dst); if (DirectedNode.class.isAssignableFrom(this.g.getGraphDatastructures() .getNodeType())) { for (int i = max; i < qLevel.length && i < max + 1; i++) { while (!qLevel[i].isEmpty()) { DirectedNode w = (DirectedNode) qLevel[i].poll(); int dist = Integer.MAX_VALUE; ArrayList<Node> min = new ArrayList<Node>(); for (IElement iEdges : w.getIncomingEdges()) { DirectedEdge ed = (DirectedEdge) iEdges; Node z = ed.getDifferingNode(w); if (d.get(z) < dist) { min.clear(); min.add(z); dist = d.get(z); continue; } if (d.get(z).equals(dist)) { min.add(z); continue; } } for (IElement iEdges : w.getOutgoingEdges()) { DirectedEdge ed = (DirectedEdge) iEdges; Node z = ed.getDifferingNode(w); if (d.get(z).equals(d.get(w) + 1) && Math.abs(visited.get(z)) < counter) { qLevel[i + 1].add(z); newASums.put(z, 0d); newParents.put(z, new HashSet<Node>()); max = Math.max(max, i + 1); uncertain.add(z); visited.put(z, counter); } } // if their is no connection to the three, remove node form // data set if (dist == Integer.MAX_VALUE || dist >= qLevel.length - 1) { d.put(w, Integer.MAX_VALUE); newSpc.put(w, 0); newParents.get(w).clear(); qALevel[qALevel.length - 1].add(w); uncertain.remove(w); continue; } // connect to the highest uncertain node boolean found = false; newSpc.put(w, 0); newParents.get(w).clear(); for (Node mNode : min) { if ((!uncertain.contains(mNode)) && d.get(mNode).intValue() + 1 == i) { uncertain.remove(w); newSpc.put(w, newSpc.get(w) + newSpc.get(mNode)); found = true; newParents.get(w).add(mNode); } d.put(w, d.get(mNode).intValue() + 1); } // else connect to another node if (!found) { qLevel[d.get(w)].add(w); max = Math.max(max, d.get(w)); } else { qALevel[d.get(w)].add(w); } } } } else if (UndirectedNode.class.isAssignableFrom(this.g .getGraphDatastructures().getNodeType())) { for (int i = max; i < qLevel.length && i < max + 1; i++) { while (!qLevel[i].isEmpty()) { UndirectedNode w = (UndirectedNode) qLevel[i].poll(); int dist = Integer.MAX_VALUE; ArrayList<Node> min = new ArrayList<Node>(); for (IElement iEdges : w.getEdges()) { UndirectedEdge ed = (UndirectedEdge) iEdges; Node z = ed.getDifferingNode(w); if (d.get(z).equals(d.get(w) + 1) && Math.abs(visited.get(z)) < counter) { qLevel[i + 1].add(z); newASums.put(z, 0d); newParents.put(z, new HashSet<Node>()); uncertain.add(z); visited.put(z, counter); max = Math.max(max, i + 1); } if (d.get(z) < dist) { min.clear(); min.add(z); dist = d.get(z); continue; } if (d.get(z).equals(dist)) { min.add(z); continue; } } // if their is no connection to the three, remove node form // data set if (dist == Integer.MAX_VALUE || dist >= qALevel.length - 1) { d.put(w, Integer.MAX_VALUE); newSpc.put(w, 0); newParents.get(w).clear(); qALevel[qALevel.length - 1].add(w); uncertain.remove(w); continue; } // connect to the highest uncertain node boolean found = false; newSpc.put(w, 0); newParents.get(w).clear(); for (Node mNode : min) { if ((!uncertain.contains(mNode)) && d.get(mNode).intValue() + 1 == i) { uncertain.remove(w); newSpc.put(w, newSpc.get(w) + newSpc.get(mNode)); found = true; newParents.get(w).add(mNode); } d.put(w, d.get(mNode).intValue() + 1); } // else connect to another node if (!found) { qLevel[d.get(w)].add(w); max = Math.max(max, d.get(w)); } else { qALevel[d.get(w)].add(w); } } } } // Stage 3 for (int i = qALevel.length - 1; i >= 0; i--) { while (!qALevel[i].isEmpty()) { Node w = qALevel[i].poll(); for (Node v : p.get(w)) { if (!newParents.get(w).contains(v)) { if (Math.abs(visited.get(v)) < counter) { qALevel[d.get(v)].add(v); visited.put(v, -counter); newASums.put(v, oldSums.get(v)); newParents.put(v, p.get(v)); } if (visited.get(v).equals(-counter)) { double temp = newASums.get(v) - oldSpc.get(v) * (1 + oldSums.get(w)) / oldSpc.get(w); newASums.put(v, temp); } } } for (Node v : newParents.get(w)) { if (d.get(v).equals(d.get(w) - 1)) { if (Math.abs(visited.get(v)) < counter) { qALevel[i - 1].add(v); visited.put(v, -counter); newASums.put(v, oldSums.get(v)); newParents.put(v, p.get(v)); } double t = newASums.get(v) + newSpc.get(v) * (1 + newASums.get(w)) / newSpc.get(w); newASums.put(v, t); if (visited.get(v).equals(-counter) && p.get(w).contains(v)) { double temp = newASums.get(v) - oldSpc.get(v) * (1 + oldSums.get(w)) / oldSpc.get(w); newASums.put(v, temp); } } } if (!w.equals(root)) { double currentScore = this.bCC.getValue(w.getIndex()); // this.bC.get(w); // this.bC.put(w, // currentScore + newASums.get(w) - oldSums.get(w)); this.bCSum = this.bCSum + newASums.get(w) - oldSums.get(w); this.bCC.setValue(w.getIndex(), currentScore + newASums.get(w) - oldSums.get(w)); } } } spcs.put(root, newSpc); oldSums.putAll(newASums); p.putAll(newParents); return true; } private boolean removeEdgeManyToMany(Node root, Node src, Node dst) { counter++; HashMap<Node, Integer> d = distances.get(root); HashMap<Node, HashSet<Node>> p = parents.get(root); HashMap<Node, Double> oldSums = accSums.get(root); HashMap<Node, Integer> oldSpc = spcs.get(root); // Queue for BFS Search Queue<Node> qBFS = new LinkedList<Node>(); // data structure for Updates HashMap<Node, Integer> dP = new HashMap<Node, Integer>(); HashMap<Node, Integer> newSpc = new HashMap<Node, Integer>(oldSpc); HashMap<Node, Double> newASums = new HashMap<Node, Double>(); // setup changes for dst node qBFS.add(dst); qALevel[d.get(dst)].add(dst); visited.put(dst, counter); dP.put(dst, oldSpc.get(src)); newASums.put(dst, 0d); newSpc.put(dst, newSpc.get(dst) - dP.get(dst)); int maxHeight = d.get(dst); if (DirectedNode.class.isAssignableFrom(this.g.getGraphDatastructures() .getNodeType())) { // Stage 2 while (!qBFS.isEmpty()) { DirectedNode v = (DirectedNode) qBFS.poll(); // all neighbours of v for (IElement iEdge : v.getOutgoingEdges()) { DirectedEdge edge = (DirectedEdge) iEdge; Node w = edge.getDifferingNode(v); if (d.get(w).equals(d.get(v) + 1)) { if (Math.abs(visited.get(w)) < counter) { qBFS.add(w); newASums.put(w, 0d); qALevel[d.get(w)].add(w); maxHeight = Math.max(maxHeight, d.get(w)); visited.put(w, counter); dP.put(w, dP.get(v)); } else { dP.put(w, dP.get(w) + dP.get(v)); } newSpc.put(w, newSpc.get(w) - dP.get(v)); } } } } else if (UndirectedNode.class.isAssignableFrom(this.g .getGraphDatastructures().getNodeType())) { // Stage 2 while (!qBFS.isEmpty()) { UndirectedNode v = (UndirectedNode) qBFS.poll(); // all neighbours of v for (IElement iEdge : v.getEdges()) { UndirectedEdge edge = (UndirectedEdge) iEdge; Node w = edge.getDifferingNode(v); if (d.get(w).equals(d.get(v) + 1)) { if (Math.abs(visited.get(w)) < counter) { qBFS.add(w); newASums.put(w, 0d); qALevel[d.get(w)].add(w); maxHeight = Math.max(maxHeight, d.get(w)); visited.put(w, counter); dP.put(w, dP.get(v)); } else { dP.put(w, dP.get(w) + dP.get(v)); } newSpc.put(w, newSpc.get(w) - dP.get(v)); } } } } // Stage 3 // traverse the shortest path tree from leaves to root for (int i = maxHeight; i >= 0; i--) { while (!qALevel[i].isEmpty()) { Node w = qALevel[i].poll(); for (Node v : p.get(w)) { if (Math.abs(visited.get(v)) < counter) { qALevel[i - 1].add(v); visited.put(v, -counter); newASums.put(v, oldSums.get(v)); } if (!(v == src && w == dst)) { double t = newASums.get(v) + newSpc.get(v) * (1 + newASums.get(w)) / newSpc.get(w); newASums.put(v, t); } if (visited.get(v).equals(-counter)) { double temp = newASums.get(v) - oldSpc.get(v) * (1 + oldSums.get(w)) / oldSpc.get(w); newASums.put(v, temp); } } if (!w.equals(root)) { double currentScore = this.bCC.getValue(w.getIndex()); // this.bC.get(w); // this.bC.put(w, // currentScore + newASums.get(w) - oldSums.get(w)); this.bCSum = this.bCSum + newASums.get(w) - oldSums.get(w); this.bCC.setValue(w.getIndex(), currentScore + newASums.get(w) - oldSums.get(w)); } } } p.get(dst).remove(src); spcs.put(root, newSpc); oldSums.putAll(newASums); return true; } @Override public boolean applyAfterUpdate(EdgeAddition ea) { if (DirectedNode.class.isAssignableFrom(this.g.getGraphDatastructures() .getNodeType())) { DirectedEdge e = (DirectedEdge) ea.getEdge(); DirectedNode src = e.getSrc(); DirectedNode dst = e.getDst(); for (IElement iE : g.getNodes()) { DirectedNode root = (DirectedNode) iE; HashMap<Node, Integer> d = this.distances.get(root); if (d.get(src).equals(Integer.MAX_VALUE) || d.get(src).equals(d.get(dst)) || d.get(src).intValue() > d.get(dst).intValue()) { // no change to shortes path tree continue; } if (d.get(dst).equals(Integer.MAX_VALUE)) { // to components merge therefore new Nodes add to shortest // path // tree nonAdjacentLevelInsertion(root, src, dst); continue; } if (d.get(src).intValue() + 1 == d.get(dst).intValue()) { // the added edge connects nodes in adjacent Levels // therefore // only the new tree edge is added adjacentLevelInsertion(root, src, dst); continue; } if (d.get(src).intValue() + 1 < d.get(dst).intValue()) { // the added edge connects nodes in non adjacent Levels // therefore all nodes in the subtree need to be checked if // they // move up in the shortest path tree nonAdjacentLevelInsertion(root, src, dst); continue; } System.err.println("err for edge insertion"); return false; } } else if (UndirectedNode.class.isAssignableFrom(this.g .getGraphDatastructures().getNodeType())) { UndirectedEdge e = (UndirectedEdge) ea.getEdge(); Node n1 = e.getNode1(); Node n2 = e.getNode2(); for (IElement iE : g.getNodes()) { UndirectedNode root = (UndirectedNode) iE; HashMap<Node, Integer> d = distances.get(root); if (d.get(n1) > d.get(n2)) { n2 = n1; n1 = e.getDifferingNode(n2); } if ((d.get(n1).equals(Integer.MAX_VALUE) && d.get(n2).equals( Integer.MAX_VALUE)) || d.get(n1).equals(d.get(n2))) { // no change to shortes path tree continue; } if (d.get(n2).equals(Integer.MAX_VALUE)) { // to components merge therefore new Nodes add to shortest // path // tree mergeOfComponentsInsertion(root, n1, n2); continue; } if (d.get(n1).intValue() + 1 == d.get(n2).intValue()) { // the added edge connects nodes in adjacent Levels // therefore // only the new tree edge is added adjacentLevelInsertion(root, n1, n2); continue; } if (d.get(n1).intValue() + 1 < d.get(n2).intValue()) { // the added edge connects nodes in non adjacent Levels // therefore all nodes in the subtree need to be checked if // they // move up in the shortest path tree nonAdjacentLevelInsertion(root, n1, n2); continue; } System.err.println(" shit" + d.get(n1) + " " + d.get(n2)); return false; } } sumShortestPaths = 0; // reinit necessary! for (Entry<Node, HashMap<Node, Integer>> e : spcs.entrySet()) { sumShortestPaths += sumSPFromHM(e.getValue(), e.getKey()); } return true; } private void nonAdjacentLevelInsertion(DirectedNode root, DirectedNode src, DirectedNode dst) { counter++; HashMap<Node, Integer> d = distances.get(root); HashMap<Node, HashSet<Node>> p = parents.get(root); HashMap<Node, Double> oldSums = accSums.get(root); HashMap<Node, Integer> oldSpc = spcs.get(root); // Data Structure for BFS Search Queue<Node> qBFS = new LinkedList<Node>(); // data structure for Updates HashMap<Node, Integer> newSpc = new HashMap<Node, Integer>(oldSpc); HashMap<Node, Double> newASums = new HashMap<Node, Double>(); HashMap<Node, HashSet<Node>> newParents = new HashMap<Node, HashSet<Node>>(); // set Up data Structure for the lower node qBFS.add(dst); visited.put(dst, counter); newSpc.put(dst, newSpc.get(src)); d.put(dst, d.get(src) + 1); qALevel[d.get(dst)].add(dst); newASums.put(dst, 0d); newParents.put(dst, new HashSet<Node>()); int maxHeight = d.get(dst); HashSet<DirectedNode> bal = new HashSet<>(); // Stage 2 while (!qBFS.isEmpty()) { DirectedNode v = (DirectedNode) qBFS.poll(); newSpc.put(v, 0); // all neighbours of v for (IElement iEdge : v.getOutgoingEdges()) { DirectedEdge ed = (DirectedEdge) iEdge; DirectedNode n = ed.getDst(); // Lower Node moves up if (d.get(n).intValue() > d.get(v).intValue() + 1) { d.put(n, d.get(v).intValue() + 1); qBFS.add(n); qALevel[d.get(n)].add(n); newASums.put(n, 0d); newParents.put(n, new HashSet<Node>()); bal.remove(n); visited.put(n, counter); maxHeight = Math.max(maxHeight, d.get(n)); continue; } // lower Node get a new Parent if (d.get(n).intValue() == d.get(v).intValue() + 1) { if (!visited.get(n).equals(counter)) { visited.put(n, counter); qALevel[d.get(n)].add(n); newParents.put(n, new HashSet<Node>()); qBFS.add(n); newASums.put(n, 0d); bal.remove(n); maxHeight = Math.max(maxHeight, d.get(n)); } continue; } } for (IElement iEdge : v.getIncomingEdges()) { DirectedEdge ed = (DirectedEdge) iEdge; DirectedNode n = ed.getSrc(); boolean b1 = p.get(v).contains(n); boolean b2 = Math.abs(visited.get(n)) < counter; boolean b3 = d.get(n).intValue() >= d.get(v).intValue(); if (b1 && b2 && b3) { visited.put(n, -counter); bal.add(n); } if (d.get(n).intValue() + 1 == d.get(v).intValue()) { newSpc.put(v, newSpc.get(v).intValue() + newSpc.get(n).intValue()); newParents.get(v).add(n); } } } for (DirectedNode directedNode : bal) { if (visited.get(directedNode).equals(-counter)) { newASums.put(directedNode, oldSums.get(directedNode)); newParents.put(directedNode, p.get(directedNode)); qALevel[d.get(directedNode)].add(directedNode); maxHeight = Math.max(maxHeight, d.get(directedNode)); } } // Stage 3 for (int i = maxHeight; i >= 0; i--) { while (!qALevel[i].isEmpty()) { DirectedNode w = (DirectedNode) qALevel[i].poll(); if (visited.get(w).equals(-counter)) { for (IElement ie : w.getOutgoingEdges()) { DirectedNode v = ((DirectedEdge) ie).getDst(); if (p.get(v).contains(w) && Math.abs(visited.get(v)) == counter) { double temp = newASums.get(w) - oldSpc.get(w) * (1 + oldSums.get(v)) / oldSpc.get(v); newASums.put(w, temp); } } } for (Node v : newParents.get(w)) { if (d.get(v).intValue() == d.get(w).intValue() - 1) { if (Math.abs(visited.get(v)) < counter) { newASums.put(v, oldSums.get(v)); newParents.put(v, p.get(v)); qALevel[d.get(v)].add(v); visited.put(v, -counter); } double t1 = newASums.get(v) + newSpc.get(v) * (1 + newASums.get(w)) / newSpc.get(w); newASums.put(v, t1); } } if (!w.equals(root)) { double currentScore = this.bCC.getValue(w.getIndex()); this.bCSum = this.bCSum + newASums.get(w) - oldSums.get(w); this.bCC.setValue(w.getIndex(), currentScore + newASums.get(w) - oldSums.get(w)); } } } spcs.put(root, newSpc); oldSums.putAll(newASums); p.putAll(newParents); } private void mergeOfComponentsInsertion(Node root, Node src, Node dst) { counter++; HashMap<Node, Integer> d = distances.get(root); HashMap<Node, HashSet<Node>> p = parents.get(root); HashMap<Node, Double> oldSums = accSums.get(root); HashMap<Node, Integer> oldSpc = spcs.get(root); // Queue for the BFS search down the shortes Path tree Queue<Node> qBFS = new LinkedList<Node>(); // data structure for Updates HashMap<Node, Integer> newSpc = new HashMap<Node, Integer>(oldSpc); HashMap<Node, Double> newASums = new HashMap<Node, Double>(); // new TreeElement and the current Values for the Tree Position d.put(dst, d.get(src) + 1); newSpc.put(dst, newSpc.get(src)); newASums.put(dst, 0d); p.get(dst).add(src); visited.put(dst, counter); int maxHeight = 0; qBFS.add(dst); // stage 2 while (!qBFS.isEmpty()) { UndirectedNode v = (UndirectedNode) qBFS.poll(); qALevel[d.get(v)].add(v); maxHeight = Math.max(maxHeight, d.get(v)); for (IElement iEdge : v.getEdges()) { UndirectedEdge ed = (UndirectedEdge) iEdge; Node n = ed.getDifferingNode(v); if (Math.abs(visited.get(n)) < counter && n != src && d.get(n).equals(Integer.MAX_VALUE)) { qBFS.add(n); visited.put(n, counter); newASums.put(n, 0d); d.put(n, d.get(v) + 1); } if (d.get(n).intValue() == d.get(v).intValue() + 1) { newSpc.put(n, newSpc.get(n) + newSpc.get(v)); p.get(n).add(v); } } } // Stage 3 // search the shortest path tree from leaves to root for (int i = maxHeight; i >= 0; i--) { while (!qALevel[i].isEmpty()) { UndirectedNode w = (UndirectedNode) qALevel[i].poll(); for (Node v : p.get(w)) { if (Math.abs(visited.get(v)) < counter) { qALevel[i - 1].add(v); visited.put(v, -counter); newASums.put(v, oldSums.get(v)); } double t = newSpc.get(v) * (1 + newASums.get(w)) / newSpc.get(w); newASums.put(v, newASums.get(v) + t); if (visited.get(v).equals(-counter) && (v != src || w != dst)) { double temp = newASums.get(v) - oldSpc.get(v) * (1 + oldSums.get(w)) / oldSpc.get(w); newASums.put(v, temp); } } if (!w.equals(root)) { double currentScore = this.bCC.getValue(w.getIndex()); // this.bC.get(w); // this.bC.put(w, // currentScore + newASums.get(w) - oldSums.get(w)); this.bCSum = this.bCSum + newASums.get(w) - oldSums.get(w); this.bCC.setValue(w.getIndex(), currentScore + newASums.get(w) - oldSums.get(w)); } } } spcs.put(root, newSpc); oldSums.putAll(newASums); } private void nonAdjacentLevelInsertion(Node root, Node src, Node dst) { counter++; // old values HashMap<Node, Integer> d = distances.get(root); HashMap<Node, HashSet<Node>> p = parents.get(root); HashMap<Node, Double> oldSums = accSums.get(root); HashMap<Node, Integer> oldSpc = spcs.get(root); // Data Structure for BFS Search Queue<Node> qBFS = new LinkedList<Node>(); // data structure for Updates HashMap<Node, Integer> newSpc = new HashMap<Node, Integer>(oldSpc); HashMap<Node, Double> newASums = new HashMap<Node, Double>(); HashMap<Node, HashSet<Node>> newParents = new HashMap<Node, HashSet<Node>>(); // set Up data Structure for the lower node qBFS.add(dst); visited.put(dst, counter); newSpc.put(dst, newSpc.get(src)); d.put(dst, d.get(src) + 1); qALevel[d.get(dst)].add(dst); newASums.put(dst, 0d); newParents.put(dst, new HashSet<Node>()); int maxHeight = d.get(dst); // Stage 2 while (!qBFS.isEmpty()) { UndirectedNode v = (UndirectedNode) qBFS.poll(); newSpc.put(v, 0); // all neighbours of v for (IElement iEdge : v.getEdges()) { UndirectedEdge ed = (UndirectedEdge) iEdge; Node n = ed.getDifferingNode(v); // Lower Node moves up if (d.get(n).intValue() > d.get(v).intValue() + 1) { d.put(n, d.get(v).intValue() + 1); qBFS.add(n); qALevel[d.get(n)].add(n); newASums.put(n, 0d); newParents.put(n, new HashSet<Node>()); visited.put(n, counter); maxHeight = Math.max(maxHeight, d.get(n)); continue; } // lower Node get a new Parent if (d.get(n).intValue() == d.get(v).intValue() + 1) { if (Math.abs(visited.get(n)) < counter) { visited.put(n, counter); qALevel[d.get(n)].add(n); newParents.put(n, new HashSet<Node>()); qBFS.add(n); newASums.put(n, 0d); maxHeight = Math.max(maxHeight, d.get(n)); } continue; } if (d.get(n).intValue() < d.get(v).intValue()) { newSpc.put(v, newSpc.get(v) + newSpc.get(n)); if (!newParents.get(v).contains(n)) { newParents.get(v).add(n); } } } } // Stage 3 for (int i = maxHeight; i >= 0; i--) { while (!qALevel[i].isEmpty()) { UndirectedNode w = (UndirectedNode) qALevel[i].poll(); for (Node v : p.get(w)) { if (!newParents.get(w).contains(v)) { if (Math.abs(visited.get(v)) < counter) { qALevel[d.get(v)].add(v); visited.put(v, -counter); newASums.put(v, oldSums.get(v)); newParents.put(v, p.get(v)); } if (visited.get(v).equals(-counter)) { double temp = newASums.get(v) - oldSpc.get(v) * (1 + oldSums.get(w)) / oldSpc.get(w); newASums.put(v, temp); } } } for (Node v : newParents.get(w)) { if (Math.abs(visited.get(v)) < counter) { qALevel[i - 1].add(v); visited.put(v, -counter); newASums.put(v, oldSums.get(v)); newParents.put(v, p.get(v)); } double t = newASums.get(v) + newSpc.get(v) * (1 + newASums.get(w)) / newSpc.get(w); newASums.put(v, t); if (visited.get(v).equals(-counter) && (dst != w || src != v)) { double temp = newASums.get(v) - oldSpc.get(v) * (1 + oldSums.get(w)) / oldSpc.get(w); newASums.put(v, temp); } } if (!w.equals(root)) { double currentScore = this.bCC.getValue(w.getIndex()); this.bCSum = this.bCSum + newASums.get(w) - oldSums.get(w); this.bCC.setValue(w.getIndex(), currentScore + newASums.get(w) - oldSums.get(w)); } } } spcs.put(root, newSpc); oldSums.putAll(newASums); p.putAll(newParents); } private boolean adjacentLevelInsertion(Node root, Node src, Node dst) { // Queue for BFS Search Queue<Node> qBFS = new LinkedList<Node>(); counter++; // old values HashMap<Node, Integer> d = distances.get(root); HashMap<Node, HashSet<Node>> p = parents.get(root); HashMap<Node, Double> oldSums = accSums.get(root); HashMap<Node, Integer> oldSpc = spcs.get(root); // data structure for Updates HashMap<Node, Integer> dP = new HashMap<Node, Integer>(); HashMap<Node, Integer> newSpc = new HashMap<Node, Integer>(oldSpc); HashMap<Node, Double> newSums = new HashMap<Node, Double>(); // setup changes for dst node qBFS.add(dst); qALevel[d.get(dst)].add(dst); visited.put(dst, counter); newSums.put(dst, 0d); dP.put(dst, oldSpc.get(src)); newSpc.put(dst, newSpc.get(dst) + dP.get(dst)); p.get(dst).add(src); int maxHeight = d.get(dst); if (DirectedNode.class.isAssignableFrom(this.g.getGraphDatastructures() .getNodeType())) { // Stage 2 while (!qBFS.isEmpty()) { DirectedNode v = (DirectedNode) qBFS.poll(); // all neighbours of v for (IElement iEdges : v.getOutgoingEdges()) { DirectedEdge edge = (DirectedEdge) iEdges; DirectedNode w = edge.getDst(); if (d.get(w).equals(d.get(v).intValue() + 1)) { if (Math.abs(visited.get(w)) < counter) { qBFS.add(w); qALevel[d.get(w)].add(w); newSums.put(w, 0d); maxHeight = Math.max(maxHeight, d.get(w)); visited.put(w, counter); dP.put(w, dP.get(v)); } else { dP.put(w, dP.get(w) + dP.get(v)); } newSpc.put(w, newSpc.get(w) + dP.get(v)); } } } } else if (UndirectedNode.class.isAssignableFrom(this.g .getGraphDatastructures().getNodeType())) { // Stage 2 while (!qBFS.isEmpty()) { UndirectedNode v = (UndirectedNode) qBFS.poll(); // all neighbours of v for (IElement iEdges : v.getEdges()) { UndirectedEdge edge = (UndirectedEdge) iEdges; Node w = edge.getDifferingNode(v); if (d.get(w).equals(d.get(v).intValue() + 1)) { if (Math.abs(visited.get(w)) < counter) { qBFS.add(w); qALevel[d.get(w)].add(w); maxHeight = Math.max(maxHeight, d.get(w)); newSums.put(w, 0d); visited.put(w, counter); dP.put(w, dP.get(v)); } else { dP.put(w, dP.get(w) + dP.get(v)); } newSpc.put(w, newSpc.get(w) + dP.get(v)); } } } } // Stage 3 // traverse the shortest path tree from leaves to root for (int i = maxHeight; i >= 0; i--) { while (!qALevel[i].isEmpty()) { Node w = (Node) qALevel[i].poll(); for (Node v : p.get(w)) { if (Math.abs(visited.get(v)) < counter) { qALevel[i - 1].add(v); visited.put(v, -counter); newSums.put(v, oldSums.get(v)); } double t = newSums.get(v) + newSpc.get(v) * (1 + newSums.get(w)) / newSpc.get(w); newSums.put(v, t); if (visited.get(v).equals(-counter) && (v != src || w != dst)) { double temp = newSums.get(v) - oldSpc.get(v) * (1 + oldSums.get(w)) / oldSpc.get(w); newSums.put(v, temp); } } if (!w.equals(root)) { double currentScore = this.bCC.getValue(w.getIndex()); // this.bC.get(w); // this.bC.put(w, // currentScore + newSums.get(w) - oldSums.get(w)); this.bCSum = this.bCSum + newSums.get(w) - oldSums.get(w); this.bCC.setValue(w.getIndex(), currentScore + newSums.get(w) - oldSums.get(w)); } } } spcs.put(root, newSpc); oldSums.putAll(newSums); return true; } @Override public boolean applyAfterUpdate(NodeRemoval nr) { Node node = (Node) nr.getNode(); g.addNode(node); HashSet<Edge> bla = new HashSet<>(); for (IElement ie : node.getEdges()) { Edge e = (Edge) ie; e.connectToNodes(); bla.add(e); } for (Edge e : bla) { e.disconnectFromNodes(); applyAfterUpdate(new EdgeRemoval(e)); } for (Node n : this.accSums.get(node).keySet()) { // this.bC.put(n, this.bC.get(n) - this.accSums.get(node).get(n)); this.bCC.setValue(n.getIndex(), this.bCC.getValue(n.getIndex()) - this.accSums.get(node).get(n)); this.bCSum = this.bCSum - this.accSums.get(node).get(n); } this.spcs.remove(node); this.distances.remove(node); this.accSums.remove(node); this.parents.remove(node); g.removeNode(node); sumShortestPaths = 0; // reinit necessary! for (Entry<Node, HashMap<Node, Integer>> e : spcs.entrySet()) { sumShortestPaths += sumSPFromHM(e.getValue(), e.getKey()); } return true; } @Override public boolean applyAfterUpdate(NodeAddition na) { Node node = (Node) na.getNode(); HashMap<Node, HashSet<Node>> p = new HashMap<Node, HashSet<Node>>(); HashMap<Node, Integer> spc = new HashMap<Node, Integer>(); HashMap<Node, Integer> d = new HashMap<Node, Integer>(); HashMap<Node, Double> sums = new HashMap<Node, Double>(); for (IElement ieE : g.getNodes()) { Node t = (Node) ieE; if (t == node) { d.put(t, 0); spc.put(t, 1); } else { spc.put(t, 0); d.put(t, Integer.MAX_VALUE); this.spcs.get(t).put(node, 0); this.distances.get(t).put(node, Integer.MAX_VALUE); this.accSums.get(t).put(node, 0d); this.parents.get(t).put(node, new HashSet<Node>()); } sums.put(t, 0d); p.put(t, new HashSet<Node>()); } this.spcs.put(node, spc); this.distances.put(node, d); this.accSums.put(node, sums); this.parents.put(node, p); bCC.setValue(node.getIndex(), 0d); visited.put(node, 0L); sumShortestPaths = 0; // reinit necessary! for (Entry<Node, HashMap<Node, Integer>> e : spcs.entrySet()) { sumShortestPaths += sumSPFromHM(e.getValue(), e.getKey()); } return true; } }
matjoe/DNA
src/dna/metrics/centrality/BetweennessCentralityU.java
Java
gpl-3.0
36,576
/* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * From ASN.1 module "NGAP-IEs" * found in "../support/ngap-r16.1.0/38413-g10.asn" * `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps` */ #ifndef _NGAP_RRCContainer_H_ #define _NGAP_RRCContainer_H_ #include <asn_application.h> /* Including external dependencies */ #include <OCTET_STRING.h> #ifdef __cplusplus extern "C" { #endif /* NGAP_RRCContainer */ typedef OCTET_STRING_t NGAP_RRCContainer_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_NGAP_RRCContainer; asn_struct_free_f NGAP_RRCContainer_free; asn_struct_print_f NGAP_RRCContainer_print; asn_constr_check_f NGAP_RRCContainer_constraint; ber_type_decoder_f NGAP_RRCContainer_decode_ber; der_type_encoder_f NGAP_RRCContainer_encode_der; xer_type_decoder_f NGAP_RRCContainer_decode_xer; xer_type_encoder_f NGAP_RRCContainer_encode_xer; oer_type_decoder_f NGAP_RRCContainer_decode_oer; oer_type_encoder_f NGAP_RRCContainer_encode_oer; per_type_decoder_f NGAP_RRCContainer_decode_uper; per_type_encoder_f NGAP_RRCContainer_encode_uper; per_type_decoder_f NGAP_RRCContainer_decode_aper; per_type_encoder_f NGAP_RRCContainer_encode_aper; #ifdef __cplusplus } #endif #endif /* _NGAP_RRCContainer_H_ */ #include <asn_internal.h>
acetcom/cellwire
lib/asn1c/ngap/NGAP_RRCContainer.h
C
gpl-3.0
1,287
/******************************************************************************* * file name: largest_perimeter_triangle.cpp * author: Hui Chen. (c) 2019 * mail: chenhui13@baidu.com * created time: 2019/02/14-09:34:53 * modified time: 2019/02/14-09:34:53 *******************************************************************************/ #include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: int largestPerimeter(vector<int>& A) { sort(A.begin(), A.end()); reverse(A.begin(), A.end()); for (int i=0; i < A.size() - 2; i++) { if (A[i+1] + A[i+2] > A[i]) { //cout<<"A["<<i<<"]"<<A[i]<<" A["<<i+1<<"]"<<A[i+1]<<" A["<<i+2<<"]"<<A[i+2]<<endl; return A[i] + A[i+1] + A[i+2]; } } return 0; } }; int main() {}
wisehead/Leetcode
51.Math_1/0976.Largest_Perimeter_Triangle.Array_Math.Easy/largest_perimeter_triangle.cpp
C++
gpl-3.0
1,030
/** DAC.c ** * Authors: Ronald Macmaster and Parth Adhia * Created: September 27th 2016 * Description: Device Driver for our Digital to Analog converter * Runs on a TLV5616 DAC component * 4 pin SSI Interface * Lab: 5 * TA: Dylan Zika * Date: September 27th 2016 *********************************************************************************/ /** hardware connections ** * DAC SSI Interface * Runs on SSI2 TLV5616 connection * PB4 SSI2CLK SClk * PB5 SSI2FSS FS * PB6 SSI2RX nothing * PB7 SSI2TX DIn */ #include <stdint.h> #include "tm4c123gh6pm.h" //DAC hardward initialization static void PortB_Init(void); static void SSI2_Init(void); /** DAC_Init() ** * Activate the DAC for voltage outputs * DAC Converts our digital output to an analog signal. * Outputs: none */ void DAC_Init(void){ PortB_Init(); SSI2_Init(); } /** DAC_Out() ** * Write a digital output to SSI-DAC interface. * Input: amplitude represented as a 12-bit number */ void DAC_Out(uint16_t amplitude){ amplitude &= (0x0FFF); // right mask 12 bits while((SSI2_SR_R & SSI_SR_TNF) == 0){ // wait till SSI TX FIFO is ready } SSI2_DR_R = amplitude; } /** DAC_Test() ** * Test the output of a new DAC * Function is an endless profile that will never finish... */ void DAC_Test(uint16_t precision, uint16_t resolution){ while(1){ for(int out = 0; out < precision; out += resolution){ DAC_Out(out); // output test voltage } } } /** SSI2_Init() ** * Run the SSI Clock at 10MHz * Transition and transmit SSI2Tx on rising clock edge. * Slave reads on the falling clock edge. * Frame select is first set to low, then MSB available at 1st clock edge (falling). * * DAC Ts = 8ns, Th = 5ns. Don't clock the DAC or SSI over 20MHz!\ * DAC Data: [15:12] XMPX mode 0 = slow and 1 = fast power 1 = power down and 0 = normal * [11:0] New DAC value. We should use slow mode and normal power */ static void SSI2_Init(void){ volatile uint32_t delay; SYSCTL_RCGCSSI_R |= 0x04; // 1) activate SSI2 delay = SYSCTL_RCGCSSI_R; // allow time to finish activating SSI2_CR1_R = 0x00000000; //2) Disable SSI, master mode SSI2_CPSR_R = 0x08; //3) 10Mhz SSIClk Fssi = Fbus / (CPSDVSR * (1 + SCR)) SSI2_CR0_R &= ~(0x0000FFFF); //3) SCR = 0, Freescale frame format. SSI2_CR0_R |= 0x4F; //5)) DSS = 16 bit data, SPH = 0 and SP0 = 1 ( use 16 bit data??) SSI2_CR1_R |= SSI_CR1_SSE; //4) enable SSI / set the SSE } /** PortB_Init() ** * Standard port b init * Initialize with AFSEL for SSI2 */ static void PortB_Init(){ volatile uint32_t delay; SYSCTL_RCGCGPIO_R |= 0x02; // 1) turn on port B delay = SYSCTL_RCGCTIMER_R; // allow time to finish activating GPIO_PORTB_AMSEL_R &= ~0xF0; // 2) disable analog on PB4-7 GPIO_PORTB_AFSEL_R |= 0xF0; // 3) Enable alternative functionality on PB4-7 GPIO_PORTB_PCTL_R &= ~0xFFFF0000; GPIO_PORTB_PCTL_R |= 0x22220000;// 4) choose GPIO functionality GPIO_PORTB_DIR_R |= 0xF0; // 5) set PB7-4 to be outputs GPIO_PORTB_DEN_R |= 0xF0; // 6) outputs are digital }
ronny-macmaster/EE445L
lab5/DAC.c
C
gpl-3.0
3,163
-- automatically generated file. Do not edit (see /usr/share/doc/menu/html) module("debian.menu") Debian_menu = {} Debian_menu["Debian_Applications_Accessibility"] = { {"Dasher text entry","/usr/bin/dasher"}, {"The GNOME Onscreen Keyboard","/usr/bin/gok"}, {"xbindkeys","/usr/bin/xbindkeys"}, {"Xmag","xmag"}, } Debian_menu["Debian_Applications_Data_Management"] = { {"LibreOffice Base","/usr/bin/libreoffice --base",}, {"Tomboy","/usr/bin/tomboy"}, } Debian_menu["Debian_Applications_Editors"] = { {"Emacs 23 (text)", "x-terminal-emulator -e ".."/usr/bin/emacs23 -nw"}, {"Emacs 23 (X11)","/usr/bin/emacs23"}, {"Gedit","/usr/bin/gedit","/usr/share/pixmaps/gedit-icon.xpm"}, {"LeafPad","/usr/bin/leafpad","/usr/share/pixmaps/leafpad.xpm"}, {"MousePad","/usr/bin/mousepad","/usr/share/pixmaps/mousepad.xpm"}, {"Nano", "x-terminal-emulator -e ".."/bin/nano","/usr/share/nano/nano-menu.xpm"}, {"PDFEdit","/usr/bin/pdfedit"}, {"Xedit","xedit"}, } Debian_menu["Debian_Applications_Emulators"] = { {"Qemulator","/usr/bin/qemulator","/usr/share/pixmaps/qemulator.xpm"}, {"VirtualBox","/usr/bin/virtualbox","/usr/share/pixmaps/virtualbox.xpm"}, } Debian_menu["Debian_Applications_File_Management"] = { {"Baobab","/usr/bin/baobab","/usr/share/pixmaps/baobab.xpm"}, {"Brasero","/usr/bin/brasero"}, {"File-Roller","/usr/bin/file-roller","/usr/share/pixmaps/file-roller.xpm"}, {"GNOME Search Tool","/usr/bin/gnome-search-tool","/usr/share/pixmaps/gsearchtool.xpm"}, {"Nautilus","/usr/bin/nautilus","/usr/share/pixmaps/nautilus.xpm"}, {"PCManFM","/usr/bin/pcmanfm"}, {"Thunar","/usr/bin/thunar"}, {"Xarchiver","/usr/bin/xarchiver","/usr/share/pixmaps/xarchiver.xpm"}, {"Xfdesktop","xfdesktop"}, } Debian_menu["Debian_Applications_Graphics"] = { {"dotty","/usr/bin/dotty"}, {"GNOME Screenshot Tool","/usr/bin/gnome-panel-screenshot"}, {"ImageMagick","/usr/bin/display logo:","/usr/share/pixmaps/display.xpm"}, {"Inkscape","/usr/bin/inkscape","/usr/share/pixmaps/inkscape.xpm"}, {"Karbon","/usr/bin/karbon","/usr/share/pixmaps/karbon.xpm"}, {"Kino","/usr/bin/kino","/usr/share/pixmaps/kino.xpm"}, {"Krita","/usr/bin/krita","/usr/share/pixmaps/krita.xpm"}, {"lefty","/usr/bin/lefty"}, {"LibreOffice Draw","/usr/bin/libreoffice --draw",}, {"The GIMP","/usr/bin/gimp","/usr/share/pixmaps/gimp.xpm"}, {"X Window Snapshot","xwd | xwud"}, } Debian_menu["Debian_Applications_Network_Communication"] = { {"Ekiga","/usr/bin/ekiga","/usr/share/pixmaps/ekiga.xpm"}, {"Evolution","/usr/bin/evolution","/usr/share/pixmaps/evolution.xpm"}, {"heirloom-mailx", "x-terminal-emulator -e ".."/usr/bin/heirloom-mailx"}, {"Pidgin","/usr/bin/pidgin","/usr/share/pixmaps/pidgin-menu.xpm"}, {"Remmina","/usr/bin/remmina"}, {"Twisted SSH Client","/usr/bin/tkconch"}, {"Vinagre","vinagre"}, {"X Chat","/usr/bin/xchat","/usr/share/icons/xchat.xpm"}, {"Xbiff","xbiff"}, } Debian_menu["Debian_Applications_Network_File_Transfer"] = { {"fatrat","/usr/bin/fatrat","/usr/share/pixmaps/fatrat.xpm"}, {"Transmission BitTorrent Client (GTK)","/usr/bin/transmission","/usr/share/pixmaps/transmission.xpm"}, } Debian_menu["Debian_Applications_Network_Monitoring"] = { {"Wireshark","/usr/bin/wireshark","/usr/share/pixmaps/wsicon32.xpm"}, } Debian_menu["Debian_Applications_Network_Web_Browsing"] = { {"Chromium","chromium"}, {"Epiphany web browser","/usr/bin/epiphany-browser"}, {"Links 2","/usr/bin/links2 -g","/usr/share/pixmaps/links2.xpm"}, {"Links 2 (text)", "x-terminal-emulator -e ".."/usr/bin/links2","/usr/share/pixmaps/links2.xpm"}, {"Lynx-cur", "x-terminal-emulator -e ".."lynx"}, {"w3af","/usr/share/w3af/w3af_gui","/usr/share/pixmaps/w3af.xpm"}, } Debian_menu["Debian_Applications_Network_Web_News"] = { {"Liferea","/usr/bin/liferea","/usr/share/liferea/pixmaps/liferea.xpm"}, } Debian_menu["Debian_Applications_Network"] = { { "Communication", Debian_menu["Debian_Applications_Network_Communication"] }, { "File Transfer", Debian_menu["Debian_Applications_Network_File_Transfer"] }, { "Monitoring", Debian_menu["Debian_Applications_Network_Monitoring"] }, { "Web Browsing", Debian_menu["Debian_Applications_Network_Web_Browsing"] }, { "Web News", Debian_menu["Debian_Applications_Network_Web_News"] }, } Debian_menu["Debian_Applications_Office"] = { {"AbiWord Word Processor","/usr/bin/abiword","/usr/share/pixmaps/abiword.xpm"}, {"GnuCash","gnucash","/usr/share/pixmaps/gnucash-icon-32x32.xpm"}, {"gnumeric","/usr/bin/gnumeric","/usr/share/pixmaps/gnome-gnumeric.xpm"}, {"LibreOffice Calc","/usr/bin/libreoffice --calc",}, {"LibreOffice Impress","/usr/bin/libreoffice --impress",}, {"LibreOffice Writer","/usr/bin/libreoffice --writer",}, } Debian_menu["Debian_Applications_Programming"] = { {"anjuta","/usr/bin/anjuta","/usr/share/pixmaps/anjuta.xpm"}, {"BeanShell (text)", "x-terminal-emulator -e ".."/usr/bin/bsh"}, {"BeanShell (windowed)","/usr/bin/xbsh"}, {"Erlang Shell", "x-terminal-emulator -e ".."/usr/bin/erl","/usr/share/pixmaps/erlang.xpm"}, {"GDB", "x-terminal-emulator -e ".."/usr/bin/gdb"}, {"Guile 1.8", "x-terminal-emulator -e ".."/usr/bin/guile-1.8"}, {"Kiki","/usr/bin/kiki","/usr/share/pixmaps/kiki.xpm"}, {"Nemiver","/usr/bin/nemiver","/usr/share/pixmaps/nemiver.xpm"}, {"Python (v2.6)", "x-terminal-emulator -e ".."/usr/bin/python2.6","/usr/share/pixmaps/python2.6.xpm"}, {"Python (v2.7)", "x-terminal-emulator -e ".."/usr/bin/python2.7","/usr/share/pixmaps/python2.7.xpm"}, {"Qt Assistant","/usr/bin/assistant-qt4"}, {"Qt Designer","/usr/bin/designer-qt4"}, {"Qt Linguist","/usr/bin/linguist-qt4"}, {"Ruby (irb1.8)", "x-terminal-emulator -e ".."/usr/bin/irb1.8"}, {"Sun Java 6 Web Start","/usr/lib/jvm/java-6-sun-1.6.0.26/bin/javaws -viewer","/usr/share/pixmaps/sun-java6.xpm"}, {"Tclsh8.4", "x-terminal-emulator -e ".."/usr/bin/tclsh8.4"}, {"Tclsh8.5", "x-terminal-emulator -e ".."/usr/bin/tclsh8.5"}, {"TkWish8.5","x-terminal-emulator -e /usr/bin/wish8.5"}, } Debian_menu["Debian_Applications_Science_Data_Analysis"] = { {"XDot","xdot"}, } Debian_menu["Debian_Applications_Science_Mathematics"] = { {"GCalcTool","/usr/bin/gcalctool","/usr/share/pixmaps/gcalctool.xpm"}, {"LibreOffice Math","/usr/bin/libreoffice --math",}, {"Xcalc","xcalc"}, } Debian_menu["Debian_Applications_Science"] = { { "Data Analysis", Debian_menu["Debian_Applications_Science_Data_Analysis"] }, { "Mathematics", Debian_menu["Debian_Applications_Science_Mathematics"] }, } Debian_menu["Debian_Applications_Shells"] = { {"Bash", "x-terminal-emulator -e ".."/bin/bash --login"}, {"Dash", "x-terminal-emulator -e ".."/bin/dash -i"}, {"Python (v2.5)", "x-terminal-emulator -e ".."/usr/bin/python2.5","/usr/share/pixmaps/python2.5.xpm"}, {"Sh", "x-terminal-emulator -e ".."/bin/sh --login"}, } Debian_menu["Debian_Applications_Sound"] = { {"Banshee","/usr/bin/banshee","/usr/share/pixmaps/banshee.xpm"}, {"GNOME ALSA Mixer","/usr/bin/gnome-alsamixer","/usr/share/pixmaps/gnome-alsamixer/gnome-alsamixer-icon.xpm"}, {"grecord (GNOME 2.0 Recorder)","/usr/bin/gnome-sound-recorder","/usr/share/pixmaps/gnome-grecord.xpm"}, {"Rhythmbox","/usr/bin/rhythmbox","/usr/share/pixmaps/rhythmbox-small.xpm"}, {"Sonata","/usr/bin/sonata","/usr/share/pixmaps/sonata.xpm"}, {"Sound Juicer","/usr/bin/sound-juicer","/usr/share/pixmaps/sound-juicer.xpm"}, {"TiMidity++","timidity -ia","/usr/share/pixmaps/timidity.xpm"}, {"Xfce Mixer","/usr/bin/xfce4-mixer","/usr/share/pixmaps/xfce4-mixer.xpm"}, } Debian_menu["Debian_Applications_System_Administration"] = { {"Aptitude (terminal)", "x-terminal-emulator -e ".."/usr/bin/aptitude-curses"}, {"Compiz Fusion Icon","/usr/bin/fusion-icon","/usr/share/pixmaps/fusion-icon.xpm"}, {"Debian Task selector", "x-terminal-emulator -e ".."su-to-root -c tasksel"}, {"Editres","editres"}, {"Gnome Control Center","/usr/bin/gnome-control-center","/usr/share/pixmaps/gnome-control-center.xpm"}, {"GNOME Network Tool","/usr/bin/gnome-nettool","/usr/share/pixmaps/gnome-nettool.xpm"}, {"GNOME partition editor","su-to-root -X -c /usr/sbin/gparted","/usr/share/pixmaps/gparted.xpm"}, {"GTK+ 2.0 theme manager","/usr/bin/gtk-chtheme","/usr/share/pixmaps/gtk-chtheme.xpm"}, {"GTK+ 2.0 Theme Switch","/usr/bin/gtk-theme-switch2"}, {"kbdd","/usr/bin/kbdd"}, {"Live Installer Launcher","su-to-root -X -c /usr/sbin/debian-installer-launcher","/usr/share/pixmaps/debian-installer-launcher.xpm"}, {"Network Admin","/usr/bin/network-admin","/usr/share/gnome-system-tools/pixmaps/network.xpm"}, {"nitrogen","/usr/bin/nitrogen"}, {"Openbox Configuration Manager","/usr/bin/obconf","/usr/share/pixmaps/obconf.xpm"}, {"OpenJDK Java 6 Policy Tool","/usr/lib/jvm/java-6-openjdk-amd64/bin/policytool","/usr/share/pixmaps/openjdk-6.xpm"}, {"Services Admin","/usr/bin/services-admin","/usr/share/gnome-system-tools/pixmaps/services.xpm"}, {"Shares Admin","/usr/bin/shares-admin","/usr/share/gnome-system-tools/pixmaps/shares.xpm"}, {"Sun Java 6 Plugin Control Panel","/usr/lib/jvm/java-6-sun-1.6.0.26/bin/ControlPanel","/usr/share/pixmaps/sun-java6.xpm"}, {"TeXconfig", "x-terminal-emulator -e ".."/usr/bin/texconfig"}, {"Time Admin","/usr/bin/time-admin","/usr/share/gnome-system-tools/pixmaps/time.xpm"}, {"User accounts Admin","/usr/bin/users-admin","/usr/share/gnome-system-tools/pixmaps/users.xpm"}, {"Wmclock","/usr/bin/wmclock"}, {"Xclipboard","xclipboard"}, {"Xfce Application Finder","xfce4-appfinder","/usr/share/pixmaps/xfce4-appfinder.xpm"}, {"Xfontsel","xfontsel"}, {"xfprint4","xfprint4"}, {"XFrun4","xfrun4"}, {"Xkill","xkill"}, {"Xrefresh","xrefresh"}, } Debian_menu["Debian_Applications_System_Hardware"] = { {"Xvidtune","xvidtune"}, } Debian_menu["Debian_Applications_System_Monitoring"] = { {"Conky", "x-terminal-emulator -e ".."/usr/bin/conky"}, {"GNOME Log Viewer","/usr/bin/gnome-system-log","/usr/share/pixmaps/gnome-system-log.xpm"}, {"GNOME system monitor","/usr/bin/gnome-system-monitor"}, {"htop", "x-terminal-emulator -e ".."/usr/bin/htop"}, {"Pstree", "x-terminal-emulator -e ".."/usr/bin/pstree.x11","/usr/share/pixmaps/pstree16.xpm"}, {"Sun Java 6 VisualVM","/usr/lib/jvm/java-6-sun-1.6.0.26/bin/jvisualvm","/usr/share/pixmaps/sun-java6.xpm"}, {"Top", "x-terminal-emulator -e ".."/usr/bin/top"}, {"Xconsole","xconsole -file /dev/xconsole"}, {"Xev","x-terminal-emulator -e xev"}, {"Xload","xload"}, } Debian_menu["Debian_Applications_System_Package_Management"] = { {"Synaptic Package Manager","/usr/bin/su-to-root -X -c /usr/sbin/synaptic","/usr/share/synaptic/pixmaps/synaptic_32x32.xpm"}, } Debian_menu["Debian_Applications_System_Security"] = { {"Seahorse","/usr/bin/seahorse","/usr/share/pixmaps/seahorse.xpm"}, {"Sun Java 6 Policy Tool","/usr/lib/jvm/java-6-sun-1.6.0.26/bin/policytool","/usr/share/pixmaps/sun-java6.xpm"}, } Debian_menu["Debian_Applications_System"] = { { "Administration", Debian_menu["Debian_Applications_System_Administration"] }, { "Hardware", Debian_menu["Debian_Applications_System_Hardware"] }, { "Monitoring", Debian_menu["Debian_Applications_System_Monitoring"] }, { "Package Management", Debian_menu["Debian_Applications_System_Package_Management"] }, { "Security", Debian_menu["Debian_Applications_System_Security"] }, } Debian_menu["Debian_Applications_Terminal_Emulators"] = { {"Gnome Terminal","/usr/bin/gnome-terminal","/usr/share/pixmaps/gnome-terminal.xpm"}, {"mrxvt","/usr/bin/mrxvt-full"}, {"Rxvt-Unicode","urxvt","/usr/share/pixmaps/urxvt.xpm"}, {"Rxvt-Unicode (Black, Xft)","urxvt -fn \"xft:Mono\" -rv","/usr/share/pixmaps/urxvt.xpm"}, {"X-Terminal as root (GKsu)","/usr/bin/gksu -u root /usr/bin/x-terminal-emulator","/usr/share/pixmaps/gksu-debian.xpm"}, {"Xfce Terminal","/usr/bin/xfce4-terminal","/usr/share/pixmaps/terminal.xpm"}, {"Xfterm4", "x-terminal-emulator -e ".."xfterm4"}, {"YaKuake","/usr/bin/yakuake"}, } Debian_menu["Debian_Applications_Text"] = { {"Character map","/usr/bin/gucharmap"}, {"GNOME Dictionary","/usr/bin/gnome-dictionary","/usr/share/pixmaps/gdict.xpm"}, } Debian_menu["Debian_Applications_Tools"] = { {"Driconf","/usr/bin/driconf"}, {"gcolor2","/usr/bin/gcolor2","/usr/share/pixmaps/gcolor2/gcolor2.xpm"}, } Debian_menu["Debian_Applications_Video"] = { {"gmlive","/usr/bin/gmlive"}, {"gmplayer","/usr/bin/gmplayer"}, {"GNOME MPlayer","gnome-mplayer","/usr/share/pixmaps/gnome-mplayer.xpm"}, {"LiVES","lives","/usr/share/pixmaps/lives.xpm"}, {"Totem","/usr/bin/totem","/usr/share/pixmaps/totem.xpm"}, {"VLC media player","/usr/bin/qvlc","/usr/share/icons/hicolor/32x32/apps/vlc.xpm"}, } Debian_menu["Debian_Applications_Viewers"] = { {"Evince","/usr/bin/evince","/usr/share/pixmaps/evince.xpm"}, {"Eye of GNOME","/usr/bin/eog","/usr/share/pixmaps/gnome-eog.xpm"}, {"gThumb Image Viewer","/usr/bin/gthumb","/usr/share/pixmaps/gthumb.xpm"}, {"Shotwell","/usr/bin/shotwell"}, {"Xditview","xditview"}, {"XDvi","/usr/bin/xdvi"}, } Debian_menu["Debian_Applications"] = { { "Accessibility", Debian_menu["Debian_Applications_Accessibility"] }, { "Data Management", Debian_menu["Debian_Applications_Data_Management"] }, { "Editors", Debian_menu["Debian_Applications_Editors"] }, { "Emulators", Debian_menu["Debian_Applications_Emulators"] }, { "File Management", Debian_menu["Debian_Applications_File_Management"] }, { "Graphics", Debian_menu["Debian_Applications_Graphics"] }, { "Network", Debian_menu["Debian_Applications_Network"] }, { "Office", Debian_menu["Debian_Applications_Office"] }, { "Programming", Debian_menu["Debian_Applications_Programming"] }, { "Science", Debian_menu["Debian_Applications_Science"] }, { "Shells", Debian_menu["Debian_Applications_Shells"] }, { "Sound", Debian_menu["Debian_Applications_Sound"] }, { "System", Debian_menu["Debian_Applications_System"] }, { "Terminal Emulators", Debian_menu["Debian_Applications_Terminal_Emulators"] }, { "Text", Debian_menu["Debian_Applications_Text"] }, { "Tools", Debian_menu["Debian_Applications_Tools"] }, { "Video", Debian_menu["Debian_Applications_Video"] }, { "Viewers", Debian_menu["Debian_Applications_Viewers"] }, } Debian_menu["Debian_Games_Action"] = { {"Battle Tanks","/usr/games/btanks","/usr/share/pixmaps/btanks.xpm"}, {"etracer","/usr/games/etracer","/usr/share/pixmaps/etracer.xpm"}, {"Granatier","/usr/games/granatier"}, {"KDE Bounce Ball Game","/usr/games/kbounce"}, {"KDE SpaceDuel","/usr/games/kspaceduel"}, {"KGoldrunner","/usr/games/kgoldrunner"}, {"Neverball","/usr/games/neverball","/usr/share/pixmaps/neverball.xpm"}, {"xmoto","/usr/games/xmoto"}, } Debian_menu["Debian_Games_Adventure"] = { {"The Mana World","/usr/games/mana /usr/share/tmw/tmw.mana","/usr/share/pixmaps/tmw.xpm"}, } Debian_menu["Debian_Games_Board"] = { {"Bovo","/usr/games/bovo"}, {"eboard","/usr/games/eboard"}, {"GNU Go", "x-terminal-emulator -e ".."/usr/games/gnugo"}, {"GnuChess", "x-terminal-emulator -e ".."/usr/games/gnuchess"}, {"KBattleship","/usr/games/kbattleship"}, {"KDE Reversi","/usr/games/kreversi"}, {"KDE Shisen-Sho","/usr/games/kshisen"}, {"KFourInLine","/usr/games/kfourinline"}, {"KiGo","/usr/games/kigo"}, {"Kiriki","/usr/games/kiriki"}, {"KLines","/usr/games/klines"}, {"KMahjongg","/usr/games/kmahjongg"}, {"KSquares","/usr/games/ksquares"}, {"Palapeli","/usr/games/palapeli"}, } Debian_menu["Debian_Games_Card"] = { {"KDE Lieutnant Skat","/usr/games/lskat"}, {"KDE Patience","/usr/games/kpat"}, } Debian_menu["Debian_Games_Puzzles"] = { {"KBlackBox","/usr/games/kblackbox"}, {"KDE Atomic Entertainment","/usr/games/katomic"}, {"KDE Klickety","/usr/games/klickety"}, {"KDE Sudoku","/usr/games/ksudoku"}, {"KJumpingCube","/usr/games/kjumpingcube"}, {"Kmines","/usr/games/kmines"}, {"KNetwalk","/usr/games/knetwalk"}, } Debian_menu["Debian_Games_Simulation"] = { {"ACM","/usr/games/acm"}, {"ACM4","/usr/games/acm4"}, {"KDE Miniature Golf","/usr/games/kolf"}, {"TORCS","/usr/games/torcs","/usr/share/pixmaps/torcs.xpm"}, {"Trophy","/usr/games/trophy","/usr/share/pixmaps/trophy.xpm"}, } Debian_menu["Debian_Games_Strategy"] = { {"Konquest","/usr/games/konquest"}, {"Warzone 2100","/usr/games/warzone2100","/usr/share/pixmaps/warzone2100-16x16.xpm"}, } Debian_menu["Debian_Games_Toys"] = { {"Google Gadgets (Qt)","/usr/bin/ggl-qt","/usr/share/pixmaps/ggl-qt.xpm"}, {"KDE Potato Guy","/usr/games/ktuberling"}, {"Oclock","oclock"}, {"Xclock (analog)","xclock -analog"}, {"Xclock (digital)","xclock -digital -update 1"}, {"Xeyes","xeyes"}, {"Xlogo","xlogo"}, } Debian_menu["Debian_Games"] = { { "Action", Debian_menu["Debian_Games_Action"] }, { "Adventure", Debian_menu["Debian_Games_Adventure"] }, { "Board", Debian_menu["Debian_Games_Board"] }, { "Card", Debian_menu["Debian_Games_Card"] }, { "Puzzles", Debian_menu["Debian_Games_Puzzles"] }, { "Simulation", Debian_menu["Debian_Games_Simulation"] }, { "Strategy", Debian_menu["Debian_Games_Strategy"] }, { "Toys", Debian_menu["Debian_Games_Toys"] }, } Debian_menu["Debian_Help"] = { {"Info", "x-terminal-emulator -e ".."info"}, {"TeXdoctk","/usr/bin/texdoctk"}, {"Xfce4-about","xfce4-about"}, {"Xfhelp4","xfhelp4"}, {"Xman","xman"}, {"yelp","/usr/bin/yelp"}, } Debian_menu["Debian_Network"] = { {"XSSer","/usr/bin/xsser --gtk --silent","/usr/share/xsser/gtk/images/xssericon_24x24.png"}, } Debian_menu["Debian_Screen_Locking"] = { {"Lock Screen (XScreenSaver)","/usr/bin/xscreensaver-command -lock"}, {"Workrave","/usr/bin/workrave","/usr/share/pixmaps/workrave/workrave.xpm"}, {"Xflock4", "x-terminal-emulator -e ".."xflock4"}, } Debian_menu["Debian_Screen_Saving"] = { {"Activate ScreenSaver (Next)","/usr/bin/xscreensaver-command -next"}, {"Activate ScreenSaver (Previous)","/usr/bin/xscreensaver-command -prev"}, {"Activate ScreenSaver (Random)","/usr/bin/xscreensaver-command -activate"}, {"Demo Screen Hacks","/usr/bin/xscreensaver-command -demo"}, {"Disable XScreenSaver","/usr/bin/xscreensaver-command -exit"}, {"Enable XScreenSaver","/usr/bin/xscreensaver"}, {"Reinitialize XScreenSaver","/usr/bin/xscreensaver-command -restart"}, {"ScreenSaver Preferences","/usr/bin/xscreensaver-command -prefs"}, } Debian_menu["Debian_Screen"] = { { "Locking", Debian_menu["Debian_Screen_Locking"] }, { "Saving", Debian_menu["Debian_Screen_Saving"] }, } Debian_menu["Debian"] = { { "Applications", Debian_menu["Debian_Applications"] }, { "Games", Debian_menu["Debian_Games"] }, { "Help", Debian_menu["Debian_Help"] }, { "Network", Debian_menu["Debian_Network"] }, { "Screen", Debian_menu["Debian_Screen"] }, }
yottanami/conf
home/.conf/awesome/debian/menu.lua
Lua
gpl-3.0
18,463
<f:layout name="Blank" /> <f:section name="main"> <f:flashMessages renderMode="div" /> <div class="select-region-wrap"> <h2><f:translate id="selectregion.choose_text" /></h2> <div class="select-region-currencies"> <f:for each="{currencies}" as="currencyEntity"> <f:link.page additionalParams="{currency:currencyEntity}" noCacheHash="1" class="select-region-choose-flag"> <f:image src="{currencyEntity.flag.uid}" alt="{currencyEntity.region} - {currencyEntity.label}" width="200" treatIdAsReference="1" /><br /> {currencyEntity.localLang} ( {currencyEntity.symbol} ) </f:link.page> </f:for> </div> </div> </f:section>
S3b0/ecompc
Resources/Private/Templates/Standard/SelectRegion.html
HTML
gpl-3.0
655
// @flow /* eslint-disable no-magic-numbers */ // For these tests, since they depend on `toLocaleString`, assume that the // locale used is American English (default in node) import numberToDisplayText from '.'; describe('numberToDisplayText', () => { test('no value', () => { expect(numberToDisplayText()).toBeUndefined(); expect(numberToDisplayText(undefined)).toBeUndefined(); expect(numberToDisplayText(null)).toBeUndefined(); expect(numberToDisplayText('')).toBeUndefined(); }); test('invalid value', () => { expect(numberToDisplayText('a')).toBe('N/A'); expect(numberToDisplayText('h87gr754hv')).toBe('N/A'); }); test('valid value, no abbr', () => { expect(numberToDisplayText(0)).toBe('0'); expect(numberToDisplayText('0')).toBe('0'); expect(numberToDisplayText(1)).toBe('1'); expect(numberToDisplayText('1')).toBe('1'); expect(numberToDisplayText(1000)).toBe('1,000'); expect(numberToDisplayText('1000')).toBe('1,000'); expect(numberToDisplayText(1234567)).toBe('1,234,567'); expect(numberToDisplayText('1234567')).toBe('1,234,567'); }); test('valid value, abbr', () => { expect(numberToDisplayText(0, true)).toBe('0'); expect(numberToDisplayText('0', true)).toBe('0'); expect(numberToDisplayText(1, true)).toBe('1'); expect(numberToDisplayText('1', true)).toBe('1'); expect(numberToDisplayText(1000, true)).toBe('1k'); expect(numberToDisplayText('1000', true)).toBe('1k'); expect(numberToDisplayText(1234567, true)).toBe('1M'); expect(numberToDisplayText('1234567', true)).toBe('1M'); expect(numberToDisplayText(1234567, true, 1000)).toBe('1,235k'); expect(numberToDisplayText('1234567', true, 1000)).toBe('1,235k'); expect(numberToDisplayText(1234499, true, 1000)).toBe('1,234k'); expect(numberToDisplayText('1234499', true, 1000)).toBe('1,234k'); }); });
ProteinsWebTeam/interpro7-client
src/components/NumberComponent/utils/number-to-display-text/test.js
JavaScript
gpl-3.0
1,890
package org.bouncycastle.openssl; import java.io.BufferedWriter; import java.io.IOException; import java.io.Writer; import java.math.BigInteger; import java.security.Key; import java.security.KeyPair; import java.security.PrivateKey; import java.security.PublicKey; import java.security.SecureRandom; import java.security.cert.CRLException; import java.security.cert.CertificateEncodingException; import java.security.cert.X509CRL; import java.security.cert.X509Certificate; import java.security.interfaces.DSAParams; import java.security.interfaces.DSAPrivateKey; import java.security.interfaces.RSAPrivateCrtKey; import java.security.interfaces.RSAPrivateKey; import org.bouncycastle.asn1.ASN1EncodableVector; import org.bouncycastle.asn1.ASN1Object; import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.DERInteger; import org.bouncycastle.asn1.DERSequence; import org.bouncycastle.asn1.cms.ContentInfo; import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; import org.bouncycastle.asn1.pkcs.RSAPrivateKeyStructure; import org.bouncycastle.asn1.x509.DSAParameter; import org.bouncycastle.jce.PKCS10CertificationRequest; import org.bouncycastle.util.Strings; import org.bouncycastle.util.encoders.Base64; import org.bouncycastle.util.encoders.Hex; import org.bouncycastle.x509.X509AttributeCertificate; import org.bouncycastle.x509.X509V2AttributeCertificate; /** * General purpose writer for OpenSSL PEM objects. */ public class PEMWriter extends BufferedWriter { private String provider; /** * Base constructor. * * @param out output stream to use. */ public PEMWriter(Writer out) { this(out, "BC"); } public PEMWriter( Writer out, String provider) { super(out); this.provider = provider; } private void writeHexEncoded(byte[] bytes) throws IOException { bytes = Hex.encode(bytes); for (int i = 0; i != bytes.length; i++) { this.write((char)bytes[i]); } } private void writeEncoded(byte[] bytes) throws IOException { char[] buf = new char[64]; bytes = Base64.encode(bytes); for (int i = 0; i < bytes.length; i += buf.length) { int index = 0; while (index != buf.length) { if ((i + index) >= bytes.length) { break; } buf[index] = (char)bytes[i + index]; index++; } this.write(buf, 0, index); this.newLine(); } } public void writeObject( Object o) throws IOException { String type; byte[] encoding; if (o instanceof X509Certificate) { type = "CERTIFICATE"; try { encoding = ((X509Certificate)o).getEncoded(); } catch (CertificateEncodingException e) { throw new IOException("Cannot encode object: " + e.toString()); } } else if (o instanceof X509CRL) { type = "X509 CRL"; try { encoding = ((X509CRL)o).getEncoded(); } catch (CRLException e) { throw new IOException("Cannot encode object: " + e.toString()); } } else if (o instanceof KeyPair) { writeObject(((KeyPair)o).getPrivate()); return; } else if (o instanceof PrivateKey) { PrivateKeyInfo info = new PrivateKeyInfo( (ASN1Sequence) ASN1Object.fromByteArray(((Key)o).getEncoded())); if (o instanceof RSAPrivateKey) { type = "RSA PRIVATE KEY"; encoding = info.getPrivateKey().getEncoded(); } else if (o instanceof DSAPrivateKey) { type = "DSA PRIVATE KEY"; DSAParameter p = DSAParameter.getInstance(info.getAlgorithmId().getParameters()); ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new DERInteger(0)); v.add(new DERInteger(p.getP())); v.add(new DERInteger(p.getQ())); v.add(new DERInteger(p.getG())); BigInteger x = ((DSAPrivateKey)o).getX(); BigInteger y = p.getG().modPow(x, p.getP()); v.add(new DERInteger(y)); v.add(new DERInteger(x)); encoding = new DERSequence(v).getEncoded(); } else if (((PrivateKey)o).getAlgorithm().equals("ECDSA")) { type = "EC PRIVATE KEY"; encoding = info.getPrivateKey().getEncoded(); } else { throw new IOException("Cannot identify private key"); } } else if (o instanceof PublicKey) { type = "PUBLIC KEY"; encoding = ((PublicKey)o).getEncoded(); } else if (o instanceof X509AttributeCertificate) { type = "ATTRIBUTE CERTIFICATE"; encoding = ((X509V2AttributeCertificate)o).getEncoded(); } else if (o instanceof PKCS10CertificationRequest) { type = "CERTIFICATE REQUEST"; encoding = ((PKCS10CertificationRequest)o).getEncoded(); } else if (o instanceof ContentInfo) { type = "PKCS7"; encoding = ((ContentInfo)o).getEncoded(); } else { throw new IOException("unknown object passed - can't encode."); } writeHeader(type); writeEncoded(encoding); writeFooter(type); } public void writeObject( Object obj, String algorithm, char[] password, SecureRandom random) throws IOException { if (obj instanceof KeyPair) { writeObject(((KeyPair)obj).getPrivate()); return; } String type = null; byte[] keyData = null; if (obj instanceof RSAPrivateCrtKey) { type = "RSA PRIVATE KEY"; RSAPrivateCrtKey k = (RSAPrivateCrtKey)obj; RSAPrivateKeyStructure keyStruct = new RSAPrivateKeyStructure( k.getModulus(), k.getPublicExponent(), k.getPrivateExponent(), k.getPrimeP(), k.getPrimeQ(), k.getPrimeExponentP(), k.getPrimeExponentQ(), k.getCrtCoefficient()); // convert to bytearray keyData = keyStruct.getEncoded(); } else if (obj instanceof DSAPrivateKey) { type = "DSA PRIVATE KEY"; DSAPrivateKey k = (DSAPrivateKey)obj; DSAParams p = k.getParams(); ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new DERInteger(0)); v.add(new DERInteger(p.getP())); v.add(new DERInteger(p.getQ())); v.add(new DERInteger(p.getG())); BigInteger x = k.getX(); BigInteger y = p.getG().modPow(x, p.getP()); v.add(new DERInteger(y)); v.add(new DERInteger(x)); keyData = new DERSequence(v).getEncoded(); } else if (obj instanceof PrivateKey && "ECDSA".equals(((PrivateKey)obj).getAlgorithm())) { type = "EC PRIVATE KEY"; PrivateKeyInfo privInfo = PrivateKeyInfo.getInstance(ASN1Object.fromByteArray(((PrivateKey)obj).getEncoded())); keyData = privInfo.getPrivateKey().getEncoded(); } if (type == null || keyData == null) { // TODO Support other types? throw new IllegalArgumentException("Object type not supported: " + obj.getClass().getName()); } String dekAlgName = Strings.toUpperCase(algorithm); // Note: For backward compatibility if (dekAlgName.equals("DESEDE")) { dekAlgName = "DES-EDE3-CBC"; } int ivLength = dekAlgName.startsWith("AES-") ? 16 : 8; byte[] iv = new byte[ivLength]; random.nextBytes(iv); byte[] encData = PEMUtilities.crypt(true, provider, keyData, password, dekAlgName, iv); // write the data writeHeader(type); this.write("Proc-Type: 4,ENCRYPTED"); this.newLine(); this.write("DEK-Info: " + dekAlgName + ","); this.writeHexEncoded(iv); this.newLine(); this.newLine(); this.writeEncoded(encData); writeFooter(type); } private void writeHeader( String type) throws IOException { this.write("-----BEGIN " + type + "-----"); this.newLine(); } private void writeFooter( String type) throws IOException { this.write("-----END " + type + "-----"); this.newLine(); } }
lynnlyc/for-honeynet-reviewers
CallbackDroid/android-environment/src/bouncycastle/src/main/java/org/bouncycastle/openssl/PEMWriter.java
Java
gpl-3.0
9,352
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_03) on Sun Jun 25 16:31:57 PDT 2006 --> <TITLE> CanooWebTestReporter (SQLUnit API JavaDocs) </TITLE> <META NAME="keywords" CONTENT="net.sourceforge.sqlunit.reporters.CanooWebTestReporter class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="CanooWebTestReporter (SQLUnit API JavaDocs)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CanooWebTestReporter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV CLASS&nbsp; &nbsp;<A HREF="../../../../net/sourceforge/sqlunit/reporters/EmptyReporter.html" title="class in net.sourceforge.sqlunit.reporters"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CanooWebTestReporter.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> net.sourceforge.sqlunit.reporters</FONT> <BR> Class CanooWebTestReporter</H2> <PRE> java.lang.Object <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>net.sourceforge.sqlunit.reporters.CanooWebTestReporter</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>CanooWebTestReporter</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></DL> </PRE> <P> SQLUnit Reporter that works with the Canoo Web Test framework. Generates XML that can be converted to output for the Canoo Web Test console. <P> <P> <DL> <DT><B>Version:</B></DT> <DD>$Revision: 1.9 $</DD> <DT><B>Author:</B></DT> <DD>Rob Nielsen (robn@asert.com.au), Paul King (paulk@asert.com.au)</DD> </DL> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#FORMAT_NAME">FORMAT_NAME</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the format name to be used in the ant task</TD> </TR> </TABLE> &nbsp; <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#CanooWebTestReporter(java.lang.String)">CanooWebTestReporter</A></B>(java.lang.String&nbsp;outputFile)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new CanooWebTestReporter</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#addFailure(java.lang.Throwable, boolean)">addFailure</A></B>(java.lang.Throwable&nbsp;th, boolean&nbsp;isError)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called when an exception occured during processing.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#echo(java.lang.String)">echo</A></B>(java.lang.String&nbsp;message)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called from within the test from the SQLUnit Echo tag to print out values from within the test.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#finishedTest(long, boolean)">finishedTest</A></B>(long&nbsp;time, boolean&nbsp;success)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called when a test is completed</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#getName()">getName</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the format name.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#hasContainer()">hasContainer</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true since this reporter runs in the context of a Canoo Web Test.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#newTestFile(java.lang.String, java.lang.String)">newTestFile</A></B>(java.lang.String&nbsp;name, java.lang.String&nbsp;location)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called when a new sqlunit test file is run.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#runningTest(java.lang.String, int, java.lang.String)">runningTest</A></B>(java.lang.String&nbsp;name, int&nbsp;testIndex, java.lang.String&nbsp;desc)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called before a test is run.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#setConfig(java.util.Map)">setConfig</A></B>(java.util.Map&nbsp;configMap)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called after the connection is made.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#settingUpConnection(java.lang.String)">settingUpConnection</A></B>(java.lang.String&nbsp;connectionId)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called before a database connection is setup.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#setUp()">setUp</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called before the set up section of the test.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#skippedTest(java.lang.String, int, java.lang.String)">skippedTest</A></B>(java.lang.String&nbsp;name, int&nbsp;testIndex, java.lang.String&nbsp;desc)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called when a test is skipped because of an earlier failure.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#tearDown()">tearDown</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called before the tear down section is run</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#tempFile(int, java.lang.String, java.lang.String)">tempFile</A></B>(int&nbsp;testId, java.lang.String&nbsp;result, java.lang.String&nbsp;file)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called when a test has failed and a temporary file is left containing data.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html#testFileComplete(boolean)">testFileComplete</A></B>(boolean&nbsp;success)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called when the test file has been completed.</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="FORMAT_NAME"><!-- --></A><H3> FORMAT_NAME</H3> <PRE> public static final java.lang.String <B>FORMAT_NAME</B></PRE> <DL> <DD>the format name to be used in the ant task <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#net.sourceforge.sqlunit.reporters.CanooWebTestReporter.FORMAT_NAME">Constant Field Values</A></DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="CanooWebTestReporter(java.lang.String)"><!-- --></A><H3> CanooWebTestReporter</H3> <PRE> public <B>CanooWebTestReporter</B>(java.lang.String&nbsp;outputFile) throws java.lang.Exception</PRE> <DL> <DD>Constructs a new CanooWebTestReporter <P> <DL> <DT><B>Parameters:</B><DD><CODE>outputFile</CODE> - the file <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE> - if a problem occurs</DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getName()"><!-- --></A><H3> getName</H3> <PRE> public final java.lang.String <B>getName</B>()</PRE> <DL> <DD>Returns the format name. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#getName()">getName</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the format name.</DL> </DD> </DL> <HR> <A NAME="hasContainer()"><!-- --></A><H3> hasContainer</H3> <PRE> public final boolean <B>hasContainer</B>()</PRE> <DL> <DD>Returns true since this reporter runs in the context of a Canoo Web Test. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#hasContainer()">hasContainer</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>true.</DL> </DD> </DL> <HR> <A NAME="newTestFile(java.lang.String, java.lang.String)"><!-- --></A><H3> newTestFile</H3> <PRE> public final void <B>newTestFile</B>(java.lang.String&nbsp;name, java.lang.String&nbsp;location)</PRE> <DL> <DD>Called when a new sqlunit test file is run. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#newTestFile(java.lang.String, java.lang.String)">newTestFile</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the test being run<DD><CODE>location</CODE> - the filename of the test file</DL> </DD> </DL> <HR> <A NAME="settingUpConnection(java.lang.String)"><!-- --></A><H3> settingUpConnection</H3> <PRE> public final void <B>settingUpConnection</B>(java.lang.String&nbsp;connectionId)</PRE> <DL> <DD>Called before a database connection is setup. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#settingUpConnection(java.lang.String)">settingUpConnection</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>connectionId</CODE> - the id of the connection being attempted, or null for the default connection</DL> </DD> </DL> <HR> <A NAME="setConfig(java.util.Map)"><!-- --></A><H3> setConfig</H3> <PRE> public final void <B>setConfig</B>(java.util.Map&nbsp;configMap)</PRE> <DL> <DD>Called after the connection is made. The map contains key/value pairs of configuration parameters for the connection and debug settings. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#setConfig(java.util.Map)">setConfig</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>configMap</CODE> - the configuration map</DL> </DD> </DL> <HR> <A NAME="setUp()"><!-- --></A><H3> setUp</H3> <PRE> public final void <B>setUp</B>()</PRE> <DL> <DD>Called before the set up section of the test. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#setUp()">setUp</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="runningTest(java.lang.String, int, java.lang.String)"><!-- --></A><H3> runningTest</H3> <PRE> public final void <B>runningTest</B>(java.lang.String&nbsp;name, int&nbsp;testIndex, java.lang.String&nbsp;desc)</PRE> <DL> <DD>Called before a test is run. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#runningTest(java.lang.String, int, java.lang.String)">runningTest</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the test being run<DD><CODE>testIndex</CODE> - the index of the test being run<DD><CODE>desc</CODE> - a description of the test being run</DL> </DD> </DL> <HR> <A NAME="finishedTest(long, boolean)"><!-- --></A><H3> finishedTest</H3> <PRE> public final void <B>finishedTest</B>(long&nbsp;time, boolean&nbsp;success)</PRE> <DL> <DD>Called when a test is completed <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#finishedTest(long, boolean)">finishedTest</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>time</CODE> - the time in milliseconds the test took to run<DD><CODE>success</CODE> - true if the test succeeded, false otherwise</DL> </DD> </DL> <HR> <A NAME="skippedTest(java.lang.String, int, java.lang.String)"><!-- --></A><H3> skippedTest</H3> <PRE> public final void <B>skippedTest</B>(java.lang.String&nbsp;name, int&nbsp;testIndex, java.lang.String&nbsp;desc)</PRE> <DL> <DD>Called when a test is skipped because of an earlier failure. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#skippedTest(java.lang.String, int, java.lang.String)">skippedTest</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the test being run<DD><CODE>testIndex</CODE> - the index of the test being run<DD><CODE>desc</CODE> - a description of the test being run</DL> </DD> </DL> <HR> <A NAME="addFailure(java.lang.Throwable, boolean)"><!-- --></A><H3> addFailure</H3> <PRE> public final void <B>addFailure</B>(java.lang.Throwable&nbsp;th, boolean&nbsp;isError)</PRE> <DL> <DD>Called when an exception occured during processing. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#addFailure(java.lang.Throwable, boolean)">addFailure</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>th</CODE> - the exception that occured<DD><CODE>isError</CODE> - true if the exception is an error, else false.</DL> </DD> </DL> <HR> <A NAME="tempFile(int, java.lang.String, java.lang.String)"><!-- --></A><H3> tempFile</H3> <PRE> public final void <B>tempFile</B>(int&nbsp;testId, java.lang.String&nbsp;result, java.lang.String&nbsp;file)</PRE> <DL> <DD>Called when a test has failed and a temporary file is left containing data. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#tempFile(int, java.lang.String, java.lang.String)">tempFile</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>testId</CODE> - the index of the test<DD><CODE>result</CODE> - the result of the test<DD><CODE>file</CODE> - the temporary file</DL> </DD> </DL> <HR> <A NAME="tearDown()"><!-- --></A><H3> tearDown</H3> <PRE> public final void <B>tearDown</B>()</PRE> <DL> <DD>Called before the tear down section is run <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#tearDown()">tearDown</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="testFileComplete(boolean)"><!-- --></A><H3> testFileComplete</H3> <PRE> public final void <B>testFileComplete</B>(boolean&nbsp;success)</PRE> <DL> <DD>Called when the test file has been completed. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#testFileComplete(boolean)">testFileComplete</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>success</CODE> - true if everything completed with no errors, false otherwise</DL> </DD> </DL> <HR> <A NAME="echo(java.lang.String)"><!-- --></A><H3> echo</H3> <PRE> public final void <B>echo</B>(java.lang.String&nbsp;message)</PRE> <DL> <DD>Called from within the test from the SQLUnit Echo tag to print out values from within the test. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html#echo(java.lang.String)">echo</A></CODE> in interface <CODE><A HREF="../../../../net/sourceforge/sqlunit/IReporter.html" title="interface in net.sourceforge.sqlunit">IReporter</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>message</CODE> - the message to echo.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CanooWebTestReporter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV CLASS&nbsp; &nbsp;<A HREF="../../../../net/sourceforge/sqlunit/reporters/EmptyReporter.html" title="class in net.sourceforge.sqlunit.reporters"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CanooWebTestReporter.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
ecalo/SQLUnit-5.0-Fork
docs/javadoc/net/sourceforge/sqlunit/reporters/CanooWebTestReporter.html
HTML
gpl-3.0
27,998
<?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/>. /** * This file contains the definition for the library class for file feedback plugin * * * @package assignfeedback_file * @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * File areas for file feedback assignment */ define('ASSIGNFEEDBACK_FILE_FILEAREA', 'feedback_files'); <<<<<<< HEAD define('ASSIGNFEEDBACK_FILE_MAXSUMMARYFILES', 5); ======= define('ASSIGNFEEDBACK_FILE_BATCH_FILEAREA', 'feedback_files_batch'); define('ASSIGNFEEDBACK_FILE_IMPORT_FILEAREA', 'feedback_files_import'); define('ASSIGNFEEDBACK_FILE_MAXSUMMARYFILES', 5); define('ASSIGNFEEDBACK_FILE_MAXSUMMARYUSERS', 5); define('ASSIGNFEEDBACK_FILE_MAXFILEUNZIPTIME', 120); >>>>>>> 230e37bfd87f00e0d010ed2ffd68ca84a53308d0 /** * library class for file feedback plugin extending feedback plugin base class * * @package asignfeedback_file * @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class assign_feedback_file extends assign_feedback_plugin { /** * Get the name of the file feedback plugin * @return string */ public function get_name() { return get_string('file', 'assignfeedback_file'); } /** * Get file feedback information from the database * * @param int $gradeid * @return mixed */ public function get_file_feedback($gradeid) { global $DB; return $DB->get_record('assignfeedback_file', array('grade'=>$gradeid)); } /** * File format options * @return array */ private function get_file_options() { global $COURSE; $fileoptions = array('subdirs'=>1, 'maxbytes'=>$COURSE->maxbytes, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL); return $fileoptions; } /** <<<<<<< HEAD ======= * Copy all the files from one file area to another * * @param file_storage $fs - The source context id * @param int $fromcontextid - The source context id * @param string $fromcomponent - The source component * @param string $fromfilearea - The source filearea * @param int $fromitemid - The source item id * @param int $tocontextid - The destination context id * @param string $tocomponent - The destination component * @param string $tofilearea - The destination filearea * @param int $toitemid - The destination item id * @return boolean */ private function copy_area_files(file_storage $fs, $fromcontextid, $fromcomponent, $fromfilearea, $fromitemid, $tocontextid, $tocomponent, $tofilearea, $toitemid) { $newfilerecord = new stdClass(); $newfilerecord->contextid = $tocontextid; $newfilerecord->component = $tocomponent; $newfilerecord->filearea = $tofilearea; $newfilerecord->itemid = $toitemid; if ($files = $fs->get_area_files($fromcontextid, $fromcomponent, $fromfilearea, $fromitemid)) { foreach ($files as $file) { if ($file->is_directory() and $file->get_filepath() === '/') { // We need a way to mark the age of each draft area. // By not copying the root dir we force it to be created automatically with current timestamp. continue; } $newfile = $fs->create_file_from_storedfile($newfilerecord, $file); } } return true; } /** >>>>>>> 230e37bfd87f00e0d010ed2ffd68ca84a53308d0 * Get form elements for grading form * * @param stdClass $grade * @param MoodleQuickForm $mform * @param stdClass $data * @param int $userid The userid we are currently grading * @return bool true if elements were added to the form */ public function get_form_elements_for_user($grade, MoodleQuickForm $mform, stdClass $data, $userid) { $fileoptions = $this->get_file_options(); $gradeid = $grade ? $grade->id : 0; $elementname = 'files_' . $userid; $data = file_prepare_standard_filemanager($data, $elementname, $fileoptions, $this->assignment->get_context(), 'assignfeedback_file', ASSIGNFEEDBACK_FILE_FILEAREA, $gradeid); $mform->addElement('filemanager', $elementname . '_filemanager', html_writer::tag('span', $this->get_name(), array('class' => 'accesshide')), null, $fileoptions); return true; } /** * Count the number of files * * @param int $gradeid * @param string $area * @return int */ private function count_files($gradeid, $area) { <<<<<<< HEAD global $USER; ======= >>>>>>> 230e37bfd87f00e0d010ed2ffd68ca84a53308d0 $fs = get_file_storage(); $files = $fs->get_area_files($this->assignment->get_context()->id, 'assignfeedback_file', $area, $gradeid, "id", false); return count($files); } /** <<<<<<< HEAD ======= * Update the number of files in the file area * * @param stdClass $grade The grade record * @return bool - true if the value was saved */ public function update_file_count($grade) { global $DB; $filefeedback = $this->get_file_feedback($grade->id); if ($filefeedback) { $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); return $DB->update_record('assignfeedback_file', $filefeedback); } else { $filefeedback = new stdClass(); $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); $filefeedback->grade = $grade->id; $filefeedback->assignment = $this->assignment->get_instance()->id; return $DB->insert_record('assignfeedback_file', $filefeedback) > 0; } } /** >>>>>>> 230e37bfd87f00e0d010ed2ffd68ca84a53308d0 * Save the feedback files * * @param stdClass $grade * @param stdClass $data * @return bool */ public function save(stdClass $grade, stdClass $data) { <<<<<<< HEAD global $DB; $fileoptions = $this->get_file_options(); $userid = $grade->userid; $elementname = 'files_' . $userid; ======= $fileoptions = $this->get_file_options(); // The element name may have been for a different user. foreach ($data as $key => $value) { if (strpos($key, 'files_') === 0 && strpos($key, '_filemanager')) { $elementname = substr($key, 0, strpos($key, '_filemanager')); } } >>>>>>> 230e37bfd87f00e0d010ed2ffd68ca84a53308d0 $data = file_postupdate_standard_filemanager($data, $elementname, $fileoptions, $this->assignment->get_context(), 'assignfeedback_file', ASSIGNFEEDBACK_FILE_FILEAREA, $grade->id); <<<<<<< HEAD $filefeedback = $this->get_file_feedback($grade->id); if ($filefeedback) { $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); return $DB->update_record('assignfeedback_file', $filefeedback); } else { $filefeedback = new stdClass(); $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); $filefeedback->grade = $grade->id; $filefeedback->assignment = $this->assignment->get_instance()->id; return $DB->insert_record('assignfeedback_file', $filefeedback) > 0; } ======= return $this->update_file_count($grade); >>>>>>> 230e37bfd87f00e0d010ed2ffd68ca84a53308d0 } /** * Display the list of files in the feedback status table * * @param stdClass $grade * @param bool $showviewlink - Set to true to show a link to see the full list of files * @return string */ public function view_summary(stdClass $grade, & $showviewlink) { $count = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); // show a view all link if the number of files is over this limit $showviewlink = $count > ASSIGNFEEDBACK_FILE_MAXSUMMARYFILES; if ($count <= ASSIGNFEEDBACK_FILE_MAXSUMMARYFILES) { return $this->assignment->render_area_files('assignfeedback_file', ASSIGNFEEDBACK_FILE_FILEAREA, $grade->id); } else { return get_string('countfiles', 'assignfeedback_file', $count); } } /** * Display the list of files in the feedback status table * @param stdClass $grade * @return string */ public function view(stdClass $grade) { return $this->assignment->render_area_files('assignfeedback_file', ASSIGNFEEDBACK_FILE_FILEAREA, $grade->id); } /** * The assignment has been deleted - cleanup * * @return bool */ public function delete_instance() { global $DB; // will throw exception on failure $DB->delete_records('assignfeedback_file', array('assignment'=>$this->assignment->get_instance()->id)); return true; } /** * Return true if there are no feedback files * @param stdClass $grade */ public function is_empty(stdClass $grade) { return $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA) == 0; } /** * Get file areas returns a list of areas this plugin stores files * @return array - An array of fileareas (keys) and descriptions (values) */ public function get_file_areas() { return array(ASSIGNFEEDBACK_FILE_FILEAREA=>$this->get_name()); } /** * Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type * and version. * * @param string $type old assignment subtype * @param int $version old assignment version * @return bool True if upgrade is possible */ public function can_upgrade($type, $version) { if (($type == 'upload' || $type == 'uploadsingle') && $version >= 2011112900) { return true; } return false; } /** * Upgrade the settings from the old assignment to the new plugin based one * * @param context $oldcontext - the context for the old assignment * @param stdClass $oldassignment - the data for the old assignment * @param string $log - can be appended to by the upgrade * @return bool was it a success? (false will trigger a rollback) */ public function upgrade_settings(context $oldcontext, stdClass $oldassignment, & $log) { // first upgrade settings (nothing to do) return true; } /** * Upgrade the feedback from the old assignment to the new one * * @param context $oldcontext - the database for the old assignment context * @param stdClass $oldassignment The data record for the old assignment * @param stdClass $oldsubmission The data record for the old submission * @param stdClass $grade The data record for the new grade * @param string $log Record upgrade messages in the log * @return bool true or false - false will trigger a rollback */ public function upgrade(context $oldcontext, stdClass $oldassignment, stdClass $oldsubmission, stdClass $grade, & $log) { global $DB; // now copy the area files $this->assignment->copy_area_files_for_upgrade($oldcontext->id, 'mod_assignment', 'response', $oldsubmission->id, // New file area $this->assignment->get_context()->id, 'assignfeedback_file', ASSIGNFEEDBACK_FILE_FILEAREA, $grade->id); // now count them! $filefeedback = new stdClass(); $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); $filefeedback->grade = $grade->id; $filefeedback->assignment = $this->assignment->get_instance()->id; if (!$DB->insert_record('assignfeedback_file', $filefeedback) > 0) { $log .= get_string('couldnotconvertgrade', 'mod_assign', $grade->userid); return false; } return true; } <<<<<<< HEAD ======= /** * Return a list of the batch grading operations performed by this plugin * This plugin supports batch upload files and upload zip * * @return array The list of batch grading operations */ public function get_grading_batch_operations() { return array('uploadfiles'=>get_string('uploadfiles', 'assignfeedback_file')); } /** * Upload files and send them to multiple users * * @param array $users - An array of user ids * @return string - The response html */ public function view_batch_upload_files($users) { global $CFG, $DB, $USER; require_capability('mod/assign:grade', $this->assignment->get_context()); require_once($CFG->dirroot . '/mod/assign/feedback/file/batchuploadfilesform.php'); require_once($CFG->dirroot . '/mod/assign/renderable.php'); $formparams = array('cm'=>$this->assignment->get_course_module()->id, 'users'=>$users, 'context'=>$this->assignment->get_context()); $usershtml = ''; $usercount = 0; foreach ($users as $userid) { if ($usercount >= ASSIGNFEEDBACK_FILE_MAXSUMMARYUSERS) { $usershtml .= get_string('moreusers', 'assignfeedback_file', count($users) - ASSIGNFEEDBACK_FILE_MAXSUMMARYUSERS); break; } $user = $DB->get_record('user', array('id'=>$userid), '*', MUST_EXIST); $usershtml .= $this->assignment->get_renderer()->render(new assign_user_summary($user, $this->assignment->get_course()->id, has_capability('moodle/site:viewfullnames', $this->assignment->get_course_context()), $this->assignment->is_blind_marking(), $this->assignment->get_uniqueid_for_user($user->id), get_extra_user_fields($this->assignment->get_context()))); $usercount += 1; } $formparams['usershtml'] = $usershtml; $mform = new assignfeedback_file_batch_upload_files_form(null, $formparams); if ($mform->is_cancelled()) { redirect(new moodle_url('view.php', array('id'=>$this->assignment->get_course_module()->id, 'action'=>'grading'))); return; } else if ($data = $mform->get_data()) { // Copy the files from the draft area to a temporary import area. $data = file_postupdate_standard_filemanager($data, 'files', $this->get_file_options(), $this->assignment->get_context(), 'assignfeedback_file', ASSIGNFEEDBACK_FILE_BATCH_FILEAREA, $USER->id); $fs = get_file_storage(); // Now copy each of these files to the users feedback file area. foreach ($users as $userid) { $grade = $this->assignment->get_user_grade($userid, true); $this->assignment->notify_grade_modified($grade); $this->copy_area_files($fs, $this->assignment->get_context()->id, 'assignfeedback_file', ASSIGNFEEDBACK_FILE_BATCH_FILEAREA, $USER->id, $this->assignment->get_context()->id, 'assignfeedback_file', ASSIGNFEEDBACK_FILE_FILEAREA, $grade->id); $filefeedback = $this->get_file_feedback($grade->id); if ($filefeedback) { $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); $DB->update_record('assignfeedback_file', $filefeedback); } else { $filefeedback = new stdClass(); $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); $filefeedback->grade = $grade->id; $filefeedback->assignment = $this->assignment->get_instance()->id; $DB->insert_record('assignfeedback_file', $filefeedback); } } // Now delete the temporary import area. $fs->delete_area_files($this->assignment->get_context()->id, 'assignfeedback_file', ASSIGNFEEDBACK_FILE_BATCH_FILEAREA, $USER->id); redirect(new moodle_url('view.php', array('id'=>$this->assignment->get_course_module()->id, 'action'=>'grading'))); return; } else { $o = ''; $o .= $this->assignment->get_renderer()->render(new assign_header($this->assignment->get_instance(), $this->assignment->get_context(), false, $this->assignment->get_course_module()->id, get_string('batchuploadfiles', 'assignfeedback_file'))); $o .= $this->assignment->get_renderer()->render(new assign_form('batchuploadfiles', $mform)); $o .= $this->assignment->get_renderer()->render_footer(); } return $o; } /** * User has chosen a custom grading batch operation and selected some users * * @param string $action - The chosen action * @param array $users - An array of user ids * @return string - The response html */ public function grading_batch_operation($action, $users) { if ($action == 'uploadfiles') { return $this->view_batch_upload_files($users); } return ''; } /** * View the upload zip form * * @return string - The html response */ public function view_upload_zip() { global $CFG, $USER; require_capability('mod/assign:grade', $this->assignment->get_context()); require_once($CFG->dirroot . '/mod/assign/feedback/file/uploadzipform.php'); require_once($CFG->dirroot . '/mod/assign/feedback/file/importziplib.php'); require_once($CFG->dirroot . '/mod/assign/feedback/file/importzipform.php'); $mform = new assignfeedback_file_upload_zip_form(null, array('context'=>$this->assignment->get_context(), 'cm'=>$this->assignment->get_course_module()->id)); $o = ''; $confirm = optional_param('confirm', 0, PARAM_BOOL); $renderer = $this->assignment->get_renderer(); // Delete any existing files. $importer = new assignfeedback_file_zip_importer(); $contextid = $this->assignment->get_context()->id; if ($mform->is_cancelled()) { $importer->delete_import_files($contextid); redirect(new moodle_url('view.php', array('id'=>$this->assignment->get_course_module()->id, 'action'=>'grading'))); return; } else if ($confirm) { $params = array('assignment'=>$this->assignment, 'importer'=>$importer); $mform = new assignfeedback_file_import_zip_form(null, $params); if ($mform->is_cancelled()) { $importer->delete_import_files($contextid); redirect(new moodle_url('view.php', array('id'=>$this->assignment->get_course_module()->id, 'action'=>'grading'))); return; } $o .= $importer->import_zip_files($this->assignment, $this); $importer->delete_import_files($contextid); } else if (($data = $mform->get_data()) && ($zipfile = $mform->save_stored_file('feedbackzip', $contextid, 'assignfeedback_file', ASSIGNFEEDBACK_FILE_IMPORT_FILEAREA, $USER->id, '/', 'import.zip', true))) { $importer->extract_files_from_zip($zipfile, $contextid); $params = array('assignment'=>$this->assignment, 'importer'=>$importer); $mform = new assignfeedback_file_import_zip_form(null, $params); $o .= $renderer->render(new assign_header($this->assignment->get_instance(), $this->assignment->get_context(), false, $this->assignment->get_course_module()->id, get_string('confirmuploadzip', 'assignfeedback_file'))); $o .= $renderer->render(new assign_form('confirmimportzip', $mform)); $o .= $renderer->render_footer(); } else { $o .= $renderer->render(new assign_header($this->assignment->get_instance(), $this->assignment->get_context(), false, $this->assignment->get_course_module()->id, get_string('uploadzip', 'assignfeedback_file'))); $o .= $renderer->render(new assign_form('uploadfeedbackzip', $mform)); $o .= $renderer->render_footer(); } return $o; } /** * Called by the assignment module when someone chooses something from the grading navigation or batch operations list * * @param string $action - The page to view * @return string - The html response */ public function view_page($action) { if ($action == 'uploadfiles') { $users = required_param('selectedusers', PARAM_TEXT); return $this->view_batch_upload_files(explode(',', $users)); } if ($action == 'uploadzip') { return $this->view_upload_zip(); } return ''; } /** * Return a list of the grading actions performed by this plugin * This plugin supports upload zip * * @return array The list of grading actions */ public function get_grading_actions() { return array('uploadzip'=>get_string('uploadzip', 'assignfeedback_file')); } >>>>>>> 230e37bfd87f00e0d010ed2ffd68ca84a53308d0 }
khan0407/FinalArcade
mod/assign/feedback/file/locallib.php
PHP
gpl-3.0
26,081
require 'o_c_logger' require 'united_states' ['historical', 'current'].each do |mode| cmtes_file_path = File.join(Settings.data_path, "congress-legislators", "committees-#{mode}.yaml") cmtes = YAML.load_file(cmtes_file_path) cmtes.each do |cmte_hash| UnitedStates::Committees.import_committee cmte_hash end end
sunlightlabs/opencongress
bin/import_committees.rb
Ruby
gpl-3.0
384
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """ """ __version__ = "$Id$" #end_pymotw_header import trace from trace_example.recurse import recurse tracer = trace.Trace(count=True, trace=False, outfile='trace_report.dat') tracer.runfunc(recurse, 2) report_tracer = trace.Trace(count=False, trace=False, infile='trace_report.dat') results = tracer.results() results.write_results(summary=True, coverdir='/tmp')
qilicun/python
python2/PyMOTW-1.132/PyMOTW/trace/trace_report.py
Python
gpl-3.0
469
/******************************************************************************* * Trombone is a flexible text processing and analysis library used * primarily by Voyant Tools (voyant-tools.org). * * Copyright (©) 2007-2012 Stéfan Sinclair & Geoffrey Rockwell * * This file is part of Trombone. * * Trombone 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. * * Trombone 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 Trombone. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ package org.voyanttools.trombone.input.extract; import java.io.IOException; import org.voyanttools.trombone.input.source.InputSource; import org.voyanttools.trombone.model.StoredDocumentSource; /** * @author sgs * */ public interface Extractor { InputSource getExtractableInputSource(StoredDocumentSource storedDocumentSource) throws IOException; }
sgsinclair/trombone
src/main/java/org/voyanttools/trombone/input/extract/Extractor.java
Java
gpl-3.0
1,382
@charset "UTF-8"; /*! * 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 */ @import url("https://fonts.googleapis.com/css?family=Roboto:400,700"); html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-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 { font-size: 2em; margin: 0.67em 0; } mark { background: #ff0; color: #000; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 1em 40px; } hr { box-sizing: content-box; height: 0; } pre { overflow: auto; } code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } button, input, optgroup, select, textarea { color: inherit; font: inherit; margin: 0; } 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 { border: 0; padding: 0; } input { line-height: normal; } input[type="checkbox"], input[type="radio"] { 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-appearance: textfield; box-sizing: content-box; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } legend { border: 0; padding: 0; } textarea { overflow: auto; } optgroup { font-weight: bold; } table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ @media print { *, *:before, *:after { background: transparent !important; color: #000 !important; box-shadow: none !important; text-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: transparent; } body { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.428571429; color: #888; background-color: #060606; } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } a { color: #2A9FD6; text-decoration: none; } a:hover, a:focus { color: #2A9FD6; 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 { display: block; max-width: 100%; height: auto; } .img-rounded { border-radius: 6px; } .img-thumbnail { padding: 4px; line-height: 1.428571429; background-color: #282828; border: 1px solid #282828; border-radius: 4px; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; max-width: 100%; height: auto; } .img-circle { border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #282828; } .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; 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: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 500; line-height: 1.1; color: #fff; } h1 small, h1 .small, h2 small, h2 .small, h3 small, h3 .small, h4 small, h4 .small, h5 small, h5 .small, h6 small, h6 .small, .h1 small, .h1 .small, .h2 small, .h2 .small, .h3 small, .h3 .small, .h4 small, .h4 .small, .h5 small, .h5 .small, .h6 small, .h6 .small { font-weight: normal; line-height: 1; color: #888; } h1, .h1, h2, .h2, h3, .h3 { margin-top: 20px; margin-bottom: 10px; } h1 small, h1 .small, .h1 small, .h1 .small, h2 small, h2 .small, .h2 small, .h2 .small, h3 small, h3 .small, .h3 small, .h3 .small { font-size: 65%; } h4, .h4, h5, .h5, h6, .h6 { margin-top: 10px; margin-bottom: 10px; } h4 small, h4 .small, .h4 small, .h4 .small, h5 small, h5 .small, .h5 small, .h5 .small, h6 small, h6 .small, .h6 small, .h6 .small { font-size: 75%; } h1, .h1 { font-size: 56px; } h2, .h2 { font-size: 45px; } h3, .h3 { font-size: 34px; } h4, .h4 { font-size: 24px; } h5, .h5 { font-size: 20px; } h6, .h6 { font-size: 16px; } 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 { background-color: #FF8800; padding: .2em; } .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, .initialism { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-muted { color: #888; } .text-primary { color: #2A9FD6; } a.text-primary:hover, a.text-primary:focus { color: #2180ac; } .text-success { color: #fff; } a.text-success:hover, a.text-success:focus { color: #e6e5e5; } .text-info { color: #fff; } a.text-info:hover, a.text-info:focus { color: #e6e5e5; } .text-warning { color: #fff; } a.text-warning:hover, a.text-warning:focus { color: #e6e5e5; } .text-danger { color: #fff; } a.text-danger:hover, a.text-danger:focus { color: #e6e5e5; } .bg-primary { color: #fff; } .bg-primary { background-color: #2A9FD6; } a.bg-primary:hover, a.bg-primary:focus { background-color: #2180ac; } .bg-success { background-color: #77B300; } a.bg-success:hover, a.bg-success:focus { background-color: #558000; } .bg-info { background-color: #9933CC; } a.bg-info:hover, a.bg-info:focus { background-color: #7a29a3; } .bg-warning { background-color: #FF8800; } a.bg-warning:hover, a.bg-warning:focus { background-color: #cc6d00; } .bg-danger { background-color: #CC0000; } a.bg-danger:hover, a.bg-danger:focus { background-color: #990000; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #282828; } ul, ol { margin-top: 0; margin-bottom: 10px; } ul ul, ul ol, ol ul, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; list-style: none; margin-left: -5px; } .list-inline > li { display: inline-block; padding-left: 5px; padding-right: 5px; } dl { margin-top: 0; margin-bottom: 20px; } dt, dd { line-height: 1.428571429; } dt { font-weight: bold; } dd { margin-left: 0; } .dl-horizontal dd:before, .dl-horizontal dd:after { content: " "; display: table; } .dl-horizontal dd:after { clear: both; } @media (min-width: 768px) { .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #888; } .initialism { font-size: 90%; } blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #282828; } 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.428571429; color: #555; } blockquote footer:before, blockquote small:before, blockquote .small:before { content: '\2014 \00A0'; } .blockquote-reverse, blockquote.pull-right { padding-right: 15px; padding-left: 0; border-right: 5px solid #282828; border-left: 0; text-align: right; } .blockquote-reverse footer:before, .blockquote-reverse small:before, .blockquote-reverse .small:before, blockquote.pull-right footer:before, blockquote.pull-right small:before, blockquote.pull-right .small:before { content: ''; } .blockquote-reverse footer:after, .blockquote-reverse small:after, .blockquote-reverse .small:after, blockquote.pull-right footer:after, blockquote.pull-right small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } address { margin-bottom: 20px; font-style: normal; line-height: 1.428571429; } 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; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } kbd kbd { padding: 0; font-size: 100%; font-weight: bold; box-shadow: none; } pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.428571429; word-break: break-all; word-wrap: break-word; color: #282828; 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 { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } .container:before, .container:after { content: " "; display: table; } .container:after { clear: both; } @media (min-width: 768px) { .container { width: 750px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1200px) { .container { width: 1170px; } } .container-fluid { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } .container-fluid:before, .container-fluid:after { content: " "; display: table; } .container-fluid:after { clear: both; } .row { margin-left: -15px; margin-right: -15px; } .row:before, .row:after { content: " "; display: table; } .row:after { clear: both; } .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-left: 15px; padding-right: 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-1 { width: 8.3333333333%; } .col-xs-2 { width: 16.6666666667%; } .col-xs-3 { width: 25%; } .col-xs-4 { width: 33.3333333333%; } .col-xs-5 { width: 41.6666666667%; } .col-xs-6 { width: 50%; } .col-xs-7 { width: 58.3333333333%; } .col-xs-8 { width: 66.6666666667%; } .col-xs-9 { width: 75%; } .col-xs-10 { width: 83.3333333333%; } .col-xs-11 { width: 91.6666666667%; } .col-xs-12 { width: 100%; } .col-xs-pull-0 { right: auto; } .col-xs-pull-1 { right: 8.3333333333%; } .col-xs-pull-2 { right: 16.6666666667%; } .col-xs-pull-3 { right: 25%; } .col-xs-pull-4 { right: 33.3333333333%; } .col-xs-pull-5 { right: 41.6666666667%; } .col-xs-pull-6 { right: 50%; } .col-xs-pull-7 { right: 58.3333333333%; } .col-xs-pull-8 { right: 66.6666666667%; } .col-xs-pull-9 { right: 75%; } .col-xs-pull-10 { right: 83.3333333333%; } .col-xs-pull-11 { right: 91.6666666667%; } .col-xs-pull-12 { right: 100%; } .col-xs-push-0 { left: auto; } .col-xs-push-1 { left: 8.3333333333%; } .col-xs-push-2 { left: 16.6666666667%; } .col-xs-push-3 { left: 25%; } .col-xs-push-4 { left: 33.3333333333%; } .col-xs-push-5 { left: 41.6666666667%; } .col-xs-push-6 { left: 50%; } .col-xs-push-7 { left: 58.3333333333%; } .col-xs-push-8 { left: 66.6666666667%; } .col-xs-push-9 { left: 75%; } .col-xs-push-10 { left: 83.3333333333%; } .col-xs-push-11 { left: 91.6666666667%; } .col-xs-push-12 { left: 100%; } .col-xs-offset-0 { margin-left: 0%; } .col-xs-offset-1 { margin-left: 8.3333333333%; } .col-xs-offset-2 { margin-left: 16.6666666667%; } .col-xs-offset-3 { margin-left: 25%; } .col-xs-offset-4 { margin-left: 33.3333333333%; } .col-xs-offset-5 { margin-left: 41.6666666667%; } .col-xs-offset-6 { margin-left: 50%; } .col-xs-offset-7 { margin-left: 58.3333333333%; } .col-xs-offset-8 { margin-left: 66.6666666667%; } .col-xs-offset-9 { margin-left: 75%; } .col-xs-offset-10 { margin-left: 83.3333333333%; } .col-xs-offset-11 { margin-left: 91.6666666667%; } .col-xs-offset-12 { margin-left: 100%; } @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-1 { width: 8.3333333333%; } .col-sm-2 { width: 16.6666666667%; } .col-sm-3 { width: 25%; } .col-sm-4 { width: 33.3333333333%; } .col-sm-5 { width: 41.6666666667%; } .col-sm-6 { width: 50%; } .col-sm-7 { width: 58.3333333333%; } .col-sm-8 { width: 66.6666666667%; } .col-sm-9 { width: 75%; } .col-sm-10 { width: 83.3333333333%; } .col-sm-11 { width: 91.6666666667%; } .col-sm-12 { width: 100%; } .col-sm-pull-0 { right: auto; } .col-sm-pull-1 { right: 8.3333333333%; } .col-sm-pull-2 { right: 16.6666666667%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-4 { right: 33.3333333333%; } .col-sm-pull-5 { right: 41.6666666667%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-7 { right: 58.3333333333%; } .col-sm-pull-8 { right: 66.6666666667%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-10 { right: 83.3333333333%; } .col-sm-pull-11 { right: 91.6666666667%; } .col-sm-pull-12 { right: 100%; } .col-sm-push-0 { left: auto; } .col-sm-push-1 { left: 8.3333333333%; } .col-sm-push-2 { left: 16.6666666667%; } .col-sm-push-3 { left: 25%; } .col-sm-push-4 { left: 33.3333333333%; } .col-sm-push-5 { left: 41.6666666667%; } .col-sm-push-6 { left: 50%; } .col-sm-push-7 { left: 58.3333333333%; } .col-sm-push-8 { left: 66.6666666667%; } .col-sm-push-9 { left: 75%; } .col-sm-push-10 { left: 83.3333333333%; } .col-sm-push-11 { left: 91.6666666667%; } .col-sm-push-12 { left: 100%; } .col-sm-offset-0 { margin-left: 0%; } .col-sm-offset-1 { margin-left: 8.3333333333%; } .col-sm-offset-2 { margin-left: 16.6666666667%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-4 { margin-left: 33.3333333333%; } .col-sm-offset-5 { margin-left: 41.6666666667%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-7 { margin-left: 58.3333333333%; } .col-sm-offset-8 { margin-left: 66.6666666667%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-10 { margin-left: 83.3333333333%; } .col-sm-offset-11 { margin-left: 91.6666666667%; } .col-sm-offset-12 { margin-left: 100%; } } @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-1 { width: 8.3333333333%; } .col-md-2 { width: 16.6666666667%; } .col-md-3 { width: 25%; } .col-md-4 { width: 33.3333333333%; } .col-md-5 { width: 41.6666666667%; } .col-md-6 { width: 50%; } .col-md-7 { width: 58.3333333333%; } .col-md-8 { width: 66.6666666667%; } .col-md-9 { width: 75%; } .col-md-10 { width: 83.3333333333%; } .col-md-11 { width: 91.6666666667%; } .col-md-12 { width: 100%; } .col-md-pull-0 { right: auto; } .col-md-pull-1 { right: 8.3333333333%; } .col-md-pull-2 { right: 16.6666666667%; } .col-md-pull-3 { right: 25%; } .col-md-pull-4 { right: 33.3333333333%; } .col-md-pull-5 { right: 41.6666666667%; } .col-md-pull-6 { right: 50%; } .col-md-pull-7 { right: 58.3333333333%; } .col-md-pull-8 { right: 66.6666666667%; } .col-md-pull-9 { right: 75%; } .col-md-pull-10 { right: 83.3333333333%; } .col-md-pull-11 { right: 91.6666666667%; } .col-md-pull-12 { right: 100%; } .col-md-push-0 { left: auto; } .col-md-push-1 { left: 8.3333333333%; } .col-md-push-2 { left: 16.6666666667%; } .col-md-push-3 { left: 25%; } .col-md-push-4 { left: 33.3333333333%; } .col-md-push-5 { left: 41.6666666667%; } .col-md-push-6 { left: 50%; } .col-md-push-7 { left: 58.3333333333%; } .col-md-push-8 { left: 66.6666666667%; } .col-md-push-9 { left: 75%; } .col-md-push-10 { left: 83.3333333333%; } .col-md-push-11 { left: 91.6666666667%; } .col-md-push-12 { left: 100%; } .col-md-offset-0 { margin-left: 0%; } .col-md-offset-1 { margin-left: 8.3333333333%; } .col-md-offset-2 { margin-left: 16.6666666667%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-4 { margin-left: 33.3333333333%; } .col-md-offset-5 { margin-left: 41.6666666667%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-7 { margin-left: 58.3333333333%; } .col-md-offset-8 { margin-left: 66.6666666667%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-10 { margin-left: 83.3333333333%; } .col-md-offset-11 { margin-left: 91.6666666667%; } .col-md-offset-12 { margin-left: 100%; } } @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-1 { width: 8.3333333333%; } .col-lg-2 { width: 16.6666666667%; } .col-lg-3 { width: 25%; } .col-lg-4 { width: 33.3333333333%; } .col-lg-5 { width: 41.6666666667%; } .col-lg-6 { width: 50%; } .col-lg-7 { width: 58.3333333333%; } .col-lg-8 { width: 66.6666666667%; } .col-lg-9 { width: 75%; } .col-lg-10 { width: 83.3333333333%; } .col-lg-11 { width: 91.6666666667%; } .col-lg-12 { width: 100%; } .col-lg-pull-0 { right: auto; } .col-lg-pull-1 { right: 8.3333333333%; } .col-lg-pull-2 { right: 16.6666666667%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-4 { right: 33.3333333333%; } .col-lg-pull-5 { right: 41.6666666667%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-7 { right: 58.3333333333%; } .col-lg-pull-8 { right: 66.6666666667%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-10 { right: 83.3333333333%; } .col-lg-pull-11 { right: 91.6666666667%; } .col-lg-pull-12 { right: 100%; } .col-lg-push-0 { left: auto; } .col-lg-push-1 { left: 8.3333333333%; } .col-lg-push-2 { left: 16.6666666667%; } .col-lg-push-3 { left: 25%; } .col-lg-push-4 { left: 33.3333333333%; } .col-lg-push-5 { left: 41.6666666667%; } .col-lg-push-6 { left: 50%; } .col-lg-push-7 { left: 58.3333333333%; } .col-lg-push-8 { left: 66.6666666667%; } .col-lg-push-9 { left: 75%; } .col-lg-push-10 { left: 83.3333333333%; } .col-lg-push-11 { left: 91.6666666667%; } .col-lg-push-12 { left: 100%; } .col-lg-offset-0 { margin-left: 0%; } .col-lg-offset-1 { margin-left: 8.3333333333%; } .col-lg-offset-2 { margin-left: 16.6666666667%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-4 { margin-left: 33.3333333333%; } .col-lg-offset-5 { margin-left: 41.6666666667%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-7 { margin-left: 58.3333333333%; } .col-lg-offset-8 { margin-left: 66.6666666667%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-10 { margin-left: 83.3333333333%; } .col-lg-offset-11 { margin-left: 91.6666666667%; } .col-lg-offset-12 { margin-left: 100%; } } table { background-color: #181818; } caption { padding-top: 8px; padding-bottom: 8px; color: #888; text-align: left; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, .table > thead > tr > td, .table > tbody > tr > th, .table > tbody > tr > td, .table > tfoot > tr > th, .table > tfoot > tr > td { padding: 8px; line-height: 1.428571429; vertical-align: top; border-top: 1px solid #282828; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #282828; } .table > caption + thead > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > th, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #282828; } .table .table { background-color: #060606; } .table-condensed > thead > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > th, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > th, .table-condensed > tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #282828; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > th, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > th, .table-bordered > tfoot > tr > td { border: 1px solid #282828; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-of-type(odd) { background-color: #090808; } .table-hover > tbody > tr:hover { background-color: #282828; } table col[class*="col-"] { position: static; float: none; display: table-column; } table td[class*="col-"], table th[class*="col-"] { position: static; float: none; display: table-cell; } .table > thead > tr > td.active, .table > thead > tr > th.active, .table > thead > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr > td.active, .table > tbody > tr > th.active, .table > tbody > tr.active > td, .table > tbody > tr.active > th, .table > tfoot > tr > td.active, .table > tfoot > tr > th.active, .table > tfoot > tr.active > td, .table > tfoot > tr.active > th { background-color: #282828; } .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: #1b1b1b; } .table > thead > tr > td.success, .table > thead > tr > th.success, .table > thead > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr > td.success, .table > tbody > tr > th.success, .table > tbody > tr.success > td, .table > tbody > tr.success > th, .table > tfoot > tr > td.success, .table > tfoot > tr > th.success, .table > tfoot > tr.success > td, .table > tfoot > tr.success > th { background-color: #77B300; } .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: #669a00; } .table > thead > tr > td.info, .table > thead > tr > th.info, .table > thead > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr > td.info, .table > tbody > tr > th.info, .table > tbody > tr.info > td, .table > tbody > tr.info > th, .table > tfoot > tr > td.info, .table > tfoot > tr > th.info, .table > tfoot > tr.info > td, .table > tfoot > tr.info > th { background-color: #9933CC; } .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: #8a2eb8; } .table > thead > tr > td.warning, .table > thead > tr > th.warning, .table > thead > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr > td.warning, .table > tbody > tr > th.warning, .table > tbody > tr.warning > td, .table > tbody > tr.warning > th, .table > tfoot > tr > td.warning, .table > tfoot > tr > th.warning, .table > tfoot > tr.warning > td, .table > tfoot > tr.warning > th { background-color: #FF8800; } .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: #e67a00; } .table > thead > tr > td.danger, .table > thead > tr > th.danger, .table > thead > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr > td.danger, .table > tbody > tr > th.danger, .table > tbody > tr.danger > td, .table > tbody > tr.danger > th, .table > tfoot > tr > td.danger, .table > tfoot > tr > th.danger, .table > tfoot > tr.danger > td, .table > tfoot > tr.danger > th { background-color: #CC0000; } .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: #b30000; } .table-responsive { overflow-x: auto; min-height: 0.01%; } @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 #282828; } .table-responsive > .table { margin-bottom: 0; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > th, .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 > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > th: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 > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > th: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 > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { padding: 0; margin: 0; border: 0; min-width: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: inherit; color: #888; border: 0; border-bottom: 1px solid #282828; } 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: 9px; font-size: 14px; line-height: 1.428571429; color: #888; } .form-control { display: block; width: 100%; height: 38px; padding: 8px 12px; font-size: 14px; line-height: 1.428571429; color: #888; background-color: #fff; background-image: none; border: 1px solid #282828; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; } .form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); } .form-control::-moz-placeholder { color: #888; opacity: 1; } .form-control:-ms-input-placeholder { color: #888; } .form-control::-webkit-input-placeholder { color: #888; } .form-control::-ms-expand { border: 0; background-color: transparent; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background-color: #ADAFAE; 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: 38px; } input[type="date"].input-sm, .input-group-sm > input[type="date"].form-control, .input-group-sm > input[type="date"].input-group-addon, .input-group-sm > .input-group-btn > input[type="date"].btn, .input-group-sm input[type="date"], input[type="time"].input-sm, .input-group-sm > input[type="time"].form-control, .input-group-sm > input[type="time"].input-group-addon, .input-group-sm > .input-group-btn > input[type="time"].btn, .input-group-sm input[type="time"], input[type="datetime-local"].input-sm, .input-group-sm > input[type="datetime-local"].form-control, .input-group-sm > input[type="datetime-local"].input-group-addon, .input-group-sm > .input-group-btn > input[type="datetime-local"].btn, .input-group-sm input[type="datetime-local"], input[type="month"].input-sm, .input-group-sm > input[type="month"].form-control, .input-group-sm > input[type="month"].input-group-addon, .input-group-sm > .input-group-btn > input[type="month"].btn, .input-group-sm input[type="month"] { line-height: 30px; } input[type="date"].input-lg, .input-group-lg > input[type="date"].form-control, .input-group-lg > input[type="date"].input-group-addon, .input-group-lg > .input-group-btn > input[type="date"].btn, .input-group-lg input[type="date"], input[type="time"].input-lg, .input-group-lg > input[type="time"].form-control, .input-group-lg > input[type="time"].input-group-addon, .input-group-lg > .input-group-btn > input[type="time"].btn, .input-group-lg input[type="time"], input[type="datetime-local"].input-lg, .input-group-lg > input[type="datetime-local"].form-control, .input-group-lg > input[type="datetime-local"].input-group-addon, .input-group-lg > .input-group-btn > input[type="datetime-local"].btn, .input-group-lg input[type="datetime-local"], input[type="month"].input-lg, .input-group-lg > input[type="month"].form-control, .input-group-lg > input[type="month"].input-group-addon, .input-group-lg > .input-group-btn > input[type="month"].btn, .input-group-lg input[type="month"] { line-height: 54px; } } .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-left: -20px; margin-top: 4px \9; } .radio + .radio, .checkbox + .checkbox { margin-top: -5px; } .radio-inline, .checkbox-inline { position: relative; display: inline-block; padding-left: 20px; margin-bottom: 0; vertical-align: middle; font-weight: normal; cursor: pointer; } .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-top: 0; margin-left: 10px; } input[type="radio"][disabled], input[type="radio"].disabled, fieldset[disabled] input[type="radio"], input[type="checkbox"][disabled], input[type="checkbox"].disabled, fieldset[disabled] input[type="checkbox"] { cursor: not-allowed; } .radio-inline.disabled, fieldset[disabled] .radio-inline, .checkbox-inline.disabled, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .radio.disabled label, fieldset[disabled] .radio label, .checkbox.disabled label, fieldset[disabled] .checkbox label { cursor: not-allowed; } .form-control-static { padding-top: 9px; padding-bottom: 9px; margin-bottom: 0; min-height: 34px; } .form-control-static.input-lg, .input-group-lg > .form-control-static.form-control, .input-group-lg > .form-control-static.input-group-addon, .input-group-lg > .input-group-btn > .form-control-static.btn, .form-control-static.input-sm, .input-group-sm > .form-control-static.form-control, .input-group-sm > .form-control-static.input-group-addon, .input-group-sm > .input-group-btn > .form-control-static.btn { padding-left: 0; padding-right: 0; } .input-sm, .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-sm, .input-group-sm > select.form-control, .input-group-sm > select.input-group-addon, .input-group-sm > .input-group-btn > select.btn { height: 30px; line-height: 30px; } textarea.input-sm, .input-group-sm > textarea.form-control, .input-group-sm > textarea.input-group-addon, .input-group-sm > .input-group-btn > textarea.btn, select[multiple].input-sm, .input-group-sm > select[multiple].form-control, .input-group-sm > select[multiple].input-group-addon, .input-group-sm > .input-group-btn > select[multiple].btn { 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, .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 54px; padding: 14px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } select.input-lg, .input-group-lg > select.form-control, .input-group-lg > select.input-group-addon, .input-group-lg > .input-group-btn > select.btn { height: 54px; line-height: 54px; } textarea.input-lg, .input-group-lg > textarea.form-control, .input-group-lg > textarea.input-group-addon, .input-group-lg > .input-group-btn > textarea.btn, select[multiple].input-lg, .input-group-lg > select[multiple].form-control, .input-group-lg > select[multiple].input-group-addon, .input-group-lg > .input-group-btn > select[multiple].btn { height: auto; } .form-group-lg .form-control { height: 54px; padding: 14px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } .form-group-lg select.form-control { height: 54px; line-height: 54px; } .form-group-lg textarea.form-control, .form-group-lg select[multiple].form-control { height: auto; } .form-group-lg .form-control-static { height: 54px; min-height: 38px; padding: 15px 16px; font-size: 18px; line-height: 1.3333333; } .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 47.5px; } .form-control-feedback { position: absolute; top: 0; right: 0; z-index: 2; display: block; width: 38px; height: 38px; line-height: 38px; text-align: center; pointer-events: none; } .input-lg + .form-control-feedback, .input-group-lg > .form-control + .form-control-feedback, .input-group-lg > .input-group-addon + .form-control-feedback, .input-group-lg > .input-group-btn > .btn + .form-control-feedback, .input-group-lg + .form-control-feedback, .form-group-lg .form-control + .form-control-feedback { width: 54px; height: 54px; line-height: 54px; } .input-sm + .form-control-feedback, .input-group-sm > .form-control + .form-control-feedback, .input-group-sm > .input-group-addon + .form-control-feedback, .input-group-sm > .input-group-btn > .btn + .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: #fff; } .has-success .form-control { border-color: #fff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-success .form-control:focus { border-color: #e6e5e5; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px white; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px white; } .has-success .input-group-addon { color: #fff; border-color: #fff; background-color: #77B300; } .has-success .form-control-feedback { color: #fff; } .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: #fff; } .has-warning .form-control { border-color: #fff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-warning .form-control:focus { border-color: #e6e5e5; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px white; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px white; } .has-warning .input-group-addon { color: #fff; border-color: #fff; background-color: #FF8800; } .has-warning .form-control-feedback { color: #fff; } .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: #fff; } .has-error .form-control { border-color: #fff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-error .form-control:focus { border-color: #e6e5e5; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px white; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px white; } .has-error .input-group-addon { color: #fff; border-color: #fff; background-color: #CC0000; } .has-error .form-control-feedback { color: #fff; } .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: #c8c8c8; } @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 { margin-top: 0; margin-bottom: 0; padding-top: 9px; } .form-horizontal .radio, .form-horizontal .checkbox { min-height: 29px; } .form-horizontal .form-group { margin-left: -15px; margin-right: -15px; } .form-horizontal .form-group:before, .form-horizontal .form-group:after { content: " "; display: table; } .form-horizontal .form-group:after { clear: both; } @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; margin-bottom: 0; padding-top: 9px; } } .form-horizontal .has-feedback .form-control-feedback { right: 15px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { padding-top: 15px; font-size: 18px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { padding-top: 6px; font-size: 12px; } } .btn { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 8px 12px; font-size: 14px; line-height: 1.428571429; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .btn:focus, .btn.focus, .btn:active:focus, .btn:active.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: #fff; text-decoration: none; } .btn:active, .btn.active { outline: 0; background-image: none; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } a.btn.disabled, fieldset[disabled] a.btn { pointer-events: none; } .btn-default { color: #fff; background-color: #424141; border-color: #424141; } .btn-default:focus, .btn-default.focus { color: #fff; background-color: #282828; border-color: #020202; } .btn-default:hover { color: #fff; background-color: #282828; border-color: #232323; } .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle { color: #fff; background-color: #282828; border-color: #232323; } .btn-default:active:hover, .btn-default:active:focus, .btn-default:active.focus, .btn-default.active:hover, .btn-default.active:focus, .btn-default.active.focus, .open > .btn-default.dropdown-toggle:hover, .open > .btn-default.dropdown-toggle:focus, .open > .btn-default.dropdown-toggle.focus { color: #fff; background-color: #161616; border-color: #020202; } .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle { background-image: none; } .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled.focus, .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default.focus { background-color: #424141; border-color: #424141; } .btn-default .badge { color: #424141; background-color: #fff; } .btn-primary { color: #fff; background-color: #2A9FD6; border-color: #2A9FD6; } .btn-primary:focus, .btn-primary.focus { color: #fff; background-color: #2180ac; border-color: #15506c; } .btn-primary:hover { color: #fff; background-color: #2180ac; border-color: #1f79a3; } .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle { color: #fff; background-color: #2180ac; border-color: #1f79a3; } .btn-primary:active:hover, .btn-primary:active:focus, .btn-primary:active.focus, .btn-primary.active:hover, .btn-primary.active:focus, .btn-primary.active.focus, .open > .btn-primary.dropdown-toggle:hover, .open > .btn-primary.dropdown-toggle:focus, .open > .btn-primary.dropdown-toggle.focus { color: #fff; background-color: #1b698e; border-color: #15506c; } .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle { background-image: none; } .btn-primary.disabled:hover, .btn-primary.disabled:focus, .btn-primary.disabled.focus, .btn-primary[disabled]:hover, .btn-primary[disabled]:focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary:hover, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary.focus { background-color: #2A9FD6; border-color: #2A9FD6; } .btn-primary .badge { color: #2A9FD6; background-color: #fff; } .btn-success { color: #fff; background-color: #77B300; border-color: #77B300; } .btn-success:focus, .btn-success.focus { color: #fff; background-color: #558000; border-color: #223400; } .btn-success:hover { color: #fff; background-color: #558000; border-color: #4e7600; } .btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle { color: #fff; background-color: #558000; border-color: #4e7600; } .btn-success:active:hover, .btn-success:active:focus, .btn-success:active.focus, .btn-success.active:hover, .btn-success.active:focus, .btn-success.active.focus, .open > .btn-success.dropdown-toggle:hover, .open > .btn-success.dropdown-toggle:focus, .open > .btn-success.dropdown-toggle.focus { color: #fff; background-color: #3d5c00; border-color: #223400; } .btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle { background-image: none; } .btn-success.disabled:hover, .btn-success.disabled:focus, .btn-success.disabled.focus, .btn-success[disabled]:hover, .btn-success[disabled]:focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success:hover, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success.focus { background-color: #77B300; border-color: #77B300; } .btn-success .badge { color: #77B300; background-color: #fff; } .btn-info { color: #fff; background-color: #9933CC; border-color: #9933CC; } .btn-info:focus, .btn-info.focus { color: #fff; background-color: #7a29a3; border-color: #4d1a66; } .btn-info:hover { color: #fff; background-color: #7a29a3; border-color: #74279b; } .btn-info:active, .btn-info.active, .open > .btn-info.dropdown-toggle { color: #fff; background-color: #7a29a3; border-color: #74279b; } .btn-info:active:hover, .btn-info:active:focus, .btn-info:active.focus, .btn-info.active:hover, .btn-info.active:focus, .btn-info.active.focus, .open > .btn-info.dropdown-toggle:hover, .open > .btn-info.dropdown-toggle:focus, .open > .btn-info.dropdown-toggle.focus { color: #fff; background-color: #652287; border-color: #4d1a66; } .btn-info:active, .btn-info.active, .open > .btn-info.dropdown-toggle { background-image: none; } .btn-info.disabled:hover, .btn-info.disabled:focus, .btn-info.disabled.focus, .btn-info[disabled]:hover, .btn-info[disabled]:focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info:hover, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info.focus { background-color: #9933CC; border-color: #9933CC; } .btn-info .badge { color: #9933CC; background-color: #fff; } .btn-warning { color: #fff; background-color: #FF8800; border-color: #FF8800; } .btn-warning:focus, .btn-warning.focus { color: #fff; background-color: #cc6d00; border-color: #804400; } .btn-warning:hover { color: #fff; background-color: #cc6d00; border-color: #c26700; } .btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle { color: #fff; background-color: #cc6d00; border-color: #c26700; } .btn-warning:active:hover, .btn-warning:active:focus, .btn-warning:active.focus, .btn-warning.active:hover, .btn-warning.active:focus, .btn-warning.active.focus, .open > .btn-warning.dropdown-toggle:hover, .open > .btn-warning.dropdown-toggle:focus, .open > .btn-warning.dropdown-toggle.focus { color: #fff; background-color: #a85a00; border-color: #804400; } .btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle { background-image: none; } .btn-warning.disabled:hover, .btn-warning.disabled:focus, .btn-warning.disabled.focus, .btn-warning[disabled]:hover, .btn-warning[disabled]:focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning:hover, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning.focus { background-color: #FF8800; border-color: #FF8800; } .btn-warning .badge { color: #FF8800; background-color: #fff; } .btn-danger { color: #fff; background-color: #CC0000; border-color: #CC0000; } .btn-danger:focus, .btn-danger.focus { color: #fff; background-color: #990000; border-color: #4d0000; } .btn-danger:hover { color: #fff; background-color: #990000; border-color: #8f0000; } .btn-danger:active, .btn-danger.active, .open > .btn-danger.dropdown-toggle { color: #fff; background-color: #990000; border-color: #8f0000; } .btn-danger:active:hover, .btn-danger:active:focus, .btn-danger:active.focus, .btn-danger.active:hover, .btn-danger.active:focus, .btn-danger.active.focus, .open > .btn-danger.dropdown-toggle:hover, .open > .btn-danger.dropdown-toggle:focus, .open > .btn-danger.dropdown-toggle.focus { color: #fff; background-color: #750000; border-color: #4d0000; } .btn-danger:active, .btn-danger.active, .open > .btn-danger.dropdown-toggle { background-image: none; } .btn-danger.disabled:hover, .btn-danger.disabled:focus, .btn-danger.disabled.focus, .btn-danger[disabled]:hover, .btn-danger[disabled]:focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger:hover, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger.focus { background-color: #CC0000; border-color: #CC0000; } .btn-danger .badge { color: #CC0000; background-color: #fff; } .btn-link { color: #2A9FD6; font-weight: normal; 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: #2A9FD6; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:hover, fieldset[disabled] .btn-link:focus { color: #888; text-decoration: none; } .btn-lg, .btn-group-lg > .btn { padding: 14px 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 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.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-property: height, visibility; transition-property: height, visibility; -webkit-transition-duration: 0.35s; transition-duration: 0.35s; -webkit-transition-timing-function: ease; transition-timing-function: ease; } .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; list-style: none; font-size: 14px; text-align: left; background-color: #222; border: 1px solid #444; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 4px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: rgba(255, 255, 255, 0.1); } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.428571429; color: #fff; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { text-decoration: none; color: #fff; background-color: #2A9FD6; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #fff; text-decoration: none; outline: 0; background-color: #2A9FD6; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #888; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); cursor: not-allowed; } .open > .dropdown-menu { display: block; } .open > a { outline: 0; } .dropdown-menu-right { left: auto; right: 0; } .dropdown-menu-left { left: 0; right: auto; } .dropdown-header { display: block; padding: 3px 20px; font-size: 12px; line-height: 1.428571429; color: #888; white-space: nowrap; } .dropdown-backdrop { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px dashed; border-bottom: 4px solid \9; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 2px; } @media (min-width: 1024px) { .navbar-right .dropdown-menu { right: 0; left: auto; } .navbar-right .dropdown-menu-left { left: 0; right: auto; } } .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 > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn:hover, .btn-group-vertical > .btn:focus, .btn-group-vertical > .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:before, .btn-toolbar:after { content: " "; display: table; } .btn-toolbar:after { clear: both; } .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-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { border-bottom-left-radius: 0; border-top-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-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; } .btn-group > .btn-lg + .dropdown-toggle, .btn-group-lg.btn-group > .btn + .dropdown-toggle { padding-left: 12px; padding-right: 12px; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 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, .btn-group-lg > .btn .caret { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret, .dropup .btn-group-lg > .btn .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:before, .btn-group-vertical > .btn-group:after { content: " "; display: table; } .btn-group-vertical > .btn-group:after { clear: both; } .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-right-radius: 4px; border-top-left-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-top-right-radius: 0; border-top-left-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-right-radius: 0; border-top-left-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; border-collapse: separate; } .btn-group-justified > .btn, .btn-group-justified > .btn-group { float: none; display: table-cell; 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 input[type="checkbox"], [data-toggle="buttons"] > .btn-group > .btn input[type="radio"], [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-left: 0; padding-right: 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-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: 8px 12px; font-size: 14px; font-weight: normal; line-height: 1; color: #888; text-align: center; background-color: #ADAFAE; border: 1px solid #282828; border-radius: 4px; } .input-group-addon.input-sm, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .input-group-addon.btn { padding: 5px 10px; font-size: 12px; border-radius: 3px; } .input-group-addon.input-lg, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .input-group-addon.btn { padding: 14px 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-bottom-right-radius: 0; border-top-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-bottom-left-radius: 0; border-top-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 { margin-bottom: 0; padding-left: 0; list-style: none; } .nav:before, .nav:after { content: " "; display: table; } .nav:after { clear: both; } .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: #222; } .nav > li.disabled > a { color: #888; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #888; text-decoration: none; background-color: transparent; cursor: not-allowed; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #222; border-color: #2A9FD6; } .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 #282828; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.428571429; border: 1px solid transparent; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: transparent transparent #282828; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #fff; background-color: #2A9FD6; border: 1px solid #282828; border-bottom-color: transparent; cursor: default; } .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: #2A9FD6; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified, .nav-tabs.nav-justified { width: 100%; } .nav-justified > li, .nav-tabs.nav-justified > li { float: none; } .nav-justified > li > a, .nav-tabs.nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-justified > li, .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } .nav-justified > li > a, .nav-tabs.nav-justified > li > a { margin-bottom: 0; } } .nav-tabs-justified, .nav-tabs.nav-justified { border-bottom: 0; } .nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:focus { border: 1px solid #ddd; } @media (min-width: 768px) { .nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a { border-bottom: 1px solid #ddd; border-radius: 4px 4px 0 0; } .nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:focus { border-bottom-color: #060606; } } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar { position: relative; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; } .navbar:before, .navbar:after { content: " "; display: table; } .navbar:after { clear: both; } @media (min-width: 1024px) { .navbar { border-radius: 4px; } } .navbar-header:before, .navbar-header:after { content: " "; display: table; } .navbar-header:after { clear: both; } @media (min-width: 1024px) { .navbar-header { float: left; } } .navbar-collapse { overflow-x: visible; padding-right: 15px; padding-left: 15px; border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); -webkit-overflow-scrolling: touch; } .navbar-collapse:before, .navbar-collapse:after { content: " "; display: table; } .navbar-collapse:after { clear: both; } .navbar-collapse.in { overflow-y: auto; } @media (min-width: 1024px) { .navbar-collapse { width: auto; border-top: 0; 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-left: 0; padding-right: 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 > .navbar-collapse, .container-fluid > .navbar-header, .container-fluid > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 1024px) { .container > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-header, .container-fluid > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { z-index: 1000; border-width: 0 0 1px; } @media (min-width: 1024px) { .navbar-static-top { border-radius: 0; } } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; } @media (min-width: 1024px) { .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; padding: 15px 15px; font-size: 18px; line-height: 20px; height: 50px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-brand > img { display: block; } @media (min-width: 1024px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; margin-right: 15px; padding: 9px 10px; margin-top: 8px; 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: 1024px) { .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; 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: 1024px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; } } .navbar-form { margin-left: -15px; margin-right: -15px; padding: 10px 15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); margin-top: 6px; margin-bottom: 6px; } @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: 1024px) { .navbar-form { width: auto; border: 0; margin-left: 0; margin-right: 0; padding-top: 0; padding-bottom: 0; -webkit-box-shadow: none; box-shadow: none; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { margin-bottom: 0; border-top-right-radius: 4px; border-top-left-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-btn { margin-top: 6px; margin-bottom: 6px; } .navbar-btn.btn-sm, .btn-group-sm > .navbar-btn.btn { margin-top: 10px; margin-bottom: 10px; } .navbar-btn.btn-xs, .btn-group-xs > .navbar-btn.btn { margin-top: 14px; margin-bottom: 14px; } .navbar-text { margin-top: 15px; margin-bottom: 15px; } @media (min-width: 1024px) { .navbar-text { float: left; margin-left: 15px; margin-right: 15px; } } @media (min-width: 1024px) { .navbar-left { float: left !important; } .navbar-right { float: right !important; margin-right: -15px; } .navbar-right ~ .navbar-right { margin-right: 0; } } .navbar-default { background-color: #060606; border-color: #282828; } .navbar-default .navbar-brand { color: #fff; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #fff; background-color: transparent; } .navbar-default .navbar-text { color: #888; } .navbar-default .navbar-nav > li > a { color: #888; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #fff; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #fff; background-color: transparent; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #888; background-color: transparent; } .navbar-default .navbar-toggle { border-color: #282828; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #282828; } .navbar-default .navbar-toggle .icon-bar { background-color: #ccc; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #282828; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { background-color: transparent; color: #fff; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #888; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #fff; 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: #fff; background-color: transparent; } .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: #888; background-color: transparent; } } .navbar-default .navbar-link { color: #888; } .navbar-default .navbar-link:hover { color: #fff; } .navbar-default .btn-link { color: #888; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #fff; } .navbar-default .btn-link[disabled]:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:hover, fieldset[disabled] .navbar-default .btn-link:focus { color: #888; } .navbar-inverse { background-color: #222; border-color: #090808; } .navbar-inverse .navbar-brand { color: #fff; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-text { color: #888; } .navbar-inverse .navbar-nav > li > a { color: #888; } .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: transparent; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #aaa; 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 { background-color: transparent; color: #fff; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: #090808; } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: #090808; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #888; } .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: transparent; } .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: #aaa; background-color: transparent; } } .navbar-inverse .navbar-link { color: #888; } .navbar-inverse .navbar-link:hover { color: #fff; } .navbar-inverse .btn-link { color: #888; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #fff; } .navbar-inverse .btn-link[disabled]:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:hover, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #aaa; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #222; border-radius: 4px; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { content: "/ "; padding: 0 5px; color: #fff; } .breadcrumb > .active { color: #888; } .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: 8px 12px; line-height: 1.428571429; text-decoration: none; color: #fff; background-color: #222; border: 1px solid #282828; margin-left: -1px; } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left: 0; border-bottom-left-radius: 4px; border-top-left-radius: 4px; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-bottom-right-radius: 4px; border-top-right-radius: 4px; } .pagination > li > a:hover, .pagination > li > a:focus, .pagination > li > span:hover, .pagination > li > span:focus { z-index: 2; color: #fff; background-color: #2A9FD6; border-color: transparent; } .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { z-index: 3; color: #fff; background-color: #2A9FD6; border-color: transparent; cursor: default; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #888; background-color: #222; border-color: #282828; cursor: not-allowed; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 14px 16px; font-size: 18px; line-height: 1.3333333; } .pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { border-bottom-left-radius: 6px; border-top-left-radius: 6px; } .pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { border-bottom-right-radius: 6px; border-top-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-bottom-left-radius: 3px; border-top-left-radius: 3px; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-bottom-right-radius: 3px; border-top-right-radius: 3px; } .pager { padding-left: 0; margin: 20px 0; list-style: none; text-align: center; } .pager:before, .pager:after { content: " "; display: table; } .pager:after { clear: both; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #222; border: 1px solid #282828; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #2A9FD6; } .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: #888; background-color: #222; cursor: not-allowed; } .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; } .label:empty { display: none; } .btn .label { position: relative; top: -1px; } a.label:hover, a.label:focus { color: #fff; text-decoration: none; cursor: pointer; } .label-default { background-color: #424141; } .label-default[href]:hover, .label-default[href]:focus { background-color: #282828; } .label-primary { background-color: #2A9FD6; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #2180ac; } .label-success { background-color: #77B300; } .label-success[href]:hover, .label-success[href]:focus { background-color: #558000; } .label-info { background-color: #9933CC; } .label-info[href]:hover, .label-info[href]:focus { background-color: #7a29a3; } .label-warning { background-color: #FF8800; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #cc6d00; } .label-danger { background-color: #CC0000; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #990000; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: bold; color: #fff; line-height: 1; vertical-align: middle; white-space: nowrap; text-align: center; background-color: #2A9FD6; border-radius: 10px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .btn-xs .badge, .btn-group-xs > .btn .badge, .btn-group-xs > .btn .badge { top: 0; padding: 1px 5px; } .list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #2A9FD6; 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; } a.badge:hover, a.badge:focus { color: #fff; text-decoration: none; cursor: pointer; } .jumbotron { padding-top: 30px; padding-bottom: 30px; margin-bottom: 30px; color: inherit; background-color: #151515; } .jumbotron h1, .jumbotron .h1 { color: inherit; } .jumbotron p { margin-bottom: 15px; font-size: 21px; font-weight: 200; } .jumbotron > hr { border-top-color: black; } .container .jumbotron, .container-fluid .jumbotron { border-radius: 6px; padding-left: 15px; padding-right: 15px; } .jumbotron .container { max-width: 100%; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .jumbotron, .container-fluid .jumbotron { padding-left: 60px; padding-right: 60px; } .jumbotron h1, .jumbotron .h1 { font-size: 63px; } } .thumbnail { display: block; padding: 4px; margin-bottom: 20px; line-height: 1.428571429; background-color: #282828; border: 1px solid #282828; border-radius: 4px; -webkit-transition: border 0.2s ease-in-out; -o-transition: border 0.2s ease-in-out; transition: border 0.2s ease-in-out; } .thumbnail > img, .thumbnail a > img { display: block; max-width: 100%; height: auto; margin-left: auto; margin-right: auto; } .thumbnail .caption { padding: 9px; color: #888; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #2A9FD6; } .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 { background-color: #77B300; border-color: #809a00; color: #fff; } .alert-success hr { border-top-color: #6a8000; } .alert-success .alert-link { color: #e6e5e5; } .alert-info { background-color: #9933CC; border-color: #6e2caf; color: #fff; } .alert-info hr { border-top-color: #61279b; } .alert-info .alert-link { color: #e6e5e5; } .alert-warning { background-color: #FF8800; border-color: #f05800; color: #fff; } .alert-warning hr { border-top-color: #d64f00; } .alert-warning .alert-link { color: #e6e5e5; } .alert-danger { background-color: #CC0000; border-color: #bd001f; color: #fff; } .alert-danger hr { border-top-color: #a3001b; } .alert-danger .alert-link { color: #e6e5e5; } @-webkit-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 { overflow: hidden; height: 20px; margin-bottom: 20px; background-color: #222; border-radius: 4px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 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: #2A9FD6; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .progress-bar, .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); 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: #77B300; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #9933CC; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #FF8800; } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #CC0000; } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media, .media-body { zoom: 1; overflow: hidden; } .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 { margin-bottom: 20px; padding-left: 0; } .list-group-item { position: relative; display: block; padding: 10px 15px; margin-bottom: -1px; background-color: #222; border: 1px solid #282828; } .list-group-item:first-child { border-top-right-radius: 4px; border-top-left-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: #888; } a.list-group-item .list-group-item-heading, button.list-group-item .list-group-item-heading { color: #fff; } a.list-group-item:hover, a.list-group-item:focus, button.list-group-item:hover, button.list-group-item:focus { text-decoration: none; color: #888; background-color: #484848; } button.list-group-item { width: 100%; text-align: left; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { background-color: #ADAFAE; color: #888; cursor: not-allowed; } .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: #888; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #fff; background-color: #2A9FD6; border-color: #2A9FD6; } .list-group-item.active .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active:focus .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: #d5ecf7; } .list-group-item-success { color: #fff; background-color: #77B300; } a.list-group-item-success, button.list-group-item-success { color: #fff; } 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, a.list-group-item-success:focus, button.list-group-item-success:hover, button.list-group-item-success:focus { color: #fff; background-color: #669a00; } a.list-group-item-success.active, a.list-group-item-success.active:hover, a.list-group-item-success.active:focus, button.list-group-item-success.active, button.list-group-item-success.active:hover, button.list-group-item-success.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .list-group-item-info { color: #fff; background-color: #9933CC; } a.list-group-item-info, button.list-group-item-info { color: #fff; } 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, a.list-group-item-info:focus, button.list-group-item-info:hover, button.list-group-item-info:focus { color: #fff; background-color: #8a2eb8; } a.list-group-item-info.active, a.list-group-item-info.active:hover, a.list-group-item-info.active:focus, button.list-group-item-info.active, button.list-group-item-info.active:hover, button.list-group-item-info.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .list-group-item-warning { color: #fff; background-color: #FF8800; } a.list-group-item-warning, button.list-group-item-warning { color: #fff; } 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, a.list-group-item-warning:focus, button.list-group-item-warning:hover, button.list-group-item-warning:focus { color: #fff; background-color: #e67a00; } a.list-group-item-warning.active, a.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus, button.list-group-item-warning.active, button.list-group-item-warning.active:hover, button.list-group-item-warning.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .list-group-item-danger { color: #fff; background-color: #CC0000; } a.list-group-item-danger, button.list-group-item-danger { color: #fff; } 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, a.list-group-item-danger:focus, button.list-group-item-danger:hover, button.list-group-item-danger:focus { color: #fff; background-color: #b30000; } a.list-group-item-danger.active, a.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus, button.list-group-item-danger.active, button.list-group-item-danger.active:hover, button.list-group-item-danger.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .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: #222; border: 1px solid transparent; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); } .panel-body { padding: 15px; } .panel-body:before, .panel-body:after { content: " "; display: table; } .panel-body:after { clear: both; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-right-radius: 3px; border-top-left-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: #3c3b3b; border-top: 1px solid #282828; 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-right-radius: 3px; border-top-left-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-right-radius: 0; border-top-left-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-left: 15px; padding-right: 15px; } .panel > .table:first-child, .panel > .table-responsive:first-child > .table:first-child { border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel > .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 > thead: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:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .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 th:first-child, .panel > .table-responsive:first-child > .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 th:first-child { border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .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 th:last-child, .panel > .table-responsive:first-child > .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 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:last-child > tfoot:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .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 th:first-child, .panel > .table-responsive:last-child > .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 th:first-child { border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .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 th:last-child, .panel > .table-responsive:last-child > .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 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 #282828; } .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-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th: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-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th: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-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { border-bottom: 0; } .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { border: 0; margin-bottom: 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 #282828; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #282828; } .panel-default { border-color: #282828; } .panel-default > .panel-heading { color: #888; background-color: #3c3b3b; border-color: #282828; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #282828; } .panel-default > .panel-heading .badge { color: #3c3b3b; background-color: #888; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #282828; } .panel-primary { border-color: #2A9FD6; } .panel-primary > .panel-heading { color: #fff; background-color: #2A9FD6; border-color: #2A9FD6; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #2A9FD6; } .panel-primary > .panel-heading .badge { color: #2A9FD6; background-color: #fff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #2A9FD6; } .panel-success { border-color: #809a00; } .panel-success > .panel-heading { color: #fff; background-color: #77B300; border-color: #809a00; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #809a00; } .panel-success > .panel-heading .badge { color: #77B300; background-color: #fff; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #809a00; } .panel-info { border-color: #6e2caf; } .panel-info > .panel-heading { color: #fff; background-color: #9933CC; border-color: #6e2caf; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #6e2caf; } .panel-info > .panel-heading .badge { color: #9933CC; background-color: #fff; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #6e2caf; } .panel-warning { border-color: #f05800; } .panel-warning > .panel-heading { color: #fff; background-color: #FF8800; border-color: #f05800; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #f05800; } .panel-warning > .panel-heading .badge { color: #FF8800; background-color: #fff; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #f05800; } .panel-danger { border-color: #bd001f; } .panel-danger > .panel-heading { color: #fff; background-color: #CC0000; border-color: #bd001f; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #bd001f; } .panel-danger > .panel-heading .badge { color: #CC0000; background-color: #fff; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #bd001f; } .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; left: 0; bottom: 0; height: 100%; width: 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: #151515; border: 1px solid #030303; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 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; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; opacity: 0.5; filter: alpha(opacity=50); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .modal-open { overflow: hidden; } .modal { display: none; overflow: hidden; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; -webkit-overflow-scrolling: touch; outline: 0; } .modal.fade .modal-dialog { -webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); -o-transform: translate(0, -25%); transform: translate(0, -25%); -webkit-transition: -webkit-transform 0.3s ease-out; -moz-transition: -moz-transform 0.3s ease-out; -o-transition: -o-transform 0.3s ease-out; transition: transform 0.3s ease-out; } .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: #201f1f; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); background-clip: padding-box; outline: 0; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; } .modal-backdrop.fade { opacity: 0; filter: alpha(opacity=0); } .modal-backdrop.in { opacity: 0.5; filter: alpha(opacity=50); } .modal-header { padding: 15px; border-bottom: 1px solid #282828; } .modal-header:before, .modal-header:after { content: " "; display: table; } .modal-header:after { clear: both; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.428571429; } .modal-body { position: relative; padding: 20px; } .modal-footer { padding: 20px; text-align: right; border-top: 1px solid #282828; } .modal-footer:before, .modal-footer:after { content: " "; display: table; } .modal-footer:after { clear: both; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .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, 0.5); box-shadow: 0 5px 15px rgba(0, 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: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; line-break: auto; line-height: 1.428571429; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; white-space: normal; word-break: normal; word-spacing: normal; word-wrap: normal; font-size: 12px; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.9; filter: alpha(opacity=90); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .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 { bottom: 0; right: 5px; 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: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; line-break: auto; line-height: 1.428571429; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; white-space: normal; word-break: normal; word-spacing: normal; word-wrap: normal; font-size: 14px; background-color: #201f1f; background-clip: padding-box; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; font-size: 14px; background-color: #181818; border-bottom: 1px solid #0b0b0b; 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 { border-width: 10px; content: ""; } .popover.top > .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #666666; border-top-color: fadein(rgba(0, 0, 0, 0.2), 5%); bottom: -11px; } .popover.top > .arrow:after { content: " "; bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #201f1f; } .popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #666666; border-right-color: fadein(rgba(0, 0, 0, 0.2), 5%); } .popover.right > .arrow:after { content: " "; left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #201f1f; } .popover.bottom > .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #666666; border-bottom-color: fadein(rgba(0, 0, 0, 0.2), 5%); top: -11px; } .popover.bottom > .arrow:after { content: " "; top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #201f1f; } .popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #666666; border-left-color: fadein(rgba(0, 0, 0, 0.2), 5%); } .popover.left > .arrow:after { content: " "; right: 1px; border-right-width: 0; border-left-color: #201f1f; bottom: -10px; } .carousel { position: relative; } .carousel-inner { position: relative; overflow: hidden; width: 100%; } .carousel-inner > .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; max-width: 100%; height: auto; line-height: 1; } @media all and (transform-3d), (-webkit-transform-3d) { .carousel-inner > .item { -webkit-transition: -webkit-transform 0.6s ease-in-out; -moz-transition: -moz-transform 0.6s ease-in-out; -o-transition: -o-transform 0.6s ease-in-out; transition: transform 0.6s ease-in-out; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; -webkit-perspective: 1000px; -moz-perspective: 1000px; perspective: 1000px; } .carousel-inner > .item.next, .carousel-inner > .item.active.right { -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0); left: 0; } .carousel-inner > .item.prev, .carousel-inner > .item.active.left { -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); left: 0; } .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right, .carousel-inner > .item.active { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); left: 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; left: 0; bottom: 0; width: 15%; opacity: 0.5; filter: alpha(opacity=50); font-size: 20px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); background-color: transparent; } .carousel-control.left { background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); } .carousel-control.right { left: auto; right: 0; background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); } .carousel-control:hover, .carousel-control:focus { outline: 0; color: #fff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; margin-top: -10px; z-index: 5; display: inline-block; } .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; line-height: 1; font-family: serif; } .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%; margin-left: -30%; padding-left: 0; list-style: none; text-align: center; } .carousel-indicators li { display: inline-block; width: 10px; height: 10px; margin: 1px; text-indent: -999px; border: 1px solid #fff; border-radius: 10px; cursor: pointer; background-color: #000 \9; background-color: transparent; } .carousel-indicators .active { margin: 0; width: 12px; height: 12px; background-color: #fff; } .carousel-caption { position: absolute; left: 15%; right: 15%; bottom: 20px; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 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 { left: 20%; right: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after { content: " "; display: table; } .clearfix:after { clear: both; } .center-block { display: block; margin-left: auto; margin-right: 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 { display: none !important; } .visible-sm { display: none !important; } .visible-md { display: none !important; } .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; } } .text-primary, .text-primary:hover { color: #2A9FD6; } .text-success, .text-success:hover { color: #77B300; } .text-danger, .text-danger:hover { color: #CC0000; } .text-warning, .text-warning:hover { color: #FF8800; } .text-info, .text-info:hover { color: #9933CC; } .bg-success, .bg-info, .bg-warning, .bg-danger { color: #fff; } table, .table { color: #fff; } table a:not(.btn), .table a:not(.btn) { color: #fff; text-decoration: underline; } table .dropdown-menu a, .table .dropdown-menu a { text-decoration: none; } table .text-muted, .table .text-muted { color: #888; } .table-responsive > .table { background-color: #181818; } .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, .has-warning .form-control-feedback { color: #FF8800; } .has-warning .form-control, .has-warning .form-control:focus, .has-warning .input-group-addon { border-color: #FF8800; } .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, .has-error .form-control-feedback { color: #CC0000; } .has-error .form-control, .has-error .form-control:focus, .has-error .input-group-addon { border-color: #CC0000; } .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, .has-success .form-control-feedback { color: #77B300; } .has-success .form-control, .has-success .form-control:focus, .has-success .input-group-addon { border-color: #77B300; } legend { color: #fff; } .input-group-addon { background-color: #424141; } .nav-tabs a, .nav-pills a, .breadcrumb a, .pager a { color: #fff; } .alert .alert-link, .alert a { color: #fff; text-decoration: underline; } .alert .close { text-decoration: none; } .close { color: #fff; text-decoration: none; opacity: 0.4; } .close:hover, .close:focus { color: #fff; opacity: 1; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #282828; } a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus { border-color: #282828; } a.list-group-item-success.active { background-color: #77B300; } a.list-group-item-success.active:hover, a.list-group-item-success.active:focus { background-color: #669a00; } a.list-group-item-warning.active { background-color: #FF8800; } a.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus { background-color: #e67a00; } a.list-group-item-danger.active { background-color: #CC0000; } a.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus { background-color: #b30000; } .jumbotron h1, .jumbotron h2, .jumbotron h3, .jumbotron h4, .jumbotron h5, .jumbotron h6 { color: #fff; } .Birthdays_event { cursor: auto !important; } .General_Meetings_event { cursor: auto !important; } .bb { background: white; border: 2px solid black; color: white; margin-bottom: 20px; margin-left: auto; margin-right: auto; padding: 3px; text-align: center; width: 1000px; } .bb a { color: black; } .bb_board { background: #274E13; min-height: 200px; padding: 5px; } .bb_frame { background: #E69138; border: 2px solid black; padding: 5px; text-align: left; } .bb_frame input { color: black; } .bb td { width: 33%; vertical-align: top; } .bb_title { border: 2px solid black; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; color: black; display: inline-block; font-size: 14pt; margin-bottom: 2px; padding: 2px 10px; } hr.documents_line { border-top: 1px solid #eee; } td.documents_line { border-right: 1px solid #eee; } .form_label { white-space: nowrap; } .db_listhead > td { padding-bottom: 2px; } .event label { padding-top: 0 !important; } td.help { padding: 0 10px; max-width: 960px; } .modal { max-width: 960px; min-width: 560px; overflow: auto; width: auto; } .navbar-collapse .navbar-nav.navbar-right:last-child { margin-right: 0; } .nav-stacked { width: auto; } .nav-stacked > li > a { padding: 0; } .tab-content { overflow: visible !important; } form, input, select, .table { margin-bottom: 0 !important; } div.checkbox { padding-top: 0 !important; } td.all_day { background-color: white; border: 1px black solid; padding: 2px; width: 150px; } #calendar { padding: 10px; } .calendar_component > table { padding: 10px; } td.calendar_date { font-size: 10pt; padding: 4px 5px; text-align: center; width: 250px; } .calendar_event_text { display: block; padding-left: 5px; } #calendar_foot { font-size: 13px; margin-bottom: 10px; padding: 2px; } .calendar_category, .calendar_location, .calendar_time { color: #777; font-size: 9pt; padding-right: 5px; } .calendar_notes { display: block; padding-left: 5px; } .calendar_posted_by { color: #777; padding-right: 5px; } table.days_view { border-collapse: separate; boder-spacing: 2px; margin: 0 auto; } .disabled_button, .disabled_button:active, .disabled_button:hover { background: transparent; border: none; box-shadow: none; color: inherit; float: none !important; margin-left: 0; margin-top: 0; } .event { border: 1px solid #999; color: #444; cursor: pointer; font-size: 10pt; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; padding: 1px 3px; } .event label { display: inline; } .other_calendar_label { color: #777; font-size: xx-small; text-align: center; } table.month_view { border: 1px solid black; width: 100%; } table.month_view td { background-color: white; border: 1px solid black; color: #444; font-size: 12pt; padding: 2px; } table.month_view th { background-color: #333; color: white; padding: 2px; width: 14%; } table.month_view td.day { vertical-align: top; } table.month_view td.non_day { background-color: #efefef; color: #757575; vertical-align: top; } table.month_view td.non_day b a { color: #757575; } #calendar .today { background-color: #9FEAFF; vertical-align: top; } .peak { background-color: #96DC9F !important; vertical-align: top; } .dpDateTD { background-color: #87CEFA; font-weight: bold; } .dpDateTD:hover { color: #4060ff; font-weight: bold; } .dpDayTD { background-color: #CCCCCC; color: white; } .dpDiv { background-image: url("../../images/calendar_background.gif"); background-size: 100% 100%; overflow: hidden; padding: 16px; width: 166px; } .dpTD:hover { background-color: #98DFFB; cursor: pointer; color: blue; } table.dp { color: black; font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 12px; height: 100%; text-align: center; width: 100%; } table.dp a { color: gray; text-decoration: none; } table.dp a:hover { color: blue; cursor: pointer; text-decoration: none; } div.date-field { vertical-align: middle; } .expandingArea { background: transparent; position: relative; } .expandingArea > textarea, .expandingArea > pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; } .expandingArea > textarea { /* The border-box box model is used to allow * padding whilst still keeping the overall width * at exactly that of the containing element. */ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; width: 100%; /* This height is used when JS is disabled */ height: 100px; } .expandingArea.active > textarea { /* Hide any scrollbars */ overflow: hidden; position: absolute; top: 0; left: 0; height: 100%; /* Remove WebKit user-resize widget */ resize: none; } .expandingArea > pre { display: none; } .expandingArea.active > pre { display: block; /* Hide the text; just using it for sizing */ visibility: hidden; } /* This stylesheet belongs to TextboxList - Copyright Guillermo Rauch <http://devthought.com> 2009 TextboxList is not priceless for commercial use. See <http://devthought.com/projects/mootools/textboxlist/> Purchase to remove copyright */ .textboxlist { background: #fff; cursor: text; font: 11px "Lucida Grande", Verdana; margin: 2px; } .textboxlist-bits { border: 1px inset #999; margin: 0; overflow: hidden; padding: 3px 4px 0; zoom: 1; *padding-bottom: 3px; } .textboxlist-bit { cursor: default; display: block; float: left; list-style-type: none; margin: 0 5px 3px 0; padding: 0; } .textboxlist-bit-editable { border: 1px solid #fff; } .textboxlist-bit-editable-input { border: 0; font: inherit; height: 14px; padding: 2px 0; *padding-bottom: 0; resize: none; overflow: hidden; margin: 0; outline: none; box-shadow: none !important; -mox-box-shadow: none !important; -webkit-box-shadow: none !important; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; } .textboxlist-bit-editable-input:focus { outline: none; box-shadow: none; -mox-box-shadow: none; -webkit-box-shadow: none; } .textboxlist-bit-box { background: #dee7f8; border: 1px solid #cad8f3; border-radius: 9px; cursor: default; line-height: 18px; padding: 0 5px; position: relative; -moz-border-radius: 5px; -webkit-border-radius: 9px; } .textboxlist-bit-box-deletable { padding-right: 15px; } .textboxlist-bit-box-deletebutton { background: url("../../images/close.gif"); display: block; font-size: 1px; height: 7px; position: absolute; right: 4px; top: 6px; width: 7px; } .textboxlist-bit-box-deletebutton:hover { background-position: 7px; border: none; text-decoration: none; } .textboxlist-bit-box-hover { background: #bbcef1; border: 1px solid #6d95e0; } .textboxlist-bit-box-focus { background: #598bec; border-color: #598bec; color: #fff; } .textboxlist-bit-box-focus .textboxlist-bit-box-deletebutton { background-position: bottom; } /* TextboxList Style guidelines This style doesn't necessarily have to be in a separate file. It's advisable not to set widths and margins from here, but instead apply it to a particular object or class (#id .textboxlist { width: xxx } or .class .textboxlist { width: xxx }) The padding-top + padding-left + height of ".textboxlist-bit-editable-input {}" has to match the line-height of ".textboxlist-bit-box {}" for UI consistency. The font configuration has to be present in .textboxlist and .textboxlist-bit-editable-input (for IE reasons) The *padding-bottom (notice the *) property of .textboxlist-bits {} has to be equal to the margin-bottom of .textboxlist-bit {} for IE reasons. The padding-top of .textboxlist ul {} has to match the margin-bottom of .textboxlist-bit, and the padding-bottom has to be null. Make sure the border-width of the .textboxlist-bit-editable {} is equal to the border-width of the box (a border that matches the background is advisable for the input) Feel free to edit the borders, fonts, backgrounds and radius. */ /* This stylesheet belongs to TextboxList - Copyright Guillermo Rauch <http://devthought.com> 2009 TextboxList is not priceless for commercial use. See <http://devthought.com/projects/mootools/textboxlist/> Purchase to remove copyright */ .textboxlist-autocomplete { position: absolute; z-index: 2; } .textboxlist-autocomplete-placeholder, .textboxlist-autocomplete-results { background: #eee; border: 1px solid #555; border-top: none; box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3); display: none; filter: alpha(opacity=90); opacity: 0.9; -moz-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3); } .textboxlist-autocomplete-placeholder { padding: 5px 7px; } .textboxlist-autocomplete-results { margin: 0; padding: 0; } .textboxlist-autocomplete-result { background: #eee; list-style-type: none; margin: 0; padding: 5px; } .textboxlist-autocomplete-result-focus { background: #c6d9e4; } .textboxlist-autocomplete-highlight { background: #eef0c4; font-weight: bold; } /* TextboxList.Autocomplete Style guidelines Try to keep .textboxlist-autocomplete {} as it is now If you apply custom styles to placeholder, also apply them to results, like it is now. .textboxlist-autocomplete-result {} needs a background for IE. */ .comment { color: #141823; margin-bottom: 4px; position: relative; } .comment .glyphicon { color: #9197a3; cursor: pointer; float: right; margin-right: 12px; } .comment_input { width: 100%; } .comment_input div { background: white; border: 1px solid #dcdee3; padding: 7px; } .comment_person { color: #3B5998; font-weight: bold; } .comment_text { margin-left: 40px; vertical-align: middle; } .comment_time { color: #9197A3; } .comments { background-color: #f6f7f8; border: 12px solid #f6f7f8; color: #141823; font-size: 12px; line-height: 16px; max-height: 300px; overflow: auto; } .comments img { border: 1px solid #dcdee3; height: 32px; margin-right: 8px; width: 32px; } .comments input { border: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; color: #141823; display: inline; font-size: 12px; height: 16px; outline: none; width: 100%; } .comments td { background-color: #f6f7f8; } .comments_divider { border-bottom: 1px solid #E9EAED; height: 1px; } .glyphicon-apple { margin-bottom: 2px; margin-top: -2px; } .likes { font-size: 12px; padding-bottom: 10px; padding-left: 12px; } .likes a, .likes a:focus { color: #6D84B4 !important; } .news_item { background: white; border: 1px solid; border-color: #e9eaed #dfe0e4 #d0d1d5; border-radius: 3px; color: #141823; margin-top: 10px; } .news_item a, .news_item a:hover { color: #365899; } .news_item > div:first-child { padding: 12px; white-space: pre-wrap; } .news_item h5 { color: #141823; } .news_item_dialog { width: 536px; } .news_item_header { color: #9197a3; font-size: 12px; margin-bottom: 11px; position: relative; } .news_item_header .glyphicon { cursor: pointer; float: right; } .news_item_header h5 { font-size: 14px; margin: 0; } .news_item_header img { height: 40px; margin-right: 8px; width: 40px; } .news_item_person { color: #3b5998; font-weight: bold; text-shadow: none; } .news_items { font-family: Helvetica,Arial,"lucida grande",tahoma,verdana,arial,sans-serif; margin: 0 auto 20px auto; width: 496px; } .post { background-color: #f6f7f8; border-top: 1px solid #E9EAED; padding: 8px; } .status { background: white; border: 1px solid; border-color: #e9eaed #dfe0e4 #d0d1d5; border-radius: 3px; margin: 0 auto; width: 496px; } .status .expandingArea { margin: 12px; width: 472px !important; } .status .glyphicon { color: #555; cursor: pointer; font-size: 20px; vertical-align: middle; } .status textarea { border: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; outline: none; resize: none; width: 472px !important; } .form_head td { padding: 5px; } .form_rows td { border-top: none !important; } .dropdown-submenu { position: relative; } .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -6px; margin-left: -100px; -webkit-border-radius: 0 6px 6px 6px; -moz-border-radius: 0 6px 6px 6px; border-radius: 0 6px 6px 6px; } .dropdown-submenu:hover > .dropdown-menu { display: block; } .dropdown-submenu > a:after { display: block; content: " "; float: right; width: 0; height: 0; border-color: transparent; border-style: solid; border-width: 5px 0 5px 5px; border-left-color: #cccccc; margin-top: 5px; margin-right: -10px; } .dropdown-submenu:hover > a:after { border-left-color: #ffffff; } .dropdown-submenu.pull-left { float: none; } .dropdown-submenu.pull-left > .dropdown-menu { left: -100%; margin-left: 10px; -webkit-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px; } select { width: initial; }
zenlunatics/template
themes/cyborg/cyborg.css
CSS
gpl-3.0
168,794
/* * Copyright (C) 2016 Stuart Howarth <showarth@marxoft.co.uk> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef VIMEOVIEW_H #define VIMEOVIEW_H #include <QWidget> class VimeoUser; class VimeoVideo; class VimeoPlaylist; class VimeoNavModel; class ListView; class QModelIndex; class QVBoxLayout; class VimeoView : public QWidget { Q_OBJECT public: explicit VimeoView(QWidget *parent = 0); public Q_SLOTS: void search(const QString &query, const QString &type, const QString &order); void showResource(const QString &type, const QString &id); private: void showAccounts(); void showCategories(); void showFavourites(); void showLatestVideos(); void showPlaylists(); void showSearchDialog(); void showSubscriptions(); void showUploads(); void showWatchLater(); private Q_SLOTS: void onItemActivated(const QModelIndex &index); void onCommentAdded(); void onUserSubscribed(VimeoUser *user); void onUserUnsubscribed(VimeoUser *user); void onVideoFavourited(VimeoVideo *video); void onVideoUnfavourited(VimeoVideo *video); void onVideoWatchLater(VimeoVideo *video); void onVideoAddedToPlaylist(VimeoVideo *video, VimeoPlaylist *playlist); private: VimeoNavModel *m_model; ListView *m_view; QVBoxLayout *m_layout; }; #endif // VIMEOVIEW_H
marxoft/cutetube2
app/src/maemo5/vimeo/vimeoview.h
C
gpl-3.0
1,925
/* * Copyright 2013 Justin Driggers <jtxdriggers@gmail.com> * * This file is part of Ventriloid. * * Ventriloid 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. * * Ventriloid 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 Ventriloid. If not, see <http://www.gnu.org/licenses/>. */ package com.jtxdriggers.android.ventriloid; import org.holoeverywhere.app.Activity; import org.holoeverywhere.app.AlertDialog; import org.holoeverywhere.app.Fragment; import org.holoeverywhere.widget.Button; import org.holoeverywhere.widget.EditText; import org.holoeverywhere.widget.ExpandableListView; import org.holoeverywhere.widget.ExpandableListView.OnChildClickListener; import org.holoeverywhere.widget.LinearLayout; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.os.Bundle; import android.os.IBinder; import android.preference.PreferenceManager; import android.support.v4.app.FragmentTransaction; import android.text.InputFilter; import android.text.InputType; import android.text.method.PasswordTransformationMethod; import android.util.TypedValue; import android.view.Gravity; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnTouchListener; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.Transformation; import android.widget.LinearLayout.LayoutParams; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.CheckBox; import android.widget.RelativeLayout; import android.widget.SeekBar; import android.widget.TextView; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; public class Connected extends Activity { public static final String SERVICE_RECEIVER = "com.jtxdriggers.android.ventriloid.Connected.SERVICE_RECEIVER"; public static final String FRAGMENT_RECEIVER = "com.jtxdriggers.android.ventriloid.Connected.FRAGMENT_RECEIVER"; public static final int SMALL = 1, MEDIUM = 2, LARGE = 3, FULLSCREEN = 4; private VentriloidService s; private VentriloidSlidingMenu sm; private Fragment fragment; private Button ptt, pttSizeUp, pttSizeDown; private RelativeLayout bottomBar; private boolean pttToggle = false, pttEnabled = false, toggleOn = false; private int pttKey; private short chatId; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.connected); getSupportActionBar().setSubtitle("Checking Latency..."); sm = new VentriloidSlidingMenu(this); sm.attachToActivity(this, VentriloidSlidingMenu.SLIDING_CONTENT); sm.makeViewPersistent(this, R.id.bottomBar); sm.getListView().setOnChildClickListener(menuClickListener); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); bottomBar = (RelativeLayout) findViewById(R.id.bottomBar); if (!prefs.getBoolean("voice_activation", false)) { pttToggle = prefs.getBoolean("toggle_mode", false); pttEnabled = prefs.getBoolean("custom_ptt", false); pttKey = pttEnabled ? prefs.getInt("ptt_key", KeyEvent.KEYCODE_CAMERA) : -1; pttSizeUp = (Button) findViewById(R.id.pttSizeUp); pttSizeUp.setOnClickListener(sizeChangeListener); pttSizeDown = (Button) findViewById(R.id.pttSizeDown); pttSizeDown.setOnClickListener(sizeChangeListener); ptt = (Button) findViewById(R.id.ptt); ptt.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { if (pttToggle) { toggleOn = !toggleOn; s.setPTTOn(toggleOn); bottomBar.setBackgroundResource(toggleOn ? R.drawable.blue_gradient_bg : R.drawable.abs__ab_bottom_solid_light_holo); return true; } else { s.setPTTOn(true); bottomBar.setBackgroundResource(R.drawable.blue_gradient_bg); return true; } } else if (!pttToggle && event.getAction() == MotionEvent.ACTION_UP) { s.setPTTOn(false); bottomBar.setBackgroundResource(R.drawable.abs__ab_bottom_solid_light_holo); return true; } return false; } }); setPTTSize(prefs.getInt("ptt_size", SMALL)); } else bottomBar.setVisibility(LinearLayout.GONE); chatId = getIntent().getShortExtra("id", (short) -1); if (getDefaultSharedPreferences().getBoolean("v3FirstConnect", true)) { AlertDialog.Builder firstRun = new AlertDialog.Builder(this); firstRun.setMessage("To display the menu, press the Menu button at the top-right or your screen, or swipe your finger from left to right."); firstRun.setNegativeButton("Close", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); firstRun.show(); getDefaultSharedPreferences().edit().putBoolean("v3FirstConnect", false).commit(); } } @Override public void onStart() { super.onStart(); if (!VentriloidService.isConnected()) { startActivity(new Intent(this, Main.class)); finish(); } else { bindService(new Intent(VentriloidService.SERVICE_INTENT), serviceConnection, Context.BIND_AUTO_CREATE); registerReceiver(serviceReceiver, new IntentFilter(SERVICE_RECEIVER)); registerReceiver(fragmentReceiver, new IntentFilter(FRAGMENT_RECEIVER)); } } @Override public void onStop() { try { unregisterReceiver(fragmentReceiver); } catch (IllegalArgumentException e) { } try { unregisterReceiver(serviceReceiver); } catch (IllegalArgumentException e) { } try { unbindService(serviceConnection); } catch (IllegalArgumentException e) { } super.onStop(); } @Override public void onSaveInstanceState(Bundle outState) { } @Override public boolean onCreateOptionsMenu(Menu menu) { getSupportMenuInflater().inflate(R.menu.connected, menu); return true; } @Override public boolean onPrepareOptionsMenu(Menu menu) { if (menu.findItem(R.id.mute) != null && s != null) menu.findItem(R.id.mute).setIcon(s.isMuted() ? R.drawable.muted : R.drawable.unmuted); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.mute: if (s.isMuted()) { s.setMuted(false); item.setIcon(R.drawable.unmuted); item.setTitle("Mute"); } else { s.setMuted(true); item.setIcon(R.drawable.muted); item.setTitle("Unmute"); } return true; case R.id.show_menu: if (sm.isMenuShowing()) sm.showContent(); else sm.showMenu(); return true; } return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { if (sm.isMenuShowing()) { sm.showContent(); return; } super.onBackPressed(); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (!pttEnabled || s == null || keyCode != pttKey) return super.onKeyDown(keyCode, event); if (pttToggle) { toggleOn = !toggleOn; s.setPTTOn(toggleOn); bottomBar.setBackgroundResource(toggleOn ? R.drawable.blue_gradient_bg : R.drawable.abs__ab_bottom_solid_light_holo); } else { s.setPTTOn(true); bottomBar.setBackgroundResource(R.drawable.blue_gradient_bg); } return true; } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (pttEnabled && !pttToggle && keyCode == pttKey) { s.setPTTOn(false); bottomBar.setBackgroundResource(R.drawable.abs__ab_bottom_solid_light_holo); return true; } else if (keyCode == KeyEvent.KEYCODE_MENU && !sm.isMenuShowing()) { sm.showMenu(); return true; } return super.onKeyUp(keyCode, event); } private void setPTTSize(int size) { int newSize = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 48 * size, getResources().getDisplayMetrics()); ViewGroup.LayoutParams params = bottomBar.getLayoutParams(); ViewGroup.LayoutParams btnParams = ptt.getLayoutParams(); Resizer animation = new Resizer(bottomBar, params.width, size == FULLSCREEN ? ViewGroup.LayoutParams.MATCH_PARENT : newSize); bottomBar.startAnimation(animation); Resizer btnAnimation = new Resizer(ptt, btnParams.width, size == FULLSCREEN ? ViewGroup.LayoutParams.MATCH_PARENT : newSize); ptt.startAnimation(btnAnimation); switch (size) { case SMALL: pttSizeUp.setVisibility(View.VISIBLE); pttSizeDown.setVisibility(View.GONE); break; case MEDIUM: case LARGE: pttSizeUp.setVisibility(View.VISIBLE); pttSizeDown.setVisibility(View.VISIBLE); break; case FULLSCREEN: pttSizeUp.setVisibility(View.GONE); pttSizeDown.setVisibility(View.VISIBLE); break; } PreferenceManager.getDefaultSharedPreferences(this).edit().putInt("ptt_size", size).commit(); } private OnClickListener sizeChangeListener = new OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case R.id.pttSizeUp: setPTTSize(PreferenceManager.getDefaultSharedPreferences(Connected.this).getInt("ptt_size", SMALL) + 1); break; case R.id.pttSizeDown: setPTTSize(PreferenceManager.getDefaultSharedPreferences(Connected.this).getInt("ptt_size", SMALL) - 1); break; } } }; private OnChildClickListener menuClickListener = new OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { AlertDialog.Builder dialog = new AlertDialog.Builder(Connected.this); LinearLayout layout = new LinearLayout(Connected.this); layout.setOrientation(LinearLayout.VERTICAL); final EditText input = new EditText(Connected.this); InputFilter[] FilterArray = new InputFilter[1]; FilterArray[0] = new InputFilter.LengthFilter(127); input.setFilters(FilterArray); int pixels = (int) (getResources().getDisplayMetrics().density * 20); LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); params.setMargins(pixels, pixels, pixels, pixels); input.setLayoutParams(params); layout.addView(input); final CheckBox silent = new CheckBox(Connected.this); silent.setChecked(true); silent.setText(" Send Silently "); LinearLayout frame = new LinearLayout(Connected.this); frame.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); frame.setGravity(Gravity.CENTER); final Item.User u = s.getItemData().getUserById(VentriloInterface.getuserid()); switch (groupPosition) { case VentriloidSlidingMenu.MENU_SWITCH_VIEW: switch (childPosition) { case VentriloidSlidingMenu.MENU_SERVER_VIEW: s.setViewType(ViewFragment.VIEW_TYPE_SERVER, (short) -1); fragment = ViewFragment.newInstance(s.getViewType()); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); s.getItemData().setActiveView(VentriloidSlidingMenu.MENU_SERVER_VIEW); sm.getAdapter().setMenuItems(s.getItemData()); return true; case VentriloidSlidingMenu.MENU_CHANNEL_VIEW: s.setViewType(ViewFragment.VIEW_TYPE_CHANNEL, (short) -1); fragment = ViewFragment.newInstance(s.getViewType()); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); s.getItemData().setActiveView(VentriloidSlidingMenu.MENU_CHANNEL_VIEW); sm.getAdapter().setMenuItems(s.getItemData()); return true; default: s.setViewType(ViewFragment.VIEW_TYPE_CHAT, s.getItemData().getChatIdFromPosition(childPosition)); fragment = ChatFragment.newInstance(s.getChatId(), s.getItemData().getMenuItems().get(groupPosition).get(childPosition)); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); s.getItemData().setActiveView(childPosition); sm.getAdapter().setMenuItems(s.getItemData()); return true; } case VentriloidSlidingMenu.MENU_AUDIO_OPTIONS: switch (childPosition) { case VentriloidSlidingMenu.MENU_BLUETOOTH: s.toggleBluetooth(); sm.getAdapter().setMenuItems(s.getItemData()); return true; case VentriloidSlidingMenu.MENU_SET_TRANSMIT: final TextView percent = new TextView(Connected.this); final SeekBar volume = new SeekBar(Connected.this); volume.setMax(158); volume.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (progress >= 72 && progress <= 86 && progress != 79) { seekBar.setProgress(79); percent.setText("100%"); } else percent.setText((progress * 200) / seekBar.getMax() + "%"); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); LinearLayout volumeLayout = new LinearLayout(Connected.this); volumeLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.CENTER)); volumeLayout.setOrientation(LinearLayout.VERTICAL); volumeLayout.addView(volume); frame.addView(percent); volumeLayout.addView(frame); dialog.setView(volumeLayout); volume.setProgress(u.volume); percent.setText((u.volume * 200) / volume.getMax() + "%"); dialog.setTitle("Set Transmit Volume:"); dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { VentriloInterface.setxmitvolume(volume.getProgress()); u.volume = volume.getProgress(); u.updateStatus(); sendBroadcast(new Intent(ViewFragment.SERVICE_RECEIVER)); getSharedPreferences("VOLUMES" + s.getServerId(), Context.MODE_PRIVATE).edit().putInt("transmit", volume.getProgress()).commit(); } }); dialog.setNegativeButton("Cancel", null); dialog.show(); return true; } case VentriloidSlidingMenu.MENU_USER_OPTIONS: switch (childPosition) { case VentriloidSlidingMenu.MENU_ADMIN: if (s.isAdmin()) { VentriloInterface.adminlogout(); s.setAdmin(false); } else { dialog.setTitle("Enter Admin Password:"); input.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); input.setTransformationMethod(PasswordTransformationMethod.getInstance()); dialog.setView(layout); dialog.setPositiveButton("Login", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (input.getText().toString().length() > 0) { VentriloInterface.adminlogin(input.getText().toString()); s.setAdmin(true); } } }); dialog.setNegativeButton("Cancel", null); dialog.show(); } return true; case VentriloidSlidingMenu.MENU_SET_COMMENT: dialog.setTitle("Set Comment:"); frame.addView(silent); layout.addView(frame); dialog.setView(layout); input.setSingleLine(); input.setText(u.comment); dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { s.getItemData().setComment(input.getText().toString()); VentriloInterface.settext(input.getText().toString(), u.url, "", silent.isChecked()); } }); dialog.setNegativeButton("Cancel", null); dialog.show(); return true; case VentriloidSlidingMenu.MENU_SET_URL: dialog.setTitle("Set URL:"); frame.addView(silent); layout.addView(frame); dialog.setView(layout); input.setText(u.url.length() > 0 ? u.url : "http://"); input.setSingleLine(); dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { s.getItemData().setUrl(input.getText().toString()); VentriloInterface.settext(u.comment, input.getText().toString(), "", silent.isChecked()); } }); dialog.setNegativeButton("Cancel", null); dialog.show(); return true; case VentriloidSlidingMenu.MENU_CHAT: if (s.getItemData().inChat()) { s.leaveChat(); if (s.getViewType() == ViewFragment.VIEW_TYPE_CHAT && s.getChatId() == 0) { s.setViewType(ViewFragment.VIEW_TYPE_SERVER, (short) -1); fragment = ViewFragment.newInstance(s.getViewType()); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); } } else { s.joinChat(); s.setViewType(ViewFragment.VIEW_TYPE_CHAT, (short) 0); fragment = ChatFragment.newInstance(s.getChatId()); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); } sm.getAdapter().setMenuItems(s.getItemData()); return true; } break; case VentriloidSlidingMenu.MENU_CLOSE: switch (childPosition) { case VentriloidSlidingMenu.MENU_MINIMIZE: finish(); return true; case VentriloidSlidingMenu.MENU_DISCONNECT: if (s.disconnect()) { startActivity(new Intent(Connected.this, Main.class)); finish(); } return true; } break; } return false; } }; private ServiceConnection serviceConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder binder) { s = ((VentriloidService.MyBinder) binder).getService(); getSupportActionBar().setTitle(s.getServername()); s.getItemData().setActiveView(s.getViewType() == ViewFragment.VIEW_TYPE_CHAT ? s.getItemData().findChatPosition(s.getChatId()) : s.getViewType()); s.getItemData().setIsAdmin(s.isAdmin()); sm.setAdapter(new SlidingMenuAdapter(Connected.this, s.getItemData())); setPing(s.getItemData().getPing()); if (chatId >= 0) s.setViewType(ViewFragment.VIEW_TYPE_CHAT, chatId); if (s.getViewType() == ViewFragment.VIEW_TYPE_CHAT) switch (s.getChatId()) { case 0: fragment = ChatFragment.newInstance(s.getChatId()); default: fragment = ChatFragment.newInstance(s.getChatId(), s.getItemData().getMenuItems().get(VentriloidSlidingMenu.MENU_SWITCH_VIEW).get(s.getItemData().findChatPosition(s.getChatId()))); } else fragment = ViewFragment.newInstance(s.getViewType()); getSupportFragmentManager() .beginTransaction() .replace(R.id.content_frame, fragment) .commit(); } public void onServiceDisconnected(ComponentName className) { s = null; } }; private BroadcastReceiver serviceReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { switch (intent.getShortExtra("type", (short)0)) { case VentriloEvents.V3_EVENT_DISCONNECT: startActivity(new Intent(Connected.this, Main.class)); finish(); break; case VentriloEvents.V3_EVENT_PING: setPing(intent.getIntExtra("ping", -1)); break; case VentriloEvents.V3_EVENT_CHAN_BADPASS: final SharedPreferences passwordPrefs = getSharedPreferences("PASSWORDS" + s.getServerId(), Context.MODE_PRIVATE); final Item.Channel c = s.getItemData().getChannelById(intent.getShortExtra("id", (short)0)); passwordPrefs.edit().remove(c.id + "pw").commit(); if (c.reqPassword) { AlertDialog.Builder passwordDialog = new AlertDialog.Builder(Connected.this); LinearLayout layout = new LinearLayout(Connected.this); final EditText input = new EditText(Connected.this); input.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); input.setTransformationMethod(PasswordTransformationMethod.getInstance()); int pixels = (int) (getResources().getDisplayMetrics().density * 20); LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); params.setMargins(pixels, pixels, pixels, pixels); input.setLayoutParams(params); layout.addView(input); passwordDialog.setTitle("Enter Channel Password:") .setView(layout) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { VentriloInterface.changechannel(c.id, input.getText().toString()); passwordPrefs.edit().putString(c.id + "pw", input.getText().toString()).commit(); return; } }) .setNegativeButton("Cancel", null) .show(); } else VentriloInterface.changechannel(c.id, ""); break; case (short) -1: bottomBar.setBackgroundResource(R.drawable.abs__ab_bottom_solid_light_holo); break; default: sendBroadcast(new Intent(ViewFragment.SERVICE_RECEIVER)); if (s != null) sm.getAdapter().setMenuItems(s.getItemData()); } } }; private BroadcastReceiver fragmentReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { switch (intent.getIntExtra("type", -1)) { case VentriloEvents.V3_EVENT_CHAT_JOIN: s.joinChat(); s.setViewType(ViewFragment.VIEW_TYPE_CHAT, (short) 0); fragment = ChatFragment.newInstance(s.getChatId()); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); sm.getAdapter().setMenuItems(s.getItemData()); break; case VentriloEvents.V3_EVENT_CHAT_LEAVE: s.leaveChat(); if (s.getViewType() == ViewFragment.VIEW_TYPE_CHAT && s.getChatId() == 0) { s.setViewType(ViewFragment.VIEW_TYPE_SERVER, (short) -1); fragment = ViewFragment.newInstance(s.getViewType()); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); } sm.getAdapter().setMenuItems(s.getItemData()); break; case VentriloEvents.V3_EVENT_PRIVATE_CHAT_START: s.setViewType(ViewFragment.VIEW_TYPE_CHAT, intent.getShortExtra("id", (short) -1)); fragment = ChatFragment.newInstance(s.getChatId(), s.getItemData().getUserById(s.getChatId()).name); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); s.getItemData().setActiveView(s.getItemData().findChatPosition(intent.getShortExtra("id", (short) -1))); sm.getAdapter().setMenuItems(s.getItemData()); break; case VentriloEvents.V3_EVENT_PRIVATE_CHAT_END: s.getItemData().removeChat(intent.getShortExtra("id", (short) -1)); if (s.getViewType() == ViewFragment.VIEW_TYPE_CHAT && s.getChatId() == intent.getShortExtra("id", (short) -1)) { sm.showMenu(); s.setViewType(ViewFragment.VIEW_TYPE_SERVER, (short) -1); fragment = ViewFragment.newInstance(s.getViewType()); getSupportFragmentManager() .beginTransaction() .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .replace(R.id.content_frame, fragment) .commit(); } sm.getAdapter().setMenuItems(s.getItemData()); break; } } }; private void setPing(int ping) { if (ping < 65535 && ping > 0) getSupportActionBar().setSubtitle("Ping: " + ping + "ms"); else getSupportActionBar().setSubtitle("Checking latency..."); } public class Resizer extends Animation { private View mView; private float mHeight; private float mWidth; public Resizer(View v, float newWidth, float newHeight) { mHeight = newHeight; mWidth = newWidth; mView = v; setDuration(300); } @Override protected void applyTransformation(float interpolatedTime, Transformation t) { ViewGroup.LayoutParams p = mView.getLayoutParams(); p.height = (int)((mHeight - p.height) * interpolatedTime + p.height); p.width = (int)((mWidth - p.width) * interpolatedTime + p.width); mView.requestLayout(); } } }
justindriggers/Ventriloid
com.jtxdriggers.android.ventriloid/src/com/jtxdriggers/android/ventriloid/Connected.java
Java
gpl-3.0
26,696
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_20) on Mon Nov 30 15:17:55 MST 2015 --> <title>API Help</title> <meta name="date" content="2015-11-30"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="API Help"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li><a href="overview-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 class="navBarCell1Rev">Help</li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?help-doc.html" target="_top">Frames</a></li> <li><a href="help-doc.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All&nbsp;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"> <h1 class="title">How This API Document Is Organized</h1> <div class="subTitle">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <h2>Overview</h2> <p>The <a href="overview-summary.html">Overview</a> page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.</p> </li> <li class="blockList"> <h2>Package</h2> <p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p> <ul> <li>Interfaces (italic)</li> <li>Classes</li> <li>Enums</li> <li>Exceptions</li> <li>Errors</li> <li>Annotation Types</li> </ul> </li> <li class="blockList"> <h2>Class/Interface</h2> <p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p> <ul> <li>Class inheritance diagram</li> <li>Direct Subclasses</li> <li>All Known Subinterfaces</li> <li>All Known Implementing Classes</li> <li>Class/interface declaration</li> <li>Class/interface description</li> </ul> <ul> <li>Nested Class Summary</li> <li>Field Summary</li> <li>Constructor Summary</li> <li>Method Summary</li> </ul> <ul> <li>Field Detail</li> <li>Constructor Detail</li> <li>Method Detail</li> </ul> <p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p> </li> <li class="blockList"> <h2>Annotation Type</h2> <p>Each annotation type has its own separate page with the following sections:</p> <ul> <li>Annotation Type declaration</li> <li>Annotation Type description</li> <li>Required Element Summary</li> <li>Optional Element Summary</li> <li>Element Detail</li> </ul> </li> <li class="blockList"> <h2>Enum</h2> <p>Each enum has its own separate page with the following sections:</p> <ul> <li>Enum declaration</li> <li>Enum description</li> <li>Enum Constant Summary</li> <li>Enum Constant Detail</li> </ul> </li> <li class="blockList"> <h2>Tree (Class Hierarchy)</h2> <p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p> <ul> <li>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.</li> <li>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</li> </ul> </li> <li class="blockList"> <h2>Deprecated API</h2> <p>The <a href="deprecated-list.html">Deprecated API</a> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</p> </li> <li class="blockList"> <h2>Index</h2> <p>The <a href="index-files/index-1.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p> </li> <li class="blockList"> <h2>Prev/Next</h2> <p>These links take you to the next or previous class, interface, package, or related page.</p> </li> <li class="blockList"> <h2>Frames/No Frames</h2> <p>These links show and hide the HTML frames. All pages are available with or without frames.</p> </li> <li class="blockList"> <h2>All Classes</h2> <p>The <a href="allclasses-noframe.html">All Classes</a> link shows all classes and interfaces except non-static nested types.</p> </li> <li class="blockList"> <h2>Serialized Form</h2> <p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.</p> </li> <li class="blockList"> <h2>Constant Field Values</h2> <p>The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.</p> </li> </ul> <span class="emphasizedPhrase">This help file applies to API documentation generated using the standard doclet.</span></div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li><a href="overview-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 class="navBarCell1Rev">Help</li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?help-doc.html" target="_top">Frames</a></li> <li><a href="help-doc.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All&nbsp;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>
CMPUT301F15T03/301p
docs/javadocs/help-doc.html
HTML
gpl-3.0
8,242
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="/js/jquery"></script> <script type="module" src="/js/app"></script> </head> </html>
RickMyers/Jarvis
test.html
HTML
gpl-3.0
166
select products_id from PRODUCTS; select products_id from PRODUCTS; select products_id, categories_id from PRODUCTS_TO_CATEGORIES where products_id=0;
pmanousis/Hecataeus
AppData/ZENCART/SQLS/store_manager.php
PHP
gpl-3.0
153
/* Scale Up */ .foogallery.fg-loaded-scale-up .fg-item-inner { transition-property: visibility, opacity, transform; transform: scale(0.6); } .foogallery.fg-loaded-scale-up .fg-loaded .fg-item-inner { transform: scale(1); }
fooplugins/foogallery-client-side
src/core/css/appearance/loaded-effects/scale-up.css
CSS
gpl-3.0
225
/****************************************************************************** * * * colours.h * * * * Developed by : * * AquaticEcoDynamics (AED) Group * * School of Earth & Environment * * The University of Western Australia * * * * Copyright 2013, 2014 - The University of Western Australia * * * * This file is part of libplot - a plotting library for GLM * * * * libplot 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. * * * * libplot 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 _COLOURS_H_ #define _COLOURS_H_ #define GRAYSCALE 0 typedef struct _rgb { int r; int g; int b; int col; unsigned long int xcolour; int count; } rgb_val; extern rgb_val _map[256]; #define MAX_COL_VAL 250 extern int black, grey, white, red, green, blue; #define JET 1 void make_colour_map(gdImagePtr im, int style); void ShowColourMapH(gdImagePtr im, int h, int v); void ShowColourMapV(gdImagePtr im, int h, int v); #endif
GLEON/GLM-source
libplot/include/colours.h
C
gpl-3.0
2,627
package fr.ironcraft.kubithon.launcher.update; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.URL; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Formatter; import org.json.JSONObject; public class DownloadableFile { private static final MessageDigest sha1Digest; static { MessageDigest digest = null; try { digest = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException ignored) { } sha1Digest = digest; } private URL url; private File file; private int size; private String sha1; public DownloadableFile(URL url, File file) { this.url = url; this.file = file; } public DownloadableFile(URL url, File file, int size, String sha1) { this.url = url; this.file = file; this.size = size; this.sha1 = sha1; } public File query() throws IOException { if (file.exists() && isValid(false)) { if (!file.getAbsolutePath().endsWith(".json")) { System.out.println("No need to download " + file.getAbsolutePath()); } return file; } for (int i = 0; i < 5 && !isValid(true); i++) { if (file.exists()) { file.delete(); } System.out.println("Downloading " + file.getAbsolutePath() + " (try " + i + ")"); Downloader.download(url.toString(), file); } System.out.println("Finished downloading " + file.getAbsolutePath()); return file; } public boolean isValid(boolean afterUpdate) throws IOException { if (!file.exists()) { return false; } if (sha1Digest == null) { return true; } if (size != 0) { boolean sizeChecked = file.length() == size; if (sizeChecked || !afterUpdate) { return sizeChecked; } } if (this.sha1 != null && this.sha1.length() > 37) { MessageDigest sha1digest; try { sha1digest = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException ignored) { return true; } FileInputStream in = new FileInputStream(file); byte[] buffer = new byte[8192]; int len = in.read(buffer); while (len != -1) { sha1digest.update(buffer, 0, len); len = in.read(buffer); } in.close(); Formatter formatter = new Formatter(); try { for (final byte b : sha1digest.digest()) { formatter.format("%02x", b); } return formatter.toString().equalsIgnoreCase(sha1); } finally { formatter.close(); } } return true; } public URL getUrl() { return url; } public File getFile() { return file; } public int getSize() { return size; } public String getSha1() { return sha1; } public static DownloadableFile fromJson(JSONObject obj, File file) throws IOException { return new DownloadableFile(new URL(obj.getString("url")), file, obj.getInt("size"), obj.has("sha1") ? obj.getString("sha1") : obj.getString("hash")); } }
Kubithorg/launcher
src/main/java/fr/ironcraft/kubithon/launcher/update/DownloadableFile.java
Java
gpl-3.0
3,748
#Region "Microsoft.VisualBasic::1d7cd1e66f7ef091c57bf13c9831d540, ..\workbench\devenv\TabPages\Options.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 Namespace TabPages Public Class Options Private Sub Options_Load(sender As Object, e As EventArgs) Handles MyBase.Load ComboLanguage.SelectedIndex = Program.Dev2Profile.IDE.Language Label4.Text = String.Format("Configuration File: {0}", Settings.File.DefaultXmlFile) End Sub Private Sub ComboLanguage_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboLanguage.SelectedIndexChanged Program.Dev2Profile.IDE.Language = ComboLanguage.SelectedIndex End Sub Private Sub Options_Resize(sender As Object, e As EventArgs) Handles Me.Resize End Sub End Class End Namespace
amethyst-asuka/GCModeller
src/workbench/devenv/TabPages/Options.vb
Visual Basic
gpl-3.0
1,748
/** * http://abricos.org, https://github.com/abricos/tinymce-prettify-plugin * @license Dual licensed under the MIT or GPL Version 3 licenses. * @version 0.1 * @author Alexander Kuzmin <roosit@abricos.org> * @package TinyMCE * @name prettify * GPL 3 LICENCES */ (function() { tinymce.PluginManager.requireLangPack('prettify'); tinymce.create('tinymce.plugins.prettify', { init : function(ed, url) { var t = this; t.editor = ed; ed.addCommand('mceprettify', function() { ed.windowManager.open({ file : url + '/dialog.htm', width : 450 + parseInt(ed.getLang('prettify.delta_width', 0)), height : 400 + parseInt(ed.getLang('prettify.delta_height', 0)), inline : 1 }, { plugin_url : url, some_custom_arg : 'custom arg' }); }); ed.addButton('prettify', { title : 'prettify.desc', cmd : 'mceprettify', image : url + '/img/prettify.png' }); ed.onNodeChange.add(function(ed, cm, n) { cm.setActive('prettify', n.nodeName == 'IMG'); }); ed.onInit.add(function( ed ) { ed.dom.loadCSS(url + '/css/codeditor.css'); }); if (tinymce.isIE || tinymce.isWebKit){ ed.onKeyDown.add(function(ed, e) { var brElement; var selection = ed.selection; if (e.keyCode == 13 && selection.getNode().nodeName === 'CODE') { selection.setContent('<br id="__prettify" /> ', {format : 'raw'}); // Do not remove the space after the BR element. brElement = ed.dom.get('__prettify'); brElement.removeAttribute('id'); selection.select(brElement); selection.collapse(); return tinymce.dom.Event.cancel(e); } }); } if (tinymce.isGecko || tinymce.isOpera) { ed.onKeyDown.add(function(ed, e) { var selection = ed.selection; if (e.keyCode == 9 && selection.getNode().nodeName === 'CODE') { selection.setContent('\t', {format : 'raw'}); return tinymce.dom.Event.cancel(e); } }); } if (tinymce.isGecko) { ed.onSetContent.add(function(ed, o) { t._replaceNewlinesWithBrElements(ed); }); } ed.onPreProcess.add(function(ed, o) { t._replaceBrElementsWithNewlines(ed, o.node); if (tinymce.isWebKit){ t._removeSpanElementsInPreElementsForWebKit(ed, o.node); } var el = ed.dom.get('__prettifyFixTooltip'); ed.dom.remove(el); }); }, _nl2br: function( strelem ) { var t = this; //Redefined the espace and unescape function if(!(t.escape && t.unescape)) { var escapeHash = { '_' : function(input) { var ret = escapeHash[input]; if(!ret) { if(input.length - 1) { ret = String.fromCharCode(input.substring(input.length - 3 ? 2 : 1)); } else { var code = input.charCodeAt(0); ret = code < 256 ? "%" + (0 + code.toString(16)).slice(-2).toUpperCase() : "%u" + ("000" + code.toString(16)).slice(-4).toUpperCase(); } escapeHash[ret] = input; escapeHash[input] = ret; } return ret; } }; t.escape = t.escape || function(str) { return str.replace(/[^\w @\*\-\+\.\/]/g, function(aChar) { return escapeHash._(aChar); }); }; t.unescape = t.unescape || function(str) { return str.replace(/%(u[\da-f]{4}|[\da-f]{2})/gi, function(seq) { return escapeHash._(seq); }); }; } strelem = t.escape(strelem); var newlineChar; if(strelem.indexOf('%0D%0A') > -1 ){ newlineChar = /%0D%0A/g ; } else if (strelem.indexOf('%0A') > -1){ newlineChar = /%0A/g ; } else if (strelem.indexOf('%0D') > -1){ newlineChar = /%0D/g ; } if ( typeof(newlineChar) == "undefined"){ return t.unescape(strelem); } else { return t.unescape(strelem.replace(newlineChar, '<br/>')); } }, _replaceNewlinesWithBrElements: function(ed) { var t = this; var preElements = ed.dom.select('code'); for (var i=0; i<preElements.length; i++) { preElements[i].innerHTML = t._nl2br(preElements[i].innerHTML); } }, _replaceBrElementsWithNewlines: function(ed, node){ var brElements = ed.dom.select('code br', node); var newlineChar = tinymce.isIE ? '\r' : '\n'; var newline; for (var i=0; i<brElements.length; i++){ newline = ed.getDoc().createTextNode(newlineChar); ed.dom.insertAfter(newline, brElements[i]); ed.dom.remove(brElements[i]); } }, _removeSpanElementsInPreElementsForWebKit: function(ed, node){ var spanElements = ed.dom.select('code span', node); var space; for (var i=0; i<spanElements.length; i++) { space = ed.getDoc().createTextNode(spanElements[i].innerHTML); ed.dom.insertAfter(space, spanElements[i]); ed.dom.remove(spanElements[i]); } }, createControl : function(n, cm) { return null; }, getInfo : function() { return { longname : 'Code Highlight', author : 'Alexander Kuzmin', authorurl : 'http://abricos.org', infourl : 'http://abricos.org', version : "0.1" }; } }); tinymce.PluginManager.add('prettify', tinymce.plugins.prettify); })();
abricos/tinymce-prettify-plugin
editor_plugin.js
JavaScript
gpl-3.0
6,472
#pragma once #include "menuscreen.h" #include <cstdint> #include <memory> struct nk_context; typedef uint32_t nk_flags; namespace FARender { class AnimationPlayer; } namespace FAGui { class MenuHandler; class PauseMenuScreen : public MenuScreen { private: using Parent = MenuScreen; public: explicit PauseMenuScreen(FAGui::MenuHandler& menu); static void bigTGoldText(nk_context* ctx, const char* text, nk_flags alignment); static float bigTGoldTextWidth(const char* text); void menuItems(nk_context* ctx); void update(nk_context* ctx) override; private: std::unique_ptr<FARender::AnimationPlayer> mBigPentagram; }; }
wheybags/freeablo
apps/freeablo/fagui/menu/pausemenuscreen.h
C
gpl-3.0
712
#include <assert.h> #include <errno.h> #include <string.h> #include <snt_pool.h> #include <snt_schd.h> #include"snt_utility.h" #include"snt_log.h" SNTPool* sntPoolCreate(unsigned int num, unsigned int itemsize) { SNTPool* alloc; unsigned char* tmp; unsigned int i; const int size = (itemsize + sizeof(SNTPool)); /* Total size of each node. */ /* Allocate pool descriptor. */ alloc = malloc(sizeof(SNTPool)); assert(alloc); /* Allocate number pool nodes. */ alloc->pool = calloc(num, size); alloc->num = num; alloc->itemsize = itemsize; assert(alloc->pool); /* Create pool chain. */ tmp = (unsigned char*)alloc->pool; for (i = 0; i < num; i++) { ((SNTPoolNode*)tmp)->next = (SNTPoolNode*)( tmp + sizeof(SNTPoolNode) + itemsize ); tmp += itemsize + sizeof(SNTPoolNode); } /* Terminator of the pool. */ tmp -= itemsize + sizeof(SNTPoolNode); ((SNTPoolNode*)tmp)->next = NULL; return alloc; } int sntPoolLockMem(SNTPool* poolallocator){ size_t sizeInBytes = (size_t)sntPoolNumNodes(poolallocator) * (size_t)sntPoolItemSize(poolallocator); return sntLockMemory(poolallocator->pool, sizeInBytes); } void* sntPoolObtain(SNTPool* allocator) { SNTPoolNode* tmp; void* block; if (allocator->pool->next == NULL) { return NULL; } /* Get next element and assigned new next element. */ tmp = allocator->pool->next; allocator->pool->next = tmp->next; /* Get data block. */ block = tmp->data; memset(block, 0, allocator->itemsize); return block; } void* sntPoolReturn(SNTPool* allocator, void* data) { SNTPoolNode* tmp; /* Decrement with size of a pointer * to get pointer for the next element.*/ tmp = (SNTPoolNode*)(((char*) data) - sizeof(void*)); /* Update next value. */ tmp->next = allocator->pool->next; allocator->pool->next = tmp; /* Clear the data to prevent sensitive information to retain on the system memory.*/ memset(tmp->data, 0, allocator->itemsize); return tmp; } void* sntPoolResize(SNTPool* pool, unsigned int num, unsigned int itemsize){ sntLogErrorPrintf("Not supported.\n"); return NULL; } unsigned int sntPoolNumNodes(const SNTPool* pool){ return pool->num; } unsigned int sntPoolItemSize(const SNTPool* pool){ return pool->itemsize; } int sntPoolGetIndex(const SNTPool* pool, const void* data){ return ((const char*)data - (const char*)pool->pool) / pool->itemsize; } static void* sntPoolItemByIndex(SNTPool* pool, unsigned int index){ return ((char*)pool->pool) + ( (pool->itemsize + sizeof(void*)) * index + sizeof(void*)); } void sntPoolFree(SNTPool* pool){ /* Zero out each pool item. */ sntPoolZeroFrame(pool); /* Release memory. */ free(pool->pool); free(pool); } void sntPoolZeroFrame(SNTPool* pool){ unsigned int i; for(i = 0; i < sntPoolNumNodes(pool); i++){ sntMemZero(sntPoolItemByIndex(pool, i), sntPoolItemSize(pool)); } }
voldien/snt
src/pool.c
C
gpl-3.0
2,842
# Django settings for freudiancommits project. import os DEBUG = True if os.environ.get('DJANGO_DEBUG', None) == '1' else False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS import dj_database_url DATABASES = {'default': dj_database_url.config()} # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # In a Windows environment this must be set to your system time zone. TIME_ZONE = 'UTC' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en-us' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # If you set this to False, Django will not format dates, numbers and # calendars according to the current locale. USE_L10N = True # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/media/" MEDIA_ROOT = '' # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" MEDIA_URL = '' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" STATIC_ROOT = '' # URL prefix for static files. # Example: "http://media.lawrence.com/static/" STATIC_URL = '/static/' # Additional locations of static files STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) # List of finder classes that know how to find static files in # various locations. STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) # Make this unique, and don't share it with anybody. SECRET_KEY = os.environ['DJANGO_SECRET_KEY'] AUTHENTICATION_BACKENDS = ( # Needed to login by username in Django admin, regardless of `allauth` 'django.contrib.auth.backends.ModelBackend', # `allauth` specific authentication methods, such as login by e-mail 'allauth.account.auth_backends.AuthenticationBackend', ) # Don't require email addresses SOCIALACCOUNT_EMAIL_REQUIRED = False SOCIALACCOUNT_EMAIL_VERIFICATION = 'none' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'allauth.account.context_processors.account', 'allauth.socialaccount.context_processors.socialaccount', 'django.core.context_processors.request', 'django.contrib.auth.context_processors.auth' ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'freudiancommits.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'freudiancommits.wsgi.application' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) INSTALLED_APPS = ( 'freudiancommits.main', 'freudiancommits.github', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'allauth', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.github', 'south', 'gunicorn', ) # A sample logging configuration. The only tangible logging # performed by this configuration is to send an email to # the site admins on every HTTP 500 error when DEBUG=False. # See http://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration. LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' } }, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, } } if 'AWS_STORAGE_BUCKET_NAME' in os.environ: AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID'] AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY'] AWS_STORAGE_BUCKET_NAME = os.environ['AWS_STORAGE_BUCKET_NAME'] AWS_S3_CUSTOM_DOMAIN = AWS_STORAGE_BUCKET_NAME STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage' DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' DEFAULT_FILE_STORAGE = 's3_folder_storage.s3.DefaultStorage' DEFAULT_S3_PATH = 'media' STATICFILES_STORAGE = 's3_folder_storage.s3.StaticStorage' STATIC_S3_PATH = 'static' AWS_S3_SECURE_URLS = False AWS_QUERYSTRING_AUTH = False MEDIA_ROOT = '/%s/' % DEFAULT_S3_PATH MEDIA_URL = '//%s/%s/' % \ (AWS_STORAGE_BUCKET_NAME, DEFAULT_S3_PATH) STATIC_ROOT = '/%s/' % STATIC_S3_PATH STATIC_URL = '//%s/%s/' % \ (AWS_STORAGE_BUCKET_NAME, STATIC_S3_PATH) ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' LOGIN_REDIRECT_URL = '/github/loading/'
michaelmior/freudiancommits
freudiancommits/settings.py
Python
gpl-3.0
6,595
// stdafx.cpp : source file that includes just the standard includes // WinMsgInfo.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h"
JetAr/WinMsgInfo
WinMsgInfo/WinMsgInfo/src/StdAfx.cpp
C++
gpl-3.0
201
#ifndef wm_h #define wm_h /* * Sylvain BERTRAND <digital.ragnarok@gmail.com> * code protected by GNU GPL v3 */ extern gboolean wm_replace; extern gboolean wm_debug_xinerama; enum wm_state wm_state(void); void wm_set_state(enum wm_state state); void wm_restart_other(const gchar *path); void wm_restart(void); void wm_exit(gint code); void wm_exit_replace(void); Cursor wm_cursor(enum wm_cursor cursor); #endif
sylware/lboxwm
wm/wm.h
C
gpl-3.0
413
package data; import tiles.Tile; import tiles.TileGrid; import org.lwjgl.opengl.Display; import org.newdawn.slick.opengl.Texture; import Players.DungeonPlayer; import helpers.Render; public class boot { public boot() { Render.beginSession(); int[][] map = { {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, }; TileGrid grid = new TileGrid(map); DungeonPlayer player = new DungeonPlayer(Render.QuickLoad("dirt"), grid.getTile(1, 1),64,64,100,2,new int[0]); while (!Display.isCloseRequested()) { //Tick function. Everything happens here grid.Draw(); player.Update(); player.Render(); Display.update(); Display.sync(GlobalSettings.fps); //TODO: Make a way of modifying tiles that are in the sheet. } Display.destroy(); } public static void main(String[] args) { new boot(); } }
anzx42/APeX
src/data/boot.java
Java
gpl-3.0
1,475
#!/usr/bin/env python3 import argparse import pathlib import numpy as np def waterfall(input_filename, output_filename): fs = 200 nfft = 8192 w = np.blackman(nfft) x = np.fromfile(input_filename, 'int16') x = (x[::2] + 1j*x[1::2])/2**15 freq_span = 5 nbins = round(freq_span / fs * nfft) # In these recordings the internal reference was used, so there # is a frequency offset freq_offset = 11.6 if '2021-12-08T12:57:25' in input_filename.name else 0 band = int(input_filename.name.split('_')[-2].replace('kHz', '')) # 1.6 Hz offset is at 10 MHz freq_offset *= band / 10000 bin_offset = round(freq_offset / fs * nfft) freq_sel = slice(nfft//2-nbins+bin_offset, nfft//2+nbins+1+bin_offset) x = x[:x.size//nfft*nfft] f = np.fft.fftshift( np.fft.fft(w * x.reshape(-1, nfft)), axes=1) f = np.abs(f[:, freq_sel])**2 np.save(output_filename, f.astype('float32')) def parse_args(): parser = argparse.ArgumentParser( description='Make waterfalls from the December 2021 eclipse IQ data') parser.add_argument('input_folder', help='Input folder') parser.add_argument('output_folder', help='Output folder') return parser.parse_args() def main(): args = parse_args() input_files = pathlib.Path(args.input_folder).glob('*.sigmf-data') output_path = pathlib.Path(args.output_folder) for f_in in input_files: f_out_name = f_in.name.replace('.sigmf-data', '_waterfall.npy') f_out = output_path / f_out_name waterfall(f_in, f_out) if __name__ == '__main__': main()
daniestevez/jupyter_notebooks
december2021_eclipse/make_waterfalls.py
Python
gpl-3.0
1,664
package cm.aptoide.pt.database.room; import androidx.annotation.NonNull; import androidx.room.Entity; import androidx.room.PrimaryKey; @Entity(tableName = "store") public class RoomStore { public static final String STORE_ID = "storeId"; public static final String ICON_PATH = "iconPath"; public static final String THEME = "theme"; public static final String DOWNLOADS = "downloads"; public static final String STORE_NAME = "storeName"; public static final String USERNAME = "username"; public static final String PASSWORD_SHA1 = "passwordSha1"; @PrimaryKey @NonNull private long storeId; private String iconPath; private String theme; private long downloads; private String storeName; private String username; private String passwordSha1; public RoomStore() { } public RoomStore(long storeId, String iconPath, String theme, long downloads, String storeName, String username, String passwordSha1) { this.storeId = storeId; this.iconPath = iconPath; this.theme = theme; this.downloads = downloads; this.storeName = storeName; this.username = username; this.passwordSha1 = passwordSha1; } public long getStoreId() { return storeId; } public void setStoreId(long storeId) { this.storeId = storeId; } public String getIconPath() { return iconPath; } public void setIconPath(String iconPath) { this.iconPath = iconPath; } public String getTheme() { return theme; } public void setTheme(String theme) { this.theme = theme; } public long getDownloads() { return downloads; } public void setDownloads(long downloads) { this.downloads = downloads; } public String getStoreName() { return storeName; } public void setStoreName(String storeName) { this.storeName = storeName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPasswordSha1() { return passwordSha1; } public void setPasswordSha1(String passwordSha1) { this.passwordSha1 = passwordSha1; } }
Aptoide/aptoide-client-v8
aptoide-database/src/main/java/cm/aptoide/pt/database/room/RoomStore.java
Java
gpl-3.0
2,135
#! /bin/bash # # loads supporting data for Energy schema in TOTUS # usage () { cat <<EOF NAME $(basename $0) - loads Energy meta data to Totus database SYNOPSIS $(basename $0) -i <dummy input dir> -s <db server> -d <db name> -u <db user> -p <db password> -h DESCRIPTION -i dummy input directory (needed by load API, but unused) -s database server (host) [optional] -d database name to import exposure data to -u database user to connect as -p password for above user -h help EOF } [ "$BIN" ] || BIN=`cd $(dirname $0); pwd` # import common functions . $BIN/common.sh # parseOptions $* # # assign global command line parameters data=$DATA server=$SERVER db=$DB user=$USER passwd=$PASSWD schema="energy" # load supporting data PGPASSWORD=$passwd psql -q -e -a -h $server -d $db -U $user <<EOF \set ON_ERROR_STOP SET search_path = $schema, public; INSERT INTO scenario (code, description) VALUES ('CONTINUITY', 'Continuity'), ('CURRENT', 'Current accounts'); INSERT INTO activity (code, description) VALUES ('HEATING', 'Household heating'), ('ALL', 'All energy activities'); -- create default model SELECT * FROM energy.configure_model_run ( 'TOTAL_RESIDENTS_MODEL', 'Energy intensity is 10 times the number of people in the selected area', 'ALL', 'CURRENT', ARRAY [ ('T 88', '', 10.0)::energy.definition_part ] ); -- call stored procedure to create default energy intensity data set for 1996, 2001 and 2011 SELECT * FROM energy.model_intensity ( 'TOTAL_RESIDENTS_MODEL'::VARCHAR, 1996::SMALLINT ) LIMIT 1; SELECT * FROM energy.model_intensity ( 'TOTAL_RESIDENTS_MODEL'::VARCHAR, 2001::SMALLINT ) LIMIT 1; SELECT * FROM energy.model_intensity ( 'TOTAL_RESIDENTS_MODEL'::VARCHAR, 2006::SMALLINT ) LIMIT 1; EOF [ $? -ne 0 ] && { ABORT "Failed preparing Energy intensity data"; } exit 0;
guolivar/totus-niwa
database/bin/loadEnergy.sh
Shell
gpl-3.0
2,037
/* * main.c * scard * * Created by Michel Depeige on 22/12/2014. * Copyright (c) 2014 Michel Depeige. * * 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, 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 (see the file COPYING); if not, write to the * Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * */ #define _GNU_SOURCE #define _BSD_SOURCE #define __BSD_VISIBLE 1 #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <event.h> #ifdef HAVE_CONFIG_H #include <stdlib.h> #include <event.h> #include "config.h" #include "conf.h" #include "eca.h" #include "main.h" #include "tools.h" #endif /* globals */ conf_t g_conf; /* prototypes */ void watchdog(evutil_socket_t fd, short what, void *arg); int main(int argc, char *argv[]) { struct event_base *base; struct event *ev; struct timeval timeout; /* init the program, check opt, init some stuff... */ checkopt(argc, argv); if (init(&base) == ERROR) exit(ERROR); /* switch to daemon mode if needed */ if (g_mode & DAEMON) daemonize(); /* watchdog */ timeout.tv_sec = 10; timeout.tv_usec = 0; ev = event_new(base, -1, EV_PERSIST, watchdog, NULL); event_add(ev, &timeout); /* schedule file rotate */ eca_schedule_rotate(base); /* event loop */ event_base_dispatch(base); eca_cleanup(); log_msg("[-] exiting\n"); log_cleanup(); http_cleanup(); conf_erase(&g_conf); return(NOERROR); } void watchdog(evutil_socket_t fd, short what, void *arg) { (void)fd; (void)what; (void)arg; eca_check_status(); }
webdev-team/scard
src/scard/main.c
C
gpl-3.0
2,053
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contests', '0001_initial'), ] operations = [ migrations.CreateModel( name='SuspendedProblem', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('suspend_init_tests', models.BooleanField(default=True)), ('problem_instance', models.OneToOneField(related_name='suspended', to='contests.ProblemInstance', on_delete=models.CASCADE)), ], options={ }, bases=(models.Model,), ), ]
sio2project/oioioi
oioioi/suspendjudge/migrations/0001_initial.py
Python
gpl-3.0
760
package com.gr8pefish.hardchoices.events; import com.gr8pefish.hardchoices.networking.UpdateCraftingMessage; import com.gr8pefish.hardchoices.networking.NetworkingHandler; import com.gr8pefish.hardchoices.players.ExtendedPlayer; import com.gr8pefish.hardchoices.players.PlayerData; import com.gr8pefish.hardchoices.proxies.CommonProxy; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; import cpw.mods.fml.common.registry.GameRegistry; public class FMLEventHandler { /* When an item is crafted, check if the item is from a mod-set in the config file, and disable the mods in that mod's set if needed */ @SubscribeEvent public void itemCraftedEvent(PlayerEvent.ItemCraftedEvent event) { //fired after pulling the item away GameRegistry.UniqueIdentifier identifier = GameRegistry.findUniqueIdentifierFor(event.crafting.getItem()); ExtendedPlayer playerData = ExtendedPlayer.get(event.player); for (String modId : playerData.disabledMods.keySet()){ if (modId.toLowerCase().trim().equals(identifier.modId.toLowerCase().trim())){ //trims unnecessary? if (!playerData.disabledMods.get(modId)){ if (!PlayerData.getBlacklistGroupDisabled(modId, event.player)){ //if mod group isn't disabled PlayerData.disableGroupMods(modId, event.player); //disable them CommonProxy.saveProxyData(event.player); //save changes NetworkingHandler.network.sendToServer(new UpdateCraftingMessage("updtCrftng")); //send message from client to server to update } } } } } }
gr8pefish/HardChoices
src/main/java/com/gr8pefish/hardchoices/events/FMLEventHandler.java
Java
gpl-3.0
1,770
#include <stdlib.h> #include <stdbool.h> #include <assert.h> #include "tree.h" typedef bool __rb_tree_color_type; struct __c_tree_node { struct __c_tree_node* parent; struct __c_tree_node* left; struct __c_tree_node* right; CReferencePtr data; __rb_tree_color_type color; }; struct __c_tree { CCompare key_compare; CTreeNode* header; size_t node_count; }; static const __rb_tree_color_type s_rb_tree_color_red = false; static const __rb_tree_color_type s_rb_tree_color_black = true; STATIC INLINE bool __is_header(CTreeNode* node) { return (node ? (node->parent->parent == node && node->color == s_rb_tree_color_red) : false); } STATIC INLINE bool __is_root(CTreeNode* node) { return (node ? (node->parent->parent == node && node->color == s_rb_tree_color_black) : false); } STATIC INLINE bool __is_left(CTreeNode* node) { return (node ? node->parent->left == node : false); } STATIC INLINE bool __is_right(CTreeNode* node) { return (node ? node->parent->right == node : false); } STATIC INLINE bool __is_black(CTreeNode* node) { return (node ? (node->color == s_rb_tree_color_black) : true); } STATIC INLINE bool __is_red(CTreeNode* node) { return (node ? (node->color == s_rb_tree_color_red) : false); } STATIC INLINE bool __has_left(CTreeNode* node) { return (node ? node->left != NULL : false); } STATIC INLINE bool __has_right(CTreeNode* node) { return (node ? node->right != NULL : false); } STATIC INLINE CTreeNode* __left(CTreeNode* node) { return node->left; } STATIC INLINE CTreeNode* __right(CTreeNode* node) { return node->right; } STATIC INLINE CTreeNode* __parent(CTreeNode* node) { return node->parent; } STATIC INLINE CTreeNode* __grand_parent(CTreeNode* node) { return node->parent->parent; } STATIC INLINE CTreeNode* __uncle(CTreeNode* node) { return (__is_left(__parent(node)) ? __right(__grand_parent(node)) : __left(__grand_parent(node))); } STATIC INLINE CTreeNode* __sibling(CTreeNode* node) { return (__is_left(node) ? __right(__parent(node)) : __left(__parent(node))); } STATIC INLINE __rb_tree_color_type __color(CTreeNode* node) { return node->color; } STATIC INLINE CReferencePtr __value(CTreeNode* node) { return node->data; } STATIC INLINE CTreeNode* __root(CTree* tree) { return tree->header->parent; } STATIC INLINE CTreeNode* __leftmost(CTree* tree) { return tree->header->left; } STATIC INLINE CTreeNode* __rightmost(CTree* tree) { return tree->header->right; } STATIC INLINE void __set_root(CTree* tree, CTreeNode* root) { tree->header->parent = root; } STATIC INLINE void __set_leftmost(CTree* tree, CTreeNode* leftmost) { tree->header->left = leftmost; } STATIC INLINE void __set_rightmost(CTree* tree, CTreeNode* rightmost) { tree->header->right = rightmost; } STATIC CTreeNode* __minimum(CTreeNode* node) { if (!node) { return NULL; } while (node->left) { node = node->left; } return node; } STATIC CTreeNode* __maximum(CTreeNode* node) { if (!node) { return NULL; } while (node->right) { node = node->right; } return node; } STATIC void __rotate_right(CTreeNode* node, CTreeNode* root) { if (!node || !node->left) { return; } CTreeNode* x = node; CTreeNode* y = x->left; x->left = y->right; if (y->right) { y->right->parent = x; } if (x == root) { x->parent->parent = y; } else if (__is_left(x)) { x->parent->left = y; } else if (__is_right(x)) { x->parent->right = y; } y->parent = x->parent; y->right = x; x->parent = y; } STATIC void __rotate_left(CTreeNode* node, CTreeNode* root) { if (!node || !node->right) { return; } CTreeNode* x = node; CTreeNode* y = x->right; x->right = y->left; if (y->left) { y->left->parent = x; } if (x == root) { x->parent->parent = y; } else if (__is_left(x)) { x->parent->left = y; } else if (__is_right(x)) { x->parent->right = y; } y->parent = x->parent; y->left = x; x->parent = y; } STATIC bool __key_compare(CReferencePtr lhs, CReferencePtr rhs) { return (lhs < rhs); } STATIC CTreeNode* __create_node(CTreeNode** node, CReferencePtr data) { if (!node || *node) { return NULL; } *node = (CTreeNode*) malloc(sizeof(CTreeNode)); if (!(*node)) { return NULL; } (*node)->parent = NULL; (*node)->left = NULL; (*node)->right = NULL; (*node)->data = data; (*node)->color = s_rb_tree_color_red; return *node; } STATIC void __destroy_node(CTreeNode* node) { FREE(node->data); FREE(node); } STATIC void __erase(CTreeNode* node) // erase node and it's children { while (node) { __erase(node->right); CTreeNode* left = node->left; __destroy_node(node); node = left; } } STATIC void __rebalance_insert(CTree* tree, CTreeNode* node) { if (!tree || !node) { return; } while (__root(tree) != node && __is_red(__parent(node))) { if (__is_left(__parent(node))) { if (__is_red(__uncle(node))) { __parent(node)->color = s_rb_tree_color_black; __uncle(node)->color = s_rb_tree_color_black; __grand_parent(node)->color = s_rb_tree_color_red; node = __grand_parent(node); } else { if (__is_right(node)) { node = __parent(node); __rotate_left(node, __root(tree)); } __parent(node)->color = s_rb_tree_color_black; __grand_parent(node)->color = s_rb_tree_color_red; __rotate_right(__grand_parent(node), __root(tree)); } } else { if (__is_red(__uncle(node))) { __parent(node)->color = s_rb_tree_color_black; __uncle(node)->color = s_rb_tree_color_black; __grand_parent(node)->color = s_rb_tree_color_red; node = __grand_parent(node); } else { if (__is_left(node)) { node = __parent(node); __rotate_right(node, __root(tree)); } __parent(node)->color = s_rb_tree_color_black; __grand_parent(node)->color = s_rb_tree_color_red; __rotate_left(__grand_parent(node), __root(tree)); } } } __root(tree)->color = s_rb_tree_color_black; } STATIC CTreeNode* __insert(CTree* tree, CTreeNode* parent, CReferencePtr data) { CTreeNode* node = NULL; if (!__create_node(&node, data)) { return NULL; } CCompare key_compare = tree->key_compare; CTreeNode* header = tree->header; if (parent == tree->header || key_compare(data, parent->data)) { parent->left = node; if (parent == header) { header->parent = node; header->right = node; } else if (parent == __leftmost(tree)) { header->left = node; } } else { parent->right = node; if (parent == __rightmost(tree)) { header->right = node; } } node->parent = parent; __rebalance_insert(tree, node); ++(tree->node_count); return node; } CTree* CTREE_CreateTree(CTree** tree, CCompare comp) { if (!tree || *tree) { return NULL; } *tree = (CTree*) malloc(sizeof(CTree)); if (!(*tree)) { return NULL; } (*tree)->header = NULL; if (!__create_node(&((*tree)->header), NULL)) { FREE(*tree); return NULL; } (*tree)->node_count = 0; (*tree)->key_compare = comp ? comp : __key_compare; (*tree)->header->left = (*tree)->header; (*tree)->header->right = (*tree)->header; return *tree; } void CTREE_DestroyTree(CTree* tree) { CTREE_Clear(tree); FREE(tree); } CReferencePtr CTREE_Reference(CTreeNode* node) { return node ? __value(node) : NULL; } CTreeNode* CTREE_Begin(CTree* tree) { return tree ? __leftmost(tree) : NULL; } CTreeNode* CTREE_End(CTree* tree) { return tree ? tree->header : NULL; } void CTREE_Forward(CTreeNode** node) { if (!node || !(*node)) { return; } if ((*node)->right) { *node = __minimum((*node)->right); } else { CTreeNode* parent = (*node)->parent; while (parent->right == *node) { *node = parent; parent = parent->parent; } // in the case of node is header and parent is root if (parent != (*node)->right) { *node = parent; } } } void CTREE_Backward(CTreeNode** node) { if (!node || !(*node)) { return; } if (__is_header(*node)) { // node is End() of tree *node = (*node)->right; } else if ((*node)->left) { *node = __maximum((*node)->left); } else { CTreeNode* parent = (*node)->parent; while (parent->left == *node) { *node = parent; parent = parent->parent; } *node = parent; } } bool CTREE_Empty(CTree* tree) { if (!tree) { return true; } return tree->node_count == 0; } size_t CTREE_Size(CTree* tree) { if (!tree) { return 0; } return tree->node_count; } size_t CTREE_MaxSize(void) { return (-1); } CTreeNode* CTREE_InsertEqual(CTree* tree, CReferencePtr data) { if (!tree || !data) { return NULL; } CTreeNode* y = tree->header; CTreeNode* x = __root(tree); CCompare key_compare = tree->key_compare; while (x) { y = x; x = key_compare(data, x->data) ? x->left : x->right; } return __insert(tree, y, data); } CTreeNode* CTREE_InsertUnique(CTree* tree, CReferencePtr data) { if (!tree || !data) { return NULL; } CTreeNode* y = tree->header; CTreeNode* x = __root(tree); CCompare key_compare = tree->key_compare; bool comp = true; while (x) { y = x; comp = key_compare(data, x->data); x = comp ? x->left : x->right; } CTreeNode* z = y; if (comp) { if (z == CTREE_Begin(tree)) { return __insert(tree, y, data); } else { CTREE_Backward(&z); } } if (key_compare(z->data, data)) { return __insert(tree, y, data); } return NULL; } CTreeNode* CTREE_Erase(CTree* tree, CTreeNode* node) { if (!tree || !node) { return CTREE_End(tree); } CTreeNode* ret_node = node; CTREE_Forward(&ret_node); CTreeNode* erase_node = node; CTreeNode* replace_node = NULL; CTreeNode* replace_parent = NULL; if (!__has_left(erase_node)) { // erase_node has right child or no child // replace_node may be null replace_node = __right(erase_node); } else { if (!__has_right(erase_node)) { // erase_node has left child replace_node = __left(erase_node); assert(replace_node); } else { // erase_node has both children // replace_node may be null erase_node = __minimum(__right(erase_node)); replace_node = __right(erase_node); } } assert(erase_node); if (erase_node == node) { // replace erase_node with replace_node if (__root(tree) == erase_node) { __set_root(tree, replace_node); } else { if (__is_left(erase_node)) { __parent(erase_node)->left = replace_node; } else { __parent(erase_node)->right = replace_node; } } if (__leftmost(tree) == erase_node) { __set_leftmost(tree, replace_node ? __minimum(replace_node) : __parent(erase_node)); } if (__rightmost(tree) == erase_node) { __set_rightmost(tree, replace_node ? __maximum(replace_node) : __parent(erase_node)); } if (replace_node) { replace_node->parent = __parent(erase_node); } replace_parent = __parent(erase_node); } else { // erase_node is node's successor if (__root(tree) == node) { __set_root(tree, erase_node); } else { if (__is_left(node)) { __parent(node)->left = erase_node; } else { __parent(node)->right = erase_node; } } erase_node->left = __left(node); __left(node)->parent = erase_node; if (erase_node != __right(node)) { erase_node->right = __right(node); __right(node)->parent = erase_node; __parent(erase_node)->left = replace_node; if (replace_node) { replace_node->parent = __parent(erase_node); } replace_parent = __parent(erase_node); } else { replace_parent = erase_node; } // swap color of node and node's successor, since node has both children // node's successor will take place of node, change its color to make sure // black node number of the left child of node is not affected __rb_tree_color_type color = erase_node->color; erase_node->color = node->color; node->color = color; erase_node->parent = __parent(node); erase_node = node; } // rebalance when erase_node is black if (__is_black(erase_node)) { while (replace_node != __root(tree) && __is_black(replace_node)) { if (replace_node) { assert(__parent(replace_node) == replace_parent); assert(__left(replace_parent) == replace_node || __right(replace_parent) == replace_node); } // replace_node may be null if (replace_node == __left(replace_parent)) { CTreeNode* replace_sibling = __right(replace_parent); if (__is_red(replace_sibling)) { replace_sibling->color = s_rb_tree_color_black; replace_parent->color = s_rb_tree_color_red; __rotate_left(replace_parent, __root(tree)); replace_sibling = __right(replace_parent); } if ((!__has_left(replace_sibling) || __is_black(__left(replace_sibling))) && (!__has_right(replace_sibling) || __is_black(__right(replace_sibling)))) { replace_sibling->color = s_rb_tree_color_red; replace_node = replace_parent; replace_parent = __parent(replace_parent); } else { if (!__has_right(replace_sibling) || __is_black(__right(replace_sibling))) { if (__has_left(replace_sibling)) { __left(replace_sibling)->color = s_rb_tree_color_black; } replace_sibling->color = s_rb_tree_color_red; __rotate_right(replace_sibling, __root(tree)); replace_sibling = __right(replace_parent); } replace_sibling->color = replace_parent->color; replace_parent->color = s_rb_tree_color_black; if (__has_right(replace_sibling)) { __right(replace_sibling)->color = s_rb_tree_color_black; } __rotate_left(replace_parent, __root(tree)); break; } } else { CTreeNode* replace_sibling = __left(replace_parent); if (__is_red(replace_sibling)) { replace_sibling->color = s_rb_tree_color_black; replace_parent->color = s_rb_tree_color_red; __rotate_right(replace_parent, __root(tree)); replace_sibling = __left(replace_parent); } if ((!__has_left(replace_sibling) || __is_black(__left(replace_sibling))) && (!__has_right(replace_sibling) || __is_black(__right(replace_sibling)))) { replace_sibling->color = s_rb_tree_color_red; replace_node = replace_parent; replace_parent = __parent(replace_parent); } else { if (!__has_left(replace_sibling) || __is_black(__left(replace_sibling))) { if (__has_right(replace_sibling)) { __right(replace_sibling)->color = s_rb_tree_color_black; } replace_sibling->color = s_rb_tree_color_red; __rotate_left(replace_sibling, __root(tree)); replace_sibling = __left(replace_parent); } replace_sibling->color = replace_parent->color; replace_parent->color = s_rb_tree_color_black; if (__has_left(replace_sibling)) { __left(replace_sibling)->color = s_rb_tree_color_black; } __rotate_right(replace_parent, __root(tree)); break; } } } if (replace_node) { replace_node->color = s_rb_tree_color_black; } } __destroy_node(erase_node); --(tree->node_count); return ret_node; } void CTREE_Clear(CTree* tree) { if (!tree) { return; } __erase(__root(tree)); CTreeNode* header = tree->header; header->parent = NULL; header->left = header; header->right = header; tree->node_count = 0; } CTreeNode* CTREE_Find(CTree* tree, CReferencePtr data) { if (CTREE_Empty(tree) || !data) { return CTREE_End(tree); } CCompare key_compare = tree->key_compare; CTreeNode* node = __root(tree); while (node) { if (key_compare(data, node->data)) { node = node->left; } else { if (!key_compare(node->data, data)) { return node; } node = node->right; } } return CTREE_End(tree); }
matrixjoeq/Handy
c/container/tree.c
C
gpl-3.0
18,760
class Message { public static avatar = ".chat-message-avatar"; public static avatarImg(userId: string): string { return `.avatar_${userId}`; } public static local(messageId: string): string { return `.local${messageId}`; } public static info = ".chat-message-info"; public static displayedName = ".chat-name"; public static guest = ".chat-name-guest"; public static creator = ".chat-name-creator"; public static moderator = ".chat-name-moderator"; public static content = ".chat-message-content"; public static right = ".chat-message-right"; public static terrariaStatus = ".chat-terraria-status"; public static terrariaOnline = ".chat-terraria-online"; public static terrariaOffline = ".chat-terraria-offline"; } export default Message;
popstarfreas/PhaseClient
app/node_modules/phaseweb/elementidentifiers/message.ts
TypeScript
gpl-3.0
836
/** * zepto插件:向左滑动删除动效 * 使用方法:$('.itemWipe').touchWipe({itemDelete: '.item-delete'}); * 参数:itemDelete 删除按钮的样式名 */ (function($) { $.fn.touchWipe = function(option) { var isMove = 0; var defaults = { itemDelete: '.item-delete', //删除元素 }; var isMoveAdd = function(){ isMove += 1; } var isMoveZero = function(){ isMove = 0; } /* var abc = function(){ return isMove } console.log(abc());*/ var opts = $.extend({}, defaults, option); //配置选项 var delWidth = $(opts.itemDelete).width(); var initX; //触摸位置 var moveX; //滑动时的位置 var X = 0; //移动距离 var objX = 0; //目标对象位置 $(this).on('touchstart', function(event) { //event.preventDefault(); var obj = this; initX = event.targetTouches[0].pageX; objX = (obj.style.WebkitTransform.replace(/translateX\(/g, "").replace(/px\)/g, "")) * 1; if (objX == 0) { $(this).on('touchmove', function(event) { //event.preventDefault(); var obj = this; moveX = event.targetTouches[0].pageX; X = moveX - initX; if (X >= 0) { var abc = function(){ isMoveAdd(); } abc(); obj.style.WebkitTransform = "translateX(" + 0 + "px)"; } else if (X < 0) { var l = Math.abs(X); obj.style.WebkitTransform = "translateX(" + -l + "px)"; if (l > delWidth) { l = delWidth; obj.style.WebkitTransform = "translateX(" + -l + "px)"; } } }); } else if (objX < 0) { $(this).on('touchmove', function(event) { var abc = function(){ isMoveAdd(); } abc(); //event.preventDefault(); var obj = this; moveX = event.targetTouches[0].pageX; X = moveX - initX; if (X >= 0) { var r = -delWidth + Math.abs(X); obj.style.WebkitTransform = "translateX(" + r + "px)"; if (r > 0) { r = 0; obj.style.WebkitTransform = "translateX(" + r + "px)"; } } else { //向左滑动 obj.style.WebkitTransform = "translateX(" + -delWidth + "px)"; } }); } }) $(this).on('touchend', function(event) { //event.preventDefault(); var obj = this; objX = (obj.style.WebkitTransform.replace(/translateX\(/g, "").replace(/px\)/g, "")) * 1; var abc = function(){ return isMove } /* var num = abc(); if(num>0){ var zero = function(){ isMoveZero(); } zero(); }else{ } */ if (objX > -delWidth / 2) { obj.style.transition = "all 0.2s"; obj.style.WebkitTransform = "translateX(" + 0 + "px)"; obj.style.transition = "all 0"; objX = 0; } else { obj.style.transition = "all 0.2s"; obj.style.WebkitTransform = "translateX(" + -delWidth + "px)"; obj.style.transition = "all 0"; objX = -delWidth; } }) //链式返回 return this; }; })(Zepto); $(function() { function deleteMessage(id) { var rawID = id.replace('del', ''), $loading = document.getElementById("loading"), host = "123.56.91.131:8090", host1 = "localhost:4567"; $loading.style.display = "block"; $.ajax({ type: "DELETE", url: "http://" + host + "/mobile/v2/message", data: {id: rawID}, success: function(response, status, xhr) { $('.'+id).remove(); $loading.style.display = "none"; }, error:function(XMLHttpRequest, textStatus, errorThrown) { $loading.style.display = "none"; alert(errorThrown); } }); } // $('.list-li').touchWipe({itemDelete: '.btn'}); $('.detail').on('click', function(event) { //event.preventDefault(); $('.content-detail').hide(); $('.detail').hide(); }) $('.list-li').on('click',function(event) { var content = $(this).attr('_val'); $('.content-detail').html(content); $('.content-detail').show(); $('.detail').show(); //alert() }) $('.item-delete').on('click', function(event) { event.preventDefault(); var r=confirm("确认删除?") var id = $(this).attr('_val'); if(r){ deleteMessage(id); } return false; }) });
jay16/pm-bi
app/assets/javascripts/mobile_v2_message.js
JavaScript
gpl-3.0
4,720
/* * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.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, see <http://www.gnu.org/licenses/>. */ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellScript.h" #include "SpellAuraEffects.h" #include "icecrown_citadel.h" enum Texts { SAY_AGGRO = 0, // You are fools to have come to this place! The icy winds of Northrend will consume your souls! SAY_UNCHAINED_MAGIC = 1, // Suffer, mortals, as your pathetic magic betrays you! EMOTE_WARN_BLISTERING_COLD = 2, // %s prepares to unleash a wave of blistering cold! SAY_BLISTERING_COLD = 3, // Can you feel the cold hand of death upon your heart? SAY_RESPITE_FOR_A_TORMENTED_SOUL = 4, // Aaah! It burns! What sorcery is this?! SAY_AIR_PHASE = 5, // Your incursion ends here! None shall survive! SAY_PHASE_2 = 6, // Now feel my master's limitless power and despair! EMOTE_WARN_FROZEN_ORB = 7, // %s fires a frozen orb towards $N! SAY_KILL = 8, // Perish! // A flaw of mortality... SAY_BERSERK = 9, // Enough! I tire of these games! SAY_DEATH = 10,// Free...at last... }; enum Spells { // Sindragosa SPELL_SINDRAGOSA_S_FURY = 70608, SPELL_TANK_MARKER = 71039, SPELL_FROST_AURA = 70084, SPELL_PERMAEATING_CHILL = 70109, SPELL_CLEAVE = 19983, SPELL_TAIL_SMASH = 71077, SPELL_FROST_BREATH_P1 = 69649, SPELL_FROST_BREATH_P2 = 73061, SPELL_UNCHAINED_MAGIC = 69762, SPELL_BACKLASH = 69770, SPELL_ICY_GRIP = 70117, SPELL_ICY_GRIP_JUMP = 70122, SPELL_BLISTERING_COLD = 70123, SPELL_FROST_BEACON = 70126, SPELL_ICE_TOMB_TARGET = 69712, SPELL_ICE_TOMB_DUMMY = 69675, SPELL_ICE_TOMB_UNTARGETABLE = 69700, SPELL_ICE_TOMB_DAMAGE = 70157, SPELL_ASPHYXIATION = 71665, SPELL_FROST_BOMB_TRIGGER = 69846, SPELL_FROST_BOMB_VISUAL = 70022, SPELL_FROST_BOMB = 69845, SPELL_MYSTIC_BUFFET = 70128, // Spinestalker SPELL_BELLOWING_ROAR = 36922, SPELL_CLEAVE_SPINESTALKER = 40505, SPELL_TAIL_SWEEP = 71370, // Rimefang SPELL_FROST_BREATH = 71386, SPELL_FROST_AURA_RIMEFANG = 71387, SPELL_ICY_BLAST = 71376, SPELL_ICY_BLAST_AREA = 71380, // Frostwarden Handler SPELL_FOCUS_FIRE = 71350, SPELL_ORDER_WHELP = 71357, SPELL_CONCUSSIVE_SHOCK = 71337, }; enum Events { // Sindragosa EVENT_BERSERK = 1, EVENT_CLEAVE = 2, EVENT_TAIL_SMASH = 3, EVENT_FROST_BREATH = 4, EVENT_UNCHAINED_MAGIC = 5, EVENT_ICY_GRIP = 6, EVENT_BLISTERING_COLD = 7, EVENT_BLISTERING_COLD_YELL = 8, EVENT_AIR_PHASE = 9, EVENT_ICE_TOMB = 10, EVENT_FROST_BOMB = 11, EVENT_LAND = 12, // Spinestalker EVENT_BELLOWING_ROAR = 13, EVENT_CLEAVE_SPINESTALKER = 14, EVENT_TAIL_SWEEP = 15, // Rimefang EVENT_FROST_BREATH_RIMEFANG = 16, EVENT_ICY_BLAST = 17, EVENT_ICY_BLAST_CAST = 18, // Trash EVENT_FROSTWARDEN_ORDER_WHELP = 19, EVENT_CONCUSSIVE_SHOCK = 20, // event groups EVENT_GROUP_LAND_PHASE = 1, }; enum FrostwingData { DATA_MYSTIC_BUFFET_STACK = 0, DATA_FROSTWYRM_OWNER = 1, DATA_WHELP_MARKER = 2, DATA_LINKED_GAMEOBJECT = 3, DATA_TRAPPED_PLAYER = 4, }; enum MovementPoints { POINT_FROSTWYRM_FLY_IN = 1, POINT_FROSTWYRM_LAND = 2, POINT_AIR_PHASE = 3, POINT_LAND = 4, }; enum Shadowmourne { QUEST_FROST_INFUSION = 24757, ITEM_SHADOW_S_EDGE = 49888, SPELL_FROST_INFUSION = 72292, SPELL_FROST_IMBUED_BLADE = 72290, }; static Position const RimefangFlyPos = {4413.309f, 2456.421f, 223.3795f, 2.890186f}; static Position const RimefangLandPos = {4413.309f, 2456.421f, 203.3848f, 2.890186f}; static Position const SpinestalkerFlyPos = {4418.895f, 2514.233f, 220.4864f, 3.396045f}; static Position const SpinestalkerLandPos = {4418.895f, 2514.233f, 203.3848f, 3.396045f}; static Position const SindragosaSpawnPos = {4818.700f, 2483.710f, 287.0650f, 3.089233f}; static Position const SindragosaFlyPos = {4475.190f, 2484.570f, 234.8510f, 3.141593f}; static Position const SindragosaLandPos = {4419.190f, 2484.570f, 203.3848f, 3.141593f}; static Position const SindragosaAirPos = {4475.990f, 2484.430f, 247.9340f, 3.141593f}; class FrostwyrmLandEvent : public BasicEvent { public: FrostwyrmLandEvent(Creature& _owner, Position const& _dest) : owner(_owner), dest(_dest) { } bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) { owner.GetMotionMaster()->MovePoint(POINT_FROSTWYRM_LAND, dest); return true; } Creature& owner; Position const& dest; }; class boss_sindragosa : public CreatureScript { public: boss_sindragosa() : CreatureScript("boss_sindragosa") { } struct boss_sindragosaAI : public BossAI { boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA) { } void InitializeAI() { if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) me->IsAIEnabled = false; else if (!me->isDead()) Reset(); } void Reset() { BossAI::Reset(); me->SetReactState(REACT_DEFENSIVE); DoCast(me, SPELL_TANK_MARKER, true); events.ScheduleEvent(EVENT_BERSERK, 600000); events.ScheduleEvent(EVENT_CLEAVE, 10000, EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_TAIL_SMASH, 20000, EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_FROST_BREATH, urand(8000, 12000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_UNCHAINED_MAGIC, urand(9000, 14000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_ICY_GRIP, 33500, EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_AIR_PHASE, 50000); mysticBuffetStack = 0; isThirdPhase = false; if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255) { me->SetFlying(true); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); } } void JustDied(Unit* killer) { BossAI::JustDied(killer); Talk(SAY_DEATH); } void EnterCombat(Unit* victim) { if (!instance->CheckRequiredBosses(DATA_SINDRAGOSA, victim->ToPlayer())) { EnterEvadeMode(); instance->DoCastSpellOnPlayers(LIGHT_S_HAMMER_TELEPORT); return; } BossAI::EnterCombat(victim); DoCast(me, SPELL_FROST_AURA); DoCast(me, SPELL_PERMAEATING_CHILL); Talk(SAY_AGGRO); } void JustReachedHome() { BossAI::JustReachedHome(); instance->SetBossState(DATA_SINDRAGOSA, FAIL); me->SetFlying(false); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); } void KilledUnit(Unit* victim) { if (victim->GetTypeId() == TYPEID_PLAYER) Talk(SAY_KILL); } void DoAction(const int32 action) { if (action == ACTION_START_FROSTWYRM) { instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 255); if (me->isDead()) return; me->SetSpeed(MOVE_FLIGHT, 4.0f); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); float moveTime = me->GetExactDist(&SindragosaFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f); me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, SindragosaLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250)); me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, SindragosaFlyPos); DoCast(me, SPELL_SINDRAGOSA_S_FURY); } } uint32 GetData(uint32 type) { if (type == DATA_MYSTIC_BUFFET_STACK) return mysticBuffetStack; return 0xFFFFFFFF; } void MovementInform(uint32 type, uint32 point) { if (type != POINT_MOTION_TYPE) return; switch (point) { case POINT_FROSTWYRM_LAND: me->setActive(false); me->SetFlying(false); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SetHomePosition(SindragosaLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetSpeed(MOVE_FLIGHT, 2.0f); // Sindragosa enters combat as soon as she lands DoZoneInCombat(); break; case POINT_AIR_PHASE: me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 3, 6), false); events.ScheduleEvent(EVENT_FROST_BOMB, 8000); break; case POINT_LAND: me->SetFlying(false); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SetReactState(REACT_DEFENSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); DoStartMovement(me->getVictim()); // trigger Asphyxiation summons.DoAction(NPC_ICE_TOMB, ACTION_TRIGGER_ASPHYXIATION); break; default: break; } } void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) { if (!isThirdPhase && !HealthAbovePct(35)) { Talk(SAY_PHASE_2); events.CancelEvent(EVENT_AIR_PHASE); events.ScheduleEvent(EVENT_ICE_TOMB, urand(7000, 10000)); events.RescheduleEvent(EVENT_ICY_GRIP, urand(35000, 40000)); DoCast(me, SPELL_MYSTIC_BUFFET, true); isThirdPhase = true; } } void JustSummoned(Creature* summon) { summons.Summon(summon); } void SummonedCreatureDespawn(Creature* summon) { BossAI::SummonedCreatureDespawn(summon); if (summon->GetEntry() == NPC_ICE_TOMB) summon->AI()->JustDied(summon); } void SpellHitTarget(Unit* target, SpellEntry const* spell) { if (SpellEntry const* buffet = sSpellMgr->GetSpellForDifficultyFromSpell(sSpellStore.LookupEntry(70127), me)) if (buffet->Id == spell->Id) if (Aura const* mysticBuffet = target->GetAura(spell->Id)) mysticBuffetStack = std::max<uint8>(mysticBuffetStack, mysticBuffet->GetStackAmount()); // Frost Infusion if (Player* player = target->ToPlayer()) { if (SpellEntry const* breath = sSpellMgr->GetSpellForDifficultyFromSpell(sSpellStore.LookupEntry(isThirdPhase ? SPELL_FROST_BREATH_P2 : SPELL_FROST_BREATH_P1), me)) { if (player->GetQuestStatus(QUEST_FROST_INFUSION) != QUEST_STATUS_REWARDED && breath->Id == spell->Id) { if (Item* shadowsEdge = player->GetWeaponForAttack(BASE_ATTACK, true)) { if (!player->HasAura(SPELL_FROST_IMBUED_BLADE) && shadowsEdge->GetEntry() == ITEM_SHADOW_S_EDGE) { if (Aura* infusion = player->GetAura(SPELL_FROST_INFUSION)) { if (infusion->GetStackAmount() == 3) { player->CastSpell(player, SPELL_FROST_IMBUED_BLADE, true); player->RemoveAura(infusion); } else player->CastSpell(player, SPELL_FROST_INFUSION, true); } else player->CastSpell(player, SPELL_FROST_INFUSION, true); } } } } } if (spell->Id == SPELL_FROST_BOMB_TRIGGER) { target->CastSpell(target, SPELL_FROST_BOMB, true); target->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL); } } void UpdateAI(const uint32 diff) { if (!UpdateVictim() || !CheckInRoom()) return; events.Update(diff); if (me->HasUnitState(UNIT_STAT_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_BERSERK: DoScriptText(EMOTE_GENERIC_BERSERK_RAID, me); Talk(SAY_BERSERK); DoCast(me, SPELL_BERSERK); break; case EVENT_CLEAVE: DoCastVictim(SPELL_CLEAVE); events.ScheduleEvent(EVENT_CLEAVE, urand(15000, 20000), EVENT_GROUP_LAND_PHASE); break; case EVENT_TAIL_SMASH: DoCast(me, SPELL_TAIL_SMASH); events.ScheduleEvent(EVENT_TAIL_SMASH, urand(27000, 32000), EVENT_GROUP_LAND_PHASE); break; case EVENT_FROST_BREATH: DoCastVictim(isThirdPhase ? SPELL_FROST_BREATH_P2 : SPELL_FROST_BREATH_P1); events.ScheduleEvent(EVENT_FROST_BREATH, urand(20000, 25000), EVENT_GROUP_LAND_PHASE); break; case EVENT_UNCHAINED_MAGIC: Talk(SAY_UNCHAINED_MAGIC); DoCast(me, SPELL_UNCHAINED_MAGIC); events.ScheduleEvent(EVENT_UNCHAINED_MAGIC, urand(30000, 35000), EVENT_GROUP_LAND_PHASE); break; case EVENT_ICY_GRIP: DoCast(me, SPELL_ICY_GRIP); events.ScheduleEvent(EVENT_ICY_GRIP, urand(70000, 75000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_BLISTERING_COLD, 1000, EVENT_GROUP_LAND_PHASE); break; case EVENT_BLISTERING_COLD: Talk(EMOTE_WARN_BLISTERING_COLD); DoCast(me, SPELL_BLISTERING_COLD); events.ScheduleEvent(EVENT_BLISTERING_COLD_YELL, 5000, EVENT_GROUP_LAND_PHASE); break; case EVENT_BLISTERING_COLD_YELL: Talk(SAY_BLISTERING_COLD); break; case EVENT_AIR_PHASE: Talk(SAY_AIR_PHASE); me->SetFlying(true); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE, SindragosaAirPos); events.DelayEvents(45000, EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_AIR_PHASE, 110000); events.RescheduleEvent(EVENT_UNCHAINED_MAGIC, urand(55000, 60000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_LAND, 45000); break; case EVENT_ICE_TOMB: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_ICE_TOMB_UNTARGETABLE)) { Talk(EMOTE_WARN_FROZEN_ORB, target->GetGUID()); DoCast(target, SPELL_ICE_TOMB_DUMMY, true); } events.ScheduleEvent(EVENT_ICE_TOMB, urand(16000, 23000)); break; case EVENT_FROST_BOMB: { float destX, destY, destZ; destX = float(rand_norm()) * 117.25f + 4339.25f; if (destX > 4371.5f && destX < 4432.0f) destY = float(rand_norm()) * 111.0f + 2429.0f; else destY = float(rand_norm()) * 31.23f + 2454.64f; destZ = 205.0f; // random number close to ground, get exact in next call me->UpdateGroundPositionZ(destX, destY, destZ); Position pos; pos.Relocate(destX, destY, destZ); if (TempSummon* summ = me->SummonCreature(NPC_FROST_BOMB, pos, TEMPSUMMON_TIMED_DESPAWN, 40000)) { summ->CastSpell(summ, SPELL_FROST_BOMB_VISUAL, true); DoCast(summ, SPELL_FROST_BOMB_TRIGGER); //me->CastSpell(destX, destY, destZ, SPELL_FROST_BOMB_TRIGGER, false); } events.ScheduleEvent(EVENT_FROST_BOMB, urand(5000, 10000)); break; } case EVENT_LAND: { events.CancelEvent(EVENT_FROST_BOMB); me->GetMotionMaster()->MovePoint(POINT_LAND, SindragosaLandPos); break; } default: break; } } DoMeleeAttackIfReady(); } private: uint8 mysticBuffetStack; bool isThirdPhase; }; CreatureAI* GetAI(Creature* creature) const { return new boss_sindragosaAI(creature); } }; class npc_ice_tomb : public CreatureScript { public: npc_ice_tomb() : CreatureScript("npc_ice_tomb") { } struct npc_ice_tombAI : public Scripted_NoMovementAI { npc_ice_tombAI(Creature* creature) : Scripted_NoMovementAI(creature) { trappedPlayer = 0; } void Reset() { me->SetReactState(REACT_PASSIVE); } void SetGUID(const uint64& guid, int32 type/* = 0 */) { if (type == DATA_TRAPPED_PLAYER) { trappedPlayer = guid; existenceCheckTimer = 1000; } } void DoAction(const int32 action) { if (action == ACTION_TRIGGER_ASPHYXIATION) if (Player* player = ObjectAccessor::GetPlayer(*me, trappedPlayer)) player->CastSpell(player, SPELL_ASPHYXIATION, true); } void JustDied(Unit* /*killer*/) { me->RemoveAllGameObjects(); if (Player* player = ObjectAccessor::GetPlayer(*me, trappedPlayer)) { trappedPlayer = 0; player->RemoveAurasDueToSpell(SPELL_ICE_TOMB_DAMAGE); player->RemoveAurasDueToSpell(SPELL_ASPHYXIATION); } } void UpdateAI(const uint32 diff) { if (!trappedPlayer) return; if (existenceCheckTimer <= diff) { Player* player = ObjectAccessor::GetPlayer(*me, trappedPlayer); if (!player || player->isDead() || !player->HasAura(SPELL_ICE_TOMB_DAMAGE)) { // Remove object JustDied(me); me->DespawnOrUnsummon(); return; } existenceCheckTimer = 1000; } else existenceCheckTimer -= diff; } private: uint64 trappedPlayer; uint32 existenceCheckTimer; }; CreatureAI* GetAI(Creature* creature) const { return new npc_ice_tombAI(creature); } }; class npc_spinestalker : public CreatureScript { public: npc_spinestalker() : CreatureScript("npc_spinestalker") { } struct npc_spinestalkerAI : public ScriptedAI { npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { } void InitializeAI() { if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) me->IsAIEnabled = false; else if (!me->isDead()) Reset(); } void Reset() { events.Reset(); events.ScheduleEvent(EVENT_BELLOWING_ROAR, urand(20000, 25000)); events.ScheduleEvent(EVENT_CLEAVE_SPINESTALKER, urand(10000, 15000)); events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(8000, 12000)); me->SetReactState(REACT_DEFENSIVE); if (instance->GetData(DATA_SPINESTALKER) != 255) { me->SetFlying(true); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); } } void JustRespawned() { ScriptedAI::JustRespawned(); instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 1); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) { events.Reset(); instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 0); } void DoAction(const int32 action) { if (action == ACTION_START_FROSTWYRM) { instance->SetData(DATA_SPINESTALKER, 255); if (me->isDead()) return; me->SetSpeed(MOVE_FLIGHT, 2.0f); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); float moveTime = me->GetExactDist(&SpinestalkerFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f); me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, SpinestalkerLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250)); me->SetDefaultMovementType(IDLE_MOTION_TYPE); me->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE); me->StopMoving(); me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, SpinestalkerFlyPos); } } void MovementInform(uint32 type, uint32 point) { if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) return; me->SetFlying(false); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SetHomePosition(SpinestalkerLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STAT_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_BELLOWING_ROAR: DoCast(me, SPELL_BELLOWING_ROAR); events.ScheduleEvent(EVENT_BELLOWING_ROAR, urand(25000, 30000)); break; case EVENT_CLEAVE_SPINESTALKER: DoCastVictim(SPELL_CLEAVE_SPINESTALKER); events.ScheduleEvent(EVENT_CLEAVE_SPINESTALKER, urand(10000, 15000)); break; case EVENT_TAIL_SWEEP: DoCast(me, SPELL_TAIL_SWEEP); events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(22000, 25000)); break; default: break; } } DoMeleeAttackIfReady(); } private: EventMap events; InstanceScript* instance; }; CreatureAI* GetAI(Creature* creature) const { return new npc_spinestalkerAI(creature); } }; class npc_rimefang : public CreatureScript { public: npc_rimefang() : CreatureScript("npc_rimefang_icc") { } struct npc_rimefangAI : public ScriptedAI { npc_rimefangAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { } void InitializeAI() { if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) me->IsAIEnabled = false; else if (!me->isDead()) Reset(); } void Reset() { events.Reset(); events.ScheduleEvent(EVENT_FROST_BREATH_RIMEFANG, urand(12000, 15000)); events.ScheduleEvent(EVENT_ICY_BLAST, urand(30000, 35000)); me->SetReactState(REACT_DEFENSIVE); icyBlastCounter = 0; if (instance->GetData(DATA_RIMEFANG) != 255) { me->SetFlying(true); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); } } void JustRespawned() { ScriptedAI::JustRespawned(); instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 1); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) { events.Reset(); instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 0); } void DoAction(const int32 action) { if (action == ACTION_START_FROSTWYRM) { instance->SetData(DATA_RIMEFANG, 255); if (me->isDead()) return; me->SetSpeed(MOVE_FLIGHT, 2.0f); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); float moveTime = me->GetExactDist(&RimefangFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f); me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, RimefangLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250)); me->SetDefaultMovementType(IDLE_MOTION_TYPE); me->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE); me->StopMoving(); me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, RimefangFlyPos); } } void MovementInform(uint32 type, uint32 point) { if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) return; me->SetFlying(false); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SetHomePosition(RimefangLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); } void EnterCombat(Unit* /*victim*/) { DoCast(me, SPELL_FROST_AURA_RIMEFANG, true); } void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STAT_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_FROST_BREATH_RIMEFANG: DoCast(me, SPELL_FROST_BREATH); events.ScheduleEvent(EVENT_FROST_BREATH_RIMEFANG, urand(35000, 40000)); break; case EVENT_ICY_BLAST: { icyBlastCounter = RAID_MODE<uint32>(5, 7, 6, 8); me->SetReactState(REACT_PASSIVE); me->AttackStop(); me->SetFlying(true); me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, RimefangFlyPos); float moveTime = me->GetExactDist(&RimefangFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f); events.ScheduleEvent(EVENT_ICY_BLAST, uint64(moveTime) + urand(60000, 70000)); events.ScheduleEvent(EVENT_ICY_BLAST_CAST, uint64(moveTime) + 250); break; } case EVENT_ICY_BLAST_CAST: if (--icyBlastCounter) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) { me->SetFacingToObject(target); DoCast(target, SPELL_ICY_BLAST); } events.ScheduleEvent(EVENT_ICY_BLAST_CAST, 3000); } else if (Unit *victim = me->SelectVictim()) { me->SetReactState(REACT_DEFENSIVE); AttackStart(victim); me->SetFlying(false); } break; default: break; } } DoMeleeAttackIfReady(); } private: EventMap events; InstanceScript* instance; uint8 icyBlastCounter; }; CreatureAI* GetAI(Creature* creature) const { return new npc_rimefangAI(creature); } }; class npc_sindragosa_trash : public CreatureScript { public: npc_sindragosa_trash() : CreatureScript("npc_sindragosa_trash") { } struct npc_sindragosa_trashAI : public ScriptedAI { npc_sindragosa_trashAI(Creature* creature) : ScriptedAI(creature) { frostwyrmId = (creature->GetHomePosition().GetPositionY() < 2484.35f) ? DATA_RIMEFANG : DATA_SPINESTALKER; instance = creature->GetInstanceScript(); } void InitializeAI() { // Increase add count if (!me->isDead() && instance) instance->SetData(frostwyrmId, 1); // this cannot be in Reset because reset also happens on evade } void Reset() { // This is shared AI for handler and whelps if (me->GetEntry() == NPC_FROSTWARDEN_HANDLER) { events.ScheduleEvent(EVENT_FROSTWARDEN_ORDER_WHELP, 3000); events.ScheduleEvent(EVENT_CONCUSSIVE_SHOCK, urand(8000, 10000)); } isTaunted = false; } void JustRespawned() { ScriptedAI::JustRespawned(); // Increase add count if (instance) instance->SetData(frostwyrmId, 1); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) { // Decrease add count if (instance) instance->SetData(frostwyrmId, 0); } void SetData(uint32 type, uint32 data) { if (type == DATA_WHELP_MARKER) isTaunted = data != 0; } uint32 GetData(uint32 type) { if (type == DATA_FROSTWYRM_OWNER) return frostwyrmId; else if (type == DATA_WHELP_MARKER) return uint32(isTaunted); return 0; } void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STAT_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_FROSTWARDEN_ORDER_WHELP: DoCast(me, SPELL_ORDER_WHELP); events.ScheduleEvent(EVENT_FROSTWARDEN_ORDER_WHELP, 3000); break; case EVENT_CONCUSSIVE_SHOCK: DoCast(me, SPELL_CONCUSSIVE_SHOCK); events.ScheduleEvent(EVENT_CONCUSSIVE_SHOCK, urand(10000, 13000)); break; default: break; } } DoMeleeAttackIfReady(); } private: InstanceScript* instance; EventMap events; uint32 frostwyrmId; bool isTaunted; // Frostwing Whelp only }; CreatureAI* GetAI(Creature* creature) const { return new npc_sindragosa_trashAI(creature); } }; class spell_sindragosa_s_fury : public SpellScriptLoader { public: spell_sindragosa_s_fury() : SpellScriptLoader("spell_sindragosa_s_fury") { } class spell_sindragosa_s_fury_SpellScript : public SpellScript { PrepareSpellScript(spell_sindragosa_s_fury_SpellScript); bool Load() { targetCount = 0; return true; } void CountTargets(std::list<Unit*>& unitList) { targetCount = unitList.size(); } void HandleDummy(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); if (!GetHitUnit()->isAlive()) return; float resistance = float(GetHitUnit()->GetResistance(GetFirstSchoolInMask(SpellSchoolMask(GetSpellInfo()->SchoolMask)))); uint32 minResistFactor = uint32((resistance / (resistance + 510.0f))* 10.0f) * 2; uint32 randomResist = urand(0, (9 - minResistFactor) * 100)/100 + minResistFactor; uint32 damage = (uint32(GetEffectValue()/targetCount) * randomResist) / 10; SpellNonMeleeDamage damageInfo(GetCaster(), GetHitUnit(), GetSpellInfo()->Id, GetSpellInfo()->SchoolMask); damageInfo.damage = damage; GetCaster()->SendSpellNonMeleeDamageLog(&damageInfo); GetCaster()->DealSpellDamage(&damageInfo, false); } void Register() { OnEffect += SpellEffectFn(spell_sindragosa_s_fury_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_s_fury_SpellScript::CountTargets, EFFECT_1, TARGET_UNIT_AREA_ENTRY_DST); } uint32 targetCount; }; SpellScript* GetSpellScript() const { return new spell_sindragosa_s_fury_SpellScript(); } }; class UnchainedMagicTargetSelector { public: UnchainedMagicTargetSelector() { } bool operator()(Unit* unit) { return unit->getPowerType() != POWER_MANA; } }; class spell_sindragosa_unchained_magic : public SpellScriptLoader { public: spell_sindragosa_unchained_magic() : SpellScriptLoader("spell_sindragosa_unchained_magic") { } class spell_sindragosa_unchained_magic_SpellScript : public SpellScript { PrepareSpellScript(spell_sindragosa_unchained_magic_SpellScript); void FilterTargets(std::list<Unit*>& unitList) { unitList.remove_if(UnchainedMagicTargetSelector()); uint32 maxSize = GetCaster()->GetMap()->GetSpawnMode() & 1 ? 5 : 2; if (unitList.size() > maxSize) Voragine::RandomResizeList(unitList, maxSize); } void Register() { OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_unchained_magic_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENEMY_SRC); } }; SpellScript* GetSpellScript() const { return new spell_sindragosa_unchained_magic_SpellScript(); } }; class spell_sindragosa_instability : public SpellScriptLoader { public: spell_sindragosa_instability() : SpellScriptLoader("spell_sindragosa_instability") { } class spell_sindragosa_instability_AuraScript : public AuraScript { PrepareAuraScript(spell_sindragosa_instability_AuraScript); bool Validate(SpellEntry const* /*spell*/) { if (!sSpellStore.LookupEntry(SPELL_BACKLASH)) return false; return true; } void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { PreventDefaultAction(); if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) GetTarget()->CastCustomSpell(SPELL_BACKLASH, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID()); } void Register() { OnEffectRemove += AuraEffectRemoveFn(spell_sindragosa_instability_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; AuraScript* GetAuraScript() const { return new spell_sindragosa_instability_AuraScript(); } }; class spell_sindragosa_frost_beacon : public SpellScriptLoader { public: spell_sindragosa_frost_beacon() : SpellScriptLoader("spell_sindragosa_frost_beacon") { } class spell_sindragosa_frost_beacon_AuraScript : public AuraScript { PrepareAuraScript(spell_sindragosa_frost_beacon_AuraScript); bool Validate(SpellEntry const* /*spell*/) { if (!sSpellStore.LookupEntry(SPELL_ICE_TOMB_DAMAGE)) return false; return true; } void PeriodicTick(AuraEffect const* /*aurEff*/) { PreventDefaultAction(); if (Unit* caster = GetCaster()) caster->CastSpell(GetTarget(), SPELL_ICE_TOMB_DAMAGE, true); } void Register() { OnEffectPeriodic += AuraEffectPeriodicFn(spell_sindragosa_frost_beacon_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; AuraScript* GetAuraScript() const { return new spell_sindragosa_frost_beacon_AuraScript(); } }; class spell_sindragosa_ice_tomb : public SpellScriptLoader { public: spell_sindragosa_ice_tomb() : SpellScriptLoader("spell_sindragosa_ice_tomb_trap") { } class spell_sindragosa_ice_tomb_SpellScript : public SpellScript { PrepareSpellScript(spell_sindragosa_ice_tomb_SpellScript); bool Validate(SpellEntry const* /*spell*/) { if (!sObjectMgr->GetCreatureTemplate(NPC_ICE_TOMB)) return false; if (!sObjectMgr->GetGameObjectTemplate(GO_ICE_BLOCK)) return false; return true; } void SummonTomb() { Position pos; GetHitUnit()->GetPosition(&pos); if (TempSummon* summon = GetCaster()->SummonCreature(NPC_ICE_TOMB, pos)) { summon->AI()->SetGUID(GetHitUnit()->GetGUID(), DATA_TRAPPED_PLAYER); if (GameObject* go = summon->SummonGameObject(GO_ICE_BLOCK, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0)) { go->SetSpellId(SPELL_ICE_TOMB_DAMAGE); summon->AddGameObject(go); } } } void Register() { AfterHit += SpellHitFn(spell_sindragosa_ice_tomb_SpellScript::SummonTomb); } }; class spell_sindragosa_ice_tomb_AuraScript : public AuraScript { PrepareAuraScript(spell_sindragosa_ice_tomb_AuraScript); void PeriodicTick(AuraEffect const* /*aurEff*/) { PreventDefaultAction(); } void Register() { OnEffectPeriodic += AuraEffectPeriodicFn(spell_sindragosa_ice_tomb_AuraScript::PeriodicTick, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; SpellScript* GetSpellScript() const { return new spell_sindragosa_ice_tomb_SpellScript(); } AuraScript* GetAuraScript() const { return new spell_sindragosa_ice_tomb_AuraScript(); } }; class FrostBombTargetSelector { public: FrostBombTargetSelector(Unit* _caster, std::list<Creature*> const& _collisionList) : caster(_caster), collisionList(_collisionList) { } bool operator()(Unit* unit) { if (unit->HasAura(SPELL_ICE_TOMB_DAMAGE)) return true; for (std::list<Creature*>::const_iterator itr = collisionList.begin(); itr != collisionList.end(); ++itr) if ((*itr)->IsInBetween(caster, unit)) return true; return false; } Unit* caster; std::list<Creature*> const& collisionList; }; class spell_sindragosa_collision_filter : public SpellScriptLoader { public: spell_sindragosa_collision_filter() : SpellScriptLoader("spell_sindragosa_collision_filter") { } class spell_sindragosa_collision_filter_SpellScript : public SpellScript { PrepareSpellScript(spell_sindragosa_collision_filter_SpellScript); bool Validate(SpellEntry const* /*spell*/) { if (!sSpellStore.LookupEntry(SPELL_ICE_TOMB_DAMAGE)) return false; return true; } void FilterTargets(std::list<Unit*>& unitList) { std::list<Creature*> tombs; GetCreatureListWithEntryInGrid(tombs, GetCaster(), NPC_ICE_TOMB, 200.0f); unitList.remove_if(FrostBombTargetSelector(GetCaster(), tombs)); } void Register() { OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_collision_filter_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENEMY_SRC); } }; SpellScript* GetSpellScript() const { return new spell_sindragosa_collision_filter_SpellScript(); } }; class spell_sindragosa_icy_grip : public SpellScriptLoader { public: spell_sindragosa_icy_grip() : SpellScriptLoader("spell_sindragosa_icy_grip") { } class spell_sindragosa_icy_grip_SpellScript : public SpellScript { PrepareSpellScript(spell_sindragosa_icy_grip_SpellScript); bool Validate(SpellEntry const* /*spell*/) { if (!sSpellStore.LookupEntry(SPELL_ICY_GRIP_JUMP)) return false; return true; } void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); GetHitUnit()->CastSpell(GetCaster(), SPELL_ICY_GRIP_JUMP, true); } void Register() { OnEffect += SpellEffectFn(spell_sindragosa_icy_grip_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const { return new spell_sindragosa_icy_grip_SpellScript(); } }; class spell_rimefang_icy_blast : public SpellScriptLoader { public: spell_rimefang_icy_blast() : SpellScriptLoader("spell_rimefang_icy_blast") { } class spell_rimefang_icy_blast_SpellScript : public SpellScript { PrepareSpellScript(spell_rimefang_icy_blast_SpellScript); bool Validate(SpellEntry const* /*spell*/) { if (!sSpellStore.LookupEntry(SPELL_ICY_BLAST_AREA)) return false; return true; } void HandleTriggerMissile(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); if (Position const* pos = GetTargetDest()) if (TempSummon* summon = GetCaster()->SummonCreature(NPC_ICY_BLAST, *pos, TEMPSUMMON_TIMED_DESPAWN, 40000)) summon->CastSpell(summon, SPELL_ICY_BLAST_AREA, true); } void Register() { OnEffect += SpellEffectFn(spell_rimefang_icy_blast_SpellScript::HandleTriggerMissile, EFFECT_1, SPELL_EFFECT_TRIGGER_MISSILE); } }; SpellScript* GetSpellScript() const { return new spell_rimefang_icy_blast_SpellScript(); } }; class OrderWhelpTargetSelector { public: explicit OrderWhelpTargetSelector(Creature* _owner) : owner(_owner) { } bool operator()(Creature* creature) { if (!creature->AI()->GetData(DATA_WHELP_MARKER) && creature->AI()->GetData(DATA_FROSTWYRM_OWNER) == owner->AI()->GetData(DATA_FROSTWYRM_OWNER)) return false; return true; } private: Creature* owner; }; class spell_frostwarden_handler_order_whelp : public SpellScriptLoader { public: spell_frostwarden_handler_order_whelp() : SpellScriptLoader("spell_frostwarden_handler_order_whelp") { } class spell_frostwarden_handler_order_whelp_SpellScript : public SpellScript { PrepareSpellScript(spell_frostwarden_handler_order_whelp_SpellScript); bool Validate(SpellEntry const* /*spell*/) { if (!sSpellStore.LookupEntry(SPELL_FOCUS_FIRE)) return false; return true; } void FilterTargets(std::list<Unit*>& unitList) { for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end();) { if ((*itr)->GetTypeId() != TYPEID_PLAYER) unitList.erase(itr++); else ++itr; } std::list<Unit*>::iterator itr = unitList.begin(); std::advance(itr, urand(0, unitList.size()-1)); Unit* target = *itr; unitList.clear(); unitList.push_back(target); } void HandleForcedCast(SpellEffIndex effIndex) { // caster is Frostwarden Handler, target is player, caster of triggered is whelp PreventHitDefaultEffect(effIndex); std::list<Creature*> unitList; GetCreatureListWithEntryInGrid(unitList, GetCaster(), NPC_FROSTWING_WHELP, 150.0f); if (Creature* creature = GetCaster()->ToCreature()) unitList.remove_if(OrderWhelpTargetSelector(creature)); std::list<Creature*>::iterator itr = unitList.begin(); std::advance(itr, urand(0, unitList.size()-1)); (*itr)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); } void Register() { OnEffect += SpellEffectFn(spell_frostwarden_handler_order_whelp_SpellScript::HandleForcedCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); OnUnitTargetSelect += SpellUnitTargetFn(spell_frostwarden_handler_order_whelp_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENEMY_DST); } }; SpellScript* GetSpellScript() const { return new spell_frostwarden_handler_order_whelp_SpellScript(); } }; class spell_frostwarden_handler_focus_fire : public SpellScriptLoader { public: spell_frostwarden_handler_focus_fire() : SpellScriptLoader("spell_frostwarden_handler_focus_fire") { } class spell_frostwarden_handler_focus_fire_SpellScript : public SpellScript { PrepareSpellScript(spell_frostwarden_handler_focus_fire_SpellScript); void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); GetCaster()->AddThreat(GetHitUnit(), float(GetEffectValue())); GetCaster()->GetAI()->SetData(DATA_WHELP_MARKER, 1); } void Register() { OnEffect += SpellEffectFn(spell_frostwarden_handler_focus_fire_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } }; class spell_frostwarden_handler_focus_fire_AuraScript : public AuraScript { PrepareAuraScript(spell_frostwarden_handler_focus_fire_AuraScript); void PeriodicTick(AuraEffect const* aurEff) { PreventDefaultAction(); if (Unit* caster = GetCaster()) { caster->AddThreat(GetTarget(), -float(SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1))); caster->GetAI()->SetData(DATA_WHELP_MARKER, 0); } } void Register() { OnEffectPeriodic += AuraEffectPeriodicFn(spell_frostwarden_handler_focus_fire_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); } }; SpellScript* GetSpellScript() const { return new spell_frostwarden_handler_focus_fire_SpellScript(); } AuraScript* GetAuraScript() const { return new spell_frostwarden_handler_focus_fire_AuraScript(); } }; class spell_trigger_spell_from_caster : public SpellScriptLoader { public: spell_trigger_spell_from_caster(char const* scriptName, uint32 _triggerId) : SpellScriptLoader(scriptName), triggerId(_triggerId) { } class spell_trigger_spell_from_caster_SpellScript : public SpellScript { PrepareSpellScript(spell_trigger_spell_from_caster_SpellScript); public: spell_trigger_spell_from_caster_SpellScript(uint32 _triggerId) : SpellScript(), triggerId(_triggerId) { } void HandleTrigger() { GetCaster()->CastSpell(GetHitUnit(), triggerId, true); } void Register() { AfterHit += SpellHitFn(spell_trigger_spell_from_caster_SpellScript::HandleTrigger); } uint32 triggerId; }; SpellScript* GetSpellScript() const { return new spell_trigger_spell_from_caster_SpellScript(triggerId); } private: uint32 triggerId; }; class at_sindragosa_lair : public AreaTriggerScript { public: at_sindragosa_lair() : AreaTriggerScript("at_sindragosa_lair") { } bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) { if (InstanceScript* instance = player->GetInstanceScript()) { if (!instance->GetData(DATA_SPINESTALKER)) if (Creature* spinestalker = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_SPINESTALKER))) spinestalker->AI()->DoAction(ACTION_START_FROSTWYRM); if (!instance->GetData(DATA_RIMEFANG)) if (Creature* rimefang = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_RIMEFANG))) rimefang->AI()->DoAction(ACTION_START_FROSTWYRM); if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && instance->GetBossState(DATA_SINDRAGOSA) != DONE) { player->GetMap()->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY()); if (Creature* sindragosa = player->GetMap()->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) { sindragosa->setActive(true); sindragosa->AI()->DoAction(ACTION_START_FROSTWYRM); } } } return true; } }; class achievement_all_you_can_eat : public AchievementCriteriaScript { public: achievement_all_you_can_eat() : AchievementCriteriaScript("achievement_all_you_can_eat") { } bool OnCheck(Player* /*source*/, Unit* target) { if (!target) return false; return target->GetAI()->GetData(DATA_MYSTIC_BUFFET_STACK) <= 5; } }; void AddSC_boss_sindragosa() { new boss_sindragosa(); new npc_ice_tomb(); new npc_spinestalker(); new npc_rimefang(); new npc_sindragosa_trash(); new spell_sindragosa_s_fury(); new spell_sindragosa_unchained_magic(); new spell_sindragosa_instability(); new spell_sindragosa_frost_beacon(); new spell_sindragosa_ice_tomb(); new spell_sindragosa_collision_filter(); new spell_sindragosa_icy_grip(); new spell_rimefang_icy_blast(); new spell_frostwarden_handler_order_whelp(); new spell_frostwarden_handler_focus_fire(); new spell_trigger_spell_from_caster("spell_sindragosa_ice_tomb", SPELL_ICE_TOMB_DUMMY); new spell_trigger_spell_from_caster("spell_sindragosa_ice_tomb_dummy", SPELL_FROST_BEACON); new at_sindragosa_lair(); new achievement_all_you_can_eat(); }
VirusOnline/VoragineCore
src/server/scripts/Raids/Icecrown_Citadel/boss_sindragosa.cpp
C++
gpl-3.0
57,945
include $(SUPPORT_DIR)/functions.mk SOURCE := $(SOURCES_DIR)/xfconf-4.12.1.tar.bz2 SOURCE_URL := http://archive.xfce.org/src/xfce/xfconf/4.12/xfconf-4.12.1.tar.bz2 MD5 := 20dc8d2bfd80ba136bf4964021b32757 toolchain: @$(STEP) "xfconf 4.12.1" @$(call check_source, $(SOURCE), $(MD5), $(SOURCE_URL)) @$(EXTRACT) $(SOURCE) $(BUILD_DIR) @( cd $(BUILD_DIR)/xfconf-4.12.1 && \ PKG_CONFIG="$(TOOLS_DIR)/bin/pkg-config" \ PKG_CONFIG_SYSROOT_DIR="/" \ PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \ PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \ PKG_CONFIG_LIBDIR="$(TOOLS_DIR)/lib/pkgconfig:$(TOOLS_DIR)/share/pkgconfig" \ CPPFLAGS="-I$(TOOLS_DIR)/include" \ CFLAGS="-O2 -I$(TOOLS_DIR)/include" \ CXXFLAGS="-O2 -I$(TOOLS_DIR)/include" \ LDFLAGS="-L$(TOOLS_DIR)/lib -Wl,-rpath,$(TOOLS_DIR)/lib" \ CONFIG_SITE=/dev/null \ ./configure \ --prefix=$(TOOLS_DIR) \ --sysconfdir=$(TOOLS_DIR)/etc \ --localstatedir=$(TOOLS_DIR)/var \ --enable-shared \ --disable-static ) @make -j$(CONFIG_PARALLEL_JOBS) -C $(BUILD_DIR)/xfconf-4.12.1 @make -j$(CONFIG_PARALLEL_JOBS) install -C $(BUILD_DIR)/xfconf-4.12.1 @rm -rf $(BUILD_DIR)/xfconf-4.12.1 system: @export CC=$(TOOLS_DIR)/bin/$(CONFIG_TARGET)-gcc @export CXX=$(TOOLS_DIR)/bin/$(CONFIG_TARGET)-g++ @export AR=$(TOOLS_DIR)/bin/$(CONFIG_TARGET)-ar @export AS=$(TOOLS_DIR)/bin/$(CONFIG_TARGET)-as @export LD=$(TOOLS_DIR)/bin/$(CONFIG_TARGET)-ld @export RANLIB=$(TOOLS_DIR)/bin/$(CONFIG_TARGET)-ranlib @export READELF=$(TOOLS_DIR)/bin/$(CONFIG_TARGET)-readelf @export STRIP=$(TOOLS_DIR)/bin/$(CONFIG_TARGET)-strip @$(STEP) "xfconf 4.12.1" @$(call check_source, $(SOURCE), $(MD5), $(SOURCE_URL)) @$(EXTRACT) $(SOURCE) $(BUILD_DIR) @( cd $(BUILD_DIR)/xfconf-4.12.1 && \ PKG_CONFIG="$(TOOLS_DIR)/bin/pkg-config" \ ac_cv_lbl_unaligned_fail=yes \ ac_cv_func_mmap_fixed_mapped=yes \ ac_cv_func_memcmp_working=yes \ ac_cv_have_decl_malloc=yes \ gl_cv_func_malloc_0_nonnull=yes \ ac_cv_func_malloc_0_nonnull=yes \ ac_cv_func_calloc_0_nonnull=yes \ ac_cv_func_realloc_0_nonnull=yes \ lt_cv_sys_lib_search_path_spec="" \ ac_cv_c_bigendian=no \ CONFIG_SITE=/dev/null \ ./configure \ --target=$(CONFIG_TARGET) \ --host=$(CONFIG_TARGET) \ --build=$(CONFIG_HOST) \ --prefix=/usr \ --exec-prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --program-prefix="" \ --disable-static \ --enable-shared ) @make -j$(CONFIG_PARALLEL_JOBS) -C $(BUILD_DIR)/xfconf-4.12.1 @make -j$(CONFIG_PARALLEL_JOBS) DESTDIR=$(SYSROOT_DIR) install -C $(BUILD_DIR)/xfconf-4.12.1 @$(call dependency_libs_patch) @make -j$(CONFIG_PARALLEL_JOBS) DESTDIR=$(ROOTFS_DIR) install -C $(BUILD_DIR)/xfconf-4.12.1 @rm -rf $(BUILD_DIR)/xfconf-4.12.1
LeeKyuHyuk/clfs-arm
packages/xfconf/Makefile
Makefile
gpl-3.0
2,667
/* Simulator Times Track is a game that allows you to simulate lap times of one or more cars. For more information see the README. Copyright (C) 2014-2015 Samuel Civitarese, Andrea Langone, Domenico D'Uva. This file is part of Simulator Times Track. Simulator Times Track 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. Simulator Times Track 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 Simulator Times Track.If not, see <http://www.gnu.org/licenses/>. */ package GUI; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JTable; import java.awt.Color; import java.awt.Font; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.*; import campionato.Campionato; public class RiepilogoCampionato { private JFrame frmNomeSoftware; private JTable tabella_partecipanti = null; private JTable tabella_gare = null; private JButton btnConfermaSelezione = null; private JButton button_1 = null; private JButton button_2 = null; private int gioc_reali = 0; private Campionato campionato = null; //contiene le gare da effetuare (compresi di circuiti) e la lista dei partecipanti private boolean gara_singola = false; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { RiepilogoCampionato window = new RiepilogoCampionato(null, true, 1); window.frmNomeSoftware.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public RiepilogoCampionato(Campionato campionato, boolean gara_singola, int gioc_reali) { this.campionato = campionato;//import campionato this.gara_singola = gara_singola;//controllo gara_singola this.setGioc_reali(gioc_reali); initialize(); } public RiepilogoCampionato(Campionato campionato) { this.campionato = campionato; this.gara_singola = false; initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { boolean terminato = this.campionato.getGara_attuale()>=this.campionato.getLista_gare().size(); // Ho finito il campionato o la gara; ListenersRiepilogo listener_generale = new ListenersRiepilogo(this); RenderTabella renderer = new RenderTabella(); frmNomeSoftware = new JFrame(); frmNomeSoftware.getContentPane().setForeground(new Color(0, 0, 0)); frmNomeSoftware.setResizable(false); frmNomeSoftware.getContentPane().setBackground(new Color(0, 0, 0)); frmNomeSoftware.setTitle("Simulator Times Track"); frmNomeSoftware.setBounds(100, 100, 726, 462); frmNomeSoftware.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frmNomeSoftware.getContentPane().setLayout(null); ModelPartecipanti model_partecipanti = new ModelPartecipanti(campionato); //TableModel per la tabella dei partecipanti ModelGare model_gare = new ModelGare(campionato); //TableModel per la tabella delle gare JLabel lblGare = new JLabel("Lista gare:"); if(gara_singola) lblGare.setText("Gara: "); lblGare.setBounds(387, 58, 101, 22); lblGare.setFont(new Font("Trebuchet MS", Font.BOLD, 16)); lblGare.setForeground(new Color(255, 69, 0)); frmNomeSoftware.getContentPane().add(lblGare); JLabel lblPartecipanti = new JLabel("Lista partecipanti:"); lblPartecipanti.setBounds(37, 58, 149, 22); lblPartecipanti.setForeground(new Color(255, 69, 0)); lblPartecipanti.setFont(new Font("Trebuchet MS", Font.BOLD, 16)); frmNomeSoftware.getContentPane().add(lblPartecipanti); if(!terminato){ button_1 = new JButton("RISULTATI QUALIFICA-->"); button_1.setActionCommand("avanti"); button_1.setBounds(480, 388, 230, 35); button_1.setForeground(new Color(255, 69, 0)); button_1.setFont(new Font("Trebuchet MS", Font.BOLD, 16)); button_1.addActionListener(listener_generale); frmNomeSoftware.getContentPane().add(button_1); } button_2 = new JButton("HOME"); button_2.setActionCommand("home"); button_2.setBounds(282, 388, 176, 35); button_2.setForeground(new Color(255, 69, 0)); button_2.setFont(new Font("Trebuchet MS", Font.BOLD, 16)); button_2.addActionListener(listener_generale); frmNomeSoftware.getContentPane().add(button_2); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(37, 91, 311, 205); frmNomeSoftware.getContentPane().add(scrollPane); JScrollPane scrollPane_1 = new JScrollPane(); scrollPane_1.setBounds(387, 91, 311, 205); frmNomeSoftware.getContentPane().add(scrollPane_1); //Tabella partecipanti tabella_partecipanti = new JTable(model_partecipanti); tabella_partecipanti.setShowGrid(false); tabella_partecipanti.setBackground(new Color(102, 205, 170)); tabella_partecipanti.getColumnModel().getColumn(0).setResizable(false); tabella_partecipanti.setForeground(new Color(255, 69, 0)); tabella_partecipanti.setFont(new Font("Trebuchet MS", Font.BOLD, 11)); tabella_partecipanti.setDefaultRenderer(Object.class, renderer); //Tabella Gare tabella_gare = new JTable(model_gare); tabella_gare.setShowGrid(false); tabella_gare.setBackground(new Color(102, 205, 170)); tabella_gare.getColumnModel().getColumn(0).setResizable(false); tabella_gare.setForeground(new Color(255, 69, 0)); tabella_gare.setFont(new Font("Trebuchet MS", Font.BOLD, 11)); tabella_gare.setDefaultRenderer(Object.class, renderer); scrollPane_1.setViewportView(tabella_gare); scrollPane.setViewportView(tabella_partecipanti); JLabel lblRiepilogoCampionato = new JLabel("Riepilogo Campionato"); if(gara_singola) lblRiepilogoCampionato.setText("Riepilogo gara"); lblRiepilogoCampionato.setForeground(new Color(255, 69, 0)); lblRiepilogoCampionato.setFont(new Font("Trebuchet MS", Font.BOLD, 20)); lblRiepilogoCampionato.setBounds(262, 11, 206, 22); frmNomeSoftware.getContentPane().add(lblRiepilogoCampionato); if(!terminato) { JLabel lblProssimoEvento = new JLabel("Prossimo evento: "); lblProssimoEvento.setForeground(new Color(255, 69, 0)); lblProssimoEvento.setFont(new Font("Trebuchet MS", Font.BOLD, 16)); lblProssimoEvento.setBounds(205, 321, 143, 22); frmNomeSoftware.getContentPane().add(lblProssimoEvento); } JLabel lblEvento = new JLabel(""); if(terminato) //La gara/campionato { lblEvento.setBounds(151, 322, 559, 22); lblEvento.setForeground(Color.GREEN); if(this.campionato.getLista_gare().size()==1) lblEvento.setText("Fine gara: il vincitore � "+ this.campionato.getPartecipanti().get(0).getPilota().getNome()+ " " + this.campionato.getPartecipanti().get(0).getPilota().getCognome()); else lblEvento.setText("Fine campionato: il vincitore � "+ this.campionato.getPartecipanti().get(0).getPilota().getNome()+ " " + this.campionato.getPartecipanti().get(0).getPilota().getCognome()); } else { lblEvento.setText("Qualifica "+this.campionato.getLista_gare().get(this.campionato.getGara_attuale()).get_Circuito().getNome()); lblEvento.setBounds(345, 321, 559, 22); lblEvento.setForeground(Color.RED); } lblEvento.setFont(new Font("Trebuchet MS", Font.BOLD, 16)); frmNomeSoftware.getContentPane().add(lblEvento); frmNomeSoftware.setVisible(true); } void frmInformazione(String messaggio){ JOptionPane.showMessageDialog(frmNomeSoftware, messaggio, "Info", JOptionPane.INFORMATION_MESSAGE ); } public boolean isGara_singola() { return gara_singola; } public void setGara_singola(boolean gara_singola) { this.gara_singola = gara_singola; } public JButton getBtnConfermaSelezione() { return btnConfermaSelezione; } public JButton getBtnQualifica() { return button_1; } public JButton getBtnHome() { return button_2; } public Campionato getCampionato() { return campionato; } public void setCampionato(Campionato campionato) { this.campionato = campionato; } public JFrame getJFrame(){ return frmNomeSoftware; } public int getGioc_reali() { return gioc_reali; } public void setGioc_reali(int gioc_reali) { this.gioc_reali = gioc_reali; } }
SamCiv/stt
src/GUI/RiepilogoCampionato.java
Java
gpl-3.0
8,955
### # Copyright 2016 - 2022 Green River Data Analysis, LLC # # License detail: https://github.com/greenriver/boston-cas/blob/production/LICENSE.md ### module MatchAccessContexts class AuthenticatedUser attr_reader :controller, :user def initialize controller @controller = controller @user = controller.current_user end def current_contact user.contact end def contacts_editable? user.can_edit_match_contacts? || hsa_can_edit_contacts? end def hsa_can_edit_contacts? controller.match.match_route.contacts_editable_by_hsa && current_contact.in?(controller.match.housing_subsidy_admin_contacts) end def match_scope ClientOpportunityMatch.accessible_by_user user end def authenticate! controller.authenticate_user! end ################ ### Path Helpers ################ def match_path match, opts = {} controller.match_path match, opts end def match_decision_path match, decision, opts = {} controller.match_decision_path match, decision, opts end def match_decision_acknowledgment_path match, decision, opts = {} controller.match_decision_acknowledgment_path match, decision, opts end def edit_match_contacts_path match, opts = {} controller.edit_match_contacts_path match, opts end def match_contacts_path match, opts = {} controller.match_contacts_path match, opts end def match_client_details_path match, opts = {} controller.match_client_details_path match, opts end end end
greenriver/boston-cas
app/models/match_access_contexts/authenticated_user.rb
Ruby
gpl-3.0
1,587
#!/usr/bin/env python3 ######################################################################### # File Name: mthreading.py # Author: ly # Created Time: Wed 05 Jul 2017 08:46:57 PM CST # Description: ######################################################################### # -*- coding: utf-8 -*- import time import threading def play(name,count): for i in range(1,count): print('%s %d in %d' %(name, i, count)) time.sleep(1) return if __name__=='__main__': t1=threading.Thread(target=play, args=('t1',10)) # 设置为守护线程 t1.setDaemon(True) t1.start() print("main") # 等待子线程结束 t1.join() exit(1)
LingyuGitHub/codingofly
python/threading/mthreading.py
Python
gpl-3.0
699
@php $q_id = isset($question->id) ? $question->id : $q_last; $q_text = isset($question->q_text) ? $question->q_text : null; @endphp <div class="panel panel-default"> <div class="panel-heading"> @lang('messages.labels.q-num')<span class="num"></span> <span class="pull-right"> <button type="button" class="close q-delquestion"><i class="material-icons">delete</i></button> </span> </div> <div class="panel-body"> <div class="form-group form-group-lg input-group label-floating"> {{ Form::label('q'.$q_id.'_text', __('messages.labels.q-text'), ['class' => 'control-label']) }} {{ Form::textarea('q'.$q_id.'_text', $q_text, ['class' => 'form-control', 'size' => 'x2']) }} <div class="input-group-addon btn-group btn-group-justified"> <a class="btn btn-raised btn-primary btn-xs q-addoption"><i class="material-icons">add_circle_outline</i></a> </div> </div> <div class="as"> @if (isset($question) && count($question->answers) > 0) @foreach ($question->answers as $answer) @include('partials.a') @endforeach @endif </div> </div> </div>
5kr1p7/laravel-testing-site
resources/views/partials/q.blade.php
PHP
gpl-3.0
1,090
package com.kubeek.device; import com.kubeek.sdk.device.KScreenParam; public class ScreenParam implements KScreenParam { private int height; private int width; private int rows; private int chain; private String ppmDirectory; private String fontDirectory; private String fontExtension; private String defaultFont; private String screenName; public ScreenParam(int rows, int chain, String ppmDirectory, String fontDirectory, String defaultFont, String screenName ){ this.rows=rows; this.chain=chain; this.ppmDirectory=ppmDirectory; this.fontDirectory=fontDirectory; this.defaultFont=defaultFont; this.screenName=screenName; this.height=rows; this.width=32*chain; this.fontExtension=".bdf"; } @Override public int getHeight() { return height; } @Override public int getWidth() { return width; } @Override public int getRows() { return rows; } @Override public int getChain() { return chain; } @Override public String getPPMDirectory() { return ppmDirectory; } @Override public String getFontDirectory() { return fontDirectory; } @Override public String getFontExtension() { return fontExtension; } @Override public String getDefaultFont() { return defaultFont; } @Override public String getScreenName() { return screenName; } }
michoo/kubeek
kubeek-core/src/main/java/com/kubeek/device/ScreenParam.java
Java
gpl-3.0
1,540